Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Unified Diff: runtime/vm/stack_frame.cc

Issue 63093003: Fix for issue 14790 - Crash when using dartium devtools (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object_x64_test.cc ('k') | runtime/vm/stack_frame_arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stack_frame.cc
===================================================================
--- runtime/vm/stack_frame.cc (revision 30084)
+++ runtime/vm/stack_frame.cc (working copy)
@@ -61,21 +61,24 @@
// helper functions to the raw object interface.
ASSERT(visitor != NULL);
NoGCScope no_gc;
- RawObject** first = reinterpret_cast<RawObject**>(sp());
- RawObject** last = reinterpret_cast<RawObject**>(
- fp() + (kFirstLocalSlotFromFp * kWordSize));
Code code;
code = LookupDartCode();
if (!code.IsNull()) {
// Visit the code object.
RawObject* raw_code = code.raw();
visitor->VisitPointer(&raw_code);
- // Visit stack based on stack maps.
+
+ // Optimized frames have a stack map. We need to visit the frame based
+ // on the stack map.
Array maps;
maps = Array::null();
Stackmap map;
map = code.GetStackmap(pc(), &maps, &map);
if (!map.IsNull()) {
+ RawObject** first = reinterpret_cast<RawObject**>(sp());
+ RawObject** last = reinterpret_cast<RawObject**>(
+ fp() + (kFirstLocalSlotFromFp * kWordSize));
+
// A stack map is present in the code object, use the stack map to
// visit frame slots which are marked as having objects.
//
@@ -108,9 +111,22 @@
// The last slot can be one slot (but not more) past the last slot
// in the case that all slots were covered by the stack map.
ASSERT((last + 1) >= first);
+ visitor->VisitPointers(first, last);
+
+ // Now visit other slots which might be part of the calling convention.
+ first = reinterpret_cast<RawObject**>(
+ fp() + ((kFirstLocalSlotFromFp + 1) * kWordSize));
+ last = reinterpret_cast<RawObject**>(
+ fp() + (kFirstObjectSlotFromFp * kWordSize));
+ visitor->VisitPointers(first, last);
+ return;
}
}
- // Each slot between the first and last included are tagged objects.
+ // For normal unoptimized Dart frames and Stub frames each slot
+ // between the first and last included are tagged objects.
+ RawObject** first = reinterpret_cast<RawObject**>(sp());
+ RawObject** last = reinterpret_cast<RawObject**>(
+ fp() + (kFirstObjectSlotFromFp * kWordSize));
visitor->VisitPointers(first, last);
}
« no previous file with comments | « runtime/vm/object_x64_test.cc ('k') | runtime/vm/stack_frame_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698