mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-12 16:48:08 +08:00
First step to boot rn apps with hot bytecode cache
Reviewed By: tadeuzagallo Differential Revision: D3561565 fbshipit-source-id: dc1cf580d7b31f30939b180aec38d9b8d0dd0f58
This commit is contained in:
committed by
Facebook Github Bot 6
parent
f08f23f8cb
commit
5405aeb2a3
@@ -40,10 +40,16 @@ public class UnpackingJSBundleLoader extends JSBundleLoader {
|
||||
|
||||
/**
|
||||
* Flag passed to loadScriptFromOptimizedBundle to let the bridge know that
|
||||
* the unpacked unpacked js source file.
|
||||
* the unpacker unpacked js source file.
|
||||
*/
|
||||
public static final int UNPACKED_JS_SOURCE = (1 << 0);
|
||||
|
||||
/**
|
||||
* Flag passed to loadScriptFromOptimizedBundle to let the bridge know that
|
||||
* the unpacker unpacked bytecode cache files.
|
||||
*/
|
||||
public static final int UNPACKED_BC_CACHE = (1 << 1);
|
||||
|
||||
/**
|
||||
* Name of the lock files. Multiple processes can be spawned off the same app
|
||||
* and we need to guarantee that at most one unpacks files at any time. To
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace react {
|
||||
|
||||
enum {
|
||||
UNPACKED_JS_SOURCE = (1 << 0),
|
||||
UNPACKED_BC_CACHE = (1 << 1),
|
||||
};
|
||||
|
||||
class JSExecutor;
|
||||
|
||||
@@ -275,6 +275,10 @@ void JSCExecutor::loadApplicationScript(
|
||||
return loadApplicationScript(std::move(jsScriptBigString), sourceURL);
|
||||
}
|
||||
|
||||
if (flags & UNPACKED_BC_CACHE) {
|
||||
configureJSCBCCache(m_context, bundlePath);
|
||||
}
|
||||
|
||||
String jsSourceURL(sourceURL.c_str());
|
||||
JSSourceCodeRef sourceCode = JSCreateSourceCode(
|
||||
jsScriptBigString->fd(),
|
||||
|
||||
Reference in New Issue
Block a user