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 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 // Maximum number of properties in copied object. | 1139 // Maximum number of properties in copied object. |
1140 static const int kMaximumClonedProperties = 6; | 1140 static const int kMaximumClonedProperties = 6; |
1141 | 1141 |
1142 FastCloneShallowObjectStub(Isolate* isolate, int length) | 1142 FastCloneShallowObjectStub(Isolate* isolate, int length) |
1143 : TurboFanCodeStub(isolate) { | 1143 : TurboFanCodeStub(isolate) { |
1144 DCHECK_GE(length, 0); | 1144 DCHECK_GE(length, 0); |
1145 DCHECK_LE(length, kMaximumClonedProperties); | 1145 DCHECK_LE(length, kMaximumClonedProperties); |
1146 minor_key_ = LengthBits::encode(LengthBits::encode(length)); | 1146 minor_key_ = LengthBits::encode(LengthBits::encode(length)); |
1147 } | 1147 } |
1148 | 1148 |
| 1149 static compiler::Node* GenerateFastPath( |
| 1150 CodeStubAssembler* assembler, |
| 1151 compiler::CodeAssembler::Label* call_runtime, compiler::Node* closure, |
| 1152 compiler::Node* literals_index, compiler::Node* object_size); |
| 1153 |
| 1154 static bool IsSupported(ObjectLiteral* expr); |
| 1155 static int PropertiesCount(int literal_length); |
| 1156 |
1149 int length() const { return LengthBits::decode(minor_key_); } | 1157 int length() const { return LengthBits::decode(minor_key_); } |
1150 | 1158 |
1151 private: | 1159 private: |
1152 class LengthBits : public BitField<int, 0, 4> {}; | 1160 class LengthBits : public BitField<int, 0, 4> {}; |
1153 | 1161 |
1154 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowObject); | 1162 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowObject); |
1155 DEFINE_TURBOFAN_CODE_STUB(FastCloneShallowObject, TurboFanCodeStub); | 1163 DEFINE_TURBOFAN_CODE_STUB(FastCloneShallowObject, TurboFanCodeStub); |
1156 }; | 1164 }; |
1157 | 1165 |
1158 | 1166 |
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3206 #undef DEFINE_HYDROGEN_CODE_STUB | 3214 #undef DEFINE_HYDROGEN_CODE_STUB |
3207 #undef DEFINE_CODE_STUB | 3215 #undef DEFINE_CODE_STUB |
3208 #undef DEFINE_CODE_STUB_BASE | 3216 #undef DEFINE_CODE_STUB_BASE |
3209 | 3217 |
3210 extern Representation RepresentationFromType(Type* type); | 3218 extern Representation RepresentationFromType(Type* type); |
3211 | 3219 |
3212 } // namespace internal | 3220 } // namespace internal |
3213 } // namespace v8 | 3221 } // namespace v8 |
3214 | 3222 |
3215 #endif // V8_CODE_STUBS_H_ | 3223 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |