Skip to content

Commit b4da1cb

Browse files
committed
Delete heapSnapshot package.json key
1 parent f6ddec5 commit b4da1cb

4 files changed

Lines changed: 7 additions & 18 deletions

File tree

src/jni/Constants.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
std::string Constants::APP_ROOT_FOLDER_PATH = "";
1111
bool Constants::V8_CACHE_COMPILED_CODE = false;
12-
bool Constants::V8_HEAP_SNAPSHOT = false;
1312
std::string Constants::V8_STARTUP_FLAGS = "";
1413
std::string Constants::V8_HEAP_SNAPSHOT_SCRIPT = "";
1514
std::string Constants::V8_HEAP_SNAPSHOT_BLOB = "";

src/jni/Constants.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class Constants
1515
static std::string V8_HEAP_SNAPSHOT_SCRIPT;
1616
static std::string V8_HEAP_SNAPSHOT_BLOB;
1717
static bool V8_CACHE_COMPILED_CODE;
18-
static bool V8_HEAP_SNAPSHOT;
1918

2019
private:
2120
Constants()

src/jni/Runtime.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,11 @@ void Runtime::Init(jstring filesPath, bool verboseLoggingEnabled, jstring packag
130130
Constants::V8_STARTUP_FLAGS = ArgConverter::jstringToString(v8Flags);
131131
JniLocalRef cacheCode(m_env.GetObjectArrayElement(args, 1));
132132
Constants::V8_CACHE_COMPILED_CODE = (bool) cacheCode;
133-
JniLocalRef snapshot(m_env.GetObjectArrayElement(args, 2));
134-
Constants::V8_HEAP_SNAPSHOT = (bool)snapshot;
135-
JniLocalRef snapshotScript(m_env.GetObjectArrayElement(args, 3));
133+
JniLocalRef snapshotScript(m_env.GetObjectArrayElement(args, 2));
136134
Constants::V8_HEAP_SNAPSHOT_SCRIPT = ArgConverter::jstringToString(snapshotScript);
137-
JniLocalRef snapshotBlob(m_env.GetObjectArrayElement(args, 4));
135+
JniLocalRef snapshotBlob(m_env.GetObjectArrayElement(args, 3));
138136
Constants::V8_HEAP_SNAPSHOT_BLOB = ArgConverter::jstringToString(snapshotBlob);
139-
JniLocalRef profilerOutputDir(m_env.GetObjectArrayElement(args, 5));
137+
JniLocalRef profilerOutputDir(m_env.GetObjectArrayElement(args, 4));
140138

141139
DEBUG_WRITE("Initializing Telerik NativeScript");
142140

@@ -355,7 +353,7 @@ Isolate* Runtime::PrepareV8Runtime(const string& filesPath, jstring packageName,
355353

356354
create_params.array_buffer_allocator = &g_allocator;
357355
// prepare the snapshot blob
358-
if (Constants::V8_HEAP_SNAPSHOT)
356+
if (!Constants::V8_HEAP_SNAPSHOT_BLOB.empty() || !Constants::V8_HEAP_SNAPSHOT_SCRIPT.empty())
359357
{
360358
DEBUG_WRITE_FORCE("Snapshot enabled.");
361359

src/src/com/tns/V8Config.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class V8Config
1111
private static final String AndroidKey = "android";
1212
private static final String V8FlagsKey = "v8Flags";
1313
private static final String CodeCacheKey = "codeCache";
14-
private static final String HeapSnapshotKey = "heapSnapshot";
1514
private static final String HeapSnapshotScriptKey = "heapSnapshotScript";
1615
private static final String HeapSnapshotBlobKey = "heapSnapshotBlob";
1716
private static final String SnapshotFile = "snapshot.blob";
@@ -41,14 +40,10 @@ public static Object[] fromPackageJSON(File appDir)
4140
{
4241
result[1] = androidObject.getBoolean(CodeCacheKey);
4342
}
44-
if (androidObject.has(HeapSnapshotKey))
45-
{
46-
result[2] = androidObject.getBoolean(HeapSnapshotKey);
47-
}
4843
if(androidObject.has(HeapSnapshotScriptKey))
4944
{
5045
String value = androidObject.getString(HeapSnapshotScriptKey);
51-
result[3] = FileSystem.resolveRelativePath(appDir.getPath(), value, appDir + "/app/");
46+
result[2] = FileSystem.resolveRelativePath(appDir.getPath(), value, appDir + "/app/");
5247
}
5348
if(androidObject.has(HeapSnapshotBlobKey))
5449
{
@@ -59,12 +54,12 @@ public static Object[] fromPackageJSON(File appDir)
5954
{
6055
// this path is expected to be a directory, containing three sub-directories: armeabi-v7a, x86 and arm64-v8a
6156
path = path + "/" + Build.CPU_ABI + "/" + SnapshotFile;
62-
result[4] = path;
57+
result[3] = path;
6358
}
6459
}
6560
if(androidObject.has(ProfilerOutputDirKey))
6661
{
67-
result[5] = androidObject.getString(ProfilerOutputDirKey);
62+
result[4] = androidObject.getString(ProfilerOutputDirKey);
6863
}
6964
}
7065
}
@@ -83,8 +78,6 @@ private static Object[] makeDefaultOptions()
8378
"--expose_gc",
8479
// enable v8 code caching, false by default
8580
false,
86-
// enable v8 heap snapshot, false by default
87-
false,
8881
// arbitrary script to be included in the snapshot
8982
"",
9083
// a binary file containing an already saved snapshot

0 commit comments

Comments
 (0)