| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 int pointers_removed_; | 396 int pointers_removed_; |
| 397 }; | 397 }; |
| 398 | 398 |
| 399 | 399 |
| 400 void MarkCompactCollector::MarkUnmarkedObject(HeapObject* object) { | 400 void MarkCompactCollector::MarkUnmarkedObject(HeapObject* object) { |
| 401 ASSERT(!object->IsMarked()); | 401 ASSERT(!object->IsMarked()); |
| 402 ASSERT(HEAP->Contains(object)); | 402 ASSERT(HEAP->Contains(object)); |
| 403 if (object->IsMap()) { | 403 if (object->IsMap()) { |
| 404 Map* map = Map::cast(object); | 404 Map* map = Map::cast(object); |
| 405 if (FLAG_cleanup_caches_in_maps_at_gc) { | 405 if (FLAG_cleanup_caches_in_maps_at_gc) { |
| 406 map->ClearCodeCache(); | 406 map->ClearCodeCache(heap_); |
| 407 } | 407 } |
| 408 SetMark(map); | 408 SetMark(map); |
| 409 if (FLAG_collect_maps && | 409 if (FLAG_collect_maps && |
| 410 map->instance_type() >= FIRST_JS_OBJECT_TYPE && | 410 map->instance_type() >= FIRST_JS_OBJECT_TYPE && |
| 411 map->instance_type() <= JS_FUNCTION_TYPE) { | 411 map->instance_type() <= JS_FUNCTION_TYPE) { |
| 412 MarkMapContents(map); | 412 MarkMapContents(map); |
| 413 } else { | 413 } else { |
| 414 marking_stack_.Push(map); | 414 marking_stack_.Push(map); |
| 415 } | 415 } |
| 416 } else { | 416 } else { |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 Object* next; | 822 Object* next; |
| 823 while (SafeIsMap(current)) { | 823 while (SafeIsMap(current)) { |
| 824 next = current->prototype(); | 824 next = current->prototype(); |
| 825 // There should never be a dead map above a live map. | 825 // There should never be a dead map above a live map. |
| 826 ASSERT(on_dead_path || current->IsMarked()); | 826 ASSERT(on_dead_path || current->IsMarked()); |
| 827 | 827 |
| 828 // A live map above a dead map indicates a dead transition. | 828 // A live map above a dead map indicates a dead transition. |
| 829 // This test will always be false on the first iteration. | 829 // This test will always be false on the first iteration. |
| 830 if (on_dead_path && current->IsMarked()) { | 830 if (on_dead_path && current->IsMarked()) { |
| 831 on_dead_path = false; | 831 on_dead_path = false; |
| 832 current->ClearNonLiveTransitions(real_prototype); | 832 current->ClearNonLiveTransitions(heap_, real_prototype); |
| 833 } | 833 } |
| 834 *HeapObject::RawField(current, Map::kPrototypeOffset) = | 834 *HeapObject::RawField(current, Map::kPrototypeOffset) = |
| 835 real_prototype; | 835 real_prototype; |
| 836 current = reinterpret_cast<Map*>(next); | 836 current = reinterpret_cast<Map*>(next); |
| 837 } | 837 } |
| 838 } | 838 } |
| 839 } | 839 } |
| 840 | 840 |
| 841 // ------------------------------------------------------------------------- | 841 // ------------------------------------------------------------------------- |
| 842 // Phase 2: Encode forwarding addresses. | 842 // Phase 2: Encode forwarding addresses. |
| (...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2348 #ifdef ENABLE_LOGGING_AND_PROFILING | 2348 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 2349 if (obj->IsCode()) { | 2349 if (obj->IsCode()) { |
| 2350 PROFILE(CodeDeleteEvent(obj->address())); | 2350 PROFILE(CodeDeleteEvent(obj->address())); |
| 2351 } else if (obj->IsJSFunction()) { | 2351 } else if (obj->IsJSFunction()) { |
| 2352 PROFILE(FunctionDeleteEvent(obj->address())); | 2352 PROFILE(FunctionDeleteEvent(obj->address())); |
| 2353 } | 2353 } |
| 2354 #endif | 2354 #endif |
| 2355 } | 2355 } |
| 2356 | 2356 |
| 2357 } } // namespace v8::internal | 2357 } } // namespace v8::internal |
| OLD | NEW |