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

Unified Diff: runtime/vm/object.cc

Issue 1127383008: Fix CompilerStats info (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 45719)
+++ runtime/vm/object.cc (working copy)
@@ -6685,6 +6685,7 @@
set_ic_data_array(Object::empty_array());
} else {
const Array& a = Array::Handle(Array::New(count, Heap::kOld));
+ INC_STAT(Isolate::Current(), total_code_size, count * sizeof(uword));
count = 0;
for (intptr_t i = 0; i < deopt_id_to_ic_data.length(); i++) {
if (deopt_id_to_ic_data[i] != NULL) {
@@ -6975,7 +6976,6 @@
RawString* Field::GetterName(const String& field_name) {
- CompilerStats::make_accessor_name++;
return String::Concat(Symbols::GetterPrefix(), field_name);
}
@@ -6986,7 +6986,6 @@
RawString* Field::SetterName(const String& field_name) {
- CompilerStats::make_accessor_name++;
return String::Concat(Symbols::SetterPrefix(), field_name);
}
@@ -6997,13 +6996,11 @@
RawString* Field::NameFromGetter(const String& getter_name) {
- CompilerStats::make_field_name++;
return String::SubString(getter_name, strlen(kGetterPrefix));
}
RawString* Field::NameFromSetter(const String& setter_name) {
- CompilerStats::make_field_name++;
return String::SubString(setter_name, strlen(kSetterPrefix));
}
@@ -7955,12 +7952,12 @@
Scanner::TokenDescriptor token = tokens[i];
if (token.kind == Token::kIDENT) { // Identifier token.
if (FLAG_compiler_stats) {
- CompilerStats::num_ident_tokens_total += 1;
+ INC_STAT(Isolate::Current(), num_ident_tokens_total, 1);
}
data.AddIdentToken(token.literal);
} else if (Token::NeedsLiteralToken(token.kind)) { // Literal token.
if (FLAG_compiler_stats) {
- CompilerStats::num_literal_tokens_total += 1;
+ INC_STAT(Isolate::Current(), num_literal_tokens_total, 1);
}
data.AddLiteralToken(token);
} else { // Keyword, pseudo keyword etc.
@@ -7968,9 +7965,7 @@
data.AddSimpleToken(token.kind);
}
}
- if (FLAG_compiler_stats) {
- CompilerStats::num_tokens_total += len;
- }
+ INC_STAT(Isolate::Current(), num_tokens_total, len);
siva 2015/05/12 17:39:52 Might make sense to cache Isolate::Current() in a
hausner 2015/05/12 21:52:16 Done.
data.AddSimpleToken(Token::kEOS); // End of stream.
// Create and setup the token stream object.
@@ -8301,15 +8296,13 @@
}
// Get the source, scan and allocate the token stream.
VMTagScope tagScope(isolate, VMTag::kCompileScannerTagId);
- TimerScope timer(FLAG_compiler_stats, &CompilerStats::scanner_timer);
+ TimerScope timer(FLAG_compiler_stats, &CSTAT_TIMER(scanner_timer));
const String& src = String::Handle(isolate, Source());
Scanner scanner(src, private_key);
set_tokens(TokenStream::Handle(isolate,
TokenStream::New(scanner.GetStream(),
private_key)));
- if (FLAG_compiler_stats) {
- CompilerStats::src_length += src.Length();
- }
+ INC_STAT(isolate, src_length, src.Length());
}
@@ -10620,6 +10613,8 @@
RawObject* raw = Object::Allocate(PcDescriptors::kClassId,
size,
Heap::kOld);
+ INC_STAT(Isolate::Current(), total_code_size, size);
+ INC_STAT(Isolate::Current(), pc_desc_size, size);
siva 2015/05/12 17:39:52 Ditto comment about caching Isolate::Current() ins
hausner 2015/05/12 21:52:16 Done.
NoSafepointScope no_safepoint;
result ^= raw;
result.SetLength(data->length());
@@ -11039,6 +11034,8 @@
RawObject* raw = Object::Allocate(LocalVarDescriptors::kClassId,
size,
Heap::kOld);
+ INC_STAT(Isolate::Current(), total_code_size, size);
+ INC_STAT(Isolate::Current(), vardesc_size, size);
NoSafepointScope no_safepoint;
result ^= raw;
result.StoreNonPointer(&result.raw_ptr()->num_entries_, num_variables);
@@ -12111,6 +12108,9 @@
void Code::set_stackmaps(const Array& maps) const {
ASSERT(maps.IsOld());
StorePointer(&raw_ptr()->stackmaps_, maps.raw());
+ INC_STAT(Isolate::Current(),
+ total_code_size,
+ maps.IsNull() ? 0 : maps.Length() * sizeof(uword));
}
@@ -12329,6 +12329,8 @@
Code& code = Code::ZoneHandle(Code::New(pointer_offset_count));
Instructions& instrs =
Instructions::ZoneHandle(Instructions::New(assembler->CodeSize()));
+ INC_STAT(Isolate::Current(), total_instr_size, assembler->CodeSize());
+ INC_STAT(Isolate::Current(), total_code_size, assembler->CodeSize());
// Copy the instructions into the instruction area and apply all fixups.
// Embedded pointers are still in handles at this point.
@@ -12373,6 +12375,8 @@
if (object_pool.IsNull()) {
instrs.set_object_pool(Object::empty_array().raw());
} else {
+ INC_STAT(Isolate::Current(),
+ total_code_size, object_pool.Length() * sizeof(uintptr_t));
// TODO(regis): Once MakeArray takes a Heap::Space argument, call it here
// with Heap::kOld and change the ARM and MIPS assemblers to work with a
// GrowableObjectArray in new space.
@@ -12388,6 +12392,8 @@
}
}
code.set_comments(assembler->GetCodeComments());
+ INC_STAT(Isolate::Current(),
+ total_code_size, code.comments().comments_.Length());
return code.raw();
}
« runtime/vm/isolate.cc ('K') | « runtime/vm/isolate.cc ('k') | runtime/vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698