Index: src/code-stub-assembler.h |
diff --git a/src/code-stub-assembler.h b/src/code-stub-assembler.h |
index 77066b2bd0a46bb2a1d147c5135e5f13b82d521e..3f98b1c94c4de2b766bb041b12e1e385ae802b0e 100644 |
--- a/src/code-stub-assembler.h |
+++ b/src/code-stub-assembler.h |
@@ -554,6 +554,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, |
@@ -1133,6 +1138,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) { |
+ 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); |