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 3786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3797 Representation::None(), | 3797 Representation::None(), |
| 3798 dominator_allocate); | 3798 dominator_allocate); |
| 3799 dominator_allocate->UpdateSize(new_dominator_size_constant); | 3799 dominator_allocate->UpdateSize(new_dominator_size_constant); |
| 3800 | 3800 |
| 3801 #ifdef VERIFY_HEAP | 3801 #ifdef VERIFY_HEAP |
| 3802 if (FLAG_verify_heap && dominator_allocate->IsNewSpaceAllocation()) { | 3802 if (FLAG_verify_heap && dominator_allocate->IsNewSpaceAllocation()) { |
| 3803 dominator_allocate->MakePrefillWithFiller(); | 3803 dominator_allocate->MakePrefillWithFiller(); |
| 3804 } else { | 3804 } else { |
| 3805 // TODO(hpayer): This is a short-term hack to make allocation mementos | 3805 // TODO(hpayer): This is a short-term hack to make allocation mementos |
| 3806 // work again in new space. | 3806 // work again in new space. |
| 3807 dominator_allocate->ClearNextMapWord(original_object_size); | 3807 dominator_allocate->ClearNextMapWord(this, original_object_size); |
| 3808 } | 3808 } |
| 3809 #else | 3809 #else |
| 3810 // TODO(hpayer): This is a short-term hack to make allocation mementos | 3810 // TODO(hpayer): This is a short-term hack to make allocation mementos |
| 3811 // work again in new space. | 3811 // work again in new space. |
| 3812 dominator_allocate->ClearNextMapWord(original_object_size); | 3812 dominator_allocate->ClearNextMapWord(this, original_object_size); |
| 3813 #endif | 3813 #endif |
| 3814 | 3814 |
| 3815 dominator_allocate->UpdateClearNextMapWord(MustClearNextMapWord()); | 3815 dominator_allocate->UpdateClearNextMapWord(MustClearNextMapWord()); |
| 3816 | 3816 |
| 3817 // After that replace the dominated allocate instruction. | 3817 // After that replace the dominated allocate instruction. |
| 3818 HInstruction* inner_offset = HConstant::CreateAndInsertBefore( | 3818 HInstruction* inner_offset = HConstant::CreateAndInsertBefore( |
| 3819 zone, | 3819 zone, |
| 3820 context(), | 3820 context(), |
| 3821 dominator_size_constant, | 3821 dominator_size_constant, |
| 3822 Representation::None(), | 3822 Representation::None(), |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3949 FreeSpace::kSizeOffset, | 3949 FreeSpace::kSizeOffset, |
| 3950 Representation::Smi()); | 3950 Representation::Smi()); |
| 3951 HStoreNamedField* store_size = HStoreNamedField::New(zone, context(), | 3951 HStoreNamedField* store_size = HStoreNamedField::New(zone, context(), |
| 3952 free_space_instr, access, filler_size); | 3952 free_space_instr, access, filler_size); |
| 3953 store_size->SetFlag(HValue::kHasNoObservableSideEffects); | 3953 store_size->SetFlag(HValue::kHasNoObservableSideEffects); |
| 3954 store_size->InsertAfter(filler_size); | 3954 store_size->InsertAfter(filler_size); |
| 3955 filler_free_space_size_ = store_size; | 3955 filler_free_space_size_ = store_size; |
| 3956 } | 3956 } |
| 3957 | 3957 |
| 3958 | 3958 |
| 3959 void HAllocate::ClearNextMapWord(int offset) { | 3959 void HAllocate::ClearNextMapWord(HAllocate* dominated, int offset) { |
| 3960 if (MustClearNextMapWord()) { | 3960 // If dominator and dominated allocate operations belong to the same basic |
| 3961 // block we can guarantee that there is no fragmentation. Hence, we do not | |
| 3962 // have to clear the map word of the dominated allocation operation. | |
| 3963 if (MustClearNextMapWord() && | |
| 3964 block()->block_id() != dominated->block()->block_id()) { | |
|
titzer
2014/04/17 12:41:46
I don't think this is true, because if you have a
| |
| 3961 Zone* zone = block()->zone(); | 3965 Zone* zone = block()->zone(); |
| 3962 HObjectAccess access = | 3966 HObjectAccess access = |
| 3963 HObjectAccess::ForObservableJSObjectOffset(offset); | 3967 HObjectAccess::ForObservableJSObjectOffset(offset); |
| 3964 HStoreNamedField* clear_next_map = | 3968 HStoreNamedField* clear_next_map = |
| 3965 HStoreNamedField::New(zone, context(), this, access, | 3969 HStoreNamedField::New(zone, context(), this, access, |
| 3966 block()->graph()->GetConstant0()); | 3970 block()->graph()->GetConstant0()); |
| 3967 clear_next_map->ClearAllSideEffects(); | 3971 clear_next_map->ClearAllSideEffects(); |
| 3968 clear_next_map->InsertAfter(this); | 3972 clear_next_map->InsertAfter(this); |
| 3969 } | 3973 } |
| 3970 } | 3974 } |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4722 break; | 4726 break; |
| 4723 case kExternalMemory: | 4727 case kExternalMemory: |
| 4724 stream->Add("[external-memory]"); | 4728 stream->Add("[external-memory]"); |
| 4725 break; | 4729 break; |
| 4726 } | 4730 } |
| 4727 | 4731 |
| 4728 stream->Add("@%d", offset()); | 4732 stream->Add("@%d", offset()); |
| 4729 } | 4733 } |
| 4730 | 4734 |
| 4731 } } // namespace v8::internal | 4735 } } // namespace v8::internal |
| OLD | NEW |