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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // Lookup the code in the (possibly custom) cache. | 180 // Lookup the code in the (possibly custom) cache. |
181 bool FindCodeInCache(Code** code_out); | 181 bool FindCodeInCache(Code** code_out); |
182 | 182 |
183 virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() = 0; | 183 virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() = 0; |
184 | 184 |
185 virtual void InitializeDescriptor(CodeStubDescriptor* descriptor) {} | 185 virtual void InitializeDescriptor(CodeStubDescriptor* descriptor) {} |
186 | 186 |
187 static void InitializeDescriptor(Isolate* isolate, uint32_t key, | 187 static void InitializeDescriptor(Isolate* isolate, uint32_t key, |
188 CodeStubDescriptor* desc); | 188 CodeStubDescriptor* desc); |
189 | 189 |
| 190 static MaybeHandle<Code> GetCode(Isolate* isolate, uint32_t key); |
| 191 |
190 // Returns information for computing the number key. | 192 // Returns information for computing the number key. |
191 virtual Major MajorKey() const = 0; | 193 virtual Major MajorKey() const = 0; |
192 uint32_t MinorKey() const { return minor_key_; } | 194 uint32_t MinorKey() const { return minor_key_; } |
193 | 195 |
194 virtual InlineCacheState GetICState() const { return UNINITIALIZED; } | 196 virtual InlineCacheState GetICState() const { return UNINITIALIZED; } |
195 virtual ExtraICState GetExtraICState() const { return kNoExtraICState; } | 197 virtual ExtraICState GetExtraICState() const { return kNoExtraICState; } |
196 virtual Code::StubType GetStubType() { | 198 virtual Code::StubType GetStubType() { |
197 return Code::NORMAL; | 199 return Code::NORMAL; |
198 } | 200 } |
199 | 201 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 256 |
255 // If a stub uses a special cache override this. | 257 // If a stub uses a special cache override this. |
256 virtual bool UseSpecialCache() { return false; } | 258 virtual bool UseSpecialCache() { return false; } |
257 | 259 |
258 // We use this dispatch to statically instantiate the correct code stub for | 260 // We use this dispatch to statically instantiate the correct code stub for |
259 // the given stub key and call the passed function with that code stub. | 261 // the given stub key and call the passed function with that code stub. |
260 typedef void (*DispatchedCall)(CodeStub* stub, void** value_out); | 262 typedef void (*DispatchedCall)(CodeStub* stub, void** value_out); |
261 static void Dispatch(Isolate* isolate, uint32_t key, void** value_out, | 263 static void Dispatch(Isolate* isolate, uint32_t key, void** value_out, |
262 DispatchedCall call); | 264 DispatchedCall call); |
263 | 265 |
| 266 static void GetCodeDispatchCall(CodeStub* stub, void** value_out); |
| 267 |
264 STATIC_ASSERT(NUMBER_OF_IDS < (1 << kStubMajorKeyBits)); | 268 STATIC_ASSERT(NUMBER_OF_IDS < (1 << kStubMajorKeyBits)); |
265 class MajorKeyBits: public BitField<uint32_t, 0, kStubMajorKeyBits> {}; | 269 class MajorKeyBits: public BitField<uint32_t, 0, kStubMajorKeyBits> {}; |
266 class MinorKeyBits: public BitField<uint32_t, | 270 class MinorKeyBits: public BitField<uint32_t, |
267 kStubMajorKeyBits, kStubMinorKeyBits> {}; // NOLINT | 271 kStubMajorKeyBits, kStubMinorKeyBits> {}; // NOLINT |
268 | 272 |
269 friend class BreakPointIterator; | 273 friend class BreakPointIterator; |
270 | 274 |
271 Isolate* isolate_; | 275 Isolate* isolate_; |
272 }; | 276 }; |
273 | 277 |
(...skipping 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2387 | 2391 |
2388 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2392 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
2389 #undef DEFINE_PLATFORM_CODE_STUB | 2393 #undef DEFINE_PLATFORM_CODE_STUB |
2390 #undef DEFINE_HANDLER_CODE_STUB | 2394 #undef DEFINE_HANDLER_CODE_STUB |
2391 #undef DEFINE_HYDROGEN_CODE_STUB | 2395 #undef DEFINE_HYDROGEN_CODE_STUB |
2392 #undef DEFINE_CODE_STUB | 2396 #undef DEFINE_CODE_STUB |
2393 #undef DEFINE_CODE_STUB_BASE | 2397 #undef DEFINE_CODE_STUB_BASE |
2394 } } // namespace v8::internal | 2398 } } // namespace v8::internal |
2395 | 2399 |
2396 #endif // V8_CODE_STUBS_H_ | 2400 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |