Skip to content

Commit 9e2077a

Browse files
DriegerBethGriggs
authored andcommitted
deps: backport 9a23bdd from upstream V8
Original commit message: [Isolate] Fix Isolate::PrintCurrentStackTrace for interpreted frames Previously we were getting the code object from the stack, so printed incorrect position details for interpreted frames. BUG=v8:7916 Change-Id: I2f87584117d88b7db3f3b9bdbfe793c4d3e33fe9 Reviewed-on: https://chromium-review.googlesource.com/1126313 Reviewed-by: Toon Verwaest <[email protected]> Commit-Queue: Ross McIlroy <[email protected]> Cr-Commit-Position: refs/heads/master@{#54253} Refs: v8/v8@9a23bdd Fixes: #21988 PR-URL: #22418 Refs: #22338 Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent d58867a commit 9e2077a

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 6
1212
#define V8_MINOR_VERSION 2
1313
#define V8_BUILD_NUMBER 414
14-
#define V8_PATCH_LEVEL 66
14+
#define V8_PATCH_LEVEL 67
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/isolate.cc

+11-3
Original file line numberDiff line numberDiff line change
@@ -1532,9 +1532,17 @@ void Isolate::PrintCurrentStackTrace(FILE* out) {
15321532

15331533
Handle<Object> receiver(frame->receiver(), this);
15341534
Handle<JSFunction> function(frame->function(), this);
1535-
Handle<AbstractCode> code(AbstractCode::cast(frame->LookupCode()), this);
1536-
const int offset =
1537-
static_cast<int>(frame->pc() - code->instruction_start());
1535+
Handle<AbstractCode> code;
1536+
int offset;
1537+
if (frame->is_interpreted()) {
1538+
InterpretedFrame* interpreted_frame = reinterpret_cast<InterpretedFrame*>(frame);
1539+
code = handle(AbstractCode::cast(interpreted_frame->GetBytecodeArray()),
1540+
this);
1541+
offset = interpreted_frame->GetBytecodeOffset();
1542+
} else {
1543+
code = handle(AbstractCode::cast(frame->LookupCode()), this);
1544+
offset = static_cast<int>(frame->pc() - code->instruction_start());
1545+
}
15381546

15391547
JSStackFrame site(this, receiver, function, code, offset);
15401548
Handle<String> line = site.ToString().ToHandleChecked();

0 commit comments

Comments
 (0)