Commit 0472d5a5 authored by Victor Gomes's avatar Victor Gomes Committed by V8 LUCI CQ

[maglev] Add Print commands

Allows to debug print a node, similar to CSA.

Bug: v8:7700
Change-Id: I602f8f8ed8c6df6b0782dd55b477252ee31dca26
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3874932Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82993}
parent 8df26597
...@@ -454,6 +454,24 @@ class MaglevGraphBuilder { ...@@ -454,6 +454,24 @@ class MaglevGraphBuilder {
MarkBytecodeDead(); MarkBytecodeDead();
} }
void Print(const char* str) {
Handle<String> string_handle =
local_isolate()->factory()->NewStringFromAsciiChecked(
str, AllocationType::kOld);
ValueNode* string_node = GetConstant(MakeRefAssumeMemoryFence(
broker(), broker()->CanonicalPersistentHandle(string_handle)));
BuildCallRuntime(Runtime::kGlobalPrint, {string_node});
}
void Print(ValueNode* value) {
BuildCallRuntime(Runtime::kDebugPrint, {value});
}
void Print(const char* str, ValueNode* value) {
Print(str);
Print(value);
}
ValueNode* GetClosure() const { ValueNode* GetClosure() const {
return current_interpreter_frame_.get( return current_interpreter_frame_.get(
interpreter::Register::function_closure()); interpreter::Register::function_closure());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment