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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) \ |
71 V(FastCloneShallowArray) \ | 71 V(FastCloneShallowArray) \ |
| 72 V(FastCloneShallowObject) \ |
72 V(FastNewClosure) \ | 73 V(FastNewClosure) \ |
73 V(FastNewContext) \ | 74 V(FastNewContext) \ |
74 V(FastNewObject) \ | 75 V(FastNewObject) \ |
75 V(FastNewRestParameter) \ | 76 V(FastNewRestParameter) \ |
76 V(FastNewSloppyArguments) \ | 77 V(FastNewSloppyArguments) \ |
77 V(FastNewStrictArguments) \ | 78 V(FastNewStrictArguments) \ |
78 V(GrowArrayElements) \ | 79 V(GrowArrayElements) \ |
79 V(InternalArrayNArgumentsConstructor) \ | 80 V(InternalArrayNArgumentsConstructor) \ |
80 V(InternalArrayNoArgumentConstructor) \ | 81 V(InternalArrayNoArgumentConstructor) \ |
81 V(InternalArraySingleArgumentConstructor) \ | 82 V(InternalArraySingleArgumentConstructor) \ |
(...skipping 25 matching lines...) Expand all Loading... |
107 V(AllocateBool16x8) \ | 108 V(AllocateBool16x8) \ |
108 V(AllocateInt8x16) \ | 109 V(AllocateInt8x16) \ |
109 V(AllocateUint8x16) \ | 110 V(AllocateUint8x16) \ |
110 V(AllocateBool8x16) \ | 111 V(AllocateBool8x16) \ |
111 V(StringLength) \ | 112 V(StringLength) \ |
112 V(Add) \ | 113 V(Add) \ |
113 V(Subtract) \ | 114 V(Subtract) \ |
114 V(BitwiseAnd) \ | 115 V(BitwiseAnd) \ |
115 V(BitwiseOr) \ | 116 V(BitwiseOr) \ |
116 V(BitwiseXor) \ | 117 V(BitwiseXor) \ |
117 V(FastCloneShallowObject) \ | |
118 V(LessThan) \ | 118 V(LessThan) \ |
119 V(LessThanOrEqual) \ | 119 V(LessThanOrEqual) \ |
120 V(GreaterThan) \ | 120 V(GreaterThan) \ |
121 V(GreaterThanOrEqual) \ | 121 V(GreaterThanOrEqual) \ |
122 V(Equal) \ | 122 V(Equal) \ |
123 V(NotEqual) \ | 123 V(NotEqual) \ |
124 V(StrictEqual) \ | 124 V(StrictEqual) \ |
125 V(StrictNotEqual) \ | 125 V(StrictNotEqual) \ |
126 V(StringEqual) \ | 126 V(StringEqual) \ |
127 V(StringNotEqual) \ | 127 V(StringNotEqual) \ |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 return AllocationSiteModeBits::decode(sub_minor_key()); | 1042 return AllocationSiteModeBits::decode(sub_minor_key()); |
1043 } | 1043 } |
1044 | 1044 |
1045 private: | 1045 private: |
1046 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; | 1046 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; |
1047 | 1047 |
1048 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowArray); | 1048 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowArray); |
1049 DEFINE_HYDROGEN_CODE_STUB(FastCloneShallowArray, HydrogenCodeStub); | 1049 DEFINE_HYDROGEN_CODE_STUB(FastCloneShallowArray, HydrogenCodeStub); |
1050 }; | 1050 }; |
1051 | 1051 |
1052 class FastCloneShallowObjectStub : public TurboFanCodeStub { | 1052 |
| 1053 class FastCloneShallowObjectStub : public HydrogenCodeStub { |
1053 public: | 1054 public: |
1054 // Maximum number of properties in copied object. | 1055 // Maximum number of properties in copied object. |
1055 static const int kMaximumClonedProperties = 6; | 1056 static const int kMaximumClonedProperties = 6; |
1056 | 1057 |
1057 FastCloneShallowObjectStub(Isolate* isolate, int length) | 1058 FastCloneShallowObjectStub(Isolate* isolate, int length) |
1058 : TurboFanCodeStub(isolate) { | 1059 : HydrogenCodeStub(isolate) { |
1059 DCHECK_GE(length, 0); | 1060 DCHECK_GE(length, 0); |
1060 DCHECK_LE(length, kMaximumClonedProperties); | 1061 DCHECK_LE(length, kMaximumClonedProperties); |
1061 minor_key_ = LengthBits::encode(LengthBits::encode(length)); | 1062 set_sub_minor_key(LengthBits::encode(length)); |
1062 } | 1063 } |
1063 | 1064 |
1064 int length() const { return LengthBits::decode(minor_key_); } | 1065 int length() const { return LengthBits::decode(sub_minor_key()); } |
1065 | 1066 |
1066 private: | 1067 private: |
1067 class LengthBits : public BitField<int, 0, 4> {}; | 1068 class LengthBits : public BitField<int, 0, 4> {}; |
1068 | 1069 |
1069 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowObject); | 1070 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowObject); |
1070 DEFINE_TURBOFAN_CODE_STUB(FastCloneShallowObject, TurboFanCodeStub); | 1071 DEFINE_HYDROGEN_CODE_STUB(FastCloneShallowObject, HydrogenCodeStub); |
1071 }; | 1072 }; |
1072 | 1073 |
1073 | 1074 |
1074 class CreateAllocationSiteStub : public HydrogenCodeStub { | 1075 class CreateAllocationSiteStub : public HydrogenCodeStub { |
1075 public: | 1076 public: |
1076 explicit CreateAllocationSiteStub(Isolate* isolate) | 1077 explicit CreateAllocationSiteStub(Isolate* isolate) |
1077 : HydrogenCodeStub(isolate) { } | 1078 : HydrogenCodeStub(isolate) { } |
1078 | 1079 |
1079 static void GenerateAheadOfTime(Isolate* isolate); | 1080 static void GenerateAheadOfTime(Isolate* isolate); |
1080 | 1081 |
(...skipping 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3102 #undef DEFINE_HYDROGEN_CODE_STUB | 3103 #undef DEFINE_HYDROGEN_CODE_STUB |
3103 #undef DEFINE_CODE_STUB | 3104 #undef DEFINE_CODE_STUB |
3104 #undef DEFINE_CODE_STUB_BASE | 3105 #undef DEFINE_CODE_STUB_BASE |
3105 | 3106 |
3106 extern Representation RepresentationFromType(Type* type); | 3107 extern Representation RepresentationFromType(Type* type); |
3107 | 3108 |
3108 } // namespace internal | 3109 } // namespace internal |
3109 } // namespace v8 | 3110 } // namespace v8 |
3110 | 3111 |
3111 #endif // V8_CODE_STUBS_H_ | 3112 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |