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 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 | 1130 |
1131 Node* Typeof(Node* value, Node* context); | 1131 Node* Typeof(Node* value, Node* context); |
1132 | 1132 |
1133 Node* GetSuperConstructor(Node* value, Node* context); | 1133 Node* GetSuperConstructor(Node* value, Node* context); |
1134 | 1134 |
1135 Node* InstanceOf(Node* object, Node* callable, Node* context); | 1135 Node* InstanceOf(Node* object, Node* callable, Node* context); |
1136 | 1136 |
1137 // Debug helpers | 1137 // Debug helpers |
1138 Node* IsDebugActive(); | 1138 Node* IsDebugActive(); |
1139 | 1139 |
| 1140 // Useful tools for PrintF-style debugging CSA builtins. |
| 1141 void ReleasePrint(const char* c_str) { |
| 1142 std::string std_str(c_str); |
| 1143 std_str += '\n'; |
| 1144 Handle<String> str = |
| 1145 factory()->NewStringFromAsciiChecked(std_str.c_str(), TENURED); |
| 1146 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), HeapConstant(str)); |
| 1147 } |
| 1148 |
| 1149 void ReleaseDebugPrint(Node* object) { |
| 1150 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), object); |
| 1151 } |
| 1152 |
| 1153 void Print(const char* c_str) { |
| 1154 #ifdef DEBUG |
| 1155 ReleasePrint(c_str); |
| 1156 #endif |
| 1157 } |
| 1158 |
| 1159 void DebugPrint(Node* object) { |
| 1160 #ifdef DEBUG |
| 1161 ReleaseDebugPrint(object); |
| 1162 #endif |
| 1163 } |
| 1164 |
1140 // TypedArray/ArrayBuffer helpers | 1165 // TypedArray/ArrayBuffer helpers |
1141 Node* IsDetachedBuffer(Node* buffer); | 1166 Node* IsDetachedBuffer(Node* buffer); |
1142 | 1167 |
1143 Node* ElementOffsetFromIndex(Node* index, ElementsKind kind, | 1168 Node* ElementOffsetFromIndex(Node* index, ElementsKind kind, |
1144 ParameterMode mode, int base_size = 0); | 1169 ParameterMode mode, int base_size = 0); |
1145 | 1170 |
1146 Node* AllocateFunctionWithMapAndContext(Node* map, Node* shared_info, | 1171 Node* AllocateFunctionWithMapAndContext(Node* map, Node* shared_info, |
1147 Node* context); | 1172 Node* context); |
1148 | 1173 |
1149 // Promise helpers | 1174 // Promise helpers |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 } | 1298 } |
1274 #else | 1299 #else |
1275 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1300 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1276 #endif | 1301 #endif |
1277 | 1302 |
1278 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1303 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1279 | 1304 |
1280 } // namespace internal | 1305 } // namespace internal |
1281 } // namespace v8 | 1306 } // namespace v8 |
1282 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1307 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |