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 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1175 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); | 1175 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); |
1176 CHECK(isolate->debug()->CheckExecutionState(break_id)); | 1176 CHECK(isolate->debug()->CheckExecutionState(break_id)); |
1177 | 1177 |
1178 if (!args[1]->IsNumber()) { | 1178 if (!args[1]->IsNumber()) { |
1179 return isolate->Throw(isolate->heap()->illegal_argument_string()); | 1179 return isolate->Throw(isolate->heap()->illegal_argument_string()); |
1180 } | 1180 } |
1181 | 1181 |
1182 // Get the step action and check validity. | 1182 // Get the step action and check validity. |
1183 StepAction step_action = static_cast<StepAction>(NumberToInt32(args[1])); | 1183 StepAction step_action = static_cast<StepAction>(NumberToInt32(args[1])); |
1184 if (step_action != StepIn && step_action != StepNext && | 1184 if (step_action != StepIn && step_action != StepNext && |
1185 step_action != StepOut && step_action != StepFrame) { | 1185 step_action != StepOut) { |
1186 return isolate->Throw(isolate->heap()->illegal_argument_string()); | 1186 return isolate->Throw(isolate->heap()->illegal_argument_string()); |
1187 } | 1187 } |
1188 | 1188 |
1189 // Clear all current stepping setup. | 1189 // Clear all current stepping setup. |
1190 isolate->debug()->ClearStepping(); | 1190 isolate->debug()->ClearStepping(); |
1191 | 1191 |
1192 // Prepare step. | 1192 // Prepare step. |
1193 isolate->debug()->PrepareStep(static_cast<StepAction>(step_action)); | 1193 isolate->debug()->PrepareStep(static_cast<StepAction>(step_action)); |
1194 return isolate->heap()->undefined_value(); | 1194 return isolate->heap()->undefined_value(); |
1195 } | 1195 } |
1196 | 1196 |
1197 RUNTIME_FUNCTION(Runtime_PrepareStepFrame) { | |
1198 HandleScope scope(isolate); | |
1199 DCHECK_EQ(0, args.length()); | |
1200 CHECK(isolate->debug()->CheckExecutionState()); | |
1201 | |
1202 // Clear all current stepping setup. | |
1203 isolate->debug()->ClearStepping(); | |
1204 | |
1205 // Prepare step. | |
1206 isolate->debug()->PrepareStep(StepFrame); | |
1207 return isolate->heap()->undefined_value(); | |
1208 } | |
1209 | |
1210 // Clear all stepping set by PrepareStep. | 1197 // Clear all stepping set by PrepareStep. |
1211 RUNTIME_FUNCTION(Runtime_ClearStepping) { | 1198 RUNTIME_FUNCTION(Runtime_ClearStepping) { |
1212 HandleScope scope(isolate); | 1199 HandleScope scope(isolate); |
1213 DCHECK_EQ(0, args.length()); | 1200 DCHECK_EQ(0, args.length()); |
1214 CHECK(isolate->debug()->is_active()); | 1201 CHECK(isolate->debug()->is_active()); |
1215 isolate->debug()->ClearStepping(); | 1202 isolate->debug()->ClearStepping(); |
1216 return isolate->heap()->undefined_value(); | 1203 return isolate->heap()->undefined_value(); |
1217 } | 1204 } |
1218 | 1205 |
1219 | 1206 |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 } | 1910 } |
1924 | 1911 |
1925 | 1912 |
1926 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 1913 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
1927 UNIMPLEMENTED(); | 1914 UNIMPLEMENTED(); |
1928 return NULL; | 1915 return NULL; |
1929 } | 1916 } |
1930 | 1917 |
1931 } // namespace internal | 1918 } // namespace internal |
1932 } // namespace v8 | 1919 } // namespace v8 |
OLD | NEW |