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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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(ElementsTransitionAndStore) \ | 70 V(ElementsTransitionAndStore) \ |
71 V(FastCloneShallowArray) \ | |
72 V(NumberToString) \ | 71 V(NumberToString) \ |
73 V(StringAdd) \ | 72 V(StringAdd) \ |
74 V(ToObject) \ | 73 V(ToObject) \ |
75 V(Typeof) \ | 74 V(Typeof) \ |
76 /* These builtins w/ JS linkage are */ \ | 75 /* These builtins w/ JS linkage are */ \ |
77 /* just fast-cases of C++ builtins. They */ \ | 76 /* just fast-cases of C++ builtins. They */ \ |
78 /* require varg support from TF */ \ | 77 /* require varg support from TF */ \ |
79 V(FastArrayPush) \ | 78 V(FastArrayPush) \ |
80 V(FastFunctionBind) \ | 79 V(FastFunctionBind) \ |
81 /* These will be ported/eliminated */ \ | 80 /* These will be ported/eliminated */ \ |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 V(ShiftRight) \ | 127 V(ShiftRight) \ |
129 V(ShiftRightLogical) \ | 128 V(ShiftRightLogical) \ |
130 V(ShiftLeft) \ | 129 V(ShiftLeft) \ |
131 V(BitwiseAnd) \ | 130 V(BitwiseAnd) \ |
132 V(BitwiseOr) \ | 131 V(BitwiseOr) \ |
133 V(BitwiseXor) \ | 132 V(BitwiseXor) \ |
134 V(Inc) \ | 133 V(Inc) \ |
135 V(InternalArrayNoArgumentConstructor) \ | 134 V(InternalArrayNoArgumentConstructor) \ |
136 V(InternalArraySingleArgumentConstructor) \ | 135 V(InternalArraySingleArgumentConstructor) \ |
137 V(Dec) \ | 136 V(Dec) \ |
137 V(FastCloneRegExp) \ | |
138 V(FastCloneShallowArray) \ | |
138 V(FastCloneShallowObject) \ | 139 V(FastCloneShallowObject) \ |
139 V(FastCloneRegExp) \ | |
140 V(FastNewClosure) \ | 140 V(FastNewClosure) \ |
141 V(FastNewFunctionContext) \ | 141 V(FastNewFunctionContext) \ |
142 V(InstanceOf) \ | 142 V(InstanceOf) \ |
143 V(LessThan) \ | 143 V(LessThan) \ |
144 V(LessThanOrEqual) \ | 144 V(LessThanOrEqual) \ |
145 V(GreaterThan) \ | 145 V(GreaterThan) \ |
146 V(GreaterThanOrEqual) \ | 146 V(GreaterThanOrEqual) \ |
147 V(Equal) \ | 147 V(Equal) \ |
148 V(NotEqual) \ | 148 V(NotEqual) \ |
149 V(KeyedLoadSloppyArguments) \ | 149 V(KeyedLoadSloppyArguments) \ |
(...skipping 1106 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( | |
1275 CodeStubAssembler* assembler, compiler::Node* closure, | |
1276 compiler::Node* literal_index, compiler::Node* constant_elements, | |
1277 compiler::Node* context, | |
1278 AllocationSiteMode allocation_site_mode = DONT_TRACK_ALLOCATION_SITE); | |
rmcilroy
2016/09/13 20:29:59
no need for the default parameter here
klaasb
2016/09/14 18:24:52
Done.
| |
1279 | |
1275 AllocationSiteMode allocation_site_mode() const { | 1280 AllocationSiteMode allocation_site_mode() const { |
1276 return AllocationSiteModeBits::decode(sub_minor_key()); | 1281 return AllocationSiteModeBits::decode(minor_key_); |
1277 } | 1282 } |
1278 | 1283 |
1279 private: | 1284 private: |
1280 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; | 1285 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; |
1281 | 1286 |
1287 static compiler::Node* NonEmptyShallowClone( | |
rmcilroy
2016/09/13 20:29:59
This should probably just be an anonymous namespac
klaasb
2016/09/14 18:24:52
Done.
| |
1288 CodeStubAssembler* assembler, compiler::Node* boilerplate, | |
1289 compiler::Node* boilerplate_map, compiler::Node* boilerplate_elements, | |
1290 compiler::Node* allocation_site, compiler::Node* capacity, | |
1291 ElementsKind kind); | |
1282 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowArray); | 1292 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowArray); |
1283 DEFINE_HYDROGEN_CODE_STUB(FastCloneShallowArray, HydrogenCodeStub); | 1293 DEFINE_TURBOFAN_CODE_STUB(FastCloneShallowArray, TurboFanCodeStub); |
1284 }; | 1294 }; |
1285 | 1295 |
1286 class FastCloneShallowObjectStub : public TurboFanCodeStub { | 1296 class FastCloneShallowObjectStub : public TurboFanCodeStub { |
1287 public: | 1297 public: |
1288 // Maximum number of properties in copied object. | 1298 // Maximum number of properties in copied object. |
1289 static const int kMaximumClonedProperties = 6; | 1299 static const int kMaximumClonedProperties = 6; |
1290 | 1300 |
1291 FastCloneShallowObjectStub(Isolate* isolate, int length) | 1301 FastCloneShallowObjectStub(Isolate* isolate, int length) |
1292 : TurboFanCodeStub(isolate) { | 1302 : TurboFanCodeStub(isolate) { |
1293 DCHECK_GE(length, 0); | 1303 DCHECK_GE(length, 0); |
(...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3206 #undef DEFINE_HYDROGEN_CODE_STUB | 3216 #undef DEFINE_HYDROGEN_CODE_STUB |
3207 #undef DEFINE_CODE_STUB | 3217 #undef DEFINE_CODE_STUB |
3208 #undef DEFINE_CODE_STUB_BASE | 3218 #undef DEFINE_CODE_STUB_BASE |
3209 | 3219 |
3210 extern Representation RepresentationFromMachineType(MachineType type); | 3220 extern Representation RepresentationFromMachineType(MachineType type); |
3211 | 3221 |
3212 } // namespace internal | 3222 } // namespace internal |
3213 } // namespace v8 | 3223 } // namespace v8 |
3214 | 3224 |
3215 #endif // V8_CODE_STUBS_H_ | 3225 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |