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

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 304153009: Implemented folding of constant size allocation followed by dynamic size allocation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: TODO removed Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 "v8.h" 5 #include "v8.h"
6 6
7 #include "code-stubs.h" 7 #include "code-stubs.h"
8 #include "hydrogen.h" 8 #include "hydrogen.h"
9 #include "lithium.h" 9 #include "lithium.h"
10 10
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 // the array because they aren't compatible with a smi array. 717 // the array because they aren't compatible with a smi array.
718 // If it's a double array, no problem, and if it's fast then no 718 // If it's a double array, no problem, and if it's fast then no
719 // problem either because doubles are boxed. 719 // problem either because doubles are boxed.
720 // 720 //
721 // TODO(mvstanton): consider an instruction to memset fill the array 721 // TODO(mvstanton): consider an instruction to memset fill the array
722 // with zero in this case instead. 722 // with zero in this case instead.
723 JSArrayBuilder::FillMode fill_mode = IsFastSmiElementsKind(kind) 723 JSArrayBuilder::FillMode fill_mode = IsFastSmiElementsKind(kind)
724 ? JSArrayBuilder::FILL_WITH_HOLE 724 ? JSArrayBuilder::FILL_WITH_HOLE
725 : JSArrayBuilder::DONT_FILL_WITH_HOLE; 725 : JSArrayBuilder::DONT_FILL_WITH_HOLE;
726 HValue* new_object = array_builder->AllocateArray(checked_length, 726 HValue* new_object = array_builder->AllocateArray(checked_length,
727 max_alloc_length,
727 checked_length, 728 checked_length,
728 fill_mode); 729 fill_mode);
729 HValue* elements = array_builder->GetElementsLocation(); 730 HValue* elements = array_builder->GetElementsLocation();
730 ASSERT(elements != NULL); 731 ASSERT(elements != NULL);
731 732
732 // Now populate the elements correctly. 733 // Now populate the elements correctly.
733 LoopBuilder builder(this, 734 LoopBuilder builder(this,
734 context(), 735 context(),
735 LoopBuilder::kPostIncrement); 736 LoopBuilder::kPostIncrement);
736 HValue* start = graph()->GetConstant0(); 737 HValue* start = graph()->GetConstant0();
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 return BuildRegExpConstructResult(length, index, input); 1494 return BuildRegExpConstructResult(length, index, input);
1494 } 1495 }
1495 1496
1496 1497
1497 Handle<Code> RegExpConstructResultStub::GenerateCode() { 1498 Handle<Code> RegExpConstructResultStub::GenerateCode() {
1498 return DoGenerateCode(this); 1499 return DoGenerateCode(this);
1499 } 1500 }
1500 1501
1501 1502
1502 } } // namespace v8::internal 1503 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698