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 3189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3200 !dominator_allocate_instr->IsNewSpaceAllocation() || | 3200 !dominator_allocate_instr->IsNewSpaceAllocation() || |
3201 !dominator_size->IsInteger32Constant()) { | 3201 !dominator_size->IsInteger32Constant()) { |
3202 if (FLAG_trace_allocation_folding) { | 3202 if (FLAG_trace_allocation_folding) { |
3203 PrintF("#%d (%s) cannot fold into #%d (%s)\n", | 3203 PrintF("#%d (%s) cannot fold into #%d (%s)\n", |
3204 id(), Mnemonic(), dominator->id(), dominator->Mnemonic()); | 3204 id(), Mnemonic(), dominator->id(), dominator->Mnemonic()); |
3205 } | 3205 } |
3206 return; | 3206 return; |
3207 } | 3207 } |
3208 | 3208 |
3209 // First update the size of the dominator allocate instruction. | 3209 // First update the size of the dominator allocate instruction. |
3210 int32_t dominator_size_constant = | 3210 int32_t original_object_size = |
3211 HConstant::cast(dominator_size)->GetInteger32Constant(); | 3211 HConstant::cast(dominator_size)->GetInteger32Constant(); |
3212 int32_t dominator_size_constant = original_object_size; | |
3212 int32_t current_size_constant = | 3213 int32_t current_size_constant = |
3213 HConstant::cast(current_size)->GetInteger32Constant(); | 3214 HConstant::cast(current_size)->GetInteger32Constant(); |
3214 int32_t new_dominator_size = dominator_size_constant + current_size_constant; | 3215 int32_t new_dominator_size = dominator_size_constant + current_size_constant; |
3215 | 3216 |
3216 if (MustAllocateDoubleAligned()) { | 3217 if (MustAllocateDoubleAligned()) { |
3217 if (!dominator_allocate_instr->MustAllocateDoubleAligned()) { | 3218 if (!dominator_allocate_instr->MustAllocateDoubleAligned()) { |
3218 dominator_allocate_instr->MakeDoubleAligned(); | 3219 dominator_allocate_instr->MakeDoubleAligned(); |
3219 } | 3220 } |
3220 if ((dominator_size_constant & kDoubleAlignmentMask) != 0) { | 3221 if ((dominator_size_constant & kDoubleAlignmentMask) != 0) { |
3221 dominator_size_constant += kDoubleSize / 2; | 3222 dominator_size_constant += kDoubleSize / 2; |
(...skipping 13 matching lines...) Expand all Loading... | |
3235 Zone* zone = block->zone(); | 3236 Zone* zone = block->zone(); |
3236 HInstruction* new_dominator_size_constant = | 3237 HInstruction* new_dominator_size_constant = |
3237 HConstant::New(zone, context(), new_dominator_size); | 3238 HConstant::New(zone, context(), new_dominator_size); |
3238 new_dominator_size_constant->InsertBefore(dominator_allocate_instr); | 3239 new_dominator_size_constant->InsertBefore(dominator_allocate_instr); |
3239 dominator_allocate_instr->UpdateSize(new_dominator_size_constant); | 3240 dominator_allocate_instr->UpdateSize(new_dominator_size_constant); |
3240 | 3241 |
3241 #ifdef VERIFY_HEAP | 3242 #ifdef VERIFY_HEAP |
3242 if (FLAG_verify_heap) { | 3243 if (FLAG_verify_heap) { |
3243 dominator_allocate_instr->MakePrefillWithFiller(); | 3244 dominator_allocate_instr->MakePrefillWithFiller(); |
3244 } | 3245 } |
3246 #else | |
Michael Starzinger
2013/08/27 08:41:24
The #ifdef is not entirely correct. If we compile
Hannes Payer (out of office)
2013/08/27 12:50:54
Done.
| |
3247 // TODO(hpayer): This is a short-term hack to make allocation mementos | |
3248 // work again in new space. | |
3249 if (dominator_allocate_instr->clear_next_map_word_) { | |
3250 HObjectAccess access = | |
3251 HObjectAccess::ForJSObjectOffset(original_object_size); | |
3252 HStoreNamedField* clear_next_map = | |
3253 HStoreNamedField::New(zone, context(), dominator_allocate_instr, access, | |
3254 block->graph()->GetConstantNull()); | |
3255 clear_next_map->ClearAllSideEffects(); | |
3256 clear_next_map->InsertAfter(dominator_allocate_instr); | |
3257 } | |
3258 dominator_allocate_instr->clear_next_map_word_ = clear_next_map_word_; | |
3245 #endif | 3259 #endif |
3246 | 3260 |
3247 // After that replace the dominated allocate instruction. | 3261 // After that replace the dominated allocate instruction. |
3248 HInstruction* dominated_allocate_instr = | 3262 HInstruction* dominated_allocate_instr = |
3249 HInnerAllocatedObject::New(zone, | 3263 HInnerAllocatedObject::New(zone, |
3250 context(), | 3264 context(), |
3251 dominator_allocate_instr, | 3265 dominator_allocate_instr, |
3252 dominator_size_constant, | 3266 dominator_size_constant, |
3253 type()); | 3267 type()); |
3254 dominated_allocate_instr->InsertBefore(this); | 3268 dominated_allocate_instr->InsertBefore(this); |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3994 break; | 4008 break; |
3995 case kExternalMemory: | 4009 case kExternalMemory: |
3996 stream->Add("[external-memory]"); | 4010 stream->Add("[external-memory]"); |
3997 break; | 4011 break; |
3998 } | 4012 } |
3999 | 4013 |
4000 stream->Add("@%d", offset()); | 4014 stream->Add("@%d", offset()); |
4001 } | 4015 } |
4002 | 4016 |
4003 } } // namespace v8::internal | 4017 } } // namespace v8::internal |
OLD | NEW |