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/code-stub-assembler.h" | 10 #include "src/code-stub-assembler.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 V(FastArrayPush) \ | 79 V(FastArrayPush) \ |
80 V(FastFunctionBind) \ | 80 V(FastFunctionBind) \ |
81 /* These will be ported/eliminated */ \ | 81 /* These will be ported/eliminated */ \ |
82 /* as part of the new IC system, ask */ \ | 82 /* as part of the new IC system, ask */ \ |
83 /* ishell before doing anything */ \ | 83 /* ishell before doing anything */ \ |
84 V(KeyedLoadGeneric) \ | 84 V(KeyedLoadGeneric) \ |
85 V(LoadConstant) \ | 85 V(LoadConstant) \ |
86 V(LoadDictionaryElement) \ | 86 V(LoadDictionaryElement) \ |
87 V(LoadFastElement) \ | 87 V(LoadFastElement) \ |
88 V(LoadField) \ | 88 V(LoadField) \ |
89 V(LoadScriptContextField) \ | |
90 V(StoreFastElement) \ | 89 V(StoreFastElement) \ |
91 V(StoreScriptContextField) \ | |
92 V(StoreTransition) \ | 90 V(StoreTransition) \ |
93 /* These should never be ported to TF */ \ | 91 /* These should never be ported to TF */ \ |
94 /* because they are either used only by */ \ | 92 /* because they are either used only by */ \ |
95 /* FCG/Crankshaft or are deprecated */ \ | 93 /* FCG/Crankshaft or are deprecated */ \ |
96 V(BinaryOpIC) \ | 94 V(BinaryOpIC) \ |
97 V(BinaryOpWithAllocationSite) \ | 95 V(BinaryOpWithAllocationSite) \ |
98 V(ToBooleanIC) \ | 96 V(ToBooleanIC) \ |
99 V(RegExpConstructResult) \ | 97 V(RegExpConstructResult) \ |
100 V(TransitionElementsKind) \ | 98 V(TransitionElementsKind) \ |
101 V(StoreGlobalViaContext) \ | 99 V(StoreGlobalViaContext) \ |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 V(FastNewFunctionContext) \ | 141 V(FastNewFunctionContext) \ |
144 V(InstanceOf) \ | 142 V(InstanceOf) \ |
145 V(LessThan) \ | 143 V(LessThan) \ |
146 V(LessThanOrEqual) \ | 144 V(LessThanOrEqual) \ |
147 V(GreaterThan) \ | 145 V(GreaterThan) \ |
148 V(GreaterThanOrEqual) \ | 146 V(GreaterThanOrEqual) \ |
149 V(Equal) \ | 147 V(Equal) \ |
150 V(NotEqual) \ | 148 V(NotEqual) \ |
151 V(KeyedLoadSloppyArguments) \ | 149 V(KeyedLoadSloppyArguments) \ |
152 V(KeyedStoreSloppyArguments) \ | 150 V(KeyedStoreSloppyArguments) \ |
| 151 V(LoadScriptContextField) \ |
| 152 V(StoreScriptContextField) \ |
153 V(StrictEqual) \ | 153 V(StrictEqual) \ |
154 V(StrictNotEqual) \ | 154 V(StrictNotEqual) \ |
155 V(StringEqual) \ | 155 V(StringEqual) \ |
156 V(StringNotEqual) \ | 156 V(StringNotEqual) \ |
157 V(StringLessThan) \ | 157 V(StringLessThan) \ |
158 V(StringLessThanOrEqual) \ | 158 V(StringLessThanOrEqual) \ |
159 V(StringGreaterThan) \ | 159 V(StringGreaterThan) \ |
160 V(StringGreaterThanOrEqual) \ | 160 V(StringGreaterThanOrEqual) \ |
161 V(ToInteger) \ | 161 V(ToInteger) \ |
162 V(ToLength) \ | 162 V(ToLength) \ |
(...skipping 2512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2675 public BitField<int, 2 * kBitsPerRegisterNumber + 1, 3> {}; // NOLINT | 2675 public BitField<int, 2 * kBitsPerRegisterNumber + 1, 3> {}; // NOLINT |
2676 class SkipFastPathBits: | 2676 class SkipFastPathBits: |
2677 public BitField<int, 2 * kBitsPerRegisterNumber + 4, 1> {}; // NOLINT | 2677 public BitField<int, 2 * kBitsPerRegisterNumber + 4, 1> {}; // NOLINT |
2678 class SSE3Bits: | 2678 class SSE3Bits: |
2679 public BitField<int, 2 * kBitsPerRegisterNumber + 5, 1> {}; // NOLINT | 2679 public BitField<int, 2 * kBitsPerRegisterNumber + 5, 1> {}; // NOLINT |
2680 | 2680 |
2681 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 2681 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
2682 DEFINE_PLATFORM_CODE_STUB(DoubleToI, PlatformCodeStub); | 2682 DEFINE_PLATFORM_CODE_STUB(DoubleToI, PlatformCodeStub); |
2683 }; | 2683 }; |
2684 | 2684 |
2685 | 2685 class ScriptContextFieldStub : public TurboFanCodeStub { |
2686 class ScriptContextFieldStub : public HandlerStub { | |
2687 public: | 2686 public: |
2688 ScriptContextFieldStub(Isolate* isolate, | 2687 ScriptContextFieldStub(Isolate* isolate, |
2689 const ScriptContextTable::LookupResult* lookup_result) | 2688 const ScriptContextTable::LookupResult* lookup_result) |
2690 : HandlerStub(isolate) { | 2689 : TurboFanCodeStub(isolate) { |
2691 DCHECK(Accepted(lookup_result)); | 2690 DCHECK(Accepted(lookup_result)); |
2692 STATIC_ASSERT(kContextIndexBits + kSlotIndexBits <= kSubMinorKeyBits); | 2691 minor_key_ = ContextIndexBits::encode(lookup_result->context_index) | |
2693 set_sub_minor_key(ContextIndexBits::encode(lookup_result->context_index) | | 2692 SlotIndexBits::encode(lookup_result->slot_index); |
2694 SlotIndexBits::encode(lookup_result->slot_index)); | |
2695 } | 2693 } |
2696 | 2694 |
2697 int context_index() const { | 2695 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
2698 return ContextIndexBits::decode(sub_minor_key()); | |
2699 } | |
2700 | 2696 |
2701 int slot_index() const { return SlotIndexBits::decode(sub_minor_key()); } | 2697 int context_index() const { return ContextIndexBits::decode(minor_key_); } |
| 2698 |
| 2699 int slot_index() const { return SlotIndexBits::decode(minor_key_); } |
2702 | 2700 |
2703 static bool Accepted(const ScriptContextTable::LookupResult* lookup_result) { | 2701 static bool Accepted(const ScriptContextTable::LookupResult* lookup_result) { |
2704 return ContextIndexBits::is_valid(lookup_result->context_index) && | 2702 return ContextIndexBits::is_valid(lookup_result->context_index) && |
2705 SlotIndexBits::is_valid(lookup_result->slot_index); | 2703 SlotIndexBits::is_valid(lookup_result->slot_index); |
2706 } | 2704 } |
2707 | 2705 |
2708 private: | 2706 private: |
2709 static const int kContextIndexBits = 9; | 2707 static const int kContextIndexBits = 9; |
2710 static const int kSlotIndexBits = 12; | 2708 static const int kSlotIndexBits = 12; |
2711 class ContextIndexBits : public BitField<int, 0, kContextIndexBits> {}; | 2709 class ContextIndexBits : public BitField<int, 0, kContextIndexBits> {}; |
2712 class SlotIndexBits | 2710 class SlotIndexBits |
2713 : public BitField<int, kContextIndexBits, kSlotIndexBits> {}; | 2711 : public BitField<int, kContextIndexBits, kSlotIndexBits> {}; |
2714 | 2712 |
2715 DEFINE_CODE_STUB_BASE(ScriptContextFieldStub, HandlerStub); | 2713 DEFINE_CODE_STUB_BASE(ScriptContextFieldStub, TurboFanCodeStub); |
2716 }; | 2714 }; |
2717 | 2715 |
2718 | 2716 |
2719 class LoadScriptContextFieldStub : public ScriptContextFieldStub { | 2717 class LoadScriptContextFieldStub : public ScriptContextFieldStub { |
2720 public: | 2718 public: |
2721 LoadScriptContextFieldStub( | 2719 LoadScriptContextFieldStub( |
2722 Isolate* isolate, const ScriptContextTable::LookupResult* lookup_result) | 2720 Isolate* isolate, const ScriptContextTable::LookupResult* lookup_result) |
2723 : ScriptContextFieldStub(isolate, lookup_result) {} | 2721 : ScriptContextFieldStub(isolate, lookup_result) {} |
2724 | 2722 |
| 2723 ExtraICState GetExtraICState() const override { return Code::LOAD_IC; } |
| 2724 |
2725 private: | 2725 private: |
2726 Code::Kind kind() const override { return Code::LOAD_IC; } | |
2727 | |
2728 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2726 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
2729 DEFINE_HANDLER_CODE_STUB(LoadScriptContextField, ScriptContextFieldStub); | 2727 DEFINE_TURBOFAN_CODE_STUB(LoadScriptContextField, ScriptContextFieldStub); |
2730 }; | 2728 }; |
2731 | 2729 |
2732 | 2730 |
2733 class StoreScriptContextFieldStub : public ScriptContextFieldStub { | 2731 class StoreScriptContextFieldStub : public ScriptContextFieldStub { |
2734 public: | 2732 public: |
2735 StoreScriptContextFieldStub( | 2733 StoreScriptContextFieldStub( |
2736 Isolate* isolate, const ScriptContextTable::LookupResult* lookup_result) | 2734 Isolate* isolate, const ScriptContextTable::LookupResult* lookup_result) |
2737 : ScriptContextFieldStub(isolate, lookup_result) {} | 2735 : ScriptContextFieldStub(isolate, lookup_result) {} |
2738 | 2736 |
| 2737 ExtraICState GetExtraICState() const override { return Code::STORE_IC; } |
| 2738 |
2739 private: | 2739 private: |
2740 Code::Kind kind() const override { return Code::STORE_IC; } | |
2741 | |
2742 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 2740 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
2743 DEFINE_HANDLER_CODE_STUB(StoreScriptContextField, ScriptContextFieldStub); | 2741 DEFINE_TURBOFAN_CODE_STUB(StoreScriptContextField, ScriptContextFieldStub); |
2744 }; | 2742 }; |
2745 | 2743 |
2746 | 2744 |
2747 class LoadFastElementStub : public HandlerStub { | 2745 class LoadFastElementStub : public HandlerStub { |
2748 public: | 2746 public: |
2749 LoadFastElementStub(Isolate* isolate, bool is_js_array, | 2747 LoadFastElementStub(Isolate* isolate, bool is_js_array, |
2750 ElementsKind elements_kind, | 2748 ElementsKind elements_kind, |
2751 bool convert_hole_to_undefined = false) | 2749 bool convert_hole_to_undefined = false) |
2752 : HandlerStub(isolate) { | 2750 : HandlerStub(isolate) { |
2753 set_sub_minor_key( | 2751 set_sub_minor_key( |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3208 #undef DEFINE_HYDROGEN_CODE_STUB | 3206 #undef DEFINE_HYDROGEN_CODE_STUB |
3209 #undef DEFINE_CODE_STUB | 3207 #undef DEFINE_CODE_STUB |
3210 #undef DEFINE_CODE_STUB_BASE | 3208 #undef DEFINE_CODE_STUB_BASE |
3211 | 3209 |
3212 extern Representation RepresentationFromMachineType(MachineType type); | 3210 extern Representation RepresentationFromMachineType(MachineType type); |
3213 | 3211 |
3214 } // namespace internal | 3212 } // namespace internal |
3215 } // namespace v8 | 3213 } // namespace v8 |
3216 | 3214 |
3217 #endif // V8_CODE_STUBS_H_ | 3215 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |