Chromium Code Reviews| Index: src/code-stub-assembler.h |
| diff --git a/src/code-stub-assembler.h b/src/code-stub-assembler.h |
| index be527fa8d30bee06dd8050de27e78315b28853d9..2a44f001cc75c1f79d43f6acbd17139bf99ee501 100644 |
| --- a/src/code-stub-assembler.h |
| +++ b/src/code-stub-assembler.h |
| @@ -537,6 +537,11 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { |
| Node* AllocateJSArrayIterator(Node* array, Node* array_map, Node* map); |
| + Node* AllocateJSIteratorResult(Node* context, Node* value, Node* done); |
| + Node* AllocateJSIteratorResult(Node* context, Node* value, bool done) { |
| + return AllocateJSIteratorResult(context, value, BooleanConstant(done)); |
| + } |
| + |
| void FillFixedArrayWithValue(ElementsKind kind, Node* array, Node* from_index, |
| Node* to_index, |
| Heap::RootListIndex value_root_index, |
| @@ -1116,6 +1121,31 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { |
| // Debug helpers |
| Node* IsDebugActive(); |
| + // Useful tools for PrintF-style debugging CSA builtins. |
| + void ReleasePrint(const char* c_str) { |
|
caitp
2017/01/10 04:13:41
I find myself writing these helpers for builtins a
|
| + std::string std_str(c_str); |
| + std_str += '\n'; |
| + Handle<String> str = |
| + factory()->NewStringFromAsciiChecked(std_str.c_str(), TENURED); |
| + CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), HeapConstant(str)); |
| + } |
| + |
| + void ReleaseDebugPrint(Node* object) { |
| + CallRuntime(Runtime::kDebugPrint, NoContextConstant(), object); |
| + } |
| + |
| + void Print(const char* c_str) { |
| +#ifdef DEBUG |
| + ReleasePrint(c_str); |
| +#endif |
| + } |
| + |
| + void DebugPrint(Node* object) { |
| +#ifdef DEBUG |
| + ReleaseDebugPrint(object); |
| +#endif |
| + } |
| + |
| // TypedArray/ArrayBuffer helpers |
| Node* IsDetachedBuffer(Node* buffer); |