Commit e44e4636 authored by jgruber's avatar jgruber Committed by Commit Bot

[builtins] Add --print-embedded-builtin-candidates

When enabled, this will print all builtins that could, in theory, be
marked as isolate-independent (because their reloc info only contains
viable entries), but are not. This is only intended for use while
implementing embedded builtins on ia32 and can be removed afterwards.

Bug: v8:6666
Change-Id: I2cb54c851391480824f15f6e5ddb7919e179da4a
Reviewed-on: https://chromium-review.googlesource.com/1183222Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55264}
parent cdaaa311
......@@ -1081,6 +1081,9 @@ DEFINE_VALUE_IMPLICATION(runtime_call_stats, runtime_stats, 1)
#endif
DEFINE_BOOL_READONLY(embedded_builtins, V8_EMBEDDED_BUILTINS_BOOL,
"Embed builtin code into the binary.")
// TODO(jgruber,v8:6666): Remove once ia32 has full embedded builtin support.
DEFINE_BOOL(print_embedded_builtin_candidates, false,
"Prints builtins that are not yet embedded but could be.")
DEFINE_BOOL(lazy_deserialization, true,
"Deserialize code lazily from the snapshot.")
DEFINE_BOOL(lazy_handler_deserialization, true,
......
......@@ -2884,6 +2884,19 @@ void CreateOffHeapTrampolines(Isolate* isolate) {
}
}
}
void PrintEmbeddedBuiltinCandidates(Isolate* isolate) {
CHECK(FLAG_print_embedded_builtin_candidates);
bool found_a_candidate = false;
for (int i = 0; i < Builtins::builtin_count; i++) {
if (Builtins::IsIsolateIndependent(i)) continue;
Code* builtin = isolate->heap()->builtin(i);
if (!builtin->IsIsolateIndependent(isolate)) continue;
if (!found_a_candidate) PrintF("Found embedded builtin candidates:\n");
found_a_candidate = true;
PrintF(" %s\n", Builtins::name(i));
}
}
} // namespace
void Isolate::PrepareEmbeddedBlobForSerialization() {
......@@ -3045,6 +3058,9 @@ bool Isolate::Init(StartupDeserializer* des) {
setup_delegate_ = nullptr;
if (FLAG_print_builtin_size) PrintBuiltinSizes(this);
if (FLAG_print_embedded_builtin_candidates) {
PrintEmbeddedBuiltinCandidates(this);
}
// Finish initialization of ThreadLocal after deserialization is done.
clear_pending_exception();
......
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