Commit 504ef4f2 authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Robustify the clearing of the cache of map-related ICs on the map.

Review URL: https://chromiumcodereview.appspot.com/9159009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10438 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 48a24b92
......@@ -49,6 +49,13 @@ void MarkCompactCollector::SetFlags(int flags) {
}
void MarkCompactCollector::ClearCacheOnMap(Map* map) {
if (FLAG_cleanup_code_caches_at_gc) {
map->ClearCodeCache(heap());
}
}
void MarkCompactCollector::MarkObject(HeapObject* obj, MarkBit mark_bit) {
ASSERT(Marking::MarkBitFrom(obj) == mark_bit);
if (!mark_bit.Get()) {
......@@ -64,6 +71,9 @@ void MarkCompactCollector::SetMark(HeapObject* obj, MarkBit mark_bit) {
ASSERT(Marking::MarkBitFrom(obj) == mark_bit);
mark_bit.Set();
MemoryChunk::IncrementLiveBytesFromGC(obj->address(), obj->Size());
if (obj->IsMap()) {
ClearCacheOnMap(Map::cast(obj));
}
}
......
......@@ -1623,9 +1623,7 @@ void MarkCompactCollector::ProcessNewlyMarkedObject(HeapObject* object) {
ASSERT(HEAP->Contains(object));
if (object->IsMap()) {
Map* map = Map::cast(object);
if (FLAG_cleanup_code_caches_at_gc) {
map->ClearCodeCache(heap());
}
ClearCacheOnMap(map);
// When map collection is enabled we have to mark through map's transitions
// in a special way to make transition links weak.
......
......@@ -624,10 +624,16 @@ class MarkCompactCollector {
void AfterMarking();
// Marks the object black and pushes it on the marking stack.
// This is for non-incremental marking.
INLINE(void MarkObject(HeapObject* obj, MarkBit mark_bit));
// Marks the object black. This is for non-incremental marking.
INLINE(void SetMark(HeapObject* obj, MarkBit mark_bit));
// Clears the cache of ICs related to this map.
INLINE(void ClearCacheOnMap(Map* map));
void ProcessNewlyMarkedObject(HeapObject* obj);
// Creates back pointers for all map transitions, stores them in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment