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/code-stub-assembler.h" | 10 #include "src/code-stub-assembler.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 /* version of the corresponding stub is */ \ | 61 /* version of the corresponding stub is */ \ |
62 /* used universally */ \ | 62 /* used universally */ \ |
63 V(CallICTrampoline) \ | 63 V(CallICTrampoline) \ |
64 V(LoadICTrampoline) \ | 64 V(LoadICTrampoline) \ |
65 V(KeyedLoadICTrampoline) \ | 65 V(KeyedLoadICTrampoline) \ |
66 V(KeyedStoreICTrampoline) \ | 66 V(KeyedStoreICTrampoline) \ |
67 V(StoreICTrampoline) \ | 67 V(StoreICTrampoline) \ |
68 /* --- HydrogenCodeStubs --- */ \ | 68 /* --- HydrogenCodeStubs --- */ \ |
69 V(ElementsTransitionAndStore) \ | 69 V(ElementsTransitionAndStore) \ |
70 V(FastCloneShallowArray) \ | 70 V(FastCloneShallowArray) \ |
71 V(GrowArrayElements) \ | |
72 V(NumberToString) \ | 71 V(NumberToString) \ |
73 V(StringAdd) \ | 72 V(StringAdd) \ |
74 V(ToObject) \ | 73 V(ToObject) \ |
75 V(Typeof) \ | 74 V(Typeof) \ |
76 /* These builtins w/ JS linkage are */ \ | 75 /* These builtins w/ JS linkage are */ \ |
77 /* just fast-cases of C++ builtins. They */ \ | 76 /* just fast-cases of C++ builtins. They */ \ |
78 /* require varg support from TF */ \ | 77 /* require varg support from TF */ \ |
79 V(FastArrayPush) \ | 78 V(FastArrayPush) \ |
80 V(FastFunctionBind) \ | 79 V(FastFunctionBind) \ |
81 /* These will be ported/eliminated */ \ | 80 /* These will be ported/eliminated */ \ |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 V(ToInteger) \ | 157 V(ToInteger) \ |
159 V(ToLength) \ | 158 V(ToLength) \ |
160 V(HasProperty) \ | 159 V(HasProperty) \ |
161 V(ForInFilter) \ | 160 V(ForInFilter) \ |
162 V(GetProperty) \ | 161 V(GetProperty) \ |
163 V(LoadICTF) \ | 162 V(LoadICTF) \ |
164 V(KeyedLoadICTF) \ | 163 V(KeyedLoadICTF) \ |
165 V(StoreInterceptor) \ | 164 V(StoreInterceptor) \ |
166 V(LoadApiGetter) \ | 165 V(LoadApiGetter) \ |
167 V(LoadIndexedInterceptor) \ | 166 V(LoadIndexedInterceptor) \ |
| 167 V(GrowArrayElements) \ |
168 /* These are only called from FGC and */ \ | 168 /* These are only called from FGC and */ \ |
169 /* can be removed when we use ignition */ \ | 169 /* can be removed when we use ignition */ \ |
170 /* only */ \ | 170 /* only */ \ |
171 V(LoadICTrampolineTF) \ | 171 V(LoadICTrampolineTF) \ |
172 V(LoadGlobalICTrampoline) \ | 172 V(LoadGlobalICTrampoline) \ |
173 V(KeyedLoadICTrampolineTF) | 173 V(KeyedLoadICTrampolineTF) |
174 | 174 |
175 // List of code stubs only used on ARM 32 bits platforms. | 175 // List of code stubs only used on ARM 32 bits platforms. |
176 #if V8_TARGET_ARCH_ARM | 176 #if V8_TARGET_ARCH_ARM |
177 #define CODE_STUB_LIST_ARM(V) V(DirectCEntry) | 177 #define CODE_STUB_LIST_ARM(V) V(DirectCEntry) |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 class CreateWeakCellStub : public TurboFanCodeStub { | 1236 class CreateWeakCellStub : public TurboFanCodeStub { |
1237 public: | 1237 public: |
1238 explicit CreateWeakCellStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 1238 explicit CreateWeakCellStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
1239 | 1239 |
1240 static void GenerateAheadOfTime(Isolate* isolate); | 1240 static void GenerateAheadOfTime(Isolate* isolate); |
1241 | 1241 |
1242 DEFINE_CALL_INTERFACE_DESCRIPTOR(CreateWeakCell); | 1242 DEFINE_CALL_INTERFACE_DESCRIPTOR(CreateWeakCell); |
1243 DEFINE_TURBOFAN_CODE_STUB(CreateWeakCell, TurboFanCodeStub); | 1243 DEFINE_TURBOFAN_CODE_STUB(CreateWeakCell, TurboFanCodeStub); |
1244 }; | 1244 }; |
1245 | 1245 |
1246 class GrowArrayElementsStub : public HydrogenCodeStub { | 1246 class GrowArrayElementsStub : public TurboFanCodeStub { |
1247 public: | 1247 public: |
1248 GrowArrayElementsStub(Isolate* isolate, bool is_js_array, ElementsKind kind) | 1248 GrowArrayElementsStub(Isolate* isolate, ElementsKind kind) |
1249 : HydrogenCodeStub(isolate) { | 1249 : TurboFanCodeStub(isolate) { |
1250 set_sub_minor_key(ElementsKindBits::encode(kind) | | 1250 minor_key_ = ElementsKindBits::encode(GetHoleyElementsKind(kind)); |
1251 IsJsArrayBits::encode(is_js_array)); | |
1252 } | 1251 } |
1253 | 1252 |
1254 ElementsKind elements_kind() const { | 1253 ElementsKind elements_kind() const { |
1255 return ElementsKindBits::decode(sub_minor_key()); | 1254 return ElementsKindBits::decode(minor_key_); |
1256 } | 1255 } |
1257 | 1256 |
1258 bool is_js_array() const { return IsJsArrayBits::decode(sub_minor_key()); } | |
1259 | |
1260 private: | 1257 private: |
1261 class ElementsKindBits : public BitField<ElementsKind, 0, 8> {}; | 1258 class ElementsKindBits : public BitField<ElementsKind, 0, 8> {}; |
1262 class IsJsArrayBits : public BitField<bool, ElementsKindBits::kNext, 1> {}; | |
1263 | 1259 |
1264 DEFINE_CALL_INTERFACE_DESCRIPTOR(GrowArrayElements); | 1260 DEFINE_CALL_INTERFACE_DESCRIPTOR(GrowArrayElements); |
1265 DEFINE_HYDROGEN_CODE_STUB(GrowArrayElements, HydrogenCodeStub); | 1261 DEFINE_TURBOFAN_CODE_STUB(GrowArrayElements, TurboFanCodeStub); |
1266 }; | 1262 }; |
1267 | 1263 |
1268 class FastArrayPushStub : public HydrogenCodeStub { | 1264 class FastArrayPushStub : public HydrogenCodeStub { |
1269 public: | 1265 public: |
1270 explicit FastArrayPushStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 1266 explicit FastArrayPushStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
1271 | 1267 |
1272 private: | 1268 private: |
1273 DEFINE_CALL_INTERFACE_DESCRIPTOR(VarArgFunction); | 1269 DEFINE_CALL_INTERFACE_DESCRIPTOR(VarArgFunction); |
1274 DEFINE_HYDROGEN_CODE_STUB(FastArrayPush, HydrogenCodeStub); | 1270 DEFINE_HYDROGEN_CODE_STUB(FastArrayPush, HydrogenCodeStub); |
1275 }; | 1271 }; |
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3140 #undef DEFINE_HYDROGEN_CODE_STUB | 3136 #undef DEFINE_HYDROGEN_CODE_STUB |
3141 #undef DEFINE_CODE_STUB | 3137 #undef DEFINE_CODE_STUB |
3142 #undef DEFINE_CODE_STUB_BASE | 3138 #undef DEFINE_CODE_STUB_BASE |
3143 | 3139 |
3144 extern Representation RepresentationFromType(Type* type); | 3140 extern Representation RepresentationFromType(Type* type); |
3145 | 3141 |
3146 } // namespace internal | 3142 } // namespace internal |
3147 } // namespace v8 | 3143 } // namespace v8 |
3148 | 3144 |
3149 #endif // V8_CODE_STUBS_H_ | 3145 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |