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 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(AllocateInNewSpace) \ | 60 V(Allocate) \ |
61 V(ArrayNArgumentsConstructor) \ | 61 V(ArrayNArgumentsConstructor) \ |
62 V(ArrayNoArgumentConstructor) \ | 62 V(ArrayNoArgumentConstructor) \ |
63 V(ArraySingleArgumentConstructor) \ | 63 V(ArraySingleArgumentConstructor) \ |
64 V(BinaryOpIC) \ | 64 V(BinaryOpIC) \ |
65 V(BinaryOpWithAllocationSite) \ | 65 V(BinaryOpWithAllocationSite) \ |
66 V(CreateAllocationSite) \ | 66 V(CreateAllocationSite) \ |
67 V(CreateWeakCell) \ | 67 V(CreateWeakCell) \ |
68 V(ElementsTransitionAndStore) \ | 68 V(ElementsTransitionAndStore) \ |
69 V(FastArrayPush) \ | 69 V(FastArrayPush) \ |
70 V(FastCloneRegExp) \ | 70 V(FastCloneRegExp) \ |
(...skipping 2605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2676 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ | 2676 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ |
2677 void GenerateAssembly( \ | 2677 void GenerateAssembly( \ |
2678 compiler::CodeStubAssembler* assembler) const override; \ | 2678 compiler::CodeStubAssembler* assembler) const override; \ |
2679 \ | 2679 \ |
2680 DEFINE_CALL_INTERFACE_DESCRIPTOR(Allocate##Type); \ | 2680 DEFINE_CALL_INTERFACE_DESCRIPTOR(Allocate##Type); \ |
2681 DEFINE_CODE_STUB(Allocate##Type, TurboFanCodeStub); \ | 2681 DEFINE_CODE_STUB(Allocate##Type, TurboFanCodeStub); \ |
2682 }; | 2682 }; |
2683 SIMD128_TYPES(SIMD128_ALLOC_STUB) | 2683 SIMD128_TYPES(SIMD128_ALLOC_STUB) |
2684 #undef SIMD128_ALLOC_STUB | 2684 #undef SIMD128_ALLOC_STUB |
2685 | 2685 |
2686 class AllocateInNewSpaceStub final : public HydrogenCodeStub { | 2686 class AllocateStub final : public HydrogenCodeStub { |
2687 public: | 2687 public: |
2688 explicit AllocateInNewSpaceStub(Isolate* isolate) | 2688 AllocateStub(Isolate* isolate, PretenureFlag pretenure_flag) |
2689 : HydrogenCodeStub(isolate) {} | 2689 : HydrogenCodeStub(isolate) { |
| 2690 set_sub_minor_key(PretenureFlagBits::encode(pretenure_flag)); |
| 2691 } |
| 2692 |
| 2693 PretenureFlag pretenure_flag() const { |
| 2694 return PretenureFlagBits::decode(sub_minor_key()); |
| 2695 } |
2690 | 2696 |
2691 private: | 2697 private: |
2692 DEFINE_CALL_INTERFACE_DESCRIPTOR(AllocateInNewSpace); | 2698 typedef BitField<PretenureFlag, 0, 1> PretenureFlagBits; |
2693 DEFINE_HYDROGEN_CODE_STUB(AllocateInNewSpace, HydrogenCodeStub); | 2699 DEFINE_CALL_INTERFACE_DESCRIPTOR(Allocate); |
| 2700 DEFINE_HYDROGEN_CODE_STUB(Allocate, HydrogenCodeStub); |
2694 }; | 2701 }; |
2695 | 2702 |
2696 | |
2697 class ArrayConstructorStubBase : public HydrogenCodeStub { | 2703 class ArrayConstructorStubBase : public HydrogenCodeStub { |
2698 public: | 2704 public: |
2699 ArrayConstructorStubBase(Isolate* isolate, | 2705 ArrayConstructorStubBase(Isolate* isolate, |
2700 ElementsKind kind, | 2706 ElementsKind kind, |
2701 AllocationSiteOverrideMode override_mode) | 2707 AllocationSiteOverrideMode override_mode) |
2702 : HydrogenCodeStub(isolate) { | 2708 : HydrogenCodeStub(isolate) { |
2703 // It only makes sense to override local allocation site behavior | 2709 // It only makes sense to override local allocation site behavior |
2704 // if there is a difference between the global allocation site policy | 2710 // if there is a difference between the global allocation site policy |
2705 // for an ElementsKind and the desired usage of the stub. | 2711 // for an ElementsKind and the desired usage of the stub. |
2706 DCHECK(override_mode != DISABLE_ALLOCATION_SITES || | 2712 DCHECK(override_mode != DISABLE_ALLOCATION_SITES || |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3121 #undef DEFINE_HYDROGEN_CODE_STUB | 3127 #undef DEFINE_HYDROGEN_CODE_STUB |
3122 #undef DEFINE_CODE_STUB | 3128 #undef DEFINE_CODE_STUB |
3123 #undef DEFINE_CODE_STUB_BASE | 3129 #undef DEFINE_CODE_STUB_BASE |
3124 | 3130 |
3125 extern Representation RepresentationFromType(Type* type); | 3131 extern Representation RepresentationFromType(Type* type); |
3126 | 3132 |
3127 } // namespace internal | 3133 } // namespace internal |
3128 } // namespace v8 | 3134 } // namespace v8 |
3129 | 3135 |
3130 #endif // V8_CODE_STUBS_H_ | 3136 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |