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

Unified Diff: src/isolate.cc

Issue 2109673003: Use source position table in turbofan code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: drive-by fix for relocation info size reservation Created 4 years, 6 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/ia32/deoptimizer-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 4bc865bfe14e2d57661d9020d6710100808751d7..fc98fac968eca890fd114668132c2674294a463b 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -621,7 +621,7 @@ class CaptureStackTraceHelper {
if (!column_key_.is_null()) {
Code* code = frame->LookupCode();
int offset = static_cast<int>(frame->pc() - code->instruction_start());
- int position = code->SourcePosition(offset);
+ int position = AbstractCode::cast(code)->SourcePosition(offset);
// Make position 1-based.
if (position >= 0) ++position;
JSObject::AddProperty(stack_frame, column_key_,
@@ -1317,20 +1317,19 @@ void Isolate::PrintCurrentStackTrace(FILE* out) {
HandleScope scope(this);
// Find code position if recorded in relocation info.
StandardFrame* frame = it.frame();
- int pos;
+ AbstractCode* abstract_code;
+ int code_offset;
if (frame->is_interpreted()) {
InterpretedFrame* iframe = reinterpret_cast<InterpretedFrame*>(frame);
- pos = iframe->GetBytecodeArray()->SourcePosition(
- iframe->GetBytecodeOffset());
- } else if (frame->is_java_script()) {
- Code* code = frame->LookupCode();
- int offset = static_cast<int>(frame->pc() - code->instruction_start());
- pos = frame->LookupCode()->SourcePosition(offset);
+ abstract_code = AbstractCode::cast(iframe->GetBytecodeArray());
+ code_offset = iframe->GetBytecodeOffset();
} else {
- DCHECK(frame->is_wasm());
- // TODO(clemensh): include wasm frames here
- continue;
+ DCHECK(frame->is_java_script() || frame->is_wasm());
+ Code* code = frame->LookupCode();
+ abstract_code = AbstractCode::cast(code);
+ code_offset = static_cast<int>(frame->pc() - code->instruction_start());
}
+ int pos = abstract_code->SourcePosition(code_offset);
JavaScriptFrame* js_frame = JavaScriptFrame::cast(frame);
Handle<Object> pos_obj(Smi::FromInt(pos), this);
// Fetch function and receiver.
« no previous file with comments | « src/ia32/deoptimizer-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698