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 3211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3222 id(), Mnemonic(), dominator->id(), dominator->Mnemonic()); | 3222 id(), Mnemonic(), dominator->id(), dominator->Mnemonic()); |
3223 } | 3223 } |
3224 return; | 3224 return; |
3225 } | 3225 } |
3226 | 3226 |
3227 // First update the size of the dominator allocate instruction. | 3227 // First update the size of the dominator allocate instruction. |
3228 int32_t dominator_size_constant = | 3228 int32_t dominator_size_constant = |
3229 HConstant::cast(dominator_size)->GetInteger32Constant(); | 3229 HConstant::cast(dominator_size)->GetInteger32Constant(); |
3230 int32_t current_size_constant = | 3230 int32_t current_size_constant = |
3231 HConstant::cast(current_size)->GetInteger32Constant(); | 3231 HConstant::cast(current_size)->GetInteger32Constant(); |
| 3232 int32_t new_dominator_size = dominator_size_constant + current_size_constant; |
| 3233 if (new_dominator_size > Page::kMaxNonCodeHeapObjectSize) { |
| 3234 if (FLAG_trace_allocation_folding) { |
| 3235 PrintF("#%d (%s) cannot fold into #%d (%s) due to size: %d\n", |
| 3236 id(), Mnemonic(), dominator->id(), dominator->Mnemonic(), |
| 3237 new_dominator_size); |
| 3238 } |
| 3239 return; |
| 3240 } |
3232 HBasicBlock* block = dominator->block(); | 3241 HBasicBlock* block = dominator->block(); |
3233 Zone* zone = block->zone(); | 3242 Zone* zone = block->zone(); |
3234 HInstruction* new_dominator_size = new(zone) HConstant( | 3243 HInstruction* new_dominator_size_constant = new(zone) HConstant( |
3235 dominator_size_constant + current_size_constant); | 3244 new_dominator_size); |
3236 new_dominator_size->InsertBefore(dominator_allocate_instr); | 3245 new_dominator_size_constant->InsertBefore(dominator_allocate_instr); |
3237 dominator_allocate_instr->UpdateSize(new_dominator_size); | 3246 dominator_allocate_instr->UpdateSize(new_dominator_size_constant); |
3238 | 3247 |
3239 #ifdef VERIFY_HEAP | 3248 #ifdef VERIFY_HEAP |
3240 HInstruction* free_space_instr = | 3249 HInstruction* free_space_instr = |
3241 new(zone) HInnerAllocatedObject(dominator_allocate_instr, | 3250 new(zone) HInnerAllocatedObject(dominator_allocate_instr, |
3242 dominator_size_constant, | 3251 dominator_size_constant, |
3243 type()); | 3252 type()); |
3244 free_space_instr->InsertAfter(dominator_allocate_instr); | 3253 free_space_instr->InsertAfter(dominator_allocate_instr); |
3245 HConstant* filler_map = new(zone) HConstant( | 3254 HConstant* filler_map = new(zone) HConstant( |
3246 isolate()->factory()->free_space_map(), | 3255 isolate()->factory()->free_space_map(), |
3247 UniqueValueId(isolate()->heap()->free_space_map()), | 3256 UniqueValueId(isolate()->heap()->free_space_map()), |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3997 case kBackingStore: | 4006 case kBackingStore: |
3998 if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString()); | 4007 if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString()); |
3999 stream->Add("[backing-store]"); | 4008 stream->Add("[backing-store]"); |
4000 break; | 4009 break; |
4001 } | 4010 } |
4002 | 4011 |
4003 stream->Add("@%d", offset()); | 4012 stream->Add("@%d", offset()); |
4004 } | 4013 } |
4005 | 4014 |
4006 } } // namespace v8::internal | 4015 } } // namespace v8::internal |
OLD | NEW |