Skip to content

Commit

Permalink
deps: backport 9a23bdd from upstream V8
Browse files Browse the repository at this point in the history
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@{nodejs#54253}

Refs: v8/v8@9a23bdd
Fixes: nodejs#21988
  • Loading branch information
Drieger committed Sep 10, 2018
1 parent 66343c5 commit 94402b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 2
#define V8_BUILD_NUMBER 414
#define V8_PATCH_LEVEL 66
#define V8_PATCH_LEVEL 67

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
14 changes: 11 additions & 3 deletions deps/v8/src/isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1532,9 +1532,17 @@ void Isolate::PrintCurrentStackTrace(FILE* out) {

Handle<Object> receiver(frame->receiver(), this);
Handle<JSFunction> function(frame->function(), this);
Handle<AbstractCode> code(AbstractCode::cast(frame->LookupCode()), this);
const int offset =
static_cast<int>(frame->pc() - code->instruction_start());
Handle<AbstractCode> code;
int offset;
if (frame->is_interpreted()) {
InterpretedFrame* interpreted_frame = reinterpret_cast<InterpretedFrame*>(frame);
code = handle(AbstractCode::cast(interpreted_frame->GetBytecodeArray()),
this);
offset = interpreted_frame->GetBytecodeOffset();
} else {
code = handle(AbstractCode::cast(frame->LookupCode()), this);
offset = static_cast<int>(frame->pc() - code->instruction_start());
}

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

0 comments on commit 94402b0

Please sign in to comment.