| 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 } | 477 } |
| 478 } | 478 } |
| 479 | 479 |
| 480 | 480 |
| 481 void Heap::ScavengePointer(HeapObject** p) { | 481 void Heap::ScavengePointer(HeapObject** p) { |
| 482 ScavengeObject(p, *p); | 482 ScavengeObject(p, *p); |
| 483 } | 483 } |
| 484 | 484 |
| 485 | 485 |
| 486 void Heap::UpdateAllocationSiteFeedback(HeapObject* object) { | 486 void Heap::UpdateAllocationSiteFeedback(HeapObject* object) { |
| 487 Heap* heap = object->GetHeap(); |
| 487 if (FLAG_allocation_site_pretenuring && | 488 if (FLAG_allocation_site_pretenuring && |
| 489 heap->new_space_high_promotion_mode_active_ && |
| 488 AllocationSite::CanTrack(object->map()->instance_type())) { | 490 AllocationSite::CanTrack(object->map()->instance_type())) { |
| 489 AllocationMemento* memento = AllocationMemento::FindForHeapObject( | 491 AllocationMemento* memento = AllocationMemento::FindForHeapObject( |
| 490 object, true); | 492 object, heap, true); |
| 491 if (memento != NULL) { | 493 if (memento != NULL) { |
| 492 ASSERT(memento->IsValid()); | 494 ASSERT(memento->IsValid()); |
| 493 bool add_to_scratchpad = | 495 bool add_to_scratchpad = |
| 494 memento->GetAllocationSite()->IncrementMementoFoundCount(); | 496 memento->GetAllocationSite()->IncrementMementoFoundCount(); |
| 495 Heap* heap = object->GetIsolate()->heap(); | |
| 496 if (add_to_scratchpad && heap->allocation_sites_scratchpad_length < | 497 if (add_to_scratchpad && heap->allocation_sites_scratchpad_length < |
| 497 kAllocationSiteScratchpadSize) { | 498 kAllocationSiteScratchpadSize) { |
| 498 heap->allocation_sites_scratchpad[ | 499 heap->allocation_sites_scratchpad[ |
| 499 heap->allocation_sites_scratchpad_length++] = | 500 heap->allocation_sites_scratchpad_length++] = |
| 500 memento->GetAllocationSite(); | 501 memento->GetAllocationSite(); |
| 501 } | 502 } |
| 502 } | 503 } |
| 503 } | 504 } |
| 504 } | 505 } |
| 505 | 506 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 #ifdef DEBUG | 818 #ifdef DEBUG |
| 818 Isolate* isolate = Isolate::Current(); | 819 Isolate* isolate = Isolate::Current(); |
| 819 isolate->heap()->disallow_allocation_failure_ = old_state_; | 820 isolate->heap()->disallow_allocation_failure_ = old_state_; |
| 820 #endif | 821 #endif |
| 821 } | 822 } |
| 822 | 823 |
| 823 | 824 |
| 824 } } // namespace v8::internal | 825 } } // namespace v8::internal |
| 825 | 826 |
| 826 #endif // V8_HEAP_INL_H_ | 827 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |