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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 */ \ | 67 /* These will be ported/eliminated */ \ |
68 /* as part of the new IC system, ask */ \ | 68 /* as part of the new IC system, ask */ \ |
69 /* ishell before doing anything */ \ | 69 /* ishell before doing anything */ \ |
70 V(LoadConstant) \ | 70 V(LoadConstant) \ |
71 V(LoadDictionaryElement) \ | |
72 V(LoadFastElement) \ | |
73 V(LoadField) \ | 71 V(LoadField) \ |
74 /* These should never be ported to TF */ \ | 72 /* These should never be ported to TF */ \ |
75 /* because they are either used only by */ \ | 73 /* because they are either used only by */ \ |
76 /* FCG/Crankshaft or are deprecated */ \ | 74 /* FCG/Crankshaft or are deprecated */ \ |
77 V(BinaryOpIC) \ | 75 V(BinaryOpIC) \ |
78 V(BinaryOpWithAllocationSite) \ | 76 V(BinaryOpWithAllocationSite) \ |
79 V(ToBooleanIC) \ | 77 V(ToBooleanIC) \ |
80 V(TransitionElementsKind) \ | 78 V(TransitionElementsKind) \ |
81 /* --- TurboFanCodeStubs --- */ \ | 79 /* --- TurboFanCodeStubs --- */ \ |
82 V(AllocateHeapNumber) \ | 80 V(AllocateHeapNumber) \ |
(...skipping 1836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1919 } | 1917 } |
1920 | 1918 |
1921 private: | 1919 private: |
1922 StringCharCodeAtGenerator char_code_at_generator_; | 1920 StringCharCodeAtGenerator char_code_at_generator_; |
1923 StringCharFromCodeGenerator char_from_code_generator_; | 1921 StringCharFromCodeGenerator char_from_code_generator_; |
1924 | 1922 |
1925 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); | 1923 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); |
1926 }; | 1924 }; |
1927 | 1925 |
1928 | 1926 |
1929 class LoadDictionaryElementStub : public HydrogenCodeStub { | |
1930 public: | |
1931 explicit LoadDictionaryElementStub(Isolate* isolate) | |
1932 : HydrogenCodeStub(isolate) {} | |
1933 | |
1934 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | |
1935 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); | |
1936 }; | |
1937 | |
1938 class LoadICTrampolineStub : public TurboFanCodeStub { | 1927 class LoadICTrampolineStub : public TurboFanCodeStub { |
1939 public: | 1928 public: |
1940 explicit LoadICTrampolineStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 1929 explicit LoadICTrampolineStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
1941 | 1930 |
1942 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 1931 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
1943 | 1932 |
1944 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 1933 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
1945 DEFINE_TURBOFAN_CODE_STUB(LoadICTrampoline, TurboFanCodeStub); | 1934 DEFINE_TURBOFAN_CODE_STUB(LoadICTrampoline, TurboFanCodeStub); |
1946 }; | 1935 }; |
1947 | 1936 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2232 Isolate* isolate, const ScriptContextTable::LookupResult* lookup_result) | 2221 Isolate* isolate, const ScriptContextTable::LookupResult* lookup_result) |
2233 : ScriptContextFieldStub(isolate, lookup_result) {} | 2222 : ScriptContextFieldStub(isolate, lookup_result) {} |
2234 | 2223 |
2235 ExtraICState GetExtraICState() const override { return Code::STORE_IC; } | 2224 ExtraICState GetExtraICState() const override { return Code::STORE_IC; } |
2236 | 2225 |
2237 private: | 2226 private: |
2238 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 2227 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
2239 DEFINE_TURBOFAN_CODE_STUB(StoreScriptContextField, ScriptContextFieldStub); | 2228 DEFINE_TURBOFAN_CODE_STUB(StoreScriptContextField, ScriptContextFieldStub); |
2240 }; | 2229 }; |
2241 | 2230 |
2242 | |
2243 class LoadFastElementStub : public HandlerStub { | |
2244 public: | |
2245 LoadFastElementStub(Isolate* isolate, bool is_js_array, | |
2246 ElementsKind elements_kind, | |
2247 bool convert_hole_to_undefined = false) | |
2248 : HandlerStub(isolate) { | |
2249 set_sub_minor_key( | |
2250 ElementsKindBits::encode(elements_kind) | | |
2251 IsJSArrayBits::encode(is_js_array) | | |
2252 CanConvertHoleToUndefined::encode(convert_hole_to_undefined)); | |
2253 } | |
2254 | |
2255 Code::Kind kind() const override { return Code::KEYED_LOAD_IC; } | |
2256 | |
2257 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } | |
2258 bool convert_hole_to_undefined() const { | |
2259 return CanConvertHoleToUndefined::decode(sub_minor_key()); | |
2260 } | |
2261 | |
2262 ElementsKind elements_kind() const { | |
2263 return ElementsKindBits::decode(sub_minor_key()); | |
2264 } | |
2265 | |
2266 private: | |
2267 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | |
2268 class IsJSArrayBits: public BitField<bool, 8, 1> {}; | |
2269 class CanConvertHoleToUndefined : public BitField<bool, 9, 1> {}; | |
2270 | |
2271 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | |
2272 DEFINE_HANDLER_CODE_STUB(LoadFastElement, HandlerStub); | |
2273 }; | |
2274 | |
2275 class StoreFastElementStub : public TurboFanCodeStub { | 2231 class StoreFastElementStub : public TurboFanCodeStub { |
2276 public: | 2232 public: |
2277 StoreFastElementStub(Isolate* isolate, bool is_js_array, | 2233 StoreFastElementStub(Isolate* isolate, bool is_js_array, |
2278 ElementsKind elements_kind, KeyedAccessStoreMode mode) | 2234 ElementsKind elements_kind, KeyedAccessStoreMode mode) |
2279 : TurboFanCodeStub(isolate) { | 2235 : TurboFanCodeStub(isolate) { |
2280 minor_key_ = CommonStoreModeBits::encode(mode) | | 2236 minor_key_ = CommonStoreModeBits::encode(mode) | |
2281 ElementsKindBits::encode(elements_kind) | | 2237 ElementsKindBits::encode(elements_kind) | |
2282 IsJSArrayBits::encode(is_js_array); | 2238 IsJSArrayBits::encode(is_js_array); |
2283 } | 2239 } |
2284 | 2240 |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2659 #undef DEFINE_PLATFORM_CODE_STUB | 2615 #undef DEFINE_PLATFORM_CODE_STUB |
2660 #undef DEFINE_HANDLER_CODE_STUB | 2616 #undef DEFINE_HANDLER_CODE_STUB |
2661 #undef DEFINE_HYDROGEN_CODE_STUB | 2617 #undef DEFINE_HYDROGEN_CODE_STUB |
2662 #undef DEFINE_CODE_STUB | 2618 #undef DEFINE_CODE_STUB |
2663 #undef DEFINE_CODE_STUB_BASE | 2619 #undef DEFINE_CODE_STUB_BASE |
2664 | 2620 |
2665 } // namespace internal | 2621 } // namespace internal |
2666 } // namespace v8 | 2622 } // namespace v8 |
2667 | 2623 |
2668 #endif // V8_CODE_STUBS_H_ | 2624 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |