| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 9344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9355 PretenureFlag pretenure_flag = isolate()->heap()->GetPretenureMode(); | 9355 PretenureFlag pretenure_flag = isolate()->heap()->GetPretenureMode(); |
| 9356 if (FLAG_allocation_site_pretenuring) { | 9356 if (FLAG_allocation_site_pretenuring) { |
| 9357 pretenure_flag = site_context->current()->GetPretenureMode() | 9357 pretenure_flag = site_context->current()->GetPretenureMode() |
| 9358 ? TENURED | 9358 ? TENURED |
| 9359 : NOT_TENURED; | 9359 : NOT_TENURED; |
| 9360 } | 9360 } |
| 9361 | 9361 |
| 9362 HInstruction* object = Add<HAllocate>(object_size_constant, type, | 9362 HInstruction* object = Add<HAllocate>(object_size_constant, type, |
| 9363 pretenure_flag, instance_type, site_context->current()); | 9363 pretenure_flag, instance_type, site_context->current()); |
| 9364 | 9364 |
| 9365 // If allocation folding reaches Page::kMaxRegularHeapObjectSize the |
| 9366 // elements array may not get folded into the object. Hence, we set the |
| 9367 // elements pointer to empty fixed array and let store elimination remove |
| 9368 // this store in the folding case. |
| 9369 HConstant* empty_fixed_array = Add<HConstant>( |
| 9370 isolate()->factory()->empty_fixed_array()); |
| 9371 Add<HStoreNamedField>(object, HObjectAccess::ForElementsPointer(), |
| 9372 empty_fixed_array); |
| 9373 |
| 9365 BuildEmitObjectHeader(boilerplate_object, object); | 9374 BuildEmitObjectHeader(boilerplate_object, object); |
| 9366 | 9375 |
| 9367 Handle<FixedArrayBase> elements(boilerplate_object->elements()); | 9376 Handle<FixedArrayBase> elements(boilerplate_object->elements()); |
| 9368 int elements_size = (elements->length() > 0 && | 9377 int elements_size = (elements->length() > 0 && |
| 9369 elements->map() != isolate()->heap()->fixed_cow_array_map()) ? | 9378 elements->map() != isolate()->heap()->fixed_cow_array_map()) ? |
| 9370 elements->Size() : 0; | 9379 elements->Size() : 0; |
| 9371 | 9380 |
| 9372 HInstruction* object_elements = NULL; | 9381 HInstruction* object_elements = NULL; |
| 9373 if (elements_size > 0) { | 9382 if (elements_size > 0) { |
| 9374 HValue* object_elements_size = Add<HConstant>(elements_size); | 9383 HValue* object_elements_size = Add<HConstant>(elements_size); |
| (...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10820 if (ShouldProduceTraceOutput()) { | 10829 if (ShouldProduceTraceOutput()) { |
| 10821 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 10830 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 10822 } | 10831 } |
| 10823 | 10832 |
| 10824 #ifdef DEBUG | 10833 #ifdef DEBUG |
| 10825 graph_->Verify(false); // No full verify. | 10834 graph_->Verify(false); // No full verify. |
| 10826 #endif | 10835 #endif |
| 10827 } | 10836 } |
| 10828 | 10837 |
| 10829 } } // namespace v8::internal | 10838 } } // namespace v8::internal |
| OLD | NEW |