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

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

Issue 2330063002: [stubs] Port StoreFastElementsStub to TurboFan. (Closed)
Patch Set: Retain removed, a comment added Created 4 years, 3 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 | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('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 "src/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 5104 matching lines...) Expand 10 before | Expand all | Expand 10 after
5115 CallInterfaceDescriptor HandlerStub::GetCallInterfaceDescriptor() const { 5115 CallInterfaceDescriptor HandlerStub::GetCallInterfaceDescriptor() const {
5116 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) { 5116 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) {
5117 return LoadWithVectorDescriptor(isolate()); 5117 return LoadWithVectorDescriptor(isolate());
5118 } else { 5118 } else {
5119 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC); 5119 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC);
5120 return StoreWithVectorDescriptor(isolate()); 5120 return StoreWithVectorDescriptor(isolate());
5121 } 5121 }
5122 } 5122 }
5123 5123
5124 5124
5125 void StoreFastElementStub::InitializeDescriptor(
5126 CodeStubDescriptor* descriptor) {
5127 descriptor->Initialize(
5128 FUNCTION_ADDR(Runtime_KeyedStoreIC_MissFromStubFailure));
5129 }
5130
5131
5132 void ElementsTransitionAndStoreStub::InitializeDescriptor( 5125 void ElementsTransitionAndStoreStub::InitializeDescriptor(
5133 CodeStubDescriptor* descriptor) { 5126 CodeStubDescriptor* descriptor) {
5134 descriptor->Initialize( 5127 descriptor->Initialize(
5135 FUNCTION_ADDR(Runtime_ElementsTransitionAndStoreIC_Miss)); 5128 FUNCTION_ADDR(Runtime_ElementsTransitionAndStoreIC_Miss));
5136 } 5129 }
5137 5130
5138 void StoreTransitionStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { 5131 void StoreTransitionStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
5139 descriptor->Initialize( 5132 descriptor->Initialize(
5140 FUNCTION_ADDR(Runtime_TransitionStoreIC_MissFromStubFailure)); 5133 FUNCTION_ADDR(Runtime_TransitionStoreIC_MissFromStubFailure));
5141 } 5134 }
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
5673 CreateWeakCellStub stub(isolate); 5666 CreateWeakCellStub stub(isolate);
5674 stub.GetCode(); 5667 stub.GetCode();
5675 } 5668 }
5676 5669
5677 5670
5678 void StoreElementStub::Generate(MacroAssembler* masm) { 5671 void StoreElementStub::Generate(MacroAssembler* masm) {
5679 DCHECK_EQ(DICTIONARY_ELEMENTS, elements_kind()); 5672 DCHECK_EQ(DICTIONARY_ELEMENTS, elements_kind());
5680 ElementHandlerCompiler::GenerateStoreSlow(masm); 5673 ElementHandlerCompiler::GenerateStoreSlow(masm);
5681 } 5674 }
5682 5675
5676 void StoreFastElementStub::GenerateAssembly(
5677 CodeStubAssembler* assembler) const {
5678 typedef CodeStubAssembler::Label Label;
5679 typedef compiler::Node Node;
5680
5681 assembler->Comment(
5682 "StoreFastElementStub: js_array=%d, elements_kind=%s, store_mode=%d",
5683 is_js_array(), ElementsKindToString(elements_kind()), store_mode());
5684
5685 Node* receiver = assembler->Parameter(Descriptor::kReceiver);
5686 Node* key = assembler->Parameter(Descriptor::kName);
5687 Node* value = assembler->Parameter(Descriptor::kValue);
5688 Node* slot = assembler->Parameter(Descriptor::kSlot);
5689 Node* vector = assembler->Parameter(Descriptor::kVector);
5690 Node* context = assembler->Parameter(Descriptor::kContext);
5691
5692 Label miss(assembler);
5693
5694 assembler->EmitElementStore(receiver, key, value, is_js_array(),
5695 elements_kind(), store_mode(), &miss);
5696 assembler->Return(value);
5697
5698 assembler->Bind(&miss);
5699 {
5700 assembler->Comment("Miss");
5701 assembler->TailCallRuntime(Runtime::kKeyedStoreIC_Miss, context, receiver,
5702 key, value, slot, vector);
5703 }
5704 }
5683 5705
5684 // static 5706 // static
5685 void StoreFastElementStub::GenerateAheadOfTime(Isolate* isolate) { 5707 void StoreFastElementStub::GenerateAheadOfTime(Isolate* isolate) {
5686 if (FLAG_minimal) return; 5708 if (FLAG_minimal) return;
5687 StoreFastElementStub(isolate, false, FAST_HOLEY_ELEMENTS, STANDARD_STORE) 5709 StoreFastElementStub(isolate, false, FAST_HOLEY_ELEMENTS, STANDARD_STORE)
5688 .GetCode(); 5710 .GetCode();
5689 StoreFastElementStub(isolate, false, FAST_HOLEY_ELEMENTS, 5711 StoreFastElementStub(isolate, false, FAST_HOLEY_ELEMENTS,
5690 STORE_AND_GROW_NO_TRANSITION).GetCode(); 5712 STORE_AND_GROW_NO_TRANSITION).GetCode();
5691 for (int i = FIRST_FAST_ELEMENTS_KIND; i <= LAST_FAST_ELEMENTS_KIND; i++) { 5713 for (int i = FIRST_FAST_ELEMENTS_KIND; i <= LAST_FAST_ELEMENTS_KIND; i++) {
5692 ElementsKind kind = static_cast<ElementsKind>(i); 5714 ElementsKind kind = static_cast<ElementsKind>(i);
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
6061 6083
6062 if (type == MachineType::Pointer()) { 6084 if (type == MachineType::Pointer()) {
6063 return Representation::External(); 6085 return Representation::External();
6064 } 6086 }
6065 6087
6066 return Representation::Tagged(); 6088 return Representation::Tagged();
6067 } 6089 }
6068 6090
6069 } // namespace internal 6091 } // namespace internal
6070 } // namespace v8 6092 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698