Skip to content

Commit

Permalink
src: support stub frames
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Aug 15, 2017
1 parent f5c4f12 commit 16fca63
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/llv8-constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ void Frame::Load() {
kConstructFrame = LoadConstant("frametype_ConstructFrame");
kJSFrame = LoadConstant("frametype_JavaScriptFrame");
kOptimizedFrame = LoadConstant("frametype_OptimizedFrame");
kStubFrame = LoadConstant("frametype_StubFrame");
}


Expand Down
1 change: 1 addition & 0 deletions src/llv8-constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ class Frame : public Module {
int64_t kConstructFrame;
int64_t kJSFrame;
int64_t kOptimizedFrame;
int64_t kStubFrame;

protected:
void Load();
Expand Down
2 changes: 2 additions & 0 deletions src/llv8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ std::string JSFrame::Inspect(bool with_args, Error& err) {
return "<internal>";
} else if (value == v8()->frame()->kConstructFrame) {
return "<constructor>";
} else if (value == v8()->frame()->kStubFrame) {
return "<stub>";
} else if (value != v8()->frame()->kJSFrame &&
value != v8()->frame()->kOptimizedFrame) {
err = Error::Failure("Unknown frame marker");
Expand Down
2 changes: 1 addition & 1 deletion test/frame-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tape('v8 stack', (t) => {
// FIXME(bnoordhuis) This can fail with versions of lldb that don't
// support the GetMemoryRegions() API; llnode won't be able to identify
// V8 builtins stack frames, it just prints them as anonymous frames.
lines = lines.filter((s) => !/<builtin>/.test(s));
lines = lines.filter((s) => !/<builtin>|<stub>/.test(s));
const eyecatcher = lines[0];
const adapter = lines[1];
const crasher = lines[2];
Expand Down

0 comments on commit 16fca63

Please sign in to comment.