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" |
11 #include "src/compiler/code-stub-assembler.h" | 11 #include "src/compiler/code-stub-assembler.h" |
12 #include "src/globals.h" | 12 #include "src/globals.h" |
13 #include "src/ic/ic-state.h" | 13 #include "src/ic/ic-state.h" |
14 #include "src/interface-descriptors.h" | 14 #include "src/interface-descriptors.h" |
15 #include "src/macro-assembler.h" | 15 #include "src/macro-assembler.h" |
16 #include "src/ostreams.h" | 16 #include "src/ostreams.h" |
17 | 17 |
18 namespace v8 { | 18 namespace v8 { |
19 namespace internal { | 19 namespace internal { |
20 | 20 |
21 // List of code stubs used on all platforms. | 21 // List of code stubs used on all platforms. |
22 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ | 22 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ |
23 /* PlatformCodeStubs */ \ | 23 /* PlatformCodeStubs */ \ |
24 V(ArrayConstructor) \ | 24 V(ArrayConstructor) \ |
| 25 V(AtomicsLoad) \ |
25 V(BinaryOpICWithAllocationSite) \ | 26 V(BinaryOpICWithAllocationSite) \ |
26 V(CallApiCallback) \ | 27 V(CallApiCallback) \ |
27 V(CallApiGetter) \ | 28 V(CallApiGetter) \ |
28 V(CallConstruct) \ | 29 V(CallConstruct) \ |
29 V(CallIC) \ | 30 V(CallIC) \ |
30 V(CEntry) \ | 31 V(CEntry) \ |
31 V(CompareIC) \ | 32 V(CompareIC) \ |
32 V(DoubleToI) \ | 33 V(DoubleToI) \ |
33 V(FunctionPrototype) \ | 34 V(FunctionPrototype) \ |
34 V(InstanceOf) \ | 35 V(InstanceOf) \ |
(...skipping 2470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2505 | 2506 |
2506 int slot_index() const { return SlotIndexBits::decode(sub_minor_key()); } | 2507 int slot_index() const { return SlotIndexBits::decode(sub_minor_key()); } |
2507 | 2508 |
2508 static bool Accepted(const ScriptContextTable::LookupResult* lookup_result) { | 2509 static bool Accepted(const ScriptContextTable::LookupResult* lookup_result) { |
2509 return ContextIndexBits::is_valid(lookup_result->context_index) && | 2510 return ContextIndexBits::is_valid(lookup_result->context_index) && |
2510 SlotIndexBits::is_valid(lookup_result->slot_index); | 2511 SlotIndexBits::is_valid(lookup_result->slot_index); |
2511 } | 2512 } |
2512 | 2513 |
2513 private: | 2514 private: |
2514 static const int kContextIndexBits = 9; | 2515 static const int kContextIndexBits = 9; |
2515 static const int kSlotIndexBits = 13; | 2516 static const int kSlotIndexBits = 12; |
2516 class ContextIndexBits : public BitField<int, 0, kContextIndexBits> {}; | 2517 class ContextIndexBits : public BitField<int, 0, kContextIndexBits> {}; |
2517 class SlotIndexBits | 2518 class SlotIndexBits |
2518 : public BitField<int, kContextIndexBits, kSlotIndexBits> {}; | 2519 : public BitField<int, kContextIndexBits, kSlotIndexBits> {}; |
2519 | 2520 |
2520 DEFINE_CODE_STUB_BASE(ScriptContextFieldStub, HandlerStub); | 2521 DEFINE_CODE_STUB_BASE(ScriptContextFieldStub, HandlerStub); |
2521 }; | 2522 }; |
2522 | 2523 |
2523 | 2524 |
2524 class LoadScriptContextFieldStub : public ScriptContextFieldStub { | 2525 class LoadScriptContextFieldStub : public ScriptContextFieldStub { |
2525 public: | 2526 public: |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3114 | 3115 |
3115 | 3116 |
3116 class ToObjectStub final : public HydrogenCodeStub { | 3117 class ToObjectStub final : public HydrogenCodeStub { |
3117 public: | 3118 public: |
3118 explicit ToObjectStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 3119 explicit ToObjectStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
3119 | 3120 |
3120 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); | 3121 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); |
3121 DEFINE_HYDROGEN_CODE_STUB(ToObject, HydrogenCodeStub); | 3122 DEFINE_HYDROGEN_CODE_STUB(ToObject, HydrogenCodeStub); |
3122 }; | 3123 }; |
3123 | 3124 |
| 3125 class AtomicsLoadStub : public PlatformCodeStub { |
| 3126 public: |
| 3127 explicit AtomicsLoadStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 3128 |
| 3129 DEFINE_CALL_INTERFACE_DESCRIPTOR(AtomicsLoad); |
| 3130 DEFINE_PLATFORM_CODE_STUB(AtomicsLoad, PlatformCodeStub); |
| 3131 }; |
| 3132 |
3124 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 3133 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
3125 #undef DEFINE_PLATFORM_CODE_STUB | 3134 #undef DEFINE_PLATFORM_CODE_STUB |
3126 #undef DEFINE_HANDLER_CODE_STUB | 3135 #undef DEFINE_HANDLER_CODE_STUB |
3127 #undef DEFINE_HYDROGEN_CODE_STUB | 3136 #undef DEFINE_HYDROGEN_CODE_STUB |
3128 #undef DEFINE_CODE_STUB | 3137 #undef DEFINE_CODE_STUB |
3129 #undef DEFINE_CODE_STUB_BASE | 3138 #undef DEFINE_CODE_STUB_BASE |
3130 | 3139 |
3131 extern Representation RepresentationFromType(Type* type); | 3140 extern Representation RepresentationFromType(Type* type); |
3132 | 3141 |
3133 } // namespace internal | 3142 } // namespace internal |
3134 } // namespace v8 | 3143 } // namespace v8 |
3135 | 3144 |
3136 #endif // V8_CODE_STUBS_H_ | 3145 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |