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 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 for (Address current = from_bottom; current < from_top; current += size) { | 1203 for (Address current = from_bottom; current < from_top; current += size) { |
1204 HeapObject* object = HeapObject::FromAddress(current); | 1204 HeapObject* object = HeapObject::FromAddress(current); |
1205 | 1205 |
1206 if (object->IsMarked()) { | 1206 if (object->IsMarked()) { |
1207 object->ClearMark(); | 1207 object->ClearMark(); |
1208 MarkCompactCollector::tracer()->decrement_marked_count(); | 1208 MarkCompactCollector::tracer()->decrement_marked_count(); |
1209 | 1209 |
1210 size = object->Size(); | 1210 size = object->Size(); |
1211 survivors_size += size; | 1211 survivors_size += size; |
1212 | 1212 |
1213 if (Heap::ShouldBePromoted(current, size) && | 1213 // Aggressively promote young survivors to the old space. |
1214 TryPromoteObject(object, size)) { | 1214 if (TryPromoteObject(object, size)) { |
1215 continue; | 1215 continue; |
1216 } | 1216 } |
1217 | 1217 |
1218 // Promotion either failed or not required. | 1218 // Promotion either failed or not required. |
1219 // Copy the content of the object. | 1219 // Copy the content of the object. |
1220 Object* target = space->AllocateRaw(size); | 1220 Object* target = space->AllocateRaw(size); |
1221 | 1221 |
1222 // Allocation cannot fail at this point: semispaces are of equal size. | 1222 // Allocation cannot fail at this point: semispaces are of equal size. |
1223 ASSERT(!target->IsFailure()); | 1223 ASSERT(!target->IsFailure()); |
1224 | 1224 |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2210 #ifdef ENABLE_LOGGING_AND_PROFILING | 2210 #ifdef ENABLE_LOGGING_AND_PROFILING |
2211 if (obj->IsCode()) { | 2211 if (obj->IsCode()) { |
2212 PROFILE(CodeDeleteEvent(obj->address())); | 2212 PROFILE(CodeDeleteEvent(obj->address())); |
2213 } else if (obj->IsJSFunction()) { | 2213 } else if (obj->IsJSFunction()) { |
2214 PROFILE(FunctionDeleteEvent(obj->address())); | 2214 PROFILE(FunctionDeleteEvent(obj->address())); |
2215 } | 2215 } |
2216 #endif | 2216 #endif |
2217 } | 2217 } |
2218 | 2218 |
2219 } } // namespace v8::internal | 2219 } } // namespace v8::internal |
OLD | NEW |