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

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

Issue 2702343003: [Debugger] Add a ReturnValueScope to correctly handle return values in nested debug breaks. (Closed)
Patch Set: Moves handle scope to Runtime_DebugBreak. 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/debug/debug.cc ('k') | no next file » | 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 10 matching lines...) Expand all
21 #include "src/wasm/wasm-module.h" 21 #include "src/wasm/wasm-module.h"
22 #include "src/wasm/wasm-objects.h" 22 #include "src/wasm/wasm-objects.h"
23 23
24 namespace v8 { 24 namespace v8 {
25 namespace internal { 25 namespace internal {
26 26
27 RUNTIME_FUNCTION(Runtime_DebugBreak) { 27 RUNTIME_FUNCTION(Runtime_DebugBreak) {
28 SealHandleScope shs(isolate); 28 SealHandleScope shs(isolate);
29 DCHECK_EQ(1, args.length()); 29 DCHECK_EQ(1, args.length());
30 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0); 30 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
31 HandleScope scope(isolate);
32 ReturnValueScope result_scope(isolate->debug());
31 isolate->debug()->set_return_value(*value); 33 isolate->debug()->set_return_value(*value);
32 34
33 // Get the top-most JavaScript frame. 35 // Get the top-most JavaScript frame.
34 JavaScriptFrameIterator it(isolate); 36 JavaScriptFrameIterator it(isolate);
35 isolate->debug()->Break(it.frame()); 37 isolate->debug()->Break(it.frame());
36 return isolate->debug()->return_value(); 38 return isolate->debug()->return_value();
37 } 39 }
38 40
39 RUNTIME_FUNCTION(Runtime_DebugBreakOnBytecode) { 41 RUNTIME_FUNCTION(Runtime_DebugBreakOnBytecode) {
40 SealHandleScope shs(isolate); 42 SealHandleScope shs(isolate);
41 DCHECK_EQ(1, args.length()); 43 DCHECK_EQ(1, args.length());
42 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0); 44 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
45 HandleScope scope(isolate);
46 ReturnValueScope result_scope(isolate->debug());
43 isolate->debug()->set_return_value(*value); 47 isolate->debug()->set_return_value(*value);
44 48
45 // Get the top-most JavaScript frame. 49 // Get the top-most JavaScript frame.
46 JavaScriptFrameIterator it(isolate); 50 JavaScriptFrameIterator it(isolate);
47 isolate->debug()->Break(it.frame()); 51 isolate->debug()->Break(it.frame());
48 52
49 // Return the handler from the original bytecode array. 53 // Return the handler from the original bytecode array.
50 DCHECK(it.frame()->is_interpreted()); 54 DCHECK(it.frame()->is_interpreted());
51 InterpretedFrame* interpreted_frame = 55 InterpretedFrame* interpreted_frame =
52 reinterpret_cast<InterpretedFrame*>(it.frame()); 56 reinterpret_cast<InterpretedFrame*>(it.frame());
(...skipping 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1964 1968
1965 RUNTIME_FUNCTION(Runtime_DebugTogglePreciseCoverage) { 1969 RUNTIME_FUNCTION(Runtime_DebugTogglePreciseCoverage) {
1966 SealHandleScope shs(isolate); 1970 SealHandleScope shs(isolate);
1967 CONVERT_BOOLEAN_ARG_CHECKED(enable, 0); 1971 CONVERT_BOOLEAN_ARG_CHECKED(enable, 0);
1968 Coverage::TogglePrecise(isolate, enable); 1972 Coverage::TogglePrecise(isolate, enable);
1969 return isolate->heap()->undefined_value(); 1973 return isolate->heap()->undefined_value();
1970 } 1974 }
1971 1975
1972 } // namespace internal 1976 } // namespace internal
1973 } // namespace v8 1977 } // namespace v8
OLDNEW
« no previous file with comments | « src/debug/debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698