Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget( | 305 void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget( |
| 306 Heap* heap, RelocInfo* rinfo) { | 306 Heap* heap, RelocInfo* rinfo) { |
| 307 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 307 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
| 308 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 308 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
| 309 // Monomorphic ICs are preserved when possible, but need to be flushed | 309 // Monomorphic ICs are preserved when possible, but need to be flushed |
| 310 // when they might be keeping a Context alive, or when the heap is about | 310 // when they might be keeping a Context alive, or when the heap is about |
| 311 // to be serialized. | 311 // to be serialized. |
| 312 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() | 312 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() |
| 313 && (target->ic_state() == MEGAMORPHIC || target->ic_state() == GENERIC || | 313 && (target->ic_state() == MEGAMORPHIC || target->ic_state() == GENERIC || |
| 314 target->ic_state() == POLYMORPHIC || heap->flush_monomorphic_ics() || | 314 target->ic_state() == POLYMORPHIC || heap->flush_monomorphic_ics() || |
| 315 Serializer::enabled() || target->ic_age() != heap->global_ic_age() || | 315 Serializer::enabled(target->GetIsolate()) || |
|
Michael Starzinger
2014/04/30 09:23:53
Better use "heap->isolate()" here.
Sven Panne
2014/04/30 09:37:19
Done.
| |
| 316 target->ic_age() != heap->global_ic_age() || | |
| 316 target->is_invalidated_weak_stub())) { | 317 target->is_invalidated_weak_stub())) { |
| 317 IC::Clear(target->GetIsolate(), rinfo->pc(), | 318 IC::Clear(target->GetIsolate(), rinfo->pc(), |
|
Michael Starzinger
2014/04/30 09:23:53
I know you didn't change this line, but likewise h
Sven Panne
2014/04/30 09:37:19
Done.
| |
| 318 rinfo->host()->constant_pool()); | 319 rinfo->host()->constant_pool()); |
| 319 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 320 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
| 320 } | 321 } |
| 321 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); | 322 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
| 322 StaticVisitor::MarkObject(heap, target); | 323 StaticVisitor::MarkObject(heap, target); |
| 323 } | 324 } |
| 324 | 325 |
| 325 | 326 |
| 326 template<typename StaticVisitor> | 327 template<typename StaticVisitor> |
| 327 void StaticMarkingVisitor<StaticVisitor>::VisitCodeAgeSequence( | 328 void StaticMarkingVisitor<StaticVisitor>::VisitCodeAgeSequence( |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 424 | 425 |
| 425 | 426 |
| 426 template<typename StaticVisitor> | 427 template<typename StaticVisitor> |
| 427 void StaticMarkingVisitor<StaticVisitor>::VisitCode( | 428 void StaticMarkingVisitor<StaticVisitor>::VisitCode( |
| 428 Map* map, HeapObject* object) { | 429 Map* map, HeapObject* object) { |
| 429 Heap* heap = map->GetHeap(); | 430 Heap* heap = map->GetHeap(); |
| 430 Code* code = Code::cast(object); | 431 Code* code = Code::cast(object); |
| 431 if (FLAG_cleanup_code_caches_at_gc) { | 432 if (FLAG_cleanup_code_caches_at_gc) { |
| 432 code->ClearTypeFeedbackInfo(heap); | 433 code->ClearTypeFeedbackInfo(heap); |
| 433 } | 434 } |
| 434 if (FLAG_age_code && !Serializer::enabled()) { | 435 if (FLAG_age_code && !Serializer::enabled(heap->isolate())) { |
| 435 code->MakeOlder(heap->mark_compact_collector()->marking_parity()); | 436 code->MakeOlder(heap->mark_compact_collector()->marking_parity()); |
| 436 } | 437 } |
| 437 code->CodeIterateBody<StaticVisitor>(heap); | 438 code->CodeIterateBody<StaticVisitor>(heap); |
| 438 } | 439 } |
| 439 | 440 |
| 440 | 441 |
| 441 template<typename StaticVisitor> | 442 template<typename StaticVisitor> |
| 442 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( | 443 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( |
| 443 Map* map, HeapObject* object) { | 444 Map* map, HeapObject* object) { |
| 444 Heap* heap = map->GetHeap(); | 445 Heap* heap = map->GetHeap(); |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 954 RelocIterator it(this, mode_mask); | 955 RelocIterator it(this, mode_mask); |
| 955 for (; !it.done(); it.next()) { | 956 for (; !it.done(); it.next()) { |
| 956 it.rinfo()->template Visit<StaticVisitor>(heap); | 957 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 957 } | 958 } |
| 958 } | 959 } |
| 959 | 960 |
| 960 | 961 |
| 961 } } // namespace v8::internal | 962 } } // namespace v8::internal |
| 962 | 963 |
| 963 #endif // V8_OBJECTS_VISITING_INL_H_ | 964 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |