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 3486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3497 Representation::Smi()); | 3497 Representation::Smi()); |
3498 length_field = | 3498 length_field = |
3499 builder()->AddUncasted<HForceRepresentation>(length_field, | 3499 builder()->AddUncasted<HForceRepresentation>(length_field, |
3500 Representation::Smi()); | 3500 Representation::Smi()); |
3501 | 3501 |
3502 // Generate size calculation code here in order to make it dominate | 3502 // Generate size calculation code here in order to make it dominate |
3503 // the JSArray allocation. | 3503 // the JSArray allocation. |
3504 HValue* elements_size = | 3504 HValue* elements_size = |
3505 builder()->BuildCalculateElementsSize(kind_, capacity); | 3505 builder()->BuildCalculateElementsSize(kind_, capacity); |
3506 | 3506 |
| 3507 // Bail out for large objects. |
| 3508 HValue* max_regular_heap_object_size = |
| 3509 builder()->Add<HConstant>(Page::kMaxRegularHeapObjectSize); |
| 3510 builder()->Add<HBoundsCheck>(elements_size, max_regular_heap_object_size); |
| 3511 |
3507 // Allocate (dealing with failure appropriately) | 3512 // Allocate (dealing with failure appropriately) |
3508 HAllocate* array_object = builder()->AllocateJSArrayObject(mode_); | 3513 HAllocate* array_object = builder()->AllocateJSArrayObject(mode_); |
3509 | 3514 |
3510 // Fill in the fields: map, properties, length | 3515 // Fill in the fields: map, properties, length |
3511 HValue* map; | 3516 HValue* map; |
3512 if (allocation_site_payload_ == NULL) { | 3517 if (allocation_site_payload_ == NULL) { |
3513 map = EmitInternalMapCode(); | 3518 map = EmitInternalMapCode(); |
3514 } else { | 3519 } else { |
3515 map = EmitMapCode(); | 3520 map = EmitMapCode(); |
3516 } | 3521 } |
(...skipping 10144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13661 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13666 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13662 } | 13667 } |
13663 | 13668 |
13664 #ifdef DEBUG | 13669 #ifdef DEBUG |
13665 graph_->Verify(false); // No full verify. | 13670 graph_->Verify(false); // No full verify. |
13666 #endif | 13671 #endif |
13667 } | 13672 } |
13668 | 13673 |
13669 } // namespace internal | 13674 } // namespace internal |
13670 } // namespace v8 | 13675 } // namespace v8 |
OLD | NEW |