Index: src/code-stub-assembler.cc |
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc |
index fc73d66c1b89945239913e51b0d3c68bf40f22b5..d09d105e2bcac733bc3d73472bf0ad95637d19f3 100644 |
--- a/src/code-stub-assembler.cc |
+++ b/src/code-stub-assembler.cc |
@@ -8398,5 +8398,29 @@ Node* CodeStubAssembler::AllocatePromiseReactionJobInfo( |
return result; |
} |
+void CodeStubAssembler::Print(const char* s) { |
+#ifdef DEBUG |
+ std::string formatted(s); |
+ formatted += "\n"; |
+ Handle<String> string = isolate()->factory()->NewStringFromAsciiChecked( |
+ formatted.c_str(), TENURED); |
+ CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), HeapConstant(string)); |
+#endif |
+} |
+ |
+void CodeStubAssembler::Print(const char* prefix, Node* tagged_value) { |
+#ifdef DEBUG |
+ if (prefix != nullptr) { |
+ std::string formatted(prefix); |
+ formatted += ": "; |
+ Handle<String> string = isolate()->factory()->NewStringFromAsciiChecked( |
+ formatted.c_str(), TENURED); |
+ CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), |
+ HeapConstant(string)); |
+ } |
+ CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), tagged_value); |
caitp
2017/01/24 13:30:37
Is there any way to assert that the value outputs
|
+#endif |
+} |
+ |
} // namespace internal |
} // namespace v8 |