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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 530 Node* AllocateFixedArray(ElementsKind kind, Node* capacity, | 530 Node* AllocateFixedArray(ElementsKind kind, Node* capacity, |
| 531 ParameterMode mode = INTPTR_PARAMETERS, | 531 ParameterMode mode = INTPTR_PARAMETERS, |
| 532 AllocationFlags flags = kNone); | 532 AllocationFlags flags = kNone); |
| 533 | 533 |
| 534 // Perform CreateArrayIterator (ES6 #sec-createarrayiterator). | 534 // Perform CreateArrayIterator (ES6 #sec-createarrayiterator). |
| 535 Node* CreateArrayIterator(Node* array, Node* array_map, Node* array_type, | 535 Node* CreateArrayIterator(Node* array, Node* array_map, Node* array_type, |
| 536 Node* context, IterationKind mode); | 536 Node* context, IterationKind mode); |
| 537 | 537 |
| 538 Node* AllocateJSArrayIterator(Node* array, Node* array_map, Node* map); | 538 Node* AllocateJSArrayIterator(Node* array, Node* array_map, Node* map); |
| 539 | 539 |
| 540 Node* AllocateJSIteratorResult(Node* context, Node* value, Node* done); | |
| 541 Node* AllocateJSIteratorResult(Node* context, Node* value, bool done) { | |
| 542 return AllocateJSIteratorResult(context, value, BooleanConstant(done)); | |
| 543 } | |
| 544 | |
| 540 void FillFixedArrayWithValue(ElementsKind kind, Node* array, Node* from_index, | 545 void FillFixedArrayWithValue(ElementsKind kind, Node* array, Node* from_index, |
| 541 Node* to_index, | 546 Node* to_index, |
| 542 Heap::RootListIndex value_root_index, | 547 Heap::RootListIndex value_root_index, |
| 543 ParameterMode mode = INTPTR_PARAMETERS); | 548 ParameterMode mode = INTPTR_PARAMETERS); |
| 544 | 549 |
| 545 // Copies all elements from |from_array| of |length| size to | 550 // Copies all elements from |from_array| of |length| size to |
| 546 // |to_array| of the same size respecting the elements kind. | 551 // |to_array| of the same size respecting the elements kind. |
| 547 void CopyFixedArrayElements( | 552 void CopyFixedArrayElements( |
| 548 ElementsKind kind, Node* from_array, Node* to_array, Node* length, | 553 ElementsKind kind, Node* from_array, Node* to_array, Node* length, |
| 549 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, | 554 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1109 | 1114 |
| 1110 Node* Typeof(Node* value, Node* context); | 1115 Node* Typeof(Node* value, Node* context); |
| 1111 | 1116 |
| 1112 Node* GetSuperConstructor(Node* value, Node* context); | 1117 Node* GetSuperConstructor(Node* value, Node* context); |
| 1113 | 1118 |
| 1114 Node* InstanceOf(Node* object, Node* callable, Node* context); | 1119 Node* InstanceOf(Node* object, Node* callable, Node* context); |
| 1115 | 1120 |
| 1116 // Debug helpers | 1121 // Debug helpers |
| 1117 Node* IsDebugActive(); | 1122 Node* IsDebugActive(); |
| 1118 | 1123 |
| 1124 // Useful tools for PrintF-style debugging CSA builtins. | |
| 1125 void ReleasePrint(const char* c_str) { | |
|
caitp
2017/01/10 04:13:41
I find myself writing these helpers for builtins a
| |
| 1126 std::string std_str(c_str); | |
| 1127 std_str += '\n'; | |
| 1128 Handle<String> str = | |
| 1129 factory()->NewStringFromAsciiChecked(std_str.c_str(), TENURED); | |
| 1130 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), HeapConstant(str)); | |
| 1131 } | |
| 1132 | |
| 1133 void ReleaseDebugPrint(Node* object) { | |
| 1134 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), object); | |
| 1135 } | |
| 1136 | |
| 1137 void Print(const char* c_str) { | |
| 1138 #ifdef DEBUG | |
| 1139 ReleasePrint(c_str); | |
| 1140 #endif | |
| 1141 } | |
| 1142 | |
| 1143 void DebugPrint(Node* object) { | |
| 1144 #ifdef DEBUG | |
| 1145 ReleaseDebugPrint(object); | |
| 1146 #endif | |
| 1147 } | |
| 1148 | |
| 1119 // TypedArray/ArrayBuffer helpers | 1149 // TypedArray/ArrayBuffer helpers |
| 1120 Node* IsDetachedBuffer(Node* buffer); | 1150 Node* IsDetachedBuffer(Node* buffer); |
| 1121 | 1151 |
| 1122 Node* ElementOffsetFromIndex(Node* index, ElementsKind kind, | 1152 Node* ElementOffsetFromIndex(Node* index, ElementsKind kind, |
| 1123 ParameterMode mode, int base_size = 0); | 1153 ParameterMode mode, int base_size = 0); |
| 1124 | 1154 |
| 1125 Node* AllocateFunctionWithMapAndContext(Node* map, Node* shared_info, | 1155 Node* AllocateFunctionWithMapAndContext(Node* map, Node* shared_info, |
| 1126 Node* context); | 1156 Node* context); |
| 1127 | 1157 |
| 1128 // Promise helpers | 1158 // Promise helpers |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1252 } | 1282 } |
| 1253 #else | 1283 #else |
| 1254 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1284 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
| 1255 #endif | 1285 #endif |
| 1256 | 1286 |
| 1257 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1287 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
| 1258 | 1288 |
| 1259 } // namespace internal | 1289 } // namespace internal |
| 1260 } // namespace v8 | 1290 } // namespace v8 |
| 1261 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1291 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |