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

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

Issue 368263003: Use a stub in crankshaft for grow store arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Performance fixes. Created 6 years, 5 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
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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/field-index.h" 8 #include "src/field-index.h"
9 #include "src/hydrogen.h" 9 #include "src/hydrogen.h"
10 #include "src/lithium.h" 10 #include "src/lithium.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 int param_count = descriptor_->register_param_count(); 119 int param_count = descriptor_->register_param_count();
120 HEnvironment* start_environment = graph()->start_environment(); 120 HEnvironment* start_environment = graph()->start_environment();
121 HBasicBlock* next_block = CreateBasicBlock(start_environment); 121 HBasicBlock* next_block = CreateBasicBlock(start_environment);
122 Goto(next_block); 122 Goto(next_block);
123 next_block->SetJoinId(BailoutId::StubEntry()); 123 next_block->SetJoinId(BailoutId::StubEntry());
124 set_current_block(next_block); 124 set_current_block(next_block);
125 125
126 bool runtime_stack_params = descriptor_->stack_parameter_count().is_valid(); 126 bool runtime_stack_params = descriptor_->stack_parameter_count().is_valid();
127 HInstruction* stack_parameter_count = NULL; 127 HInstruction* stack_parameter_count = NULL;
128 for (int i = 0; i < param_count; ++i) { 128 for (int i = 0; i < param_count; ++i) {
129 Representation r = descriptor_->GetRegisterParameterRepresentation(i); 129 Representation r = descriptor_->GetParameterRepresentation(i);
130 HParameter* param = Add<HParameter>(i, HParameter::REGISTER_PARAMETER, r); 130 HParameter* param = Add<HParameter>(i, HParameter::REGISTER_PARAMETER, r);
131 start_environment->Bind(i, param); 131 start_environment->Bind(i, param);
132 parameters_[i] = param; 132 parameters_[i] = param;
133 if (descriptor_->IsParameterCountRegister(i)) { 133 if (descriptor_->IsParameterCountRegister(i)) {
134 param->set_type(HType::Smi()); 134 param->set_type(HType::Smi());
135 stack_parameter_count = param; 135 stack_parameter_count = param;
136 arguments_length_ = stack_parameter_count; 136 arguments_length_ = stack_parameter_count;
137 } 137 }
138 } 138 }
139 139
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 return feedback_vector; 528 return feedback_vector;
529 } 529 }
530 530
531 531
532 Handle<Code> CreateAllocationSiteStub::GenerateCode() { 532 Handle<Code> CreateAllocationSiteStub::GenerateCode() {
533 return DoGenerateCode(this); 533 return DoGenerateCode(this);
534 } 534 }
535 535
536 536
537 template <> 537 template <>
538 HValue* CodeStubGraphBuilder<GrowArrayElementsStub>::BuildCodeStub() {
539 HValue* object = GetParameter(GrowArrayElementsStub::kObjectIndex);
540 HValue* key = GetParameter(GrowArrayElementsStub::kKeyIndex);
541 HValue* current_capacity = GetParameter(
542 GrowArrayElementsStub::kCapacityIndex);
543 ElementsKind kind = casted_stub()->elements_kind();
544
545 HValue* elements = AddLoadElements(object);
546 HValue* length = casted_stub()->is_js_array()
547 ? Add<HLoadNamedField>(object, static_cast<HValue*>(NULL),
548 HObjectAccess::ForArrayLength(kind))
549 : current_capacity;
550
551 return BuildCheckAndGrowElementsCapacity(object, elements, kind, length,
552 current_capacity, key);
553 }
554
555
556 Handle<Code> GrowArrayElementsStub::GenerateCode() {
557 return DoGenerateCode(this);
558 }
559
560
561 template <>
538 HValue* CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() { 562 HValue* CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() {
539 HInstruction* load = BuildUncheckedMonomorphicElementAccess( 563 HInstruction* load = BuildUncheckedMonomorphicElementAccess(
540 GetParameter(KeyedLoadIC::kReceiverIndex), 564 GetParameter(KeyedLoadIC::kReceiverIndex),
541 GetParameter(KeyedLoadIC::kNameIndex), 565 GetParameter(KeyedLoadIC::kNameIndex),
542 NULL, 566 NULL,
543 casted_stub()->is_js_array(), 567 casted_stub()->is_js_array(),
544 casted_stub()->elements_kind(), 568 casted_stub()->elements_kind(),
545 LOAD, 569 LOAD,
546 NEVER_RETURN_HOLE, 570 NEVER_RETURN_HOLE,
547 STANDARD_STORE); 571 STANDARD_STORE);
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 return Pop(); 1728 return Pop();
1705 } 1729 }
1706 1730
1707 1731
1708 Handle<Code> KeyedLoadGenericElementStub::GenerateCode() { 1732 Handle<Code> KeyedLoadGenericElementStub::GenerateCode() {
1709 return DoGenerateCode(this); 1733 return DoGenerateCode(this);
1710 } 1734 }
1711 1735
1712 1736
1713 } } // namespace v8::internal 1737 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698