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

Unified Diff: src/debug/debug-frames.cc

Issue 1703453002: [interpreter, debugger] support debug breaks via bytecode array copy (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug/debug-frames.h ('k') | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug-frames.cc
diff --git a/src/debug/debug-frames.cc b/src/debug/debug-frames.cc
index f01354500b0e5ce1670a45e8e7afe6087158f99f..25634be8d233178429cfd8cf0fe3ae739cf96f0c 100644
--- a/src/debug/debug-frames.cc
+++ b/src/debug/debug-frames.cc
@@ -15,6 +15,7 @@ FrameInspector::FrameInspector(JavaScriptFrame* frame,
has_adapted_arguments_ = frame_->has_adapted_arguments();
is_bottommost_ = inlined_jsframe_index == 0;
is_optimized_ = frame_->is_optimized();
+ is_interpreted_ = frame_->is_interpreted();
// Calculate the deoptimized frame.
if (frame->is_optimized()) {
// TODO(turbofan): Revisit once we support deoptimization.
@@ -69,6 +70,11 @@ Handle<Object> FrameInspector::GetExpression(int index) {
int FrameInspector::GetSourcePosition() {
if (is_optimized_) {
return deoptimized_frame_->GetSourcePosition();
+ } else if (is_interpreted_) {
+ InterpretedFrame* frame = reinterpret_cast<InterpretedFrame*>(frame_);
+ BytecodeArray* bytecode_array =
+ frame->function()->shared()->bytecode_array();
+ return bytecode_array->SourcePosition(frame->GetBytecodeOffset());
} else {
Code* code = frame_->LookupCode();
int offset = static_cast<int>(frame_->pc() - code->instruction_start());
@@ -95,6 +101,7 @@ void FrameInspector::SetArgumentsFrame(JavaScriptFrame* frame) {
DCHECK(has_adapted_arguments_);
frame_ = frame;
is_optimized_ = frame_->is_optimized();
+ is_interpreted_ = frame_->is_interpreted();
DCHECK(!is_optimized_);
}
« no previous file with comments | « src/debug/debug-frames.h ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698