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 3487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3498 dominator_allocate->ClearNextMapWord(original_object_size); | 3498 dominator_allocate->ClearNextMapWord(original_object_size); |
3499 #endif | 3499 #endif |
3500 | 3500 |
3501 dominator_allocate->clear_next_map_word_ = clear_next_map_word_; | 3501 dominator_allocate->clear_next_map_word_ = clear_next_map_word_; |
3502 | 3502 |
3503 // After that replace the dominated allocate instruction. | 3503 // After that replace the dominated allocate instruction. |
3504 HInstruction* dominated_allocate_instr = | 3504 HInstruction* dominated_allocate_instr = |
3505 HInnerAllocatedObject::New(zone, | 3505 HInnerAllocatedObject::New(zone, |
3506 context(), | 3506 context(), |
3507 dominator_allocate, | 3507 dominator_allocate, |
3508 dominator_size_constant, | 3508 dominator_size, |
3509 type()); | 3509 type()); |
3510 dominated_allocate_instr->InsertBefore(this); | 3510 dominated_allocate_instr->InsertBefore(this); |
3511 DeleteAndReplaceWith(dominated_allocate_instr); | 3511 DeleteAndReplaceWith(dominated_allocate_instr); |
3512 if (FLAG_trace_allocation_folding) { | 3512 if (FLAG_trace_allocation_folding) { |
3513 PrintF("#%d (%s) folded into #%d (%s)\n", | 3513 PrintF("#%d (%s) folded into #%d (%s)\n", |
3514 id(), Mnemonic(), dominator_allocate->id(), | 3514 id(), Mnemonic(), dominator_allocate->id(), |
3515 dominator_allocate->Mnemonic()); | 3515 dominator_allocate->Mnemonic()); |
3516 } | 3516 } |
3517 } | 3517 } |
3518 | 3518 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3594 free_space_size, | 3594 free_space_size, |
3595 Representation::Smi(), | 3595 Representation::Smi(), |
3596 filler_free_space_size_); | 3596 filler_free_space_size_); |
3597 filler_free_space_size_->UpdateValue(new_free_space_size); | 3597 filler_free_space_size_->UpdateValue(new_free_space_size); |
3598 } | 3598 } |
3599 | 3599 |
3600 | 3600 |
3601 void HAllocate::CreateFreeSpaceFiller(int32_t free_space_size) { | 3601 void HAllocate::CreateFreeSpaceFiller(int32_t free_space_size) { |
3602 ASSERT(filler_free_space_size_ == NULL); | 3602 ASSERT(filler_free_space_size_ == NULL); |
3603 Zone* zone = block()->zone(); | 3603 Zone* zone = block()->zone(); |
3604 int32_t dominator_size = | |
3605 HConstant::cast(dominating_allocate_->size())->GetInteger32Constant(); | |
3606 HInstruction* free_space_instr = | 3604 HInstruction* free_space_instr = |
3607 HInnerAllocatedObject::New(zone, context(), dominating_allocate_, | 3605 HInnerAllocatedObject::New(zone, context(), dominating_allocate_, |
3608 dominator_size, type()); | 3606 dominating_allocate_->size(), type()); |
3609 free_space_instr->InsertBefore(this); | 3607 free_space_instr->InsertBefore(this); |
3610 HConstant* filler_map = HConstant::New( | 3608 HConstant* filler_map = HConstant::New( |
3611 zone, | 3609 zone, |
3612 context(), | 3610 context(), |
3613 isolate()->factory()->free_space_map()); | 3611 isolate()->factory()->free_space_map()); |
3614 filler_map->FinalizeUniqueness(); // TODO(titzer): should be init'd a'ready | 3612 filler_map->FinalizeUniqueness(); // TODO(titzer): should be init'd a'ready |
3615 filler_map->InsertAfter(free_space_instr); | 3613 filler_map->InsertAfter(free_space_instr); |
3616 HInstruction* store_map = HStoreNamedField::New(zone, context(), | 3614 HInstruction* store_map = HStoreNamedField::New(zone, context(), |
3617 free_space_instr, HObjectAccess::ForMap(), filler_map); | 3615 free_space_instr, HObjectAccess::ForMap(), filler_map); |
3618 store_map->SetFlag(HValue::kHasNoObservableSideEffects); | 3616 store_map->SetFlag(HValue::kHasNoObservableSideEffects); |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4413 break; | 4411 break; |
4414 case kExternalMemory: | 4412 case kExternalMemory: |
4415 stream->Add("[external-memory]"); | 4413 stream->Add("[external-memory]"); |
4416 break; | 4414 break; |
4417 } | 4415 } |
4418 | 4416 |
4419 stream->Add("@%d", offset()); | 4417 stream->Add("@%d", offset()); |
4420 } | 4418 } |
4421 | 4419 |
4422 } } // namespace v8::internal | 4420 } } // namespace v8::internal |
OLD | NEW |