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/debug/debug-evaluate.h" | 8 #include "src/debug/debug-evaluate.h" |
9 #include "src/debug/debug-frames.h" | 9 #include "src/debug/debug-frames.h" |
10 #include "src/debug/debug-scopes.h" | 10 #include "src/debug/debug-scopes.h" |
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 isolate->debug()->ClearStepping(); | 1236 isolate->debug()->ClearStepping(); |
1237 return isolate->heap()->undefined_value(); | 1237 return isolate->heap()->undefined_value(); |
1238 } | 1238 } |
1239 | 1239 |
1240 | 1240 |
1241 RUNTIME_FUNCTION(Runtime_DebugEvaluate) { | 1241 RUNTIME_FUNCTION(Runtime_DebugEvaluate) { |
1242 HandleScope scope(isolate); | 1242 HandleScope scope(isolate); |
1243 | 1243 |
1244 // Check the execution state and decode arguments frame and source to be | 1244 // Check the execution state and decode arguments frame and source to be |
1245 // evaluated. | 1245 // evaluated. |
1246 DCHECK(args.length() == 6); | 1246 DCHECK(args.length() == 4); |
1247 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); | 1247 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); |
1248 CHECK(isolate->debug()->CheckExecutionState(break_id)); | 1248 CHECK(isolate->debug()->CheckExecutionState(break_id)); |
1249 | 1249 |
1250 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); | 1250 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); |
1251 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]); | 1251 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]); |
1252 CONVERT_ARG_HANDLE_CHECKED(String, source, 3); | 1252 CONVERT_ARG_HANDLE_CHECKED(String, source, 3); |
1253 CONVERT_BOOLEAN_ARG_CHECKED(disable_break, 4); | |
1254 CONVERT_ARG_HANDLE_CHECKED(HeapObject, context_extension, 5); | |
1255 | 1253 |
1256 StackFrame::Id id = DebugFrameHelper::UnwrapFrameId(wrapped_id); | 1254 StackFrame::Id id = DebugFrameHelper::UnwrapFrameId(wrapped_id); |
1257 | 1255 |
1258 RETURN_RESULT_OR_FAILURE( | 1256 RETURN_RESULT_OR_FAILURE( |
1259 isolate, DebugEvaluate::Local(isolate, id, inlined_jsframe_index, source, | 1257 isolate, |
1260 disable_break, context_extension)); | 1258 DebugEvaluate::Local(isolate, id, inlined_jsframe_index, source)); |
1261 } | 1259 } |
1262 | 1260 |
1263 | 1261 |
1264 RUNTIME_FUNCTION(Runtime_DebugEvaluateGlobal) { | 1262 RUNTIME_FUNCTION(Runtime_DebugEvaluateGlobal) { |
1265 HandleScope scope(isolate); | 1263 HandleScope scope(isolate); |
1266 | 1264 |
1267 // Check the execution state and decode arguments frame and source to be | 1265 // Check the execution state and decode arguments frame and source to be |
1268 // evaluated. | 1266 // evaluated. |
1269 DCHECK(args.length() == 4); | 1267 DCHECK(args.length() == 2); |
1270 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); | 1268 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); |
1271 CHECK(isolate->debug()->CheckExecutionState(break_id)); | 1269 CHECK(isolate->debug()->CheckExecutionState(break_id)); |
1272 | 1270 |
1273 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); | 1271 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); |
1274 CONVERT_BOOLEAN_ARG_CHECKED(disable_break, 2); | |
1275 CONVERT_ARG_HANDLE_CHECKED(HeapObject, context_extension, 3); | |
1276 | 1272 |
1277 RETURN_RESULT_OR_FAILURE( | 1273 RETURN_RESULT_OR_FAILURE(isolate, DebugEvaluate::Global(isolate, source)); |
1278 isolate, | |
1279 DebugEvaluate::Global(isolate, source, disable_break, context_extension)); | |
1280 } | 1274 } |
1281 | 1275 |
1282 | 1276 |
1283 RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) { | 1277 RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) { |
1284 HandleScope scope(isolate); | 1278 HandleScope scope(isolate); |
1285 DCHECK(args.length() == 0); | 1279 DCHECK(args.length() == 0); |
1286 | 1280 |
1287 // This runtime function is used by the debugger to determine whether the | 1281 // This runtime function is used by the debugger to determine whether the |
1288 // debugger is active or not. Hence we fail gracefully here and don't crash. | 1282 // debugger is active or not. Hence we fail gracefully here and don't crash. |
1289 if (!isolate->debug()->is_active()) return isolate->ThrowIllegalOperation(); | 1283 if (!isolate->debug()->is_active()) return isolate->ThrowIllegalOperation(); |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 } | 1917 } |
1924 | 1918 |
1925 | 1919 |
1926 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 1920 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
1927 UNIMPLEMENTED(); | 1921 UNIMPLEMENTED(); |
1928 return NULL; | 1922 return NULL; |
1929 } | 1923 } |
1930 | 1924 |
1931 } // namespace internal | 1925 } // namespace internal |
1932 } // namespace v8 | 1926 } // namespace v8 |
OLD | NEW |