Summary:
`JSIndexedRAMBundle` used to read scripts including the terminating null bytes. That worked on iOS, but not on Android, where we have an ascii-only optimization.
This changes that behavior to only read the actual script data excluding the terminal null.
Reviewed By: javache
Differential Revision: D4265374
fbshipit-source-id: 7e6f943666aee610d79939cef09b103305803c69
Summary:
The C++ standard requires that when a function is used in a template it's prototype needs to be defined not only before the template specialization, but also before the template itself.
Because of that one needs to (in certain compilers) be aware of the proper order of includes so that the function prototype is defined before the JSCExecutor.h is included.
As a workaround the toValue might be written as a template (ValueEncoder<T>::toValue) defined in JSCExecutor.h instead of being an non-existing symbol.
Thanks to that the JSCExecutor.h does not have to be included before the specialization of the ValueEncoder template.
Reviewed By: mhorowitz
Differential Revision: D4182724
fbshipit-source-id: 9bdf239ae66ef7a7d2c82daf7db5926472687bde
Summary:
`JSBigMmapString` needs to know too much about the details of the "optimized bundle" format. In honour of this fact, I'm renaming it to `JSBigOptimizedBundleString`. In a following diff, I will introduce a new class just for File-backed Strings, whose only responsibility is dealing with an mmaped region.
This diff already pulls in some fixes for formatting reference and pointer declarations from the linter.
Reviewed By: michalgr
Differential Revision: D4189391
fbshipit-source-id: b376c2a8d9ae5b83575da8457e607bbbfc648ebd
Summary:
Introduces the inspector library supporting the Chrome Debugging Protocol for JavaScriptCore. Eventually this will mean that it is possible to attach
the Chrome inspector directly to the JSC instance running on the device. This library doesn't define the actual transport but leaves that up to the platform
layer.
The main entry point (and the only exported header) is `Inspector.h`.
This diff only introduces the basics supporting the `Schema` and `Inspector` domains meaning it doesn't have any features yet. These will come in following
diffs.
Reviewed By: michalgr
Differential Revision: D4021490
fbshipit-source-id: 517fd9033051c11ba97d312b16382445ae85d3f3
Summary:
**Motivation**
I'm working on a project that uses React Native and needs to add direct synchronous bindings to native stuff through the JavaScriptCore C API. This is because it's performance-sensitive and would benefit from the quickest JS->C path. It does this using cross-platform C++ code that works on both iOS and Android. Most of the infrastructure for getting access to the JSC context is already in React Native actually, just had to add a few more things.
(lexs you mentioned to tag you in this pull request)
**Test plan**
Modify the JavaScriptCore context through the `JSContextRef` returned (eg. add an object at global scope) and verify that it exists in JavaScript.
Closes https://github.com/facebook/react-native/pull/10399
Differential Revision: D4080945
Pulled By: lexs
fbshipit-source-id: 6659b7a01e09fd84475adde183c1d3aca2d4cf09
Summary: Instead of sending a list of modules over to JS on startup (and actually blocking script execution) instead provide a proxy object that constructs each of these lazily.
Reviewed By: lexs
Differential Revision: D3936979
fbshipit-source-id: 71bde822f01eb17a29f56c5e60e95e98e207d74d