Skip to content

Commit

Permalink
Merge pull request #4265 from ayeung/timob-13779
Browse files Browse the repository at this point in the history
TIMOB-13779: Remove access to V8's gc except for profiling.
  • Loading branch information
matt-langston committed May 17, 2013
2 parents 167c271 + ff244b0 commit df55020
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
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

0 comments on commit df55020

Please sign in to comment.