Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: src/hydrogen.cc

Issue 1392853009: Reland "Add bailout for large objects when allocating arrays in optimized code." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Skip test where bounds check interferes with forced deopts Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698