Commit 601f5f78 authored by Caitlin Potter's avatar Caitlin Potter Committed by Commit Bot

Make JSFunctionPrint() output Builtin names

This change has been useful when inspecting on_reject callbacks in
Isolate::InternalPromiseHasUserDefinedRejectHandler, it's probably
going to be helpful for other things too.

BUG=
R=adamk@chromium.org, littledan@chromium.org

Change-Id: I7c5bac87a3b8bd3ce19d71cf73397a93109976ba
Reviewed-on: https://chromium-review.googlesource.com/907641Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#51164}
parent c509e057
......@@ -1107,6 +1107,21 @@ void JSFunction::JSFunctionPrint(std::ostream& os) { // NOLINT
}
os << "\n - shared_info = " << Brief(shared());
os << "\n - name = " << Brief(shared()->name());
// Print Builtin name for builtin functions
int builtin_index = code()->builtin_index();
if (builtin_index != -1 && !IsInterpreted()) {
if (builtin_index == Builtins::kDeserializeLazy) {
if (shared()->HasLazyDeserializationBuiltinId()) {
builtin_index = shared()->lazy_deserialization_builtin_id();
os << "\n - builtin: " << GetIsolate()->builtins()->name(builtin_index)
<< "(lazy)";
}
} else {
os << "\n - builtin: " << GetIsolate()->builtins()->name(builtin_index);
}
}
os << "\n - formal_parameter_count = "
<< shared()->internal_formal_parameter_count();
os << "\n - kind = " << shared()->kind();
......
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