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 3278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3289 if (new_dominator_size > Page::kMaxNonCodeHeapObjectSize) { | 3289 if (new_dominator_size > Page::kMaxNonCodeHeapObjectSize) { |
3290 if (FLAG_trace_allocation_folding) { | 3290 if (FLAG_trace_allocation_folding) { |
3291 PrintF("#%d (%s) cannot fold into #%d (%s) due to size: %d\n", | 3291 PrintF("#%d (%s) cannot fold into #%d (%s) due to size: %d\n", |
3292 id(), Mnemonic(), dominator_allocate->id(), | 3292 id(), Mnemonic(), dominator_allocate->id(), |
3293 dominator_allocate->Mnemonic(), new_dominator_size); | 3293 dominator_allocate->Mnemonic(), new_dominator_size); |
3294 } | 3294 } |
3295 return; | 3295 return; |
3296 } | 3296 } |
3297 | 3297 |
3298 HInstruction* new_dominator_size_constant = HConstant::CreateAndInsertBefore( | 3298 HInstruction* new_dominator_size_constant = HConstant::CreateAndInsertBefore( |
3299 zone, context(), new_dominator_size, dominator_allocate); | 3299 zone, |
3300 context(), | |
3301 new_dominator_size, | |
3302 Representation::None(), | |
3303 dominator_allocate); | |
3300 dominator_allocate->UpdateSize(new_dominator_size_constant); | 3304 dominator_allocate->UpdateSize(new_dominator_size_constant); |
3301 | 3305 |
3302 #ifdef VERIFY_HEAP | 3306 #ifdef VERIFY_HEAP |
3303 if (FLAG_verify_heap && dominator_allocate->IsNewSpaceAllocation()) { | 3307 if (FLAG_verify_heap && dominator_allocate->IsNewSpaceAllocation()) { |
3304 dominator_allocate->MakePrefillWithFiller(); | 3308 dominator_allocate->MakePrefillWithFiller(); |
3305 } | 3309 } |
3306 #endif | 3310 #endif |
3307 | 3311 |
3308 // After that replace the dominated allocate instruction. | 3312 // After that replace the dominated allocate instruction. |
3309 HInstruction* dominated_allocate_instr = | 3313 HInstruction* dominated_allocate_instr = |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3387 | 3391 |
3388 | 3392 |
3389 void HAllocate::UpdateFreeSpaceFiller(int32_t free_space_size) { | 3393 void HAllocate::UpdateFreeSpaceFiller(int32_t free_space_size) { |
3390 ASSERT(filler_free_space_size_ != NULL); | 3394 ASSERT(filler_free_space_size_ != NULL); |
3391 Zone* zone = block()->zone(); | 3395 Zone* zone = block()->zone(); |
3392 HConstant* new_free_space_size = HConstant::CreateAndInsertBefore( | 3396 HConstant* new_free_space_size = HConstant::CreateAndInsertBefore( |
3393 zone, | 3397 zone, |
3394 context(), | 3398 context(), |
3395 filler_free_space_size_->value()->GetInteger32Constant() + | 3399 filler_free_space_size_->value()->GetInteger32Constant() + |
3396 free_space_size, | 3400 free_space_size, |
3401 Representation::Smi(), | |
Jakob Kummerow
2013/08/27 11:43:34
I'd like a comment here, please. Roughly:
We must
| |
3397 filler_free_space_size_); | 3402 filler_free_space_size_); |
3398 filler_free_space_size_->UpdateValue(new_free_space_size); | 3403 filler_free_space_size_->UpdateValue(new_free_space_size); |
3399 } | 3404 } |
3400 | 3405 |
3401 | 3406 |
3402 void HAllocate::CreateFreeSpaceFiller(int32_t free_space_size) { | 3407 void HAllocate::CreateFreeSpaceFiller(int32_t free_space_size) { |
3403 ASSERT(filler_free_space_size_ == NULL); | 3408 ASSERT(filler_free_space_size_ == NULL); |
3404 Zone* zone = block()->zone(); | 3409 Zone* zone = block()->zone(); |
3405 int32_t dominator_size = | 3410 int32_t dominator_size = |
3406 HConstant::cast(dominating_allocate_->size())->GetInteger32Constant(); | 3411 HConstant::cast(dominating_allocate_->size())->GetInteger32Constant(); |
3407 HInstruction* free_space_instr = | 3412 HInstruction* free_space_instr = |
3408 HInnerAllocatedObject::New(zone, context(), dominating_allocate_, | 3413 HInnerAllocatedObject::New(zone, context(), dominating_allocate_, |
3409 dominator_size, type()); | 3414 dominator_size, type()); |
3410 free_space_instr->InsertBefore(this); | 3415 free_space_instr->InsertBefore(this); |
3411 HConstant* filler_map = HConstant::New( | 3416 HConstant* filler_map = HConstant::New( |
3412 zone, | 3417 zone, |
3413 context(), | 3418 context(), |
3414 isolate()->factory()->free_space_map(), | 3419 isolate()->factory()->free_space_map(), |
3415 UniqueValueId(isolate()->heap()->free_space_map())); | 3420 UniqueValueId(isolate()->heap()->free_space_map())); |
3416 filler_map->InsertAfter(free_space_instr); | 3421 filler_map->InsertAfter(free_space_instr); |
3417 HInstruction* store_map = HStoreNamedField::New(zone, context(), | 3422 HInstruction* store_map = HStoreNamedField::New(zone, context(), |
3418 free_space_instr, HObjectAccess::ForMap(), filler_map); | 3423 free_space_instr, HObjectAccess::ForMap(), filler_map); |
3419 store_map->SetFlag(HValue::kHasNoObservableSideEffects); | 3424 store_map->SetFlag(HValue::kHasNoObservableSideEffects); |
3420 store_map->InsertAfter(filler_map); | 3425 store_map->InsertAfter(filler_map); |
3421 | 3426 |
3422 HConstant* filler_size = HConstant::CreateAndInsertAfter( | 3427 HConstant* filler_size = HConstant::CreateAndInsertAfter( |
3423 zone, context(), free_space_size, store_map); | 3428 zone, context(), free_space_size, Representation::Smi(), store_map); |
Jakob Kummerow
2013/08/27 11:43:34
Consider repeating the comment here, or an abbrevi
| |
3424 HObjectAccess access = | 3429 HObjectAccess access = |
3425 HObjectAccess::ForJSObjectOffset(FreeSpace::kSizeOffset); | 3430 HObjectAccess::ForJSObjectOffset(FreeSpace::kSizeOffset, |
3431 Representation::Smi()); | |
3426 HStoreNamedField* store_size = HStoreNamedField::New(zone, context(), | 3432 HStoreNamedField* store_size = HStoreNamedField::New(zone, context(), |
3427 free_space_instr, access, filler_size); | 3433 free_space_instr, access, filler_size); |
3428 store_size->SetFlag(HValue::kHasNoObservableSideEffects); | 3434 store_size->SetFlag(HValue::kHasNoObservableSideEffects); |
3429 store_size->InsertAfter(filler_size); | 3435 store_size->InsertAfter(filler_size); |
3430 filler_free_space_size_ = store_size; | 3436 filler_free_space_size_ = store_size; |
3431 } | 3437 } |
3432 | 3438 |
3433 | 3439 |
3434 void HAllocate::PrintDataTo(StringStream* stream) { | 3440 void HAllocate::PrintDataTo(StringStream* stream) { |
3435 size()->PrintNameTo(stream); | 3441 size()->PrintNameTo(stream); |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4165 break; | 4171 break; |
4166 case kExternalMemory: | 4172 case kExternalMemory: |
4167 stream->Add("[external-memory]"); | 4173 stream->Add("[external-memory]"); |
4168 break; | 4174 break; |
4169 } | 4175 } |
4170 | 4176 |
4171 stream->Add("@%d", offset()); | 4177 stream->Add("@%d", offset()); |
4172 } | 4178 } |
4173 | 4179 |
4174 } } // namespace v8::internal | 4180 } } // namespace v8::internal |
OLD | NEW |