| 460 | } |
| 461 | |
| 462 | bool Runtime::TryCallGC() { |
| 463 | auto success = m_gcFunc != nullptr; |
| 464 | if (success) { |
| 465 | success = __sync_bool_compare_and_swap(&m_runGC, true, false); |
| 466 | if (success) { |
| 467 | auto ctx = m_isolate->GetCurrentContext(); |
| 468 | auto globalObject = ctx->Global(); |
| 469 | auto gcFunc = Local<Function>::New(m_isolate, *m_gcFunc); |
| 470 | auto maybeResult = |
| 471 | gcFunc.As<Function>()->Call(ctx, globalObject, 0, nullptr); |
| 472 | DEBUG_WRITE("Induced GC runtimeId=%d", m_id); |
| 473 | } |
| 474 | } |
| 475 | return success; |
| 476 | } |
| 477 | |
| 478 | void Runtime::PassExceptionToJsNative(JNIEnv* env, jobject obj, |
| 479 | jthrowable exception, jstring message, |
no test coverage detected