Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: src/runtime/runtime-debug.cc

Issue 2685483002: [debugger] expose side-effect free evaluate to inspector. (Closed)
Patch Set: add inspector test Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | test/debugger/debug/debug-evaluate-no-side-effect.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-coverage.h" 9 #include "src/debug/debug-coverage.h"
10 #include "src/debug/debug-evaluate.h" 10 #include "src/debug/debug-evaluate.h"
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 isolate->debug()->ClearStepping(); 1203 isolate->debug()->ClearStepping();
1204 return isolate->heap()->undefined_value(); 1204 return isolate->heap()->undefined_value();
1205 } 1205 }
1206 1206
1207 1207
1208 RUNTIME_FUNCTION(Runtime_DebugEvaluate) { 1208 RUNTIME_FUNCTION(Runtime_DebugEvaluate) {
1209 HandleScope scope(isolate); 1209 HandleScope scope(isolate);
1210 1210
1211 // Check the execution state and decode arguments frame and source to be 1211 // Check the execution state and decode arguments frame and source to be
1212 // evaluated. 1212 // evaluated.
1213 DCHECK_EQ(4, args.length()); 1213 DCHECK_EQ(5, args.length());
1214 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); 1214 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]);
1215 CHECK(isolate->debug()->CheckExecutionState(break_id)); 1215 CHECK(isolate->debug()->CheckExecutionState(break_id));
1216 1216
1217 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); 1217 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1);
1218 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]); 1218 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]);
1219 CONVERT_ARG_HANDLE_CHECKED(String, source, 3); 1219 CONVERT_ARG_HANDLE_CHECKED(String, source, 3);
1220 CONVERT_BOOLEAN_ARG_CHECKED(throw_on_side_effect, 4);
1220 1221
1221 StackFrame::Id id = DebugFrameHelper::UnwrapFrameId(wrapped_id); 1222 StackFrame::Id id = DebugFrameHelper::UnwrapFrameId(wrapped_id);
1222 1223
1223 RETURN_RESULT_OR_FAILURE( 1224 RETURN_RESULT_OR_FAILURE(
1224 isolate, 1225 isolate, DebugEvaluate::Local(isolate, id, inlined_jsframe_index, source,
1225 DebugEvaluate::Local(isolate, id, inlined_jsframe_index, source)); 1226 throw_on_side_effect));
1226 } 1227 }
1227 1228
1228 1229
1229 RUNTIME_FUNCTION(Runtime_DebugEvaluateGlobal) { 1230 RUNTIME_FUNCTION(Runtime_DebugEvaluateGlobal) {
1230 HandleScope scope(isolate); 1231 HandleScope scope(isolate);
1231 1232
1232 // Check the execution state and decode arguments frame and source to be 1233 // Check the execution state and decode arguments frame and source to be
1233 // evaluated. 1234 // evaluated.
1234 DCHECK_EQ(2, args.length()); 1235 DCHECK_EQ(2, args.length());
1235 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); 1236 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]);
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 if (enable) { 1942 if (enable) {
1942 Coverage::EnablePrecise(isolate); 1943 Coverage::EnablePrecise(isolate);
1943 } else { 1944 } else {
1944 Coverage::DisablePrecise(isolate); 1945 Coverage::DisablePrecise(isolate);
1945 } 1946 }
1946 return isolate->heap()->undefined_value(); 1947 return isolate->heap()->undefined_value();
1947 } 1948 }
1948 1949
1949 } // namespace internal 1950 } // namespace internal
1950 } // namespace v8 1951 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/debugger/debug/debug-evaluate-no-side-effect.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698