diff options
Diffstat (limited to 'deps/v8/src/runtime/runtime-debug.cc')
-rw-r--r-- | deps/v8/src/runtime/runtime-debug.cc | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/deps/v8/src/runtime/runtime-debug.cc b/deps/v8/src/runtime/runtime-debug.cc index 1cd524f17c..9f49e4d5d2 100644 --- a/deps/v8/src/runtime/runtime-debug.cc +++ b/deps/v8/src/runtime/runtime-debug.cc @@ -10,6 +10,7 @@ #include "src/debug/debug-frames.h" #include "src/debug/debug-scopes.h" #include "src/frames-inl.h" +#include "src/isolate-inl.h" #include "src/runtime/runtime.h" namespace v8 { @@ -221,7 +222,7 @@ MaybeHandle<JSArray> Runtime::GetInternalProperties(Isolate* isolate, Handle<JSObject> promise = Handle<JSObject>::cast(object); Handle<Object> status_obj = - DebugGetProperty(promise, isolate->promise_status()); + DebugGetProperty(promise, isolate->factory()->promise_status_symbol()); RUNTIME_ASSERT_HANDLIFIED(status_obj->IsSmi(), JSArray); const char* status = "rejected"; int status_val = Handle<Smi>::cast(status_obj)->value(); @@ -244,7 +245,7 @@ MaybeHandle<JSArray> Runtime::GetInternalProperties(Isolate* isolate, result->set(1, *status_str); Handle<Object> value_obj = - DebugGetProperty(promise, isolate->promise_value()); + DebugGetProperty(promise, isolate->factory()->promise_value_symbol()); Handle<String> promise_value = factory->NewStringFromAsciiChecked("[[PromiseValue]]"); result->set(2, *promise_value); @@ -533,6 +534,7 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) { // Get scope info and read from it for local variable information. Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction())); + RUNTIME_ASSERT(function->IsSubjectToDebugging()); Handle<SharedFunctionInfo> shared(function->shared()); Handle<ScopeInfo> scope_info(shared->scope_info()); DCHECK(*scope_info != ScopeInfo::Empty(isolate)); @@ -566,13 +568,11 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) { if (scope_info->LocalIsSynthetic(i)) continue; Handle<String> name(scope_info->LocalName(i)); VariableMode mode; - VariableLocation location; InitializationFlag init_flag; MaybeAssignedFlag maybe_assigned_flag; locals->set(local * 2, *name); int context_slot_index = ScopeInfo::ContextSlotIndex( - scope_info, name, &mode, &location, &init_flag, &maybe_assigned_flag); - DCHECK(VariableLocation::CONTEXT == location); + scope_info, name, &mode, &init_flag, &maybe_assigned_flag); Object* value = context->get(context_slot_index); locals->set(local * 2 + 1, value); local++; @@ -712,8 +712,8 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) { // THIS MUST BE DONE LAST SINCE WE MIGHT ADVANCE // THE FRAME ITERATOR TO WRAP THE RECEIVER. Handle<Object> receiver(it.frame()->receiver(), isolate); - if (!receiver->IsJSObject() && is_sloppy(shared->language_mode()) && - !function->IsBuiltin()) { + DCHECK(!function->IsBuiltin()); + if (!receiver->IsJSObject() && is_sloppy(shared->language_mode())) { // If the receiver is not a JSObject and the function is not a // builtin or strict-mode we have hit an optimization where a // value object is not converted into a wrapped JS objects. To @@ -1602,13 +1602,10 @@ RUNTIME_FUNCTION(Runtime_GetScript) { CONVERT_ARG_HANDLE_CHECKED(String, script_name, 0); Handle<Script> found; - Heap* heap = isolate->heap(); { - HeapIterator iterator(heap); - HeapObject* obj = NULL; - while ((obj = iterator.next()) != NULL) { - if (!obj->IsScript()) continue; - Script* script = Script::cast(obj); + Script::Iterator iterator(isolate); + Script* script = NULL; + while ((script = iterator.Next()) != NULL) { if (!script->name()->IsString()) continue; String* name = String::cast(script->name()); if (name->Equals(*script_name)) { @@ -1618,7 +1615,7 @@ RUNTIME_FUNCTION(Runtime_GetScript) { } } - if (found.is_null()) return heap->undefined_value(); + if (found.is_null()) return isolate->heap()->undefined_value(); return *Script::GetWrapper(found); } @@ -1637,7 +1634,7 @@ RUNTIME_FUNCTION(Runtime_DebugCallbackSupportsStepping) { // or not even a function. return isolate->heap()->ToBoolean( callback->IsJSFunction() && - (!JSFunction::cast(callback)->IsBuiltin() || + (JSFunction::cast(callback)->IsSubjectToDebugging() || JSFunction::cast(callback)->shared()->bound())); } |