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

Unified Diff: runtime/vm/compiler.cc

Issue 907093002: Port flow_graph*, disassembler to ISL_Print (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | runtime/vm/disassembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 8191288014bd26b3213e01d18e85de717568d5d4..b7f04fddb296782f7b57b857d5f1bf64f4da0f8d 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -184,7 +184,7 @@ RawError* Compiler::Compile(const Library& library, const Script& script) {
if (FLAG_trace_compiler) {
const String& script_url = String::Handle(script.url());
// TODO(iposva): Extract script kind.
- OS::Print("Compiling %s '%s'\n", "", script_url.ToCString());
+ ISL_Print("Compiling %s '%s'\n", "", script_url.ToCString());
}
const String& library_key = String::Handle(library.private_key());
script.Tokenize(library_key);
@@ -294,7 +294,7 @@ RawError* Compiler::CompileClass(const Class& cls) {
LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
if (FLAG_trace_compiler) {
- OS::Print("Compiling Class %s '%s'\n", "", cls.ToCString());
+ ISL_Print("Compiling Class %s '%s'\n", "", cls.ToCString());
}
// Add the primary class which needs to be parsed to the parse list.
@@ -414,7 +414,7 @@ static bool CompileParsedFunctionHelper(CompilationPipeline* pipeline,
if (FLAG_print_ic_data_map) {
for (intptr_t i = 0; i < ic_data_array->length(); i++) {
if ((*ic_data_array)[i] != NULL) {
- OS::Print("%" Pd " ", i);
+ ISL_Print("%" Pd " ", i);
FlowGraphPrinter::PrintICData(*(*ic_data_array)[i]);
}
}
@@ -717,9 +717,9 @@ static bool CompileParsedFunctionHelper(CompilationPipeline* pipeline,
CodePatcher::PatchEntry(Code::Handle(function.CurrentCode()));
if (FLAG_trace_compiler || FLAG_trace_patching) {
if (FLAG_trace_compiler) {
- OS::Print(" ");
+ ISL_Print(" ");
}
- OS::Print("Patch unoptimized '%s' entry point %#" Px "\n",
+ ISL_Print("Patch unoptimized '%s' entry point %#" Px "\n",
function.ToFullyQualifiedCString(),
Code::Handle(function.unoptimized_code()).EntryPoint());
}
@@ -773,7 +773,7 @@ static bool CompileParsedFunctionHelper(CompilationPipeline* pipeline,
// try again (done = true), and indicate that we did not finish
// compiling (is_compiled = false).
if (FLAG_trace_bailout) {
- OS::Print("%s\n", error.ToErrorCString());
+ ISL_Print("%s\n", error.ToErrorCString());
}
done = true;
ASSERT(optimized);
@@ -795,35 +795,35 @@ static bool CompileParsedFunctionHelper(CompilationPipeline* pipeline,
static void DisassembleCode(const Function& function, bool optimized) {
const char* function_fullname = function.ToFullyQualifiedCString();
- OS::Print("Code for %sfunction '%s' {\n",
+ ISL_Print("Code for %sfunction '%s' {\n",
optimized ? "optimized " : "",
function_fullname);
const Code& code = Code::Handle(function.CurrentCode());
code.Disassemble();
- OS::Print("}\n");
+ ISL_Print("}\n");
- OS::Print("Pointer offsets for function: {\n");
+ ISL_Print("Pointer offsets for function: {\n");
// Pointer offsets are stored in descending order.
Object& obj = Object::Handle();
for (intptr_t i = code.pointer_offsets_length() - 1; i >= 0; i--) {
const uword addr = code.GetPointerOffsetAt(i) + code.EntryPoint();
obj = *reinterpret_cast<RawObject**>(addr);
- OS::Print(" %d : %#" Px " '%s'\n",
+ ISL_Print(" %d : %#" Px " '%s'\n",
code.GetPointerOffsetAt(i), addr, obj.ToCString());
}
- OS::Print("}\n");
+ ISL_Print("}\n");
- OS::Print("PC Descriptors for function '%s' {\n", function_fullname);
+ ISL_Print("PC Descriptors for function '%s' {\n", function_fullname);
PcDescriptors::PrintHeaderString();
const PcDescriptors& descriptors =
PcDescriptors::Handle(code.pc_descriptors());
- OS::Print("%s}\n", descriptors.ToCString());
+ ISL_Print("%s}\n", descriptors.ToCString());
uword start = Instructions::Handle(code.instructions()).EntryPoint();
const Array& deopt_table = Array::Handle(code.deopt_info_array());
intptr_t deopt_table_length = DeoptTable::GetLength(deopt_table);
if (deopt_table_length > 0) {
- OS::Print("DeoptInfo: {\n");
+ ISL_Print("DeoptInfo: {\n");
Smi& offset = Smi::Handle();
DeoptInfo& info = DeoptInfo::Handle();
Smi& reason_and_flags = Smi::Handle();
@@ -832,49 +832,49 @@ static void DisassembleCode(const Function& function, bool optimized) {
const intptr_t reason =
DeoptTable::ReasonField::decode(reason_and_flags.Value());
ASSERT((0 <= reason) && (reason < ICData::kDeoptNumReasons));
- OS::Print("%4" Pd ": 0x%" Px " %s (%s)\n",
+ ISL_Print("%4" Pd ": 0x%" Px " %s (%s)\n",
i,
start + offset.Value(),
info.ToCString(),
DeoptReasonToCString(
static_cast<ICData::DeoptReasonId>(reason)));
}
- OS::Print("}\n");
+ ISL_Print("}\n");
}
const Array& object_table = Array::Handle(code.object_table());
if (object_table.Length() > 0) {
- OS::Print("Object Table: {\n");
+ ISL_Print("Object Table: {\n");
for (intptr_t i = 0; i < object_table.Length(); i++) {
- OS::Print(" %" Pd ": %s\n", i,
+ ISL_Print(" %" Pd ": %s\n", i,
Object::Handle(object_table.At(i)).ToCString());
}
- OS::Print("}\n");
+ ISL_Print("}\n");
}
const Array& object_pool = Array::Handle(
Instructions::Handle(code.instructions()).object_pool());
if (object_pool.Length() > 0) {
- OS::Print("Object Pool: {\n");
+ ISL_Print("Object Pool: {\n");
for (intptr_t i = 0; i < object_pool.Length(); i++) {
- OS::Print(" %" Pd ": %s\n", i,
+ ISL_Print(" %" Pd ": %s\n", i,
Object::Handle(object_pool.At(i)).ToCString());
}
- OS::Print("}\n");
+ ISL_Print("}\n");
}
- OS::Print("Stackmaps for function '%s' {\n", function_fullname);
+ ISL_Print("Stackmaps for function '%s' {\n", function_fullname);
if (code.stackmaps() != Array::null()) {
const Array& stackmap_table = Array::Handle(code.stackmaps());
Stackmap& map = Stackmap::Handle();
for (intptr_t i = 0; i < stackmap_table.Length(); ++i) {
map ^= stackmap_table.At(i);
- OS::Print("%s\n", map.ToCString());
+ ISL_Print("%s\n", map.ToCString());
}
}
- OS::Print("}\n");
+ ISL_Print("}\n");
- OS::Print("Variable Descriptors for function '%s' {\n",
+ ISL_Print("Variable Descriptors for function '%s' {\n",
function_fullname);
const LocalVarDescriptors& var_descriptors =
LocalVarDescriptors::Handle(code.var_descriptors());
@@ -887,31 +887,31 @@ static void DisassembleCode(const Function& function, bool optimized) {
var_descriptors.GetInfo(i, &var_info);
const int8_t kind = var_info.kind();
if (kind == RawLocalVarDescriptors::kSavedCurrentContext) {
- OS::Print(" saved current CTX reg offset %d\n", var_info.index());
+ ISL_Print(" saved current CTX reg offset %d\n", var_info.index());
} else {
if (kind == RawLocalVarDescriptors::kContextLevel) {
- OS::Print(" context level %d scope %d", var_info.index(),
+ ISL_Print(" context level %d scope %d", var_info.index(),
var_info.scope_id);
} else if (kind == RawLocalVarDescriptors::kStackVar) {
- OS::Print(" stack var '%s' offset %d",
+ ISL_Print(" stack var '%s' offset %d",
var_name.ToCString(), var_info.index());
} else {
ASSERT(kind == RawLocalVarDescriptors::kContextVar);
- OS::Print(" context var '%s' level %d offset %d",
+ ISL_Print(" context var '%s' level %d offset %d",
var_name.ToCString(), var_info.scope_id, var_info.index());
}
- OS::Print(" (valid %d-%d)\n", var_info.begin_pos, var_info.end_pos);
+ ISL_Print(" (valid %d-%d)\n", var_info.begin_pos, var_info.end_pos);
}
}
- OS::Print("}\n");
+ ISL_Print("}\n");
- OS::Print("Exception Handlers for function '%s' {\n", function_fullname);
+ ISL_Print("Exception Handlers for function '%s' {\n", function_fullname);
const ExceptionHandlers& handlers =
ExceptionHandlers::Handle(code.exception_handlers());
- OS::Print("%s}\n", handlers.ToCString());
+ ISL_Print("%s}\n", handlers.ToCString());
{
- OS::Print("Static call target functions {\n");
+ ISL_Print("Static call target functions {\n");
const Array& table = Array::Handle(code.static_calls_target_table());
Smi& offset = Smi::Handle();
Function& function = Function::Handle();
@@ -924,18 +924,18 @@ static void DisassembleCode(const Function& function, bool optimized) {
if (function.IsNull()) {
Class& cls = Class::Handle();
cls ^= code.owner();
- OS::Print(" 0x%" Px ": allocation stub for %s, %p\n",
+ ISL_Print(" 0x%" Px ": allocation stub for %s, %p\n",
start + offset.Value(),
cls.ToCString(),
code.raw());
} else {
- OS::Print(" 0x%" Px ": %s, %p\n",
+ ISL_Print(" 0x%" Px ": %s, %p\n",
start + offset.Value(),
function.ToFullyQualifiedCString(),
code.raw());
}
}
- OS::Print("}\n");
+ ISL_Print("}\n");
}
}
@@ -956,7 +956,7 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
ParsedFunction* parsed_function = new(zone) ParsedFunction(
thread, Function::ZoneHandle(zone, function.raw()));
if (FLAG_trace_compiler) {
- OS::Print("Compiling %s%sfunction: '%s' @ token %" Pd ", size %" Pd "\n",
+ ISL_Print("Compiling %s%sfunction: '%s' @ token %" Pd ", size %" Pd "\n",
(osr_id == Isolate::kNoDeoptId ? "" : "osr "),
(optimized ? "optimized " : ""),
function.ToFullyQualifiedCString(),
@@ -976,10 +976,10 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
if (optimized) {
// Optimizer bailed out. Disable optimizations and to never try again.
if (FLAG_trace_compiler) {
- OS::Print("--> disabling optimizations for '%s'\n",
+ ISL_Print("--> disabling optimizations for '%s'\n",
function.ToFullyQualifiedCString());
} else if (FLAG_trace_failed_optimization_attempts) {
- OS::Print("Cannot optimize: %s\n",
+ ISL_Print("Cannot optimize: %s\n",
function.ToFullyQualifiedCString());
}
function.SetIsOptimizable(false);
@@ -991,7 +991,7 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
per_compile_timer.Stop();
if (FLAG_trace_compiler) {
- OS::Print("--> '%s' entry: %#" Px " size: %" Pd " time: %" Pd64 " us\n",
+ ISL_Print("--> '%s' entry: %#" Px " size: %" Pd " time: %" Pd64 " us\n",
function.ToFullyQualifiedCString(),
Code::Handle(function.CurrentCode()).EntryPoint(),
Code::Handle(function.CurrentCode()).Size(),
@@ -1006,9 +1006,9 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
optimized &&
FlowGraphPrinter::ShouldPrint(function)) {
// TODO(fschneider): Print unoptimized code along with the optimized code.
- OS::Print("*** BEGIN CODE\n");
+ ISL_Print("*** BEGIN CODE\n");
DisassembleCode(function, true);
- OS::Print("*** END CODE\n");
+ ISL_Print("*** END CODE\n");
}
return Error::null();
@@ -1158,7 +1158,7 @@ RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) {
LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
if (FLAG_trace_compiler) {
- OS::Print("compiling expression: ");
+ ISL_Print("compiling expression: ");
AstPrinter::PrintNode(fragment);
}
« no previous file with comments | « no previous file | runtime/vm/disassembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698