| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <limits> | 6 #include <limits> |
| 7 | 7 |
| 8 #include "v8.h" | 8 #include "v8.h" |
| 9 | 9 |
| 10 #include "accessors.h" | 10 #include "accessors.h" |
| (...skipping 10705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10716 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 10716 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 10717 isolate, result, | 10717 isolate, result, |
| 10718 JSObject::GetAccessor(Handle<JSObject>::cast(receiver), name, component)); | 10718 JSObject::GetAccessor(Handle<JSObject>::cast(receiver), name, component)); |
| 10719 return *result; | 10719 return *result; |
| 10720 } | 10720 } |
| 10721 | 10721 |
| 10722 | 10722 |
| 10723 RUNTIME_FUNCTION(Runtime_DebugBreak) { | 10723 RUNTIME_FUNCTION(Runtime_DebugBreak) { |
| 10724 SealHandleScope shs(isolate); | 10724 SealHandleScope shs(isolate); |
| 10725 ASSERT(args.length() == 0); | 10725 ASSERT(args.length() == 0); |
| 10726 Execution::DebugBreakHelper(isolate); | 10726 isolate->debug()->DebugBreakHelper(); |
| 10727 return isolate->heap()->undefined_value(); | 10727 return isolate->heap()->undefined_value(); |
| 10728 } | 10728 } |
| 10729 | 10729 |
| 10730 | 10730 |
| 10731 // Helper functions for wrapping and unwrapping stack frame ids. | 10731 // Helper functions for wrapping and unwrapping stack frame ids. |
| 10732 static Smi* WrapFrameId(StackFrame::Id id) { | 10732 static Smi* WrapFrameId(StackFrame::Id id) { |
| 10733 ASSERT(IsAligned(OffsetFrom(id), static_cast<intptr_t>(4))); | 10733 ASSERT(IsAligned(OffsetFrom(id), static_cast<intptr_t>(4))); |
| 10734 return Smi::FromInt(id >> 2); | 10734 return Smi::FromInt(id >> 2); |
| 10735 } | 10735 } |
| 10736 | 10736 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10833 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 10833 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); |
| 10834 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); | 10834 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); |
| 10835 | 10835 |
| 10836 // Make sure to set the current context to the context before the debugger was | 10836 // Make sure to set the current context to the context before the debugger was |
| 10837 // entered (if the debugger is entered). The reason for switching context here | 10837 // entered (if the debugger is entered). The reason for switching context here |
| 10838 // is that for some property lookups (accessors and interceptors) callbacks | 10838 // is that for some property lookups (accessors and interceptors) callbacks |
| 10839 // into the embedding application can occour, and the embedding application | 10839 // into the embedding application can occour, and the embedding application |
| 10840 // could have the assumption that its own native context is the current | 10840 // could have the assumption that its own native context is the current |
| 10841 // context and not some internal debugger context. | 10841 // context and not some internal debugger context. |
| 10842 SaveContext save(isolate); | 10842 SaveContext save(isolate); |
| 10843 if (isolate->debug()->InDebugger()) { | 10843 if (isolate->debug()->is_entered()) { |
| 10844 isolate->set_context(*isolate->debug()->debugger_entry()->GetContext()); | 10844 isolate->set_context(*isolate->debug()->debugger_entry()->GetContext()); |
| 10845 } | 10845 } |
| 10846 | 10846 |
| 10847 // Skip the global proxy as it has no properties and always delegates to the | 10847 // Skip the global proxy as it has no properties and always delegates to the |
| 10848 // real global object. | 10848 // real global object. |
| 10849 if (obj->IsJSGlobalProxy()) { | 10849 if (obj->IsJSGlobalProxy()) { |
| 10850 obj = Handle<JSObject>(JSObject::cast(obj->GetPrototype())); | 10850 obj = Handle<JSObject>(JSObject::cast(obj->GetPrototype())); |
| 10851 } | 10851 } |
| 10852 | 10852 |
| 10853 | 10853 |
| (...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12880 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); | 12880 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); |
| 12881 RUNTIME_ASSERT(CheckExecutionState(isolate, break_id)); | 12881 RUNTIME_ASSERT(CheckExecutionState(isolate, break_id)); |
| 12882 | 12882 |
| 12883 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); | 12883 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); |
| 12884 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]); | 12884 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]); |
| 12885 CONVERT_ARG_HANDLE_CHECKED(String, source, 3); | 12885 CONVERT_ARG_HANDLE_CHECKED(String, source, 3); |
| 12886 CONVERT_BOOLEAN_ARG_CHECKED(disable_break, 4); | 12886 CONVERT_BOOLEAN_ARG_CHECKED(disable_break, 4); |
| 12887 CONVERT_ARG_HANDLE_CHECKED(Object, context_extension, 5); | 12887 CONVERT_ARG_HANDLE_CHECKED(Object, context_extension, 5); |
| 12888 | 12888 |
| 12889 // Handle the processing of break. | 12889 // Handle the processing of break. |
| 12890 DisableBreak disable_break_save(isolate, disable_break); | 12890 DisableBreak disable_break_scope(isolate->debug(), disable_break); |
| 12891 | 12891 |
| 12892 // Get the frame where the debugging is performed. | 12892 // Get the frame where the debugging is performed. |
| 12893 StackFrame::Id id = UnwrapFrameId(wrapped_id); | 12893 StackFrame::Id id = UnwrapFrameId(wrapped_id); |
| 12894 JavaScriptFrameIterator it(isolate, id); | 12894 JavaScriptFrameIterator it(isolate, id); |
| 12895 JavaScriptFrame* frame = it.frame(); | 12895 JavaScriptFrame* frame = it.frame(); |
| 12896 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate); | 12896 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate); |
| 12897 Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction())); | 12897 Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction())); |
| 12898 | 12898 |
| 12899 // Traverse the saved contexts chain to find the active context for the | 12899 // Traverse the saved contexts chain to find the active context for the |
| 12900 // selected frame. | 12900 // selected frame. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12944 // evaluated. | 12944 // evaluated. |
| 12945 ASSERT(args.length() == 4); | 12945 ASSERT(args.length() == 4); |
| 12946 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); | 12946 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); |
| 12947 RUNTIME_ASSERT(CheckExecutionState(isolate, break_id)); | 12947 RUNTIME_ASSERT(CheckExecutionState(isolate, break_id)); |
| 12948 | 12948 |
| 12949 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); | 12949 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); |
| 12950 CONVERT_BOOLEAN_ARG_CHECKED(disable_break, 2); | 12950 CONVERT_BOOLEAN_ARG_CHECKED(disable_break, 2); |
| 12951 CONVERT_ARG_HANDLE_CHECKED(Object, context_extension, 3); | 12951 CONVERT_ARG_HANDLE_CHECKED(Object, context_extension, 3); |
| 12952 | 12952 |
| 12953 // Handle the processing of break. | 12953 // Handle the processing of break. |
| 12954 DisableBreak disable_break_save(isolate, disable_break); | 12954 DisableBreak disable_break_scope(isolate->debug(), disable_break); |
| 12955 | 12955 |
| 12956 // Enter the top context from before the debugger was invoked. | 12956 // Enter the top context from before the debugger was invoked. |
| 12957 SaveContext save(isolate); | 12957 SaveContext save(isolate); |
| 12958 SaveContext* top = &save; | 12958 SaveContext* top = &save; |
| 12959 while (top != NULL && *top->context() == *isolate->debug()->debug_context()) { | 12959 while (top != NULL && *top->context() == *isolate->debug()->debug_context()) { |
| 12960 top = top->prev(); | 12960 top = top->prev(); |
| 12961 } | 12961 } |
| 12962 if (top != NULL) { | 12962 if (top != NULL) { |
| 12963 isolate->set_context(*top->context()); | 12963 isolate->set_context(*top->context()); |
| 12964 } | 12964 } |
| (...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15171 } | 15171 } |
| 15172 return NULL; | 15172 return NULL; |
| 15173 } | 15173 } |
| 15174 | 15174 |
| 15175 | 15175 |
| 15176 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15176 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
| 15177 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15177 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 15178 } | 15178 } |
| 15179 | 15179 |
| 15180 } } // namespace v8::internal | 15180 } } // namespace v8::internal |
| OLD | NEW |