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

Unified Diff: src/compiler.cc

Issue 1649743002: Add counters to trace baseline code size. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_trace_bc
Patch Set: Review Comments Created 4 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
« no previous file with comments | « no previous file | src/counters.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 7fbbfb17ff5daf7b809e94144a3b35a3f45ba633..354542d56e3f44ff14420659726a56a493499aee 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -727,7 +727,6 @@ static void RecordFunctionCompilation(Logger::LogEventsAndTags tag,
}
}
-
static bool CompileUnoptimizedCode(CompilationInfo* info) {
DCHECK(AllowCompilation::IsAllowed(info->isolate()));
if (!Compiler::Analyze(info->parse_info()) ||
@@ -756,13 +755,39 @@ static bool UseIgnition(CompilationInfo* info) {
return info->closure()->PassesFilter(FLAG_ignition_filter);
}
+static int CodeAndMetadataSize(CompilationInfo* info) {
+ int size = 0;
+ if (info->has_bytecode_array()) {
+ Handle<BytecodeArray> bytecode_array = info->bytecode_array();
+ size += bytecode_array->BytecodeArraySize();
+ size += bytecode_array->constant_pool()->Size();
+ size += bytecode_array->handler_table()->Size();
+ size += bytecode_array->source_position_table()->Size();
+ } else {
+ Handle<Code> code = info->code();
+ size += code->CodeSize();
+ size += code->relocation_info()->Size();
+ size += code->deoptimization_data()->Size();
+ size += code->handler_table()->Size();
+ }
+ return size;
+}
+
static bool GenerateBaselineCode(CompilationInfo* info) {
+ bool success;
if (FLAG_ignition && UseIgnition(info)) {
- return interpreter::Interpreter::MakeBytecode(info);
+ success = interpreter::Interpreter::MakeBytecode(info);
} else {
- return FullCodeGenerator::MakeCode(info);
+ success = FullCodeGenerator::MakeCode(info);
+ }
+ if (success) {
+ Isolate* isolate = info->isolate();
+ Counters* counters = isolate->counters();
+ counters->total_baseline_code_size()->Increment(CodeAndMetadataSize(info));
+ counters->total_baseline_compile_count()->Increment(1);
}
+ return success;
}
« no previous file with comments | « no previous file | src/counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698