Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_STUB_ASSEMBLER_H_ | 5 #ifndef V8_CODE_STUB_ASSEMBLER_H_ |
| 6 #define V8_CODE_STUB_ASSEMBLER_H_ | 6 #define V8_CODE_STUB_ASSEMBLER_H_ |
| 7 | 7 |
| 8 #include <functional> | 8 #include <functional> |
| 9 | 9 |
| 10 #include "src/compiler/code-assembler.h" | 10 #include "src/compiler/code-assembler.h" |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1101 | 1101 |
| 1102 compiler::Node* Typeof(compiler::Node* value, compiler::Node* context); | 1102 compiler::Node* Typeof(compiler::Node* value, compiler::Node* context); |
| 1103 | 1103 |
| 1104 compiler::Node* InstanceOf(compiler::Node* object, compiler::Node* callable, | 1104 compiler::Node* InstanceOf(compiler::Node* object, compiler::Node* callable, |
| 1105 compiler::Node* context); | 1105 compiler::Node* context); |
| 1106 | 1106 |
| 1107 // TypedArray/ArrayBuffer helpers | 1107 // TypedArray/ArrayBuffer helpers |
| 1108 compiler::Node* IsDetachedBuffer(compiler::Node* buffer); | 1108 compiler::Node* IsDetachedBuffer(compiler::Node* buffer); |
| 1109 | 1109 |
| 1110 private: | 1110 private: |
| 1111 friend class CodeStubArguments; | |
| 1112 | |
| 1111 enum ElementSupport { kOnlyProperties, kSupportElements }; | 1113 enum ElementSupport { kOnlyProperties, kSupportElements }; |
| 1112 | 1114 |
| 1113 void DescriptorLookupLinear(compiler::Node* unique_name, | 1115 void DescriptorLookupLinear(compiler::Node* unique_name, |
| 1114 compiler::Node* descriptors, compiler::Node* nof, | 1116 compiler::Node* descriptors, compiler::Node* nof, |
| 1115 Label* if_found, Variable* var_name_index, | 1117 Label* if_found, Variable* var_name_index, |
| 1116 Label* if_not_found); | 1118 Label* if_not_found); |
| 1117 compiler::Node* CallGetterIfAccessor(compiler::Node* value, | 1119 compiler::Node* CallGetterIfAccessor(compiler::Node* value, |
| 1118 compiler::Node* details, | 1120 compiler::Node* details, |
| 1119 compiler::Node* context, | 1121 compiler::Node* context, |
| 1120 compiler::Node* receiver, | 1122 compiler::Node* receiver, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1201 | 1203 |
| 1202 compiler::Node* AllocateConsString(Heap::RootListIndex map_root_index, | 1204 compiler::Node* AllocateConsString(Heap::RootListIndex map_root_index, |
| 1203 compiler::Node* length, | 1205 compiler::Node* length, |
| 1204 compiler::Node* first, | 1206 compiler::Node* first, |
| 1205 compiler::Node* second, | 1207 compiler::Node* second, |
| 1206 AllocationFlags flags); | 1208 AllocationFlags flags); |
| 1207 | 1209 |
| 1208 static const int kElementLoopUnrollThreshold = 8; | 1210 static const int kElementLoopUnrollThreshold = 8; |
| 1209 }; | 1211 }; |
| 1210 | 1212 |
| 1213 class CodeStubArguments { | |
| 1214 public: | |
| 1215 CodeStubArguments(CodeStubAssembler* assembler, compiler::Node* argc, | |
|
Igor Sheludko
2016/11/03 11:52:20
Please add a comment that argc does not include re
danno
2016/11/03 15:01:48
Done.
| |
| 1216 CodeStubAssembler::ParameterMode mode = | |
| 1217 CodeStubAssembler::INTPTR_PARAMETERS); | |
| 1218 | |
| 1219 compiler::Node* GetReceiver(); | |
| 1220 | |
| 1221 compiler::Node* AtIndex(compiler::Node* index, | |
|
Igor Sheludko
2016/11/03 11:52:20
index is zero-based, not including receiver.
danno
2016/11/03 15:01:48
Done.
| |
| 1222 CodeStubAssembler::ParameterMode mode = | |
| 1223 CodeStubAssembler::INTPTR_PARAMETERS); | |
| 1224 | |
| 1225 compiler::Node* AtIndex(int index); | |
| 1226 | |
| 1227 typedef std::function<void(CodeStubAssembler* assembler, compiler::Node* arg)> | |
| 1228 ForEachBodyFunction; | |
| 1229 | |
| 1230 void ForEach(ForEachBodyFunction body, compiler::Node* first = nullptr, | |
|
Igor Sheludko
2016/11/03 11:52:20
Please mention that this iteration does not includ
danno
2016/11/03 15:01:48
Done.
| |
| 1231 compiler::Node* last = nullptr, | |
| 1232 CodeStubAssembler::ParameterMode mode = | |
| 1233 CodeStubAssembler::INTPTR_PARAMETERS) { | |
| 1234 CodeStubAssembler::VariableList list(0, assembler_->zone()); | |
| 1235 ForEach(list, body, first, last); | |
| 1236 } | |
| 1237 | |
| 1238 void ForEach(const CodeStubAssembler::VariableList& vars, | |
|
Igor Sheludko
2016/11/03 11:52:20
Same here.
danno
2016/11/03 15:01:48
Done.
| |
| 1239 ForEachBodyFunction body, compiler::Node* first = nullptr, | |
| 1240 compiler::Node* last = nullptr, | |
| 1241 CodeStubAssembler::ParameterMode mode = | |
| 1242 CodeStubAssembler::INTPTR_PARAMETERS); | |
| 1243 | |
| 1244 void PopAndReturn(compiler::Node* value); | |
| 1245 | |
| 1246 private: | |
| 1247 compiler::Node* GetArguments(); | |
| 1248 | |
| 1249 CodeStubAssembler* assembler_; | |
| 1250 compiler::Node* argc_; | |
| 1251 compiler::Node* arguments_; | |
| 1252 compiler::Node* fp_; | |
| 1253 }; | |
| 1254 | |
| 1211 #define CSA_ASSERT(x) Assert((x), #x, __FILE__, __LINE__) | 1255 #define CSA_ASSERT(x) Assert((x), #x, __FILE__, __LINE__) |
| 1212 #ifdef ENABLE_SLOW_DCHECKS | 1256 #ifdef ENABLE_SLOW_DCHECKS |
| 1213 #define CSA_SLOW_ASSERT(x) \ | 1257 #define CSA_SLOW_ASSERT(x) \ |
| 1214 if (FLAG_enable_slow_asserts) { \ | 1258 if (FLAG_enable_slow_asserts) { \ |
| 1215 Assert((x), #x, __FILE__, __LINE__); \ | 1259 Assert((x), #x, __FILE__, __LINE__); \ |
| 1216 } | 1260 } |
| 1217 #else | 1261 #else |
| 1218 #define CSA_SLOW_ASSERT(x) | 1262 #define CSA_SLOW_ASSERT(x) |
| 1219 #endif | 1263 #endif |
| 1220 | 1264 |
| 1221 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1265 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
| 1222 | 1266 |
| 1223 } // namespace internal | 1267 } // namespace internal |
| 1224 } // namespace v8 | 1268 } // namespace v8 |
| 1225 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1269 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |