| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 V(LoadFastElement) \ | 78 V(LoadFastElement) \ |
| 79 V(MegamorphicLoad) \ | 79 V(MegamorphicLoad) \ |
| 80 V(NameDictionaryLookup) \ | 80 V(NameDictionaryLookup) \ |
| 81 V(NumberToString) \ | 81 V(NumberToString) \ |
| 82 V(RegExpConstructResult) \ | 82 V(RegExpConstructResult) \ |
| 83 V(StoreFastElement) \ | 83 V(StoreFastElement) \ |
| 84 V(StoreScriptContextField) \ | 84 V(StoreScriptContextField) \ |
| 85 V(StringAdd) \ | 85 V(StringAdd) \ |
| 86 V(ToBoolean) \ | 86 V(ToBoolean) \ |
| 87 V(TransitionElementsKind) \ | 87 V(TransitionElementsKind) \ |
| 88 V(VectorKeyedLoad) \ | 88 V(VectorRawKeyedLoad) \ |
| 89 V(VectorLoad) \ | 89 V(VectorRawLoad) \ |
| 90 /* IC Handler stubs */ \ | 90 /* IC Handler stubs */ \ |
| 91 V(LoadConstant) \ | 91 V(LoadConstant) \ |
| 92 V(LoadField) \ | 92 V(LoadField) \ |
| 93 V(KeyedLoadSloppyArguments) \ | 93 V(KeyedLoadSloppyArguments) \ |
| 94 V(StoreField) \ | 94 V(StoreField) \ |
| 95 V(StoreGlobal) \ | 95 V(StoreGlobal) \ |
| 96 V(StoreTransition) \ | 96 V(StoreTransition) \ |
| 97 V(StringLength) \ | 97 V(StringLength) \ |
| 98 V(RestParamAccess) | 98 V(RestParamAccess) |
| 99 | 99 |
| (...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2055 if (FLAG_vector_ics) { | 2055 if (FLAG_vector_ics) { |
| 2056 return VectorLoadICDescriptor(isolate()); | 2056 return VectorLoadICDescriptor(isolate()); |
| 2057 } | 2057 } |
| 2058 return LoadDescriptor(isolate()); | 2058 return LoadDescriptor(isolate()); |
| 2059 } | 2059 } |
| 2060 | 2060 |
| 2061 DEFINE_HYDROGEN_CODE_STUB(MegamorphicLoad, HydrogenCodeStub); | 2061 DEFINE_HYDROGEN_CODE_STUB(MegamorphicLoad, HydrogenCodeStub); |
| 2062 }; | 2062 }; |
| 2063 | 2063 |
| 2064 | 2064 |
| 2065 class VectorLoadStub : public HydrogenCodeStub { | 2065 class VectorRawLoadStub : public PlatformCodeStub { |
| 2066 public: | 2066 public: |
| 2067 explicit VectorLoadStub(Isolate* isolate, const LoadICState& state) | 2067 explicit VectorRawLoadStub(Isolate* isolate, const LoadICState& state) |
| 2068 : HydrogenCodeStub(isolate) { | 2068 : PlatformCodeStub(isolate) { |
| 2069 set_sub_minor_key(state.GetExtraICState()); | 2069 minor_key_ = state.GetExtraICState(); |
| 2070 } | 2070 } |
| 2071 | 2071 |
| 2072 Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; } | 2072 void GenerateForTrampoline(MacroAssembler* masm); |
| 2073 | 2073 |
| 2074 InlineCacheState GetICState() const FINAL { return DEFAULT; } | 2074 virtual Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; } |
| 2075 | 2075 |
| 2076 ExtraICState GetExtraICState() const FINAL { | 2076 virtual InlineCacheState GetICState() const FINAL OVERRIDE { return DEFAULT; } |
| 2077 return static_cast<ExtraICState>(sub_minor_key()); | 2077 |
| 2078 virtual ExtraICState GetExtraICState() const FINAL OVERRIDE { |
| 2079 return static_cast<ExtraICState>(minor_key_); |
| 2078 } | 2080 } |
| 2079 | 2081 |
| 2080 private: | 2082 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorLoadIC); |
| 2081 LoadICState state() const { return LoadICState(GetExtraICState()); } | 2083 DEFINE_PLATFORM_CODE_STUB(VectorRawLoad, PlatformCodeStub); |
| 2082 | 2084 |
| 2083 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorLoadIC); | 2085 protected: |
| 2084 DEFINE_HYDROGEN_CODE_STUB(VectorLoad, HydrogenCodeStub); | 2086 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
| 2085 }; | 2087 }; |
| 2086 | 2088 |
| 2087 | 2089 |
| 2088 class VectorKeyedLoadStub : public VectorLoadStub { | 2090 class VectorRawKeyedLoadStub : public PlatformCodeStub { |
| 2089 public: | 2091 public: |
| 2090 explicit VectorKeyedLoadStub(Isolate* isolate) | 2092 explicit VectorRawKeyedLoadStub(Isolate* isolate) |
| 2091 : VectorLoadStub(isolate, LoadICState(0)) {} | 2093 : PlatformCodeStub(isolate) {} |
| 2092 | 2094 |
| 2093 Code::Kind GetCodeKind() const OVERRIDE { return Code::KEYED_LOAD_IC; } | 2095 void GenerateForTrampoline(MacroAssembler* masm); |
| 2096 |
| 2097 virtual Code::Kind GetCodeKind() const OVERRIDE { |
| 2098 return Code::KEYED_LOAD_IC; |
| 2099 } |
| 2100 |
| 2101 virtual InlineCacheState GetICState() const FINAL OVERRIDE { return DEFAULT; } |
| 2094 | 2102 |
| 2095 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorLoadIC); | 2103 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorLoadIC); |
| 2096 DEFINE_HYDROGEN_CODE_STUB(VectorKeyedLoad, VectorLoadStub); | 2104 DEFINE_PLATFORM_CODE_STUB(VectorRawKeyedLoad, PlatformCodeStub); |
| 2105 |
| 2106 protected: |
| 2107 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
| 2097 }; | 2108 }; |
| 2098 | 2109 |
| 2099 | 2110 |
| 2100 class DoubleToIStub : public PlatformCodeStub { | 2111 class DoubleToIStub : public PlatformCodeStub { |
| 2101 public: | 2112 public: |
| 2102 DoubleToIStub(Isolate* isolate, Register source, Register destination, | 2113 DoubleToIStub(Isolate* isolate, Register source, Register destination, |
| 2103 int offset, bool is_truncating, bool skip_fastpath = false) | 2114 int offset, bool is_truncating, bool skip_fastpath = false) |
| 2104 : PlatformCodeStub(isolate) { | 2115 : PlatformCodeStub(isolate) { |
| 2105 minor_key_ = SourceRegisterBits::encode(source.code()) | | 2116 minor_key_ = SourceRegisterBits::encode(source.code()) | |
| 2106 DestinationRegisterBits::encode(destination.code()) | | 2117 DestinationRegisterBits::encode(destination.code()) | |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2732 | 2743 |
| 2733 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2744 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
| 2734 #undef DEFINE_PLATFORM_CODE_STUB | 2745 #undef DEFINE_PLATFORM_CODE_STUB |
| 2735 #undef DEFINE_HANDLER_CODE_STUB | 2746 #undef DEFINE_HANDLER_CODE_STUB |
| 2736 #undef DEFINE_HYDROGEN_CODE_STUB | 2747 #undef DEFINE_HYDROGEN_CODE_STUB |
| 2737 #undef DEFINE_CODE_STUB | 2748 #undef DEFINE_CODE_STUB |
| 2738 #undef DEFINE_CODE_STUB_BASE | 2749 #undef DEFINE_CODE_STUB_BASE |
| 2739 } } // namespace v8::internal | 2750 } } // namespace v8::internal |
| 2740 | 2751 |
| 2741 #endif // V8_CODE_STUBS_H_ | 2752 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |