| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/debug/debug-evaluate.h" | 9 #include "src/debug/debug-evaluate.h" |
| 10 #include "src/debug/debug-frames.h" | 10 #include "src/debug/debug-frames.h" |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 RUNTIME_FUNCTION(Runtime_GetScopeCount) { | 744 RUNTIME_FUNCTION(Runtime_GetScopeCount) { |
| 745 HandleScope scope(isolate); | 745 HandleScope scope(isolate); |
| 746 DCHECK_EQ(2, args.length()); | 746 DCHECK_EQ(2, args.length()); |
| 747 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); | 747 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); |
| 748 CHECK(isolate->debug()->CheckExecutionState(break_id)); | 748 CHECK(isolate->debug()->CheckExecutionState(break_id)); |
| 749 | 749 |
| 750 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); | 750 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); |
| 751 | 751 |
| 752 // Get the frame where the debugging is performed. | 752 // Get the frame where the debugging is performed. |
| 753 StackFrame::Id id = DebugFrameHelper::UnwrapFrameId(wrapped_id); | 753 StackFrame::Id id = DebugFrameHelper::UnwrapFrameId(wrapped_id); |
| 754 JavaScriptFrameIterator it(isolate, id); | 754 StackTraceFrameIterator it(isolate, id); |
| 755 JavaScriptFrame* frame = it.frame(); | 755 StandardFrame* frame = it.frame(); |
| 756 if (it.frame()->is_wasm()) return 0; |
| 757 |
| 756 FrameInspector frame_inspector(frame, 0, isolate); | 758 FrameInspector frame_inspector(frame, 0, isolate); |
| 757 | 759 |
| 758 // Count the visible scopes. | 760 // Count the visible scopes. |
| 759 int n = 0; | 761 int n = 0; |
| 760 for (ScopeIterator it(isolate, &frame_inspector); !it.Done(); it.Next()) { | 762 for (ScopeIterator it(isolate, &frame_inspector); !it.Done(); it.Next()) { |
| 761 n++; | 763 n++; |
| 762 } | 764 } |
| 763 | 765 |
| 764 return Smi::FromInt(n); | 766 return Smi::FromInt(n); |
| 765 } | 767 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 779 DCHECK_EQ(4, args.length()); | 781 DCHECK_EQ(4, args.length()); |
| 780 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); | 782 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); |
| 781 CHECK(isolate->debug()->CheckExecutionState(break_id)); | 783 CHECK(isolate->debug()->CheckExecutionState(break_id)); |
| 782 | 784 |
| 783 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); | 785 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); |
| 784 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]); | 786 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]); |
| 785 CONVERT_NUMBER_CHECKED(int, index, Int32, args[3]); | 787 CONVERT_NUMBER_CHECKED(int, index, Int32, args[3]); |
| 786 | 788 |
| 787 // Get the frame where the debugging is performed. | 789 // Get the frame where the debugging is performed. |
| 788 StackFrame::Id id = DebugFrameHelper::UnwrapFrameId(wrapped_id); | 790 StackFrame::Id id = DebugFrameHelper::UnwrapFrameId(wrapped_id); |
| 789 JavaScriptFrameIterator frame_it(isolate, id); | 791 StackTraceFrameIterator frame_it(isolate, id); |
| 790 JavaScriptFrame* frame = frame_it.frame(); | 792 // Wasm has no scopes, this must be javascript. |
| 793 JavaScriptFrame* frame = JavaScriptFrame::cast(frame_it.frame()); |
| 791 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate); | 794 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate); |
| 792 | 795 |
| 793 // Find the requested scope. | 796 // Find the requested scope. |
| 794 int n = 0; | 797 int n = 0; |
| 795 ScopeIterator it(isolate, &frame_inspector); | 798 ScopeIterator it(isolate, &frame_inspector); |
| 796 for (; !it.Done() && n < index; it.Next()) { | 799 for (; !it.Done() && n < index; it.Next()) { |
| 797 n++; | 800 n++; |
| 798 } | 801 } |
| 799 if (it.Done()) { | 802 if (it.Done()) { |
| 800 return isolate->heap()->undefined_value(); | 803 return isolate->heap()->undefined_value(); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 bool res; | 971 bool res; |
| 969 if (args[0]->IsNumber()) { | 972 if (args[0]->IsNumber()) { |
| 970 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); | 973 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); |
| 971 CHECK(isolate->debug()->CheckExecutionState(break_id)); | 974 CHECK(isolate->debug()->CheckExecutionState(break_id)); |
| 972 | 975 |
| 973 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); | 976 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); |
| 974 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]); | 977 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]); |
| 975 | 978 |
| 976 // Get the frame where the debugging is performed. | 979 // Get the frame where the debugging is performed. |
| 977 StackFrame::Id id = DebugFrameHelper::UnwrapFrameId(wrapped_id); | 980 StackFrame::Id id = DebugFrameHelper::UnwrapFrameId(wrapped_id); |
| 978 JavaScriptFrameIterator frame_it(isolate, id); | 981 StackTraceFrameIterator frame_it(isolate, id); |
| 979 JavaScriptFrame* frame = frame_it.frame(); | 982 // Wasm has no scopes, this must be javascript. |
| 983 JavaScriptFrame* frame = JavaScriptFrame::cast(frame_it.frame()); |
| 980 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate); | 984 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate); |
| 981 | 985 |
| 982 ScopeIterator it(isolate, &frame_inspector); | 986 ScopeIterator it(isolate, &frame_inspector); |
| 983 res = SetScopeVariableValue(&it, index, variable_name, new_value); | 987 res = SetScopeVariableValue(&it, index, variable_name, new_value); |
| 984 } else if (args[0]->IsJSFunction()) { | 988 } else if (args[0]->IsJSFunction()) { |
| 985 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); | 989 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); |
| 986 ScopeIterator it(isolate, fun); | 990 ScopeIterator it(isolate, fun); |
| 987 res = SetScopeVariableValue(&it, index, variable_name, new_value); | 991 res = SetScopeVariableValue(&it, index, variable_name, new_value); |
| 988 } else { | 992 } else { |
| 989 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, gen, 0); | 993 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, gen, 0); |
| (...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1926 } | 1930 } |
| 1927 | 1931 |
| 1928 | 1932 |
| 1929 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 1933 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
| 1930 UNIMPLEMENTED(); | 1934 UNIMPLEMENTED(); |
| 1931 return NULL; | 1935 return NULL; |
| 1932 } | 1936 } |
| 1933 | 1937 |
| 1934 } // namespace internal | 1938 } // namespace internal |
| 1935 } // namespace v8 | 1939 } // namespace v8 |
| OLD | NEW |