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

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

Issue 2109093003: [wasm] Enable wasm frame inspection for debugging (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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') | src/debug/debug-frames.h » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/debug/debug-evaluate.h" 5 #include "src/debug/debug-evaluate.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/contexts.h" 8 #include "src/contexts.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/debug/debug-frames.h" 10 #include "src/debug/debug-frames.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 MaybeHandle<Object> DebugEvaluate::Local(Isolate* isolate, 47 MaybeHandle<Object> DebugEvaluate::Local(Isolate* isolate,
48 StackFrame::Id frame_id, 48 StackFrame::Id frame_id,
49 int inlined_jsframe_index, 49 int inlined_jsframe_index,
50 Handle<String> source, 50 Handle<String> source,
51 bool disable_break, 51 bool disable_break,
52 Handle<HeapObject> context_extension) { 52 Handle<HeapObject> context_extension) {
53 // Handle the processing of break. 53 // Handle the processing of break.
54 DisableBreak disable_break_scope(isolate->debug(), disable_break); 54 DisableBreak disable_break_scope(isolate->debug(), disable_break);
55 55
56 // Get the frame where the debugging is performed. 56 // Get the frame where the debugging is performed.
57 JavaScriptFrameIterator it(isolate, frame_id); 57 StackTraceFrameIterator it(isolate, frame_id);
58 JavaScriptFrame* frame = it.frame(); 58 if (!it.is_javascript()) return isolate->factory()->undefined_value();
59 JavaScriptFrame* frame = it.javascript_frame();
59 60
60 // Traverse the saved contexts chain to find the active context for the 61 // Traverse the saved contexts chain to find the active context for the
61 // selected frame. 62 // selected frame.
62 SaveContext* save = 63 SaveContext* save =
63 DebugFrameHelper::FindSavedContextForFrame(isolate, frame); 64 DebugFrameHelper::FindSavedContextForFrame(isolate, frame);
64 SaveContext savex(isolate); 65 SaveContext savex(isolate);
65 isolate->set_context(*(save->context())); 66 isolate->set_context(*(save->context()));
66 67
67 // This is not a lot different than DebugEvaluate::Global, except that 68 // This is not a lot different than DebugEvaluate::Global, except that
68 // variables accessible by the function we are evaluating from are 69 // variables accessible by the function we are evaluating from are
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 120 }
120 121
121 122
122 DebugEvaluate::ContextBuilder::ContextBuilder(Isolate* isolate, 123 DebugEvaluate::ContextBuilder::ContextBuilder(Isolate* isolate,
123 JavaScriptFrame* frame, 124 JavaScriptFrame* frame,
124 int inlined_jsframe_index) 125 int inlined_jsframe_index)
125 : isolate_(isolate), 126 : isolate_(isolate),
126 frame_(frame), 127 frame_(frame),
127 inlined_jsframe_index_(inlined_jsframe_index) { 128 inlined_jsframe_index_(inlined_jsframe_index) {
128 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate); 129 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate);
129 Handle<JSFunction> local_function = 130 Handle<JSFunction> local_function = frame_inspector.GetFunction();
130 Handle<JSFunction>::cast(frame_inspector.GetFunction());
131 Handle<Context> outer_context(local_function->context()); 131 Handle<Context> outer_context(local_function->context());
132 evaluation_context_ = outer_context; 132 evaluation_context_ = outer_context;
133 outer_info_ = handle(local_function->shared()); 133 outer_info_ = handle(local_function->shared());
134 Factory* factory = isolate->factory(); 134 Factory* factory = isolate->factory();
135 135
136 // To evaluate as if we were running eval at the point of the debug break, 136 // To evaluate as if we were running eval at the point of the debug break,
137 // we reconstruct the context chain as follows: 137 // we reconstruct the context chain as follows:
138 // - To make stack-allocated variables visible, we materialize them and 138 // - To make stack-allocated variables visible, we materialize them and
139 // use a debug-evaluate context to wrap both the materialized object and 139 // use a debug-evaluate context to wrap both the materialized object and
140 // the original context. 140 // the original context.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 return; 251 return;
252 } else if (local_function->shared()->scope_info()->HasReceiver() && 252 } else if (local_function->shared()->scope_info()->HasReceiver() &&
253 !frame_->receiver()->IsTheHole(isolate_)) { 253 !frame_->receiver()->IsTheHole(isolate_)) {
254 recv = handle(frame_->receiver(), isolate_); 254 recv = handle(frame_->receiver(), isolate_);
255 } 255 }
256 JSObject::SetOwnPropertyIgnoreAttributes(target, name, recv, NONE).Check(); 256 JSObject::SetOwnPropertyIgnoreAttributes(target, name, recv, NONE).Check();
257 } 257 }
258 258
259 } // namespace internal 259 } // namespace internal
260 } // namespace v8 260 } // namespace v8
OLDNEW
« no previous file with comments | « src/debug/debug.cc ('k') | src/debug/debug-frames.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698