| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/hydrogen.h" | 5 #include "src/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
| 10 #include "src/ast-numbering.h" | 10 #include "src/ast-numbering.h" |
| (...skipping 3496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3507 Representation::Smi()); | 3507 Representation::Smi()); |
| 3508 length_field = | 3508 length_field = |
| 3509 builder()->AddUncasted<HForceRepresentation>(length_field, | 3509 builder()->AddUncasted<HForceRepresentation>(length_field, |
| 3510 Representation::Smi()); | 3510 Representation::Smi()); |
| 3511 | 3511 |
| 3512 // Generate size calculation code here in order to make it dominate | 3512 // Generate size calculation code here in order to make it dominate |
| 3513 // the JSArray allocation. | 3513 // the JSArray allocation. |
| 3514 HValue* elements_size = | 3514 HValue* elements_size = |
| 3515 builder()->BuildCalculateElementsSize(kind_, capacity); | 3515 builder()->BuildCalculateElementsSize(kind_, capacity); |
| 3516 | 3516 |
| 3517 // Bail out for large objects. |
| 3518 HValue* max_regular_heap_object_size = |
| 3519 builder()->Add<HConstant>(Page::kMaxRegularHeapObjectSize); |
| 3520 builder()->Add<HBoundsCheck>(elements_size, max_regular_heap_object_size); |
| 3521 |
| 3517 // Allocate (dealing with failure appropriately) | 3522 // Allocate (dealing with failure appropriately) |
| 3518 HAllocate* array_object = builder()->AllocateJSArrayObject(mode_); | 3523 HAllocate* array_object = builder()->AllocateJSArrayObject(mode_); |
| 3519 | 3524 |
| 3520 // Fill in the fields: map, properties, length | 3525 // Fill in the fields: map, properties, length |
| 3521 HValue* map; | 3526 HValue* map; |
| 3522 if (allocation_site_payload_ == NULL) { | 3527 if (allocation_site_payload_ == NULL) { |
| 3523 map = EmitInternalMapCode(); | 3528 map = EmitInternalMapCode(); |
| 3524 } else { | 3529 } else { |
| 3525 map = EmitMapCode(); | 3530 map = EmitMapCode(); |
| 3526 } | 3531 } |
| (...skipping 10144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13671 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13676 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13672 } | 13677 } |
| 13673 | 13678 |
| 13674 #ifdef DEBUG | 13679 #ifdef DEBUG |
| 13675 graph_->Verify(false); // No full verify. | 13680 graph_->Verify(false); // No full verify. |
| 13676 #endif | 13681 #endif |
| 13677 } | 13682 } |
| 13678 | 13683 |
| 13679 } // namespace internal | 13684 } // namespace internal |
| 13680 } // namespace v8 | 13685 } // namespace v8 |
| OLD | NEW |