Chromium Code Reviews| 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 9755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9766 | 9766 |
| 9767 HInstruction* object = Add<HAllocate>(object_size_constant, type, | 9767 HInstruction* object = Add<HAllocate>(object_size_constant, type, |
| 9768 pretenure_flag, instance_type, site_context->current()); | 9768 pretenure_flag, instance_type, site_context->current()); |
| 9769 | 9769 |
| 9770 BuildEmitObjectHeader(boilerplate_object, object); | 9770 BuildEmitObjectHeader(boilerplate_object, object); |
| 9771 | 9771 |
| 9772 Handle<FixedArrayBase> elements(boilerplate_object->elements()); | 9772 Handle<FixedArrayBase> elements(boilerplate_object->elements()); |
| 9773 int elements_size = (elements->length() > 0 && | 9773 int elements_size = (elements->length() > 0 && |
| 9774 elements->map() != isolate()->heap()->fixed_cow_array_map()) ? | 9774 elements->map() != isolate()->heap()->fixed_cow_array_map()) ? |
| 9775 elements->Size() : 0; | 9775 elements->Size() : 0; |
| 9776 | 9776 |
|
Hannes Payer (out of office)
2014/03/17 09:37:18
This method needs more comments... please explain
mvstanton
2014/03/17 12:25:28
Done.
| |
| 9777 if (pretenure_flag == TENURED && | |
| 9778 elements->map() == isolate()->heap()->fixed_cow_array_map() && | |
| 9779 isolate()->heap()->InNewSpace(*elements)) { | |
| 9780 elements = Handle<FixedArrayBase>( | |
| 9781 isolate()->factory()->CopyAndTenureFixedCOWArray( | |
| 9782 Handle<FixedArray>::cast(elements))); | |
| 9783 boilerplate_object->set_elements(*elements); | |
| 9784 } | |
| 9785 | |
| 9777 HInstruction* object_elements = NULL; | 9786 HInstruction* object_elements = NULL; |
| 9778 if (elements_size > 0) { | 9787 if (elements_size > 0) { |
| 9779 HValue* object_elements_size = Add<HConstant>(elements_size); | 9788 HValue* object_elements_size = Add<HConstant>(elements_size); |
| 9780 if (boilerplate_object->HasFastDoubleElements()) { | 9789 if (boilerplate_object->HasFastDoubleElements()) { |
| 9781 // Allocation folding will not be able to fold |object| and | 9790 // Allocation folding will not be able to fold |object| and |
| 9782 // |object_elements| together if they are pre-tenured. | 9791 // |object_elements| together if they are pre-tenured. |
| 9783 if (pretenure_flag == TENURED) { | 9792 if (pretenure_flag == TENURED) { |
| 9784 HConstant* empty_fixed_array = Add<HConstant>( | 9793 HConstant* empty_fixed_array = Add<HConstant>( |
| 9785 isolate()->factory()->empty_fixed_array()); | 9794 isolate()->factory()->empty_fixed_array()); |
| 9786 Add<HStoreNamedField>(object, HObjectAccess::ForElementsPointer(), | 9795 Add<HStoreNamedField>(object, HObjectAccess::ForElementsPointer(), |
| (...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11273 if (ShouldProduceTraceOutput()) { | 11282 if (ShouldProduceTraceOutput()) { |
| 11274 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11283 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 11275 } | 11284 } |
| 11276 | 11285 |
| 11277 #ifdef DEBUG | 11286 #ifdef DEBUG |
| 11278 graph_->Verify(false); // No full verify. | 11287 graph_->Verify(false); // No full verify. |
| 11279 #endif | 11288 #endif |
| 11280 } | 11289 } |
| 11281 | 11290 |
| 11282 } } // namespace v8::internal | 11291 } } // namespace v8::internal |
| OLD | NEW |