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 36 matching lines...) Loading... | |
47 V(ProfileEntryHook) \ | 47 V(ProfileEntryHook) \ |
48 V(RecordWrite) \ | 48 V(RecordWrite) \ |
49 V(RegExpExec) \ | 49 V(RegExpExec) \ |
50 V(StoreArrayLiteralElement) \ | 50 V(StoreArrayLiteralElement) \ |
51 V(StoreBufferOverflow) \ | 51 V(StoreBufferOverflow) \ |
52 V(StoreElement) \ | 52 V(StoreElement) \ |
53 V(StringCompare) \ | 53 V(StringCompare) \ |
54 V(StubFailureTrampoline) \ | 54 V(StubFailureTrampoline) \ |
55 V(SubString) \ | 55 V(SubString) \ |
56 V(ToNumber) \ | 56 V(ToNumber) \ |
57 V(VectorStoreICTrampoline) \ | |
58 V(VectorKeyedStoreICTrampoline) \ | |
59 V(VectorStoreIC) \ | |
60 V(VectorKeyedStoreIC) \ | |
57 /* HydrogenCodeStubs */ \ | 61 /* HydrogenCodeStubs */ \ |
58 V(AllocateHeapNumber) \ | 62 V(AllocateHeapNumber) \ |
59 V(ArrayNArgumentsConstructor) \ | 63 V(ArrayNArgumentsConstructor) \ |
60 V(ArrayNoArgumentConstructor) \ | 64 V(ArrayNoArgumentConstructor) \ |
61 V(ArraySingleArgumentConstructor) \ | 65 V(ArraySingleArgumentConstructor) \ |
62 V(BinaryOpIC) \ | 66 V(BinaryOpIC) \ |
63 V(BinaryOpWithAllocationSite) \ | 67 V(BinaryOpWithAllocationSite) \ |
64 V(CompareNilIC) \ | 68 V(CompareNilIC) \ |
65 V(CreateAllocationSite) \ | 69 V(CreateAllocationSite) \ |
66 V(CreateWeakCell) \ | 70 V(CreateWeakCell) \ |
(...skipping 2085 matching lines...) Loading... | |
2152 public: | 2156 public: |
2153 explicit KeyedLoadICTrampolineStub(Isolate* isolate) | 2157 explicit KeyedLoadICTrampolineStub(Isolate* isolate) |
2154 : LoadICTrampolineStub(isolate, LoadICState(0)) {} | 2158 : LoadICTrampolineStub(isolate, LoadICState(0)) {} |
2155 | 2159 |
2156 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2160 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
2157 | 2161 |
2158 DEFINE_PLATFORM_CODE_STUB(KeyedLoadICTrampoline, LoadICTrampolineStub); | 2162 DEFINE_PLATFORM_CODE_STUB(KeyedLoadICTrampoline, LoadICTrampolineStub); |
2159 }; | 2163 }; |
2160 | 2164 |
2161 | 2165 |
2166 class VectorStoreICTrampolineStub : public PlatformCodeStub { | |
2167 public: | |
2168 VectorStoreICTrampolineStub(Isolate* isolate, const StoreICState& state) | |
2169 : PlatformCodeStub(isolate) { | |
2170 minor_key_ = state.GetExtraICState(); | |
2171 } | |
2172 | |
2173 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | |
2174 | |
2175 InlineCacheState GetICState() const final { return DEFAULT; } | |
2176 | |
2177 ExtraICState GetExtraICState() const final { | |
2178 return static_cast<ExtraICState>(minor_key_); | |
2179 } | |
2180 | |
2181 protected: | |
2182 StoreICState state() const { | |
2183 return StoreICState(static_cast<ExtraICState>(minor_key_)); | |
2184 } | |
2185 | |
2186 private: | |
2187 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreICTrampoline); | |
2188 DEFINE_PLATFORM_CODE_STUB(VectorStoreICTrampoline, PlatformCodeStub); | |
2189 }; | |
2190 | |
2191 | |
2192 class VectorKeyedStoreICTrampolineStub : public VectorStoreICTrampolineStub { | |
2193 public: | |
2194 explicit VectorKeyedStoreICTrampolineStub(Isolate* isolate, | |
Jakob Kummerow
2015/05/22 11:38:17
nit: "explicit" is unnecessary
mvstanton
2015/05/22 12:06:16
Done.
| |
2195 const StoreICState& state) | |
2196 : VectorStoreICTrampolineStub(isolate, state) {} | |
2197 | |
2198 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } | |
2199 | |
2200 DEFINE_PLATFORM_CODE_STUB(VectorKeyedStoreICTrampoline, | |
2201 VectorStoreICTrampolineStub); | |
2202 }; | |
2203 | |
2204 | |
2162 class CallICTrampolineStub : public PlatformCodeStub { | 2205 class CallICTrampolineStub : public PlatformCodeStub { |
2163 public: | 2206 public: |
2164 CallICTrampolineStub(Isolate* isolate, const CallICState& state) | 2207 CallICTrampolineStub(Isolate* isolate, const CallICState& state) |
2165 : PlatformCodeStub(isolate) { | 2208 : PlatformCodeStub(isolate) { |
2166 minor_key_ = state.GetExtraICState(); | 2209 minor_key_ = state.GetExtraICState(); |
2167 } | 2210 } |
2168 | 2211 |
2169 Code::Kind GetCodeKind() const override { return Code::CALL_IC; } | 2212 Code::Kind GetCodeKind() const override { return Code::CALL_IC; } |
2170 | 2213 |
2171 InlineCacheState GetICState() const final { return DEFAULT; } | 2214 InlineCacheState GetICState() const final { return DEFAULT; } |
(...skipping 58 matching lines...) Loading... | |
2230 InlineCacheState GetICState() const final override { return DEFAULT; } | 2273 InlineCacheState GetICState() const final override { return DEFAULT; } |
2231 | 2274 |
2232 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2275 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
2233 DEFINE_PLATFORM_CODE_STUB(KeyedLoadIC, PlatformCodeStub); | 2276 DEFINE_PLATFORM_CODE_STUB(KeyedLoadIC, PlatformCodeStub); |
2234 | 2277 |
2235 protected: | 2278 protected: |
2236 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2279 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
2237 }; | 2280 }; |
2238 | 2281 |
2239 | 2282 |
2283 class VectorStoreICStub : public PlatformCodeStub { | |
2284 public: | |
2285 explicit VectorStoreICStub(Isolate* isolate, const StoreICState& state) | |
Jakob Kummerow
2015/05/22 11:38:17
nit: "explicit" is unnecessary
mvstanton
2015/05/22 12:06:16
Done.
| |
2286 : PlatformCodeStub(isolate) { | |
2287 minor_key_ = state.GetExtraICState(); | |
2288 } | |
2289 | |
2290 void GenerateForTrampoline(MacroAssembler* masm); | |
2291 | |
2292 virtual Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | |
Jakob Kummerow
2015/05/22 11:38:17
nit: the cool kids use only one of "virtual", "ove
mvstanton
2015/05/22 12:06:16
W00t, looks cleaner..thx.
| |
2293 | |
2294 virtual InlineCacheState GetICState() const final override { return DEFAULT; } | |
2295 | |
2296 virtual ExtraICState GetExtraICState() const final override { | |
2297 return static_cast<ExtraICState>(minor_key_); | |
2298 } | |
2299 | |
2300 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreIC); | |
2301 DEFINE_PLATFORM_CODE_STUB(VectorStoreIC, PlatformCodeStub); | |
2302 | |
2303 protected: | |
2304 void GenerateImpl(MacroAssembler* masm, bool in_frame); | |
2305 }; | |
2306 | |
2307 | |
2308 class VectorKeyedStoreICStub : public PlatformCodeStub { | |
2309 public: | |
2310 explicit VectorKeyedStoreICStub(Isolate* isolate, const StoreICState& state) | |
Jakob Kummerow
2015/05/22 11:38:17
nit: "explicit" is unnecessary
mvstanton
2015/05/22 12:06:16
Done.
| |
2311 : PlatformCodeStub(isolate) { | |
2312 minor_key_ = state.GetExtraICState(); | |
2313 } | |
2314 | |
2315 void GenerateForTrampoline(MacroAssembler* masm); | |
2316 | |
2317 virtual Code::Kind GetCodeKind() const override { | |
2318 return Code::KEYED_STORE_IC; | |
2319 } | |
2320 | |
2321 virtual InlineCacheState GetICState() const final override { return DEFAULT; } | |
2322 | |
2323 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreIC); | |
2324 DEFINE_PLATFORM_CODE_STUB(VectorKeyedStoreIC, PlatformCodeStub); | |
2325 | |
2326 protected: | |
2327 void GenerateImpl(MacroAssembler* masm, bool in_frame); | |
2328 }; | |
2329 | |
2330 | |
2240 class DoubleToIStub : public PlatformCodeStub { | 2331 class DoubleToIStub : public PlatformCodeStub { |
2241 public: | 2332 public: |
2242 DoubleToIStub(Isolate* isolate, Register source, Register destination, | 2333 DoubleToIStub(Isolate* isolate, Register source, Register destination, |
2243 int offset, bool is_truncating, bool skip_fastpath = false) | 2334 int offset, bool is_truncating, bool skip_fastpath = false) |
2244 : PlatformCodeStub(isolate) { | 2335 : PlatformCodeStub(isolate) { |
2245 minor_key_ = SourceRegisterBits::encode(source.code()) | | 2336 minor_key_ = SourceRegisterBits::encode(source.code()) | |
2246 DestinationRegisterBits::encode(destination.code()) | | 2337 DestinationRegisterBits::encode(destination.code()) | |
2247 OffsetBits::encode(offset) | | 2338 OffsetBits::encode(offset) | |
2248 IsTruncatingBits::encode(is_truncating) | | 2339 IsTruncatingBits::encode(is_truncating) | |
2249 SkipFastPathBits::encode(skip_fastpath) | | 2340 SkipFastPathBits::encode(skip_fastpath) | |
(...skipping 626 matching lines...) Loading... | |
2876 | 2967 |
2877 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2968 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
2878 #undef DEFINE_PLATFORM_CODE_STUB | 2969 #undef DEFINE_PLATFORM_CODE_STUB |
2879 #undef DEFINE_HANDLER_CODE_STUB | 2970 #undef DEFINE_HANDLER_CODE_STUB |
2880 #undef DEFINE_HYDROGEN_CODE_STUB | 2971 #undef DEFINE_HYDROGEN_CODE_STUB |
2881 #undef DEFINE_CODE_STUB | 2972 #undef DEFINE_CODE_STUB |
2882 #undef DEFINE_CODE_STUB_BASE | 2973 #undef DEFINE_CODE_STUB_BASE |
2883 } } // namespace v8::internal | 2974 } } // namespace v8::internal |
2884 | 2975 |
2885 #endif // V8_CODE_STUBS_H_ | 2976 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |