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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 /* These are only called from FCG */ \ | 60 /* These are only called from FCG */ \ |
61 /* They can be removed when only the TF */ \ | 61 /* They can be removed when only the TF */ \ |
62 /* version of the corresponding stub is */ \ | 62 /* version of the corresponding stub is */ \ |
63 /* used universally */ \ | 63 /* used universally */ \ |
64 V(CallICTrampoline) \ | 64 V(CallICTrampoline) \ |
65 V(LoadICTrampoline) \ | 65 V(LoadICTrampoline) \ |
66 V(KeyedLoadICTrampoline) \ | 66 V(KeyedLoadICTrampoline) \ |
67 V(KeyedStoreICTrampoline) \ | 67 V(KeyedStoreICTrampoline) \ |
68 V(StoreICTrampoline) \ | 68 V(StoreICTrampoline) \ |
69 /* --- HydrogenCodeStubs --- */ \ | 69 /* --- HydrogenCodeStubs --- */ \ |
70 V(FastCloneShallowArray) \ | |
71 V(NumberToString) \ | 70 V(NumberToString) \ |
72 V(StringAdd) \ | 71 V(StringAdd) \ |
73 V(ToObject) \ | 72 V(ToObject) \ |
74 V(Typeof) \ | 73 V(Typeof) \ |
75 /* These builtins w/ JS linkage are */ \ | 74 /* These builtins w/ JS linkage are */ \ |
76 /* just fast-cases of C++ builtins. They */ \ | 75 /* just fast-cases of C++ builtins. They */ \ |
77 /* require varg support from TF */ \ | 76 /* require varg support from TF */ \ |
78 V(FastArrayPush) \ | 77 V(FastArrayPush) \ |
79 V(FastFunctionBind) \ | 78 V(FastFunctionBind) \ |
80 /* These will be ported/eliminated */ \ | 79 /* These will be ported/eliminated */ \ |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 V(ShiftRightLogical) \ | 125 V(ShiftRightLogical) \ |
127 V(ShiftLeft) \ | 126 V(ShiftLeft) \ |
128 V(BitwiseAnd) \ | 127 V(BitwiseAnd) \ |
129 V(BitwiseOr) \ | 128 V(BitwiseOr) \ |
130 V(BitwiseXor) \ | 129 V(BitwiseXor) \ |
131 V(Inc) \ | 130 V(Inc) \ |
132 V(InternalArrayNoArgumentConstructor) \ | 131 V(InternalArrayNoArgumentConstructor) \ |
133 V(InternalArraySingleArgumentConstructor) \ | 132 V(InternalArraySingleArgumentConstructor) \ |
134 V(Dec) \ | 133 V(Dec) \ |
135 V(ElementsTransitionAndStore) \ | 134 V(ElementsTransitionAndStore) \ |
| 135 V(FastCloneRegExp) \ |
| 136 V(FastCloneShallowArray) \ |
136 V(FastCloneShallowObject) \ | 137 V(FastCloneShallowObject) \ |
137 V(FastCloneRegExp) \ | |
138 V(FastNewClosure) \ | 138 V(FastNewClosure) \ |
139 V(FastNewFunctionContext) \ | 139 V(FastNewFunctionContext) \ |
140 V(InstanceOf) \ | 140 V(InstanceOf) \ |
141 V(LessThan) \ | 141 V(LessThan) \ |
142 V(LessThanOrEqual) \ | 142 V(LessThanOrEqual) \ |
143 V(GreaterThan) \ | 143 V(GreaterThan) \ |
144 V(GreaterThanOrEqual) \ | 144 V(GreaterThanOrEqual) \ |
145 V(Equal) \ | 145 V(Equal) \ |
146 V(NotEqual) \ | 146 V(NotEqual) \ |
147 V(KeyedLoadSloppyArguments) \ | 147 V(KeyedLoadSloppyArguments) \ |
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 compiler::Node* literal_index, | 1256 compiler::Node* literal_index, |
1257 compiler::Node* pattern, | 1257 compiler::Node* pattern, |
1258 compiler::Node* flags, | 1258 compiler::Node* flags, |
1259 compiler::Node* context); | 1259 compiler::Node* context); |
1260 | 1260 |
1261 private: | 1261 private: |
1262 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneRegExp); | 1262 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneRegExp); |
1263 DEFINE_TURBOFAN_CODE_STUB(FastCloneRegExp, TurboFanCodeStub); | 1263 DEFINE_TURBOFAN_CODE_STUB(FastCloneRegExp, TurboFanCodeStub); |
1264 }; | 1264 }; |
1265 | 1265 |
1266 | 1266 class FastCloneShallowArrayStub : public TurboFanCodeStub { |
1267 class FastCloneShallowArrayStub : public HydrogenCodeStub { | |
1268 public: | 1267 public: |
1269 FastCloneShallowArrayStub(Isolate* isolate, | 1268 FastCloneShallowArrayStub(Isolate* isolate, |
1270 AllocationSiteMode allocation_site_mode) | 1269 AllocationSiteMode allocation_site_mode) |
1271 : HydrogenCodeStub(isolate) { | 1270 : TurboFanCodeStub(isolate) { |
1272 set_sub_minor_key(AllocationSiteModeBits::encode(allocation_site_mode)); | 1271 minor_key_ = AllocationSiteModeBits::encode(allocation_site_mode); |
1273 } | 1272 } |
1274 | 1273 |
| 1274 static compiler::Node* Generate(CodeStubAssembler* assembler, |
| 1275 compiler::Node* closure, |
| 1276 compiler::Node* literal_index, |
| 1277 compiler::Node* constant_elements, |
| 1278 compiler::Node* context, |
| 1279 AllocationSiteMode allocation_site_mode); |
| 1280 |
1275 AllocationSiteMode allocation_site_mode() const { | 1281 AllocationSiteMode allocation_site_mode() const { |
1276 return AllocationSiteModeBits::decode(sub_minor_key()); | 1282 return AllocationSiteModeBits::decode(minor_key_); |
1277 } | 1283 } |
1278 | 1284 |
1279 private: | 1285 private: |
1280 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; | 1286 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; |
1281 | 1287 |
1282 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowArray); | 1288 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowArray); |
1283 DEFINE_HYDROGEN_CODE_STUB(FastCloneShallowArray, HydrogenCodeStub); | 1289 DEFINE_TURBOFAN_CODE_STUB(FastCloneShallowArray, TurboFanCodeStub); |
1284 }; | 1290 }; |
1285 | 1291 |
1286 class FastCloneShallowObjectStub : public TurboFanCodeStub { | 1292 class FastCloneShallowObjectStub : public TurboFanCodeStub { |
1287 public: | 1293 public: |
1288 // Maximum number of properties in copied object. | 1294 // Maximum number of properties in copied object. |
1289 static const int kMaximumClonedProperties = 6; | 1295 static const int kMaximumClonedProperties = 6; |
1290 | 1296 |
1291 FastCloneShallowObjectStub(Isolate* isolate, int length) | 1297 FastCloneShallowObjectStub(Isolate* isolate, int length) |
1292 : TurboFanCodeStub(isolate) { | 1298 : TurboFanCodeStub(isolate) { |
1293 DCHECK_GE(length, 0); | 1299 DCHECK_GE(length, 0); |
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3146 #undef DEFINE_HYDROGEN_CODE_STUB | 3152 #undef DEFINE_HYDROGEN_CODE_STUB |
3147 #undef DEFINE_CODE_STUB | 3153 #undef DEFINE_CODE_STUB |
3148 #undef DEFINE_CODE_STUB_BASE | 3154 #undef DEFINE_CODE_STUB_BASE |
3149 | 3155 |
3150 extern Representation RepresentationFromMachineType(MachineType type); | 3156 extern Representation RepresentationFromMachineType(MachineType type); |
3151 | 3157 |
3152 } // namespace internal | 3158 } // namespace internal |
3153 } // namespace v8 | 3159 } // namespace v8 |
3154 | 3160 |
3155 #endif // V8_CODE_STUBS_H_ | 3161 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |