Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: src/code-stub-assembler.cc

Issue 2651673003: [csa] add utilities for printf-style debugging (Closed)
Patch Set: [code-stub-assembler] add utilities for printf-style debugging Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/code-stub-assembler.h ('K') | « src/code-stub-assembler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index fc73d66c1b89945239913e51b0d3c68bf40f22b5..26bab00ccf09842534f05a745848cd907fd59478 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::DebugPrint(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);
+#endif
+}
+
} // namespace internal
} // namespace v8
« src/code-stub-assembler.h ('K') | « src/code-stub-assembler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698