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

Unified Diff: src/isolate.cc

Issue 2895163002: [builtins] Add --print-builtin-size flag (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index faa04848cff43c13c49ff5837ecb6718deac3822..4e6ad8524d72a72eefb103d7c06ba0d4323cbe09 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -2660,6 +2660,16 @@ void Isolate::InitializeLoggingAndCounters() {
}
}
+namespace {
+void PrintBuiltinSizes(Isolate* isolate) {
+ Builtins* builtins = isolate->builtins();
+ for (int i = 0; i < Builtins::builtin_count; i++) {
+ const char* name = builtins->name(i);
+ Code* code = builtins->builtin(static_cast<Builtins::Name>(i));
+ PrintF(stdout, "%s: %d\n", name, code->instruction_size());
+ }
+}
+} // namespace
bool Isolate::Init(Deserializer* des) {
TRACE_ISOLATE(init);
@@ -2799,6 +2809,8 @@ bool Isolate::Init(Deserializer* des) {
delete setup_delegate_;
setup_delegate_ = nullptr;
+ if (FLAG_print_builtin_size) PrintBuiltinSizes(this);
+
// Finish initialization of ThreadLocal after deserialization is done.
clear_pending_exception();
clear_pending_message();
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698