Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMOB-13779: Remove access to V8's gc except for profiling. #4265

Merged
merged 1 commit into from
May 17, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public void initRuntime()
DBG = false;
}

nativeInit(useGlobalRefs, deployData.getDebuggerPort(), DBG);
nativeInit(useGlobalRefs, deployData.getDebuggerPort(), DBG, deployData.isProfilerEnabled());

if (deployData.isDebuggerEnabled()) {
dispatchDebugMessages();
} else if (deployData.isProfilerEnabled()) {
Expand Down Expand Up @@ -219,7 +219,7 @@ public void setGCFlag()
}

// JNI method prototypes
private native void nativeInit(boolean useGlobalRefs, int debuggerPort, boolean DBG);
private native void nativeInit(boolean useGlobalRefs, int debuggerPort, boolean DBG, boolean profilerEnabled);
private native void nativeRunModule(String source, String filename, KrollProxySupport activityProxy);
private native Object nativeEvalString(String source, String filename);
private native void nativeProcessDebugMessages();
Expand Down
12 changes: 7 additions & 5 deletions android/runtime/v8/src/native/V8Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,14 @@ using namespace titanium;
* Method: nativeInit
* Signature: (Lorg/appcelerator/kroll/runtime/v8/V8Runtime;)J
*/
JNIEXPORT void JNICALL Java_org_appcelerator_kroll_runtime_v8_V8Runtime_nativeInit(JNIEnv *env, jobject self, jboolean useGlobalRefs, jint debuggerPort, jboolean DBG)
JNIEXPORT void JNICALL Java_org_appcelerator_kroll_runtime_v8_V8Runtime_nativeInit(JNIEnv *env, jobject self, jboolean useGlobalRefs, jint debuggerPort, jboolean DBG, jboolean profilerEnabled)
{
char* argv[] = { const_cast<char*>(""), const_cast<char*>("--expose-gc") };
int argc = sizeof(argv)/sizeof(*argv);
V8::SetFlagsFromCommandLine(&argc, argv, false);

if (profilerEnabled) {
char* argv[] = { const_cast<char*>(""), const_cast<char*>("--expose-gc") };
int argc = sizeof(argv)/sizeof(*argv);
V8::SetFlagsFromCommandLine(&argc, argv, false);
}

HandleScope scope;
titanium::JNIScope jniScope(env);

Expand Down