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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 ASSERT(code->ic_flag() == Code::IC_TARGET_IS_ADDRESS); | 270 ASSERT(code->ic_flag() == Code::IC_TARGET_IS_ADDRESS); |
271 } | 271 } |
272 | 272 |
273 void EndCodeIteration(Code* code) { | 273 void EndCodeIteration(Code* code) { |
274 // If this is a compacting collection, set ic targets | 274 // If this is a compacting collection, set ic targets |
275 // are pointing to object headers. | 275 // are pointing to object headers. |
276 if (IsCompacting()) code->set_ic_flag(Code::IC_TARGET_IS_OBJECT); | 276 if (IsCompacting()) code->set_ic_flag(Code::IC_TARGET_IS_OBJECT); |
277 } | 277 } |
278 | 278 |
279 void VisitCodeTarget(RelocInfo* rinfo) { | 279 void VisitCodeTarget(RelocInfo* rinfo) { |
280 ASSERT(is_code_target(rinfo->rmode())); | 280 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
281 Code* code = CodeFromDerivedPointer(rinfo->target_address()); | 281 Code* code = CodeFromDerivedPointer(rinfo->target_address()); |
282 if (FLAG_cleanup_ics_at_gc && code->is_inline_cache_stub()) { | 282 if (FLAG_cleanup_ics_at_gc && code->is_inline_cache_stub()) { |
283 IC::Clear(rinfo->pc()); | 283 IC::Clear(rinfo->pc()); |
284 // Please note targets for cleared inline cached do not have to be | 284 // Please note targets for cleared inline cached do not have to be |
285 // marked since they are contained in Heap::non_monomorphic_cache(). | 285 // marked since they are contained in Heap::non_monomorphic_cache(). |
286 } else { | 286 } else { |
287 MarkCompactCollector::MarkObject(code); | 287 MarkCompactCollector::MarkObject(code); |
288 } | 288 } |
289 if (IsCompacting()) { | 289 if (IsCompacting()) { |
290 // When compacting we convert the target to a real object pointer. | 290 // When compacting we convert the target to a real object pointer. |
291 code = CodeFromDerivedPointer(rinfo->target_address()); | 291 code = CodeFromDerivedPointer(rinfo->target_address()); |
292 rinfo->set_target_object(code); | 292 rinfo->set_target_object(code); |
293 } | 293 } |
294 } | 294 } |
295 | 295 |
296 void VisitDebugTarget(RelocInfo* rinfo) { | 296 void VisitDebugTarget(RelocInfo* rinfo) { |
297 ASSERT(is_js_return(rinfo->rmode()) && rinfo->is_call_instruction()); | 297 ASSERT(RelocInfo::IsJSReturn(rinfo->rmode()) && |
| 298 rinfo->is_call_instruction()); |
298 HeapObject* code = CodeFromDerivedPointer(rinfo->call_address()); | 299 HeapObject* code = CodeFromDerivedPointer(rinfo->call_address()); |
299 MarkCompactCollector::MarkObject(code); | 300 MarkCompactCollector::MarkObject(code); |
300 // When compacting we convert the call to a real object pointer. | 301 // When compacting we convert the call to a real object pointer. |
301 if (IsCompacting()) rinfo->set_call_object(code); | 302 if (IsCompacting()) rinfo->set_call_object(code); |
302 } | 303 } |
303 | 304 |
304 private: | 305 private: |
305 // Mark object pointed to by p. | 306 // Mark object pointed to by p. |
306 void MarkObjectByPointer(Object** p) { | 307 void MarkObjectByPointer(Object** p) { |
307 if (!(*p)->IsHeapObject()) return; | 308 if (!(*p)->IsHeapObject()) return; |
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1766 | 1767 |
1767 void MarkCompactCollector::RebuildRSets() { | 1768 void MarkCompactCollector::RebuildRSets() { |
1768 #ifdef DEBUG | 1769 #ifdef DEBUG |
1769 ASSERT(state_ == RELOCATE_OBJECTS); | 1770 ASSERT(state_ == RELOCATE_OBJECTS); |
1770 state_ = REBUILD_RSETS; | 1771 state_ = REBUILD_RSETS; |
1771 #endif | 1772 #endif |
1772 Heap::RebuildRSets(); | 1773 Heap::RebuildRSets(); |
1773 } | 1774 } |
1774 | 1775 |
1775 } } // namespace v8::internal | 1776 } } // namespace v8::internal |
OLD | NEW |