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

Unified Diff: src/frames.cc

Issue 7864025: Fix two bugs in the code compaction: (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 3 months 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 | « no previous file | src/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index cc559cf7c9ef486928d7b1d9495eb438b01289fb..69ec4d4b33f63f979a124d61bc34e3cd265e65b0 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -1162,6 +1162,14 @@ Code* PcToCodeCache::GcSafeCastToCode(HeapObject* object, Address pc) {
}
+static int GcSafeSizeOfCodeSpaceObject(HeapObject* object) {
+ MapWord map_word = object->map_word();
+ Map* map = map_word.IsForwardingAddress() ?
+ map_word.ToForwardingAddress()->map() : map_word.ToMap();
+ return object->SizeFromMap(map);
+}
+
+
Code* PcToCodeCache::GcSafeFindCodeForPc(Address pc) {
Heap* heap = isolate_->heap();
// Check if the pc points into a large object chunk.
@@ -1171,7 +1179,7 @@ Code* PcToCodeCache::GcSafeFindCodeForPc(Address pc) {
// Iterate through the page until we reach the end or find an object starting
// after the pc.
Page* page = Page::FromAddress(pc);
- HeapObjectIterator iterator(page, heap->GcSafeSizeOfOldObjectFunction());
+ HeapObjectIterator iterator(page, &GcSafeSizeOfCodeSpaceObject);
HeapObject* previous = NULL;
while (true) {
HeapObject* next = iterator.Next();
« no previous file with comments | « no previous file | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698