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 2602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2613 boilerplate, static_cast<HValue*>(NULL), access)); | 2613 boilerplate, static_cast<HValue*>(NULL), access)); |
2614 } | 2614 } |
2615 } | 2615 } |
2616 | 2616 |
2617 // Create an allocation site info if requested. | 2617 // Create an allocation site info if requested. |
2618 if (mode == TRACK_ALLOCATION_SITE) { | 2618 if (mode == TRACK_ALLOCATION_SITE) { |
2619 BuildCreateAllocationMemento( | 2619 BuildCreateAllocationMemento( |
2620 object, Add<HConstant>(JSArray::kSize), allocation_site); | 2620 object, Add<HConstant>(JSArray::kSize), allocation_site); |
2621 } | 2621 } |
2622 | 2622 |
2623 // We have to initialize the elements pointer if allocation folding is | 2623 if (length > 0) { |
2624 // turned off. | 2624 // We have to initialize the elements pointer if allocation folding is |
2625 if (!FLAG_use_gvn || !FLAG_use_allocation_folding) { | 2625 // turned off. |
2626 HConstant* empty_fixed_array = Add<HConstant>( | 2626 if (!FLAG_use_gvn || !FLAG_use_allocation_folding) { |
2627 isolate()->factory()->empty_fixed_array()); | 2627 HConstant* empty_fixed_array = Add<HConstant>( |
2628 Add<HStoreNamedField>(object, HObjectAccess::ForElementsPointer(), | 2628 isolate()->factory()->empty_fixed_array()); |
2629 empty_fixed_array, INITIALIZING_STORE); | 2629 Add<HStoreNamedField>(object, HObjectAccess::ForElementsPointer(), |
2630 } | 2630 empty_fixed_array, INITIALIZING_STORE); |
| 2631 } |
2631 | 2632 |
2632 if (length > 0) { | |
2633 HValue* boilerplate_elements = AddLoadElements(boilerplate); | 2633 HValue* boilerplate_elements = AddLoadElements(boilerplate); |
2634 HValue* object_elements; | 2634 HValue* object_elements; |
2635 if (IsFastDoubleElementsKind(kind)) { | 2635 if (IsFastDoubleElementsKind(kind)) { |
2636 HValue* elems_size = Add<HConstant>(FixedDoubleArray::SizeFor(length)); | 2636 HValue* elems_size = Add<HConstant>(FixedDoubleArray::SizeFor(length)); |
2637 object_elements = Add<HAllocate>(elems_size, HType::Tagged(), | 2637 object_elements = Add<HAllocate>(elems_size, HType::Tagged(), |
2638 NOT_TENURED, FIXED_DOUBLE_ARRAY_TYPE); | 2638 NOT_TENURED, FIXED_DOUBLE_ARRAY_TYPE); |
2639 } else { | 2639 } else { |
2640 HValue* elems_size = Add<HConstant>(FixedArray::SizeFor(length)); | 2640 HValue* elems_size = Add<HConstant>(FixedArray::SizeFor(length)); |
2641 object_elements = Add<HAllocate>(elems_size, HType::Tagged(), | 2641 object_elements = Add<HAllocate>(elems_size, HType::Tagged(), |
2642 NOT_TENURED, FIXED_ARRAY_TYPE); | 2642 NOT_TENURED, FIXED_ARRAY_TYPE); |
(...skipping 9001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11644 if (ShouldProduceTraceOutput()) { | 11644 if (ShouldProduceTraceOutput()) { |
11645 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11645 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11646 } | 11646 } |
11647 | 11647 |
11648 #ifdef DEBUG | 11648 #ifdef DEBUG |
11649 graph_->Verify(false); // No full verify. | 11649 graph_->Verify(false); // No full verify. |
11650 #endif | 11650 #endif |
11651 } | 11651 } |
11652 | 11652 |
11653 } } // namespace v8::internal | 11653 } } // namespace v8::internal |
OLD | NEW |