Summary:
setStyleInputs batching API was added to reduce the number of jni calls and although it improved performance in yoga world but was not impactful in litho and is not used anywhere.
Removing this saves around 500 bytes per architecture
#Changelog:
[Internal][Yoga] Removed unused code setStyleInputs batching API form Yoga
Reviewed By: amir-shalem
Differential Revision: D18036536
fbshipit-source-id: 7436b55dcd464dd9f9cc46406d4fd78d12babe55
Summary: UseVanillaJNI flag was missing for measure and baseline functions
Reviewed By: amir-shalem
Differential Revision: D17868201
fbshipit-source-id: 95d6843d643e90157a51550d6efbf059f0ca2c39
Summary: We can use getCurrentEnv() instead of passing environment variable around
Reviewed By: amir-shalem
Differential Revision: D17842042
fbshipit-source-id: 185b174ae7c08e746bc76c0600c2e326b15c4993
Summary: We can use getCurrentEnv() , no need to pass env around methods
Reviewed By: amir-shalem
Differential Revision: D17841281
fbshipit-source-id: a4a58292e70ac05b0f0b9eb962a82a8501ad0226
Summary: Move JNI_ONLoad to a separate file so that both fbjni native methods and vanillla jni native methods can be initialized correctly
Reviewed By: amir-shalem
Differential Revision: D17840166
fbshipit-source-id: 045df0df7a95bc331cbbefb3a118a349f3029465
Summary: set missing useVanillaJNI, it was causing part of the unit-tests to run in fbjni instead of vanillajni.
Reviewed By: SidharthGuglani
Differential Revision: D17852635
fbshipit-source-id: 5bc187d90fbdc430015be55a015a7d1e0ba0ebc6
Summary: Use TestParametrization to test both fbjni and vanilla jni versions
Reviewed By: amir-shalem
Differential Revision: D17788718
fbshipit-source-id: 0f3317b7403cadca7b7ccd9140f1933d746bf433
Summary: Add ScopedLocalRef, ScopedGlobalRef and some common methods to be used later.
Reviewed By: amir-shalem
Differential Revision: D17711284
fbshipit-source-id: be43d5e246bc2406765057783be11854877c41f1
Summary: This diff moves methods related to actions on YGNode like free node, reset node etc. to vanilla JNI
Reviewed By: amir-shalem
Differential Revision: D17668008
fbshipit-source-id: 03bfc51ec1fcf06569713400f984d551827e22fe
Summary: Moving common code to YGJNI.h header class so that same can be used in fbjni and vanilla jni implementations
Reviewed By: amir-shalem
Differential Revision: D17666457
fbshipit-source-id: 1e6cd2506fb773b8a17ebef277a2c7ef9728e66b
Summary:
Adds a flag useVanillaJNI in YogaConfig to determine whether to use FbJNI or JNI.
Currently default is set to false.
We will experiment based on this flag once all code have been migrated.
Reviewed By: Andrey-Mishanin
Differential Revision: D17601703
fbshipit-source-id: 377a5bd2a6f8a7584e84932e87fa7044d8165efd
Summary:
This diffs adds a separate file YGJNIVanilla.cpp to add jni methods which uses vanilla JNI instead of FBJNI.
In this diff only one method has been added to setup the experiment boolean setup.
At the end of this diff stack , we will be able to experiment between fbjni and vanilla jni in yoga and finally get rid of fbjni which saves us around 300Kb per architecture in yoga binary size.
Reviewed By: Andrey-Mishanin
Differential Revision: D17601591
fbshipit-source-id: a88520c625bd8b5d9ffcf8ab5f02fc71dc800081
Summary:
In D17439957, I noted that YogaLogger#log throws a NoMethodFoundException when called from C++ b/c C++ and Java's signatures of that method don't match. C++ uses YogaNodeJNIBase for the first param, Java uses YogaNode. Both my attempts to fix this failed.
Attempt #1 - Make Java use YogaNodeJNIBase. This doesn't work because the :java-interface target includes YogaLogger but not YogaNodeJNIBase. Moving YogaLogger to the impl target doesn't work either b/c other files in :java-interface reference YogaLogger.
Attempt #2 - Make C++ use YogaNode. This doesn't work b/c we try to call the log method with objects of fbjni type YogaNodeJNIBase. This would be fine in Java since YogaNodeJNIBase extends YogaNode. But fbjni's typing isn't advanced enough to know this, so the Yoga C++ fails to compile.
At this point, I was wondering what the value of having this param in the log function at all was. None of the implementations in our codebase use it today. It might be easier to just remove it all together. This also removes a bug with YGNodePrint where we pass a null layout context that eventually causes a SIG_ABRT when we use it to try to find a YogaNode to pass to this function. (https://fburl.com/diffusion/ssw9h8lv).
Reviewed By: amir-shalem
Differential Revision: D17470379
fbshipit-source-id: 8fc2d95505971a52af2399a9fbb60b63f27f0ec2
Summary: This diff fixes two issues with the JNI integration of YogaLogger#log. (1) The YogaLogger class descriptor was missing a semicolon. This causes a ClassNotFoundException whenever you try to call the log method from C++. (2) The C++ signature for the class was using YogaNodeJNIBase as an arg but the Java signature was using YogaNode. This causes a MethodNotFoundException whenever you try to call the method after fixing problem 1.
Reviewed By: astreet
Differential Revision: D17439957
fbshipit-source-id: be3c16512558050265565b3688fb09a7da31b9b2
Summary:
Split the yoga buck targets from interface to actual implementation.
This is currently done without moving any files folder, since only we will make the distinction between interface<-->implementation only this buck target (and not in the litho/reactnative yoga copies).
Buck does insures that the `java-interface` is pure since it doesn't depend on any fbjni code.
Reviewed By: SidharthGuglani
Differential Revision: D17266406
fbshipit-source-id: 46aa469b74c2c3114f1d3d762c41d32cfe269f57
Summary:
Remove YogaNode.create() from the abstract class after we made sure nothing uses it anymore
This is the final stage to make `YogaNode` a pure class without JNI references
Reviewed By: SidharthGuglani
Differential Revision: D17280571
fbshipit-source-id: bd0eb138f7a6a9de8988fc0a7b90badbf635dac5
Summary:
Split YogaConfig into the same way YogaNode is split today.
Into an abstract class defining the interface, and actual JNI implementation
Reviewed By: SidharthGuglani
Differential Revision: D17266404
fbshipit-source-id: 3d5d6aa65c55cfa61d47c662d140cdce6dcb0ea1
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/922
We are not using this dependency anywhere in yoga. Removed in this diff.
Reviewed By: passy
Differential Revision: D17131081
fbshipit-source-id: 5544b892f4ef5ca0207d9e21a5b97a2940ac6d53
Summary:
Expose native pointer thru an interface function for YogaConfig (its package private to `com.facebook.yoga` namespace),
This way we can make later on YogaConfig a pure abstract class.
Plus, it makes sure external users don't modify the pointer
Reviewed By: SidharthGuglani
Differential Revision: D17266401
fbshipit-source-id: f39b488cea0b73bc3578bb3aa90ab00139bf9271
Summary:
Update build tools version to 28.0.3 to fix the below warning
WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.0.
Android SDK Build Tools 27.0.3 will be used.
Reviewed By: passy
Differential Revision: D17343575
fbshipit-source-id: aa12bf2b55666aacb18f09b1cca22eab05f38220
Summary: Bump version to 1.16.0-SNAPSHOT for new yoga release
Reviewed By: amir-shalem
Differential Revision: D17396540
fbshipit-source-id: ddd01454752d88548ae7490cfd9fccfb8c591ec9
Summary: Bump version to 1.16.0 for new yoga release
Reviewed By: amir-shalem
Differential Revision: D17395785
fbshipit-source-id: b01b31d58b5b1a2a9532e9cce0892c08960ec31c
Summary:
Fixes the yoga build 1:15:0 build issue
Could not find yoga:libfb:unspecified.
Required by:
project :app > com.facebook.yoga:yoga:1.15.0
libfb dependency was added to solve import issue in YogaPhantomJNIRefs but since we don't have that file now in codebase , it will not be a problem.
Reviewed By: amir-shalem
Differential Revision: D17395380
fbshipit-source-id: ab8eb2c89afe29b4688787db2214c328d875041e
Summary: Bumping version to 1.15.0 for new yoga release
Reviewed By: amir-shalem
Differential Revision: D17394805
fbshipit-source-id: de43e97a0c155f332ecbe4e98b78c2f7c9ffe771
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/927
When D16220924 brought a new fbjni copy (with new directories), we forgot to fix the cmake files which are used by gradle build system.
Reviewed By: SidharthGuglani
Differential Revision: D17367160
fbshipit-source-id: 3e7d20d4c53ff3012a164bf6e32f1000ecb3ffc2
Summary:
Add standalone factory classes which generate YogaNode + YogaConfig, later on it will allow us to separate the yoga interface and actual implementation buck targets (see D17266406)
We've done such breakage change previously in D14122974.
Reviewed By: SidharthGuglani
Differential Revision: D17258196
fbshipit-source-id: b12f1a0d23c3f82b14cee0731a1daf1c015ee32c
Summary:
Removed unused file YogaNodeJNIPhantomRefs.java as this was causing oss build failures because of an import.
````:yoga:compileDebugJavaWithJavac/home/travis/build/facebook/yoga/java/com/facebook/yoga/YogaNodeJNIPhantomRefs.java:9: error: package com.facebook.jni does not exist
import com.facebook.jni.DestructorThread;
^
/home/travis/build/facebook/yoga/java/com/facebook/yoga/YogaNodeJNIPhantomRefs.java:30: error: package DestructorThread does not exist
new DestructorThread.Destructor(node) {
^
2 errors
FAILED
Reviewed By: pasqualeanatriello
Differential Revision: D17257330
fbshipit-source-id: 98b0c5d5b7dcd94bee559b58194c13b07f47723d
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/925
Gradle is failing to compile yoga for two reasons:
1. Ever since `YogaNodeJNIPhantomRefs` was introduced which uses `DestructorThread.Destructor` from fbjni which was the first direct Java dependency from yoga java to fbjni java code.
2. Adding a missing gradle endpoint for `testutil` since it is now required for yoga unit-tests
Reviewed By: SidharthGuglani
Differential Revision: D17274226
fbshipit-source-id: 3df9648321162d34f81fd3675ca1474e8a1c6d3a
Summary:
clang 6.0 install was failing in yoga oss tests
Travis has made xenial as default distribution
https://changelog.travis-ci.com/xenial-as-the-default-build-environment-is-coming-97772
Added dist: trusty to the configuration to fix this.
Reviewed By: passy
Differential Revision: D17257300
fbshipit-source-id: f9fcd6ba774dad1c28bd953c0d850c7078d02015