OLD | NEW |
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 5105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5116 CallInterfaceDescriptor HandlerStub::GetCallInterfaceDescriptor() const { | 5116 CallInterfaceDescriptor HandlerStub::GetCallInterfaceDescriptor() const { |
5117 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) { | 5117 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) { |
5118 return LoadWithVectorDescriptor(isolate()); | 5118 return LoadWithVectorDescriptor(isolate()); |
5119 } else { | 5119 } else { |
5120 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC); | 5120 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC); |
5121 return StoreWithVectorDescriptor(isolate()); | 5121 return StoreWithVectorDescriptor(isolate()); |
5122 } | 5122 } |
5123 } | 5123 } |
5124 | 5124 |
5125 | 5125 |
5126 void StoreFastElementStub::InitializeDescriptor( | |
5127 CodeStubDescriptor* descriptor) { | |
5128 descriptor->Initialize( | |
5129 FUNCTION_ADDR(Runtime_KeyedStoreIC_MissFromStubFailure)); | |
5130 } | |
5131 | |
5132 | |
5133 void ElementsTransitionAndStoreStub::InitializeDescriptor( | 5126 void ElementsTransitionAndStoreStub::InitializeDescriptor( |
5134 CodeStubDescriptor* descriptor) { | 5127 CodeStubDescriptor* descriptor) { |
5135 descriptor->Initialize( | 5128 descriptor->Initialize( |
5136 FUNCTION_ADDR(Runtime_ElementsTransitionAndStoreIC_Miss)); | 5129 FUNCTION_ADDR(Runtime_ElementsTransitionAndStoreIC_Miss)); |
5137 } | 5130 } |
5138 | 5131 |
5139 void StoreTransitionStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { | 5132 void StoreTransitionStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { |
5140 descriptor->Initialize( | 5133 descriptor->Initialize( |
5141 FUNCTION_ADDR(Runtime_TransitionStoreIC_MissFromStubFailure)); | 5134 FUNCTION_ADDR(Runtime_TransitionStoreIC_MissFromStubFailure)); |
5142 } | 5135 } |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5676 CreateWeakCellStub stub(isolate); | 5669 CreateWeakCellStub stub(isolate); |
5677 stub.GetCode(); | 5670 stub.GetCode(); |
5678 } | 5671 } |
5679 | 5672 |
5680 | 5673 |
5681 void StoreElementStub::Generate(MacroAssembler* masm) { | 5674 void StoreElementStub::Generate(MacroAssembler* masm) { |
5682 DCHECK_EQ(DICTIONARY_ELEMENTS, elements_kind()); | 5675 DCHECK_EQ(DICTIONARY_ELEMENTS, elements_kind()); |
5683 ElementHandlerCompiler::GenerateStoreSlow(masm); | 5676 ElementHandlerCompiler::GenerateStoreSlow(masm); |
5684 } | 5677 } |
5685 | 5678 |
| 5679 void StoreFastElementStub::GenerateAssembly( |
| 5680 CodeStubAssembler* assembler) const { |
| 5681 typedef CodeStubAssembler::Label Label; |
| 5682 typedef compiler::Node Node; |
| 5683 |
| 5684 assembler->Comment( |
| 5685 "StoreFastElementStub: js_array=%d, elements_kind=%s, store_mode=%d", |
| 5686 is_js_array(), ElementsKindToString(elements_kind()), store_mode()); |
| 5687 |
| 5688 Node* receiver = assembler->Parameter(Descriptor::kReceiver); |
| 5689 Node* key = assembler->Parameter(Descriptor::kName); |
| 5690 Node* value = assembler->Parameter(Descriptor::kValue); |
| 5691 Node* slot = assembler->Parameter(Descriptor::kSlot); |
| 5692 Node* vector = assembler->Parameter(Descriptor::kVector); |
| 5693 Node* context = assembler->Parameter(Descriptor::kContext); |
| 5694 |
| 5695 Label miss(assembler); |
| 5696 |
| 5697 assembler->StoreObjectElement(receiver, key, value, is_js_array(), |
| 5698 elements_kind(), store_mode(), &miss); |
| 5699 assembler->Return(value); |
| 5700 |
| 5701 assembler->Bind(&miss); |
| 5702 { |
| 5703 assembler->Comment("Miss"); |
| 5704 assembler->TailCallRuntime(Runtime::kKeyedStoreIC_Miss, context, receiver, |
| 5705 key, value, slot, vector); |
| 5706 } |
| 5707 } |
5686 | 5708 |
5687 // static | 5709 // static |
5688 void StoreFastElementStub::GenerateAheadOfTime(Isolate* isolate) { | 5710 void StoreFastElementStub::GenerateAheadOfTime(Isolate* isolate) { |
5689 if (FLAG_minimal) return; | 5711 if (FLAG_minimal) return; |
5690 StoreFastElementStub(isolate, false, FAST_HOLEY_ELEMENTS, STANDARD_STORE) | 5712 StoreFastElementStub(isolate, false, FAST_HOLEY_ELEMENTS, STANDARD_STORE) |
5691 .GetCode(); | 5713 .GetCode(); |
5692 StoreFastElementStub(isolate, false, FAST_HOLEY_ELEMENTS, | 5714 StoreFastElementStub(isolate, false, FAST_HOLEY_ELEMENTS, |
5693 STORE_AND_GROW_NO_TRANSITION).GetCode(); | 5715 STORE_AND_GROW_NO_TRANSITION).GetCode(); |
5694 for (int i = FIRST_FAST_ELEMENTS_KIND; i <= LAST_FAST_ELEMENTS_KIND; i++) { | 5716 for (int i = FIRST_FAST_ELEMENTS_KIND; i <= LAST_FAST_ELEMENTS_KIND; i++) { |
5695 ElementsKind kind = static_cast<ElementsKind>(i); | 5717 ElementsKind kind = static_cast<ElementsKind>(i); |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6064 | 6086 |
6065 if (type == MachineType::Pointer()) { | 6087 if (type == MachineType::Pointer()) { |
6066 return Representation::External(); | 6088 return Representation::External(); |
6067 } | 6089 } |
6068 | 6090 |
6069 return Representation::Tagged(); | 6091 return Representation::Tagged(); |
6070 } | 6092 } |
6071 | 6093 |
6072 } // namespace internal | 6094 } // namespace internal |
6073 } // namespace v8 | 6095 } // namespace v8 |
OLD | NEW |