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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 V(NonNumberToNumber) \ | 50 V(NonNumberToNumber) \ |
51 V(StringToNumber) \ | 51 V(StringToNumber) \ |
52 V(ToString) \ | 52 V(ToString) \ |
53 V(ToName) \ | 53 V(ToName) \ |
54 V(ToObject) \ | 54 V(ToObject) \ |
55 V(VectorStoreICTrampoline) \ | 55 V(VectorStoreICTrampoline) \ |
56 V(VectorKeyedStoreICTrampoline) \ | 56 V(VectorKeyedStoreICTrampoline) \ |
57 V(VectorStoreIC) \ | 57 V(VectorStoreIC) \ |
58 V(VectorKeyedStoreIC) \ | 58 V(VectorKeyedStoreIC) \ |
59 /* HydrogenCodeStubs */ \ | 59 /* HydrogenCodeStubs */ \ |
60 V(Allocate) \ | |
61 V(ArrayNArgumentsConstructor) \ | 60 V(ArrayNArgumentsConstructor) \ |
62 V(ArrayNoArgumentConstructor) \ | 61 V(ArrayNoArgumentConstructor) \ |
63 V(ArraySingleArgumentConstructor) \ | 62 V(ArraySingleArgumentConstructor) \ |
64 V(BinaryOpIC) \ | 63 V(BinaryOpIC) \ |
65 V(BinaryOpWithAllocationSite) \ | 64 V(BinaryOpWithAllocationSite) \ |
66 V(CreateAllocationSite) \ | 65 V(CreateAllocationSite) \ |
67 V(CreateWeakCell) \ | 66 V(CreateWeakCell) \ |
68 V(ElementsTransitionAndStore) \ | 67 V(ElementsTransitionAndStore) \ |
69 V(FastArrayPush) \ | 68 V(FastArrayPush) \ |
70 V(FastCloneRegExp) \ | 69 V(FastCloneRegExp) \ |
(...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2743 \ | 2742 \ |
2744 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ | 2743 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ |
2745 void GenerateAssembly(CodeStubAssembler* assembler) const override; \ | 2744 void GenerateAssembly(CodeStubAssembler* assembler) const override; \ |
2746 \ | 2745 \ |
2747 DEFINE_CALL_INTERFACE_DESCRIPTOR(Allocate##Type); \ | 2746 DEFINE_CALL_INTERFACE_DESCRIPTOR(Allocate##Type); \ |
2748 DEFINE_CODE_STUB(Allocate##Type, TurboFanCodeStub); \ | 2747 DEFINE_CODE_STUB(Allocate##Type, TurboFanCodeStub); \ |
2749 }; | 2748 }; |
2750 SIMD128_TYPES(SIMD128_ALLOC_STUB) | 2749 SIMD128_TYPES(SIMD128_ALLOC_STUB) |
2751 #undef SIMD128_ALLOC_STUB | 2750 #undef SIMD128_ALLOC_STUB |
2752 | 2751 |
2753 class AllocateStub final : public HydrogenCodeStub { | |
2754 public: | |
2755 AllocateStub(Isolate* isolate, PretenureFlag pretenure_flag) | |
2756 : HydrogenCodeStub(isolate) { | |
2757 set_sub_minor_key(PretenureFlagBits::encode(pretenure_flag)); | |
2758 } | |
2759 | |
2760 PretenureFlag pretenure_flag() const { | |
2761 return PretenureFlagBits::decode(sub_minor_key()); | |
2762 } | |
2763 | |
2764 private: | |
2765 typedef BitField<PretenureFlag, 0, 1> PretenureFlagBits; | |
2766 DEFINE_CALL_INTERFACE_DESCRIPTOR(Allocate); | |
2767 DEFINE_HYDROGEN_CODE_STUB(Allocate, HydrogenCodeStub); | |
2768 }; | |
2769 | |
2770 class ArrayConstructorStubBase : public HydrogenCodeStub { | 2752 class ArrayConstructorStubBase : public HydrogenCodeStub { |
2771 public: | 2753 public: |
2772 ArrayConstructorStubBase(Isolate* isolate, | 2754 ArrayConstructorStubBase(Isolate* isolate, |
2773 ElementsKind kind, | 2755 ElementsKind kind, |
2774 AllocationSiteOverrideMode override_mode) | 2756 AllocationSiteOverrideMode override_mode) |
2775 : HydrogenCodeStub(isolate) { | 2757 : HydrogenCodeStub(isolate) { |
2776 // It only makes sense to override local allocation site behavior | 2758 // It only makes sense to override local allocation site behavior |
2777 // if there is a difference between the global allocation site policy | 2759 // if there is a difference between the global allocation site policy |
2778 // for an ElementsKind and the desired usage of the stub. | 2760 // for an ElementsKind and the desired usage of the stub. |
2779 DCHECK(override_mode != DISABLE_ALLOCATION_SITES || | 2761 DCHECK(override_mode != DISABLE_ALLOCATION_SITES || |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3194 #undef DEFINE_HYDROGEN_CODE_STUB | 3176 #undef DEFINE_HYDROGEN_CODE_STUB |
3195 #undef DEFINE_CODE_STUB | 3177 #undef DEFINE_CODE_STUB |
3196 #undef DEFINE_CODE_STUB_BASE | 3178 #undef DEFINE_CODE_STUB_BASE |
3197 | 3179 |
3198 extern Representation RepresentationFromType(Type* type); | 3180 extern Representation RepresentationFromType(Type* type); |
3199 | 3181 |
3200 } // namespace internal | 3182 } // namespace internal |
3201 } // namespace v8 | 3183 } // namespace v8 |
3202 | 3184 |
3203 #endif // V8_CODE_STUBS_H_ | 3185 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |