diff options
Diffstat (limited to 'src/3rdparty/v8/src/execution.cc')
-rw-r--r-- | src/3rdparty/v8/src/execution.cc | 76 |
1 files changed, 59 insertions, 17 deletions
diff --git a/src/3rdparty/v8/src/execution.cc b/src/3rdparty/v8/src/execution.cc index 7e69abe..913bf64 100644 --- a/src/3rdparty/v8/src/execution.cc +++ b/src/3rdparty/v8/src/execution.cc @@ -101,12 +101,12 @@ static Handle<Object> Invoke(bool is_construct, // Make sure that the global object of the context we're about to // make the current one is indeed a global object. - ASSERT(function->context()->global()->IsGlobalObject()); + ASSERT(function->context()->global_object()->IsGlobalObject()); Handle<JSObject> oldqml; if (!qml.is_null()) { - oldqml = Handle<JSObject>(function->context()->qml_global()); - function->context()->set_qml_global(JSObject::cast(*qml)); + oldqml = Handle<JSObject>(function->context()->qml_global_object()); + function->context()->set_qml_global_object(JSObject::cast(*qml)); } { @@ -126,9 +126,9 @@ static Handle<Object> Invoke(bool is_construct, } if (!qml.is_null()) - function->context()->set_qml_global(*oldqml); + function->context()->set_qml_global_object(*oldqml); -#ifdef DEBUG +#ifdef VERIFY_HEAP value->Verify(); #endif @@ -142,6 +142,12 @@ static Handle<Object> Invoke(bool is_construct, V8::FatalProcessOutOfMemory("JS", true); } } +#ifdef ENABLE_DEBUGGER_SUPPORT + // Reset stepping state when script exits with uncaught exception. + if (isolate->debugger()->IsDebuggerActive()) { + isolate->debug()->ClearStepping(); + } +#endif // ENABLE_DEBUGGER_SUPPORT return Handle<Object>(); } else { isolate->clear_pending_message(); @@ -158,7 +164,8 @@ Handle<Object> Execution::Call(Handle<Object> callable, bool* pending_exception, bool convert_receiver) { - return Call(callable, receiver, argc, argv, pending_exception, convert_receiver, Handle<Object>()); + return Call(callable, receiver, argc, argv, pending_exception, + convert_receiver, Handle<Object>()); } Handle<Object> Execution::Call(Handle<Object> callable, @@ -180,10 +187,10 @@ Handle<Object> Execution::Call(Handle<Object> callable, if (convert_receiver && !receiver->IsJSReceiver() && !func->shared()->native() && func->shared()->is_classic_mode()) { if (receiver->IsUndefined() || receiver->IsNull()) { - Object* global = func->context()->global()->global_receiver(); + Object* global = func->context()->global_object()->global_receiver(); // Under some circumstances, 'global' can be the JSBuiltinsObject - // In that case, don't rewrite. - // (FWIW, the same holds for GetIsolate()->global()->global_receiver().) + // In that case, don't rewrite. (FWIW, the same holds for + // GetIsolate()->global_object()->global_receiver().) if (!global->IsJSBuiltinsObject()) receiver = Handle<Object>(global); } else { receiver = ToObject(receiver, pending_exception); @@ -199,7 +206,7 @@ Handle<Object> Execution::New(Handle<JSFunction> func, int argc, Handle<Object> argv[], bool* pending_exception) { - return Invoke(true, func, Isolate::Current()->global(), argc, argv, + return Invoke(true, func, Isolate::Current()->global_object(), argc, argv, pending_exception, Handle<Object>()); } @@ -261,7 +268,7 @@ Handle<Object> Execution::GetFunctionDelegate(Handle<Object> object) { if (fun->IsHeapObject() && HeapObject::cast(fun)->map()->has_instance_call_handler()) { return Handle<JSFunction>( - isolate->global_context()->call_as_function_delegate()); + isolate->native_context()->call_as_function_delegate()); } return factory->undefined_value(); @@ -285,7 +292,7 @@ Handle<Object> Execution::TryGetFunctionDelegate(Handle<Object> object, if (fun->IsHeapObject() && HeapObject::cast(fun)->map()->has_instance_call_handler()) { return Handle<JSFunction>( - isolate->global_context()->call_as_function_delegate()); + isolate->native_context()->call_as_function_delegate()); } // If the Object doesn't have an instance-call handler we should @@ -318,7 +325,7 @@ Handle<Object> Execution::GetConstructorDelegate(Handle<Object> object) { if (fun->IsHeapObject() && HeapObject::cast(fun)->map()->has_instance_call_handler()) { return Handle<JSFunction>( - isolate->global_context()->call_as_constructor_delegate()); + isolate->native_context()->call_as_constructor_delegate()); } return isolate->factory()->undefined_value(); @@ -346,7 +353,7 @@ Handle<Object> Execution::TryGetConstructorDelegate( if (fun->IsHeapObject() && HeapObject::cast(fun)->map()->has_instance_call_handler()) { return Handle<JSFunction>( - isolate->global_context()->call_as_constructor_delegate()); + isolate->native_context()->call_as_constructor_delegate()); } // If the Object doesn't have an instance-call handler we should @@ -461,6 +468,25 @@ void StackGuard::RequestRuntimeProfilerTick() { } +void StackGuard::RequestCodeReadyEvent() { + ASSERT(FLAG_parallel_recompilation); + if (ExecutionAccess::TryLock(isolate_)) { + thread_local_.interrupt_flags_ |= CODE_READY; + if (thread_local_.postpone_interrupts_nesting_ == 0) { + thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit; + isolate_->heap()->SetStackLimits(); + } + ExecutionAccess::Unlock(isolate_); + } +} + + +bool StackGuard::IsCodeReadyEvent() { + ExecutionAccess access(isolate_); + return (thread_local_.interrupt_flags_ & CODE_READY) != 0; +} + + bool StackGuard::IsGCRequest() { ExecutionAccess access(isolate_); return (thread_local_.interrupt_flags_ & GC_REQUEST) != 0; @@ -676,7 +702,7 @@ Handle<JSRegExp> Execution::NewJSRegExp(Handle<String> pattern, Handle<String> flags, bool* exc) { Handle<JSFunction> function = Handle<JSFunction>( - pattern->GetIsolate()->global_context()->regexp_function()); + pattern->GetIsolate()->native_context()->regexp_function()); Handle<Object> re_obj = RegExpImpl::CreateRegExpLiteral( function, pattern, flags, exc); if (*exc) return Handle<JSRegExp>(); @@ -722,7 +748,7 @@ Handle<JSFunction> Execution::InstantiateFunction( // Fast case: see if the function has already been instantiated int serial_number = Smi::cast(data->serial_number())->value(); Object* elm = - isolate->global_context()->function_cache()-> + isolate->native_context()->function_cache()-> GetElementNoExceptionThrown(serial_number); if (elm->IsJSFunction()) return Handle<JSFunction>(JSFunction::cast(elm)); // The function has not yet been instantiated in this context; do it. @@ -847,6 +873,11 @@ Object* Execution::DebugBreakHelper() { return isolate->heap()->undefined_value(); } + // Ignore debug break if debugger is not active. + if (!isolate->debugger()->IsDebuggerActive()) { + return isolate->heap()->undefined_value(); + } + StackLimitCheck check(isolate); if (check.HasOverflowed()) { return isolate->heap()->undefined_value(); @@ -861,7 +892,7 @@ Object* Execution::DebugBreakHelper() { if (JSFunction::cast(fun)->IsBuiltin()) { return isolate->heap()->undefined_value(); } - GlobalObject* global = JSFunction::cast(fun)->context()->global(); + GlobalObject* global = JSFunction::cast(fun)->context()->global_object(); // Don't stop in debugger functions. if (isolate->debug()->IsDebugGlobal(global)) { return isolate->heap()->undefined_value(); @@ -921,6 +952,17 @@ MaybeObject* Execution::HandleStackGuardInterrupt(Isolate* isolate) { stack_guard->Continue(GC_REQUEST); } + if (stack_guard->IsCodeReadyEvent()) { + ASSERT(FLAG_parallel_recompilation); + if (FLAG_trace_parallel_recompilation) { + PrintF(" ** CODE_READY event received.\n"); + } + stack_guard->Continue(CODE_READY); + } + if (!stack_guard->IsTerminateExecution()) { + isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); + } + isolate->counters()->stack_interrupts()->Increment(); // If FLAG_count_based_interrupts, every interrupt is a profiler interrupt. if (FLAG_count_based_interrupts || |