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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 V(ArrayNoArgumentConstructor) \ | 63 V(ArrayNoArgumentConstructor) \ |
64 V(ArraySingleArgumentConstructor) \ | 64 V(ArraySingleArgumentConstructor) \ |
65 V(BinaryOpIC) \ | 65 V(BinaryOpIC) \ |
66 V(BinaryOpWithAllocationSite) \ | 66 V(BinaryOpWithAllocationSite) \ |
67 V(CreateAllocationSite) \ | 67 V(CreateAllocationSite) \ |
68 V(CreateWeakCell) \ | 68 V(CreateWeakCell) \ |
69 V(ElementsTransitionAndStore) \ | 69 V(ElementsTransitionAndStore) \ |
70 V(FastArrayPush) \ | 70 V(FastArrayPush) \ |
71 V(FastCloneRegExp) \ | 71 V(FastCloneRegExp) \ |
72 V(FastCloneShallowArray) \ | 72 V(FastCloneShallowArray) \ |
| 73 V(FastCloneShallowObject) \ |
73 V(FastNewClosure) \ | 74 V(FastNewClosure) \ |
74 V(FastNewContext) \ | 75 V(FastNewContext) \ |
75 V(FastNewObject) \ | 76 V(FastNewObject) \ |
76 V(FastNewRestParameter) \ | 77 V(FastNewRestParameter) \ |
77 V(FastNewSloppyArguments) \ | 78 V(FastNewSloppyArguments) \ |
78 V(FastNewStrictArguments) \ | 79 V(FastNewStrictArguments) \ |
79 V(GrowArrayElements) \ | 80 V(GrowArrayElements) \ |
80 V(InternalArrayNArgumentsConstructor) \ | 81 V(InternalArrayNArgumentsConstructor) \ |
81 V(InternalArrayNoArgumentConstructor) \ | 82 V(InternalArrayNoArgumentConstructor) \ |
82 V(InternalArraySingleArgumentConstructor) \ | 83 V(InternalArraySingleArgumentConstructor) \ |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 V(Subtract) \ | 115 V(Subtract) \ |
115 V(Multiply) \ | 116 V(Multiply) \ |
116 V(Divide) \ | 117 V(Divide) \ |
117 V(Modulus) \ | 118 V(Modulus) \ |
118 V(ShiftRight) \ | 119 V(ShiftRight) \ |
119 V(ShiftRightLogical) \ | 120 V(ShiftRightLogical) \ |
120 V(ShiftLeft) \ | 121 V(ShiftLeft) \ |
121 V(BitwiseAnd) \ | 122 V(BitwiseAnd) \ |
122 V(BitwiseOr) \ | 123 V(BitwiseOr) \ |
123 V(BitwiseXor) \ | 124 V(BitwiseXor) \ |
124 V(FastCloneShallowObject) \ | |
125 V(LessThan) \ | 125 V(LessThan) \ |
126 V(LessThanOrEqual) \ | 126 V(LessThanOrEqual) \ |
127 V(GreaterThan) \ | 127 V(GreaterThan) \ |
128 V(GreaterThanOrEqual) \ | 128 V(GreaterThanOrEqual) \ |
129 V(Equal) \ | 129 V(Equal) \ |
130 V(NotEqual) \ | 130 V(NotEqual) \ |
131 V(StrictEqual) \ | 131 V(StrictEqual) \ |
132 V(StrictNotEqual) \ | 132 V(StrictNotEqual) \ |
133 V(StringEqual) \ | 133 V(StringEqual) \ |
134 V(StringNotEqual) \ | 134 V(StringNotEqual) \ |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 return AllocationSiteModeBits::decode(sub_minor_key()); | 1099 return AllocationSiteModeBits::decode(sub_minor_key()); |
1100 } | 1100 } |
1101 | 1101 |
1102 private: | 1102 private: |
1103 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; | 1103 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; |
1104 | 1104 |
1105 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowArray); | 1105 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowArray); |
1106 DEFINE_HYDROGEN_CODE_STUB(FastCloneShallowArray, HydrogenCodeStub); | 1106 DEFINE_HYDROGEN_CODE_STUB(FastCloneShallowArray, HydrogenCodeStub); |
1107 }; | 1107 }; |
1108 | 1108 |
1109 class FastCloneShallowObjectStub : public TurboFanCodeStub { | 1109 |
| 1110 class FastCloneShallowObjectStub : public HydrogenCodeStub { |
1110 public: | 1111 public: |
1111 // Maximum number of properties in copied object. | 1112 // Maximum number of properties in copied object. |
1112 static const int kMaximumClonedProperties = 6; | 1113 static const int kMaximumClonedProperties = 6; |
1113 | 1114 |
1114 FastCloneShallowObjectStub(Isolate* isolate, int length) | 1115 FastCloneShallowObjectStub(Isolate* isolate, int length) |
1115 : TurboFanCodeStub(isolate) { | 1116 : HydrogenCodeStub(isolate) { |
1116 DCHECK_GE(length, 0); | 1117 DCHECK_GE(length, 0); |
1117 DCHECK_LE(length, kMaximumClonedProperties); | 1118 DCHECK_LE(length, kMaximumClonedProperties); |
1118 minor_key_ = LengthBits::encode(LengthBits::encode(length)); | 1119 set_sub_minor_key(LengthBits::encode(length)); |
1119 } | 1120 } |
1120 | 1121 |
1121 int length() const { return LengthBits::decode(minor_key_); } | 1122 int length() const { return LengthBits::decode(sub_minor_key()); } |
1122 | 1123 |
1123 private: | 1124 private: |
1124 class LengthBits : public BitField<int, 0, 4> {}; | 1125 class LengthBits : public BitField<int, 0, 4> {}; |
1125 | 1126 |
1126 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowObject); | 1127 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowObject); |
1127 DEFINE_TURBOFAN_CODE_STUB(FastCloneShallowObject, TurboFanCodeStub); | 1128 DEFINE_HYDROGEN_CODE_STUB(FastCloneShallowObject, HydrogenCodeStub); |
1128 }; | 1129 }; |
1129 | 1130 |
1130 | 1131 |
1131 class CreateAllocationSiteStub : public HydrogenCodeStub { | 1132 class CreateAllocationSiteStub : public HydrogenCodeStub { |
1132 public: | 1133 public: |
1133 explicit CreateAllocationSiteStub(Isolate* isolate) | 1134 explicit CreateAllocationSiteStub(Isolate* isolate) |
1134 : HydrogenCodeStub(isolate) { } | 1135 : HydrogenCodeStub(isolate) { } |
1135 | 1136 |
1136 static void GenerateAheadOfTime(Isolate* isolate); | 1137 static void GenerateAheadOfTime(Isolate* isolate); |
1137 | 1138 |
(...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3163 #undef DEFINE_HYDROGEN_CODE_STUB | 3164 #undef DEFINE_HYDROGEN_CODE_STUB |
3164 #undef DEFINE_CODE_STUB | 3165 #undef DEFINE_CODE_STUB |
3165 #undef DEFINE_CODE_STUB_BASE | 3166 #undef DEFINE_CODE_STUB_BASE |
3166 | 3167 |
3167 extern Representation RepresentationFromType(Type* type); | 3168 extern Representation RepresentationFromType(Type* type); |
3168 | 3169 |
3169 } // namespace internal | 3170 } // namespace internal |
3170 } // namespace v8 | 3171 } // namespace v8 |
3171 | 3172 |
3172 #endif // V8_CODE_STUBS_H_ | 3173 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |