diff options
author | Daniel Beckert <drbeckert@gmail.com> | 2018-09-17 16:26:31 -0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-09-20 08:09:24 +0200 |
commit | 566075967d2ebd91a0386dc2ac6840e178a8d135 (patch) | |
tree | 076e57896a57b13293a0215ea53c573a0c2aa902 /deps | |
parent | 8ffcb2d2cab59fa8174c52a8914266eee2915362 (diff) | |
download | node-new-566075967d2ebd91a0386dc2ac6840e178a8d135.tar.gz |
deps: cherry-pick 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 <verwaest@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54253}
Refs: https://github.com/v8/v8/commit/9a23bdd7ea2eba9a7a4439a7844e72fbf42bb3c4
Refs: https://github.com/nodejs/node/issues/21988
PR-URL: https://github.com/nodejs/node/pull/22910
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Diffstat (limited to 'deps')
-rw-r--r-- | deps/v8/src/isolate.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/deps/v8/src/isolate.cc b/deps/v8/src/isolate.cc index bb50ae493d..0bdfef5e81 100644 --- a/deps/v8/src/isolate.cc +++ b/deps/v8/src/isolate.cc @@ -1661,8 +1661,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->InstructionStart()); + Handle<AbstractCode> code; + int offset; + if (frame->is_interpreted()) { + InterpretedFrame* interpreted_frame = InterpretedFrame::cast(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->InstructionStart()); + } JSStackFrame site(this, receiver, function, code, offset); Handle<String> line = site.ToString().ToHandleChecked(); |