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 #ifndef V8_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 V(NameDictionaryLookup) \ | 57 V(NameDictionaryLookup) \ |
58 /* This can be removed once there are no */ \ | 58 /* This can be removed once there are no */ \ |
59 /* more deopting Hydrogen stubs. */ \ | 59 /* more deopting Hydrogen stubs. */ \ |
60 V(StubFailureTrampoline) \ | 60 V(StubFailureTrampoline) \ |
61 /* These are only called from FCG */ \ | 61 /* These are only called from FCG */ \ |
62 /* They can be removed when only the TF */ \ | 62 /* They can be removed when only the TF */ \ |
63 /* version of the corresponding stub is */ \ | 63 /* version of the corresponding stub is */ \ |
64 /* used universally */ \ | 64 /* used universally */ \ |
65 V(CallICTrampoline) \ | 65 V(CallICTrampoline) \ |
66 /* --- HydrogenCodeStubs --- */ \ | 66 /* --- HydrogenCodeStubs --- */ \ |
67 /* These will be ported/eliminated */ \ | |
68 /* as part of the new IC system, ask */ \ | |
69 /* ishell before doing anything */ \ | |
70 V(LoadField) \ | |
71 /* These should never be ported to TF */ \ | 67 /* These should never be ported to TF */ \ |
72 /* because they are either used only by */ \ | 68 /* because they are either used only by */ \ |
73 /* FCG/Crankshaft or are deprecated */ \ | 69 /* FCG/Crankshaft or are deprecated */ \ |
74 V(BinaryOpIC) \ | 70 V(BinaryOpIC) \ |
75 V(BinaryOpWithAllocationSite) \ | 71 V(BinaryOpWithAllocationSite) \ |
76 V(ToBooleanIC) \ | 72 V(ToBooleanIC) \ |
77 V(TransitionElementsKind) \ | 73 V(TransitionElementsKind) \ |
78 /* --- TurboFanCodeStubs --- */ \ | 74 /* --- TurboFanCodeStubs --- */ \ |
79 V(AllocateHeapNumber) \ | 75 V(AllocateHeapNumber) \ |
80 V(AllocateFloat32x4) \ | 76 V(AllocateFloat32x4) \ |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 V(LoadIC) \ | 114 V(LoadIC) \ |
119 V(LoadICProtoArray) \ | 115 V(LoadICProtoArray) \ |
120 V(KeyedLoadICTF) \ | 116 V(KeyedLoadICTF) \ |
121 V(StoreFastElement) \ | 117 V(StoreFastElement) \ |
122 V(StoreGlobal) \ | 118 V(StoreGlobal) \ |
123 V(StoreIC) \ | 119 V(StoreIC) \ |
124 V(KeyedStoreICTF) \ | 120 V(KeyedStoreICTF) \ |
125 V(StoreInterceptor) \ | 121 V(StoreInterceptor) \ |
126 V(LoadApiGetter) \ | 122 V(LoadApiGetter) \ |
127 V(LoadIndexedInterceptor) \ | 123 V(LoadIndexedInterceptor) \ |
124 V(LoadField) \ | |
128 V(GrowArrayElements) \ | 125 V(GrowArrayElements) \ |
129 /* These are only called from FGC and */ \ | 126 /* These are only called from FGC and */ \ |
130 /* can be removed when we use ignition */ \ | 127 /* can be removed when we use ignition */ \ |
131 /* only */ \ | 128 /* only */ \ |
132 V(LoadICTrampoline) \ | 129 V(LoadICTrampoline) \ |
133 V(LoadGlobalICTrampoline) \ | 130 V(LoadGlobalICTrampoline) \ |
134 V(KeyedLoadICTrampolineTF) \ | 131 V(KeyedLoadICTrampolineTF) \ |
135 V(StoreICTrampoline) \ | 132 V(StoreICTrampoline) \ |
136 V(KeyedStoreICTrampolineTF) | 133 V(KeyedStoreICTrampolineTF) |
137 | 134 |
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1162 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override; | 1159 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override; |
1163 | 1160 |
1164 protected: | 1161 protected: |
1165 explicit HandlerStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 1162 explicit HandlerStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
1166 | 1163 |
1167 virtual Code::Kind kind() const = 0; | 1164 virtual Code::Kind kind() const = 0; |
1168 | 1165 |
1169 DEFINE_CODE_STUB_BASE(HandlerStub, HydrogenCodeStub); | 1166 DEFINE_CODE_STUB_BASE(HandlerStub, HydrogenCodeStub); |
1170 }; | 1167 }; |
1171 | 1168 |
1172 | 1169 class LoadFieldStub : public TurboFanCodeStub { |
1173 class LoadFieldStub: public HandlerStub { | |
1174 public: | 1170 public: |
1175 LoadFieldStub(Isolate* isolate, FieldIndex index) : HandlerStub(isolate) { | 1171 explicit LoadFieldStub(Isolate* isolate) : TurboFanCodeStub(isolate) { |
1176 int property_index_key = index.GetFieldAccessStubKey(); | 1172 minor_key_ = 0; |
Igor Sheludko
2016/12/22 15:53:59
Please remove this. CodeStub initializes minor_key
danno
2016/12/28 16:14:13
Done.
| |
1177 set_sub_minor_key(LoadFieldByIndexBits::encode(property_index_key)); | |
1178 } | 1173 } |
1179 | 1174 |
1180 FieldIndex index() const { | 1175 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
1181 int property_index_key = LoadFieldByIndexBits::decode(sub_minor_key()); | 1176 ExtraICState GetExtraICState() const override { return GetCodeKind(); } |
1182 return FieldIndex::FromFieldAccessStubKey(property_index_key); | |
1183 } | |
1184 | |
1185 protected: | |
1186 Code::Kind kind() const override { return Code::LOAD_IC; } | |
1187 | 1177 |
1188 private: | 1178 private: |
1189 class LoadFieldByIndexBits : public BitField<int, 0, 13> {}; | 1179 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadField); |
1190 | 1180 DEFINE_TURBOFAN_CODE_STUB(LoadField, TurboFanCodeStub); |
1191 // TODO(ishell): The stub uses only kReceiver parameter. | |
1192 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | |
1193 DEFINE_HANDLER_CODE_STUB(LoadField, HandlerStub); | |
1194 }; | 1181 }; |
1195 | 1182 |
1196 class KeyedLoadSloppyArgumentsStub : public TurboFanCodeStub { | 1183 class KeyedLoadSloppyArgumentsStub : public TurboFanCodeStub { |
1197 public: | 1184 public: |
1198 explicit KeyedLoadSloppyArgumentsStub(Isolate* isolate) | 1185 explicit KeyedLoadSloppyArgumentsStub(Isolate* isolate) |
1199 : TurboFanCodeStub(isolate) {} | 1186 : TurboFanCodeStub(isolate) {} |
1200 | 1187 |
1201 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 1188 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
1202 ExtraICState GetExtraICState() const override { return Code::LOAD_IC; } | 1189 ExtraICState GetExtraICState() const override { return Code::LOAD_IC; } |
1203 | 1190 |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2503 #undef DEFINE_PLATFORM_CODE_STUB | 2490 #undef DEFINE_PLATFORM_CODE_STUB |
2504 #undef DEFINE_HANDLER_CODE_STUB | 2491 #undef DEFINE_HANDLER_CODE_STUB |
2505 #undef DEFINE_HYDROGEN_CODE_STUB | 2492 #undef DEFINE_HYDROGEN_CODE_STUB |
2506 #undef DEFINE_CODE_STUB | 2493 #undef DEFINE_CODE_STUB |
2507 #undef DEFINE_CODE_STUB_BASE | 2494 #undef DEFINE_CODE_STUB_BASE |
2508 | 2495 |
2509 } // namespace internal | 2496 } // namespace internal |
2510 } // namespace v8 | 2497 } // namespace v8 |
2511 | 2498 |
2512 #endif // V8_CODE_STUBS_H_ | 2499 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |