Skip to content

Commit e0673fe

Browse files
alexmarkovCommit Queue
authored andcommitted
[vm,dyn_modules] Fix printing of interpreter entry and exit frames
TEST=ci Change-Id: I49139dd3f03df74e3a6a94f7a4366b9d4dfdc0fb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428580 Reviewed-by: Slava Egorov <[email protected]> Commit-Queue: Alexander Markov <[email protected]>
1 parent 081211f commit e0673fe

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

runtime/vm/stack_frame.cc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,16 @@ const char* StackFrame::ToCString() const {
175175
Zone* zone = Thread::Current()->zone();
176176
#if defined(DART_DYNAMIC_MODULES)
177177
if (is_interpreted()) {
178-
const Bytecode& bytecode = Bytecode::Handle(zone, LookupDartBytecode());
179-
const char* name = bytecode.IsNull() ? "Cannot find bytecode object"
180-
: bytecode.FullyQualifiedName();
178+
const char* name;
179+
if (IsEntryFrame()) {
180+
name = "[Interpreter] Entry frame";
181+
} else if (IsExitFrame()) {
182+
name = "[Interpreter] Exit frame";
183+
} else {
184+
const Bytecode& bytecode = Bytecode::Handle(zone, LookupDartBytecode());
185+
name = bytecode.IsNull() ? "Cannot find bytecode object"
186+
: bytecode.FullyQualifiedName();
187+
}
181188
return zone->PrintToString(" pc 0x%" Pp " fp 0x%" Pp " sp 0x%" Pp " %s",
182189
pc(), fp(), sp(), name);
183190
}
@@ -433,6 +440,7 @@ BytecodePtr StackFrame::LookupDartBytecode() const {
433440

434441
BytecodePtr StackFrame::GetBytecodeObject() const {
435442
ASSERT(is_interpreted());
443+
ASSERT(!IsEntryFrame() && !IsExitFrame());
436444
ObjectPtr pc_marker = *(
437445
reinterpret_cast<ObjectPtr*>(fp() + kKBCPcMarkerSlotFromFp * kWordSize));
438446
ASSERT((pc_marker == Object::null()) ||

0 commit comments

Comments
 (0)