| Index: runtime/vm/code_generator.cc
|
| ===================================================================
|
| --- runtime/vm/code_generator.cc (revision 16987)
|
| +++ runtime/vm/code_generator.cc (working copy)
|
| @@ -62,7 +62,7 @@
|
| const String& function_name = String::Handle(function.name());
|
| const String& class_name =
|
| String::Handle(Class::Handle(function.Owner()).Name());
|
| - OS::Print("> Entering '%s.%s'\n",
|
| + OS::PrintErr("> Entering '%s.%s'\n",
|
| class_name.ToCString(), function_name.ToCString());
|
| }
|
|
|
| @@ -74,7 +74,7 @@
|
| const String& function_name = String::Handle(function.name());
|
| const String& class_name =
|
| String::Handle(Class::Handle(function.Owner()).Name());
|
| - OS::Print("< Exiting '%s.%s'\n",
|
| + OS::PrintErr("< Exiting '%s.%s'\n",
|
| class_name.ToCString(), function_name.ToCString());
|
| }
|
|
|
| @@ -363,29 +363,29 @@
|
| const Type& instance_type = Type::Handle(instance.GetType());
|
| ASSERT(instance_type.IsInstantiated());
|
| if (type.IsInstantiated()) {
|
| - OS::Print("%s: '%s' %"Pd" %s '%s' %"Pd" (pc: %#"Px").\n",
|
| - message,
|
| - String::Handle(instance_type.Name()).ToCString(),
|
| - Class::Handle(instance_type.type_class()).id(),
|
| - (result.raw() == Bool::True().raw()) ? "is" : "is !",
|
| - String::Handle(type.Name()).ToCString(),
|
| - Class::Handle(type.type_class()).id(),
|
| - caller_frame->pc());
|
| + OS::PrintErr("%s: '%s' %"Pd" %s '%s' %"Pd" (pc: %#"Px").\n",
|
| + message,
|
| + String::Handle(instance_type.Name()).ToCString(),
|
| + Class::Handle(instance_type.type_class()).id(),
|
| + (result.raw() == Bool::True().raw()) ? "is" : "is !",
|
| + String::Handle(type.Name()).ToCString(),
|
| + Class::Handle(type.type_class()).id(),
|
| + caller_frame->pc());
|
| } else {
|
| // Instantiate type before printing.
|
| const AbstractType& instantiated_type =
|
| AbstractType::Handle(type.InstantiateFrom(instantiator_type_arguments));
|
| - OS::Print("%s: '%s' %s '%s' instantiated from '%s' (pc: %#"Px").\n",
|
| - message,
|
| - String::Handle(instance_type.Name()).ToCString(),
|
| - (result.raw() == Bool::True().raw()) ? "is" : "is !",
|
| - String::Handle(instantiated_type.Name()).ToCString(),
|
| - String::Handle(type.Name()).ToCString(),
|
| - caller_frame->pc());
|
| + OS::PrintErr("%s: '%s' %s '%s' instantiated from '%s' (pc: %#"Px").\n",
|
| + message,
|
| + String::Handle(instance_type.Name()).ToCString(),
|
| + (result.raw() == Bool::True().raw()) ? "is" : "is !",
|
| + String::Handle(instantiated_type.Name()).ToCString(),
|
| + String::Handle(type.Name()).ToCString(),
|
| + caller_frame->pc());
|
| }
|
| const Function& function = Function::Handle(
|
| caller_frame->LookupDartFunction());
|
| - OS::Print(" -> Function %s\n", function.ToFullyQualifiedCString());
|
| + OS::PrintErr(" -> Function %s\n", function.ToFullyQualifiedCString());
|
| }
|
|
|
|
|
| @@ -492,7 +492,7 @@
|
| (last_instantiator_type_arguments.raw() ==
|
| instantiator_type_arguments.raw())) {
|
| if (FLAG_trace_type_checks) {
|
| - OS::Print("%"Pd" ", i);
|
| + OS::PrintErr("%"Pd" ", i);
|
| if (type_arguments_replaced) {
|
| PrintTypeCheck("Duplicate cache entry (canonical.)", instance, type,
|
| instantiator_type_arguments, result);
|
| @@ -518,7 +518,7 @@
|
| if (!test_type.IsInstantiated()) {
|
| test_type = type.InstantiateFrom(instantiator_type_arguments);
|
| }
|
| - OS::Print(" Updated test cache %p ix: %"Pd" with (%"Pd", %p, %p, %s)\n"
|
| + OS::PrintErr(" Updated test cache %p ix: %"Pd" with (%"Pd", %p, %p, %s)\n"
|
| " [%p %s %"Pd", %p %s]\n"
|
| " [%p %s %"Pd", %p %s] %s\n",
|
| new_cache.raw(),
|
| @@ -766,7 +766,7 @@
|
| CodePatcher::PatchStaticCallAt(caller_frame->pc(), target_code.EntryPoint());
|
| caller_code.SetStaticCallTargetCodeAt(caller_frame->pc(), target_code);
|
| if (FLAG_trace_patching) {
|
| - OS::Print("PatchStaticCall: patching from %#"Px" to '%s' %#"Px"\n",
|
| + OS::PrintErr("PatchStaticCall: patching from %#"Px" to '%s' %#"Px"\n",
|
| caller_frame->pc(),
|
| target_function.ToFullyQualifiedCString(),
|
| target_code.EntryPoint());
|
| @@ -874,7 +874,7 @@
|
| // Let the megamorphic stub handle special cases: NoSuchMethod,
|
| // closure calls.
|
| if (FLAG_trace_ic) {
|
| - OS::Print("InlineCacheMissHandler NULL code for receiver: %s\n",
|
| + OS::PrintErr("InlineCacheMissHandler NULL code for receiver: %s\n",
|
| receiver.ToCString());
|
| }
|
| return Function::null();
|
| @@ -900,14 +900,14 @@
|
| if (FLAG_trace_ic_miss_in_optimized) {
|
| const Code& caller = Code::Handle(Code::LookupCode(caller_frame->pc()));
|
| if (caller.is_optimized()) {
|
| - OS::Print("IC miss in optimized code; call %s -> %s\n",
|
| + OS::PrintErr("IC miss in optimized code; call %s -> %s\n",
|
| Function::Handle(caller.function()).ToCString(),
|
| target_function.ToCString());
|
| }
|
| }
|
| if (FLAG_trace_ic) {
|
| - OS::Print("InlineCacheMissHandler %d call at %#"Px"' "
|
| - "adding <%s> id:%"Pd" -> <%s>\n",
|
| + OS::PrintErr("InlineCacheMissHandler %d call at %#"Px"' "
|
| + "adding <%s> id:%"Pd" -> <%s>\n",
|
| args.length(),
|
| caller_frame->pc(),
|
| Class::Handle(receiver.clazz()).ToCString(),
|
| @@ -1015,8 +1015,8 @@
|
| }
|
| ASSERT(!cls.IsNull());
|
| if (FLAG_trace_ic || FLAG_trace_ic_miss_in_optimized) {
|
| - OS::Print("Megamorphic IC miss, class=%s, function=%s\n",
|
| - cls.ToCString(), name.ToCString());
|
| + OS::PrintErr("Megamorphic IC miss, class=%s, function=%s\n",
|
| + cls.ToCString(), name.ToCString());
|
| }
|
|
|
| intptr_t arg_count =
|
| @@ -1305,14 +1305,14 @@
|
| ASSERT(top_frame != NULL);
|
| const Function& top_function = Function::Handle(
|
| top_frame->LookupDartFunction());
|
| - OS::Print("Failed: '%s' %s @ %#"Px"\n",
|
| + OS::PrintErr("Failed: '%s' %s @ %#"Px"\n",
|
| msg, top_function.ToFullyQualifiedCString(), top_frame->pc());
|
| StackFrame* caller_frame = iterator.NextFrame();
|
| if (caller_frame != NULL) {
|
| const Function& caller_function = Function::Handle(
|
| caller_frame->LookupDartFunction());
|
| const Code& code = Code::Handle(caller_frame->LookupDartCode());
|
| - OS::Print(" -> caller: %s (%s)\n",
|
| + OS::PrintErr(" -> caller: %s (%s)\n",
|
| caller_function.ToFullyQualifiedCString(),
|
| code.is_optimized() ? "optimized" : "unoptimized");
|
| }
|
| @@ -1327,7 +1327,7 @@
|
| DartFrameIterator iterator;
|
| StackFrame* frame = iterator.NextFrame();
|
| ASSERT(frame != NULL);
|
| - OS::Print("IC call @%#"Px": ICData: %p cnt:%"Pd" nchecks: %"Pd" %s %s\n",
|
| + OS::PrintErr("IC call @%#"Px": ICData: %p cnt:%"Pd" nchecks: %"Pd" %s %s\n",
|
| frame->pc(),
|
| ic_data.raw(),
|
| function.usage_counter(),
|
| @@ -1383,7 +1383,7 @@
|
| function.usage_counter() - FLAG_reoptimization_counter_threshold);
|
| } else {
|
| if (FLAG_trace_failed_optimization_attempts) {
|
| - PrintCaller("Not Optimizable");
|
| + OS::PrintErr("Not Optimizable: %s\n", function.ToFullyQualifiedCString());
|
| }
|
| // TODO(5442338): Abort as this should not happen.
|
| function.set_usage_counter(kLowInvocationCount);
|
| @@ -1417,7 +1417,7 @@
|
| CodePatcher::PatchStaticCallAt(frame->pc(), target_code.EntryPoint());
|
| caller_code.SetStaticCallTargetCodeAt(frame->pc(), target_code);
|
| if (FLAG_trace_patching) {
|
| - OS::Print("FixCallersTarget: patching from %#"Px" to '%s' %#"Px"\n",
|
| + OS::PrintErr("FixCallersTarget: patching from %#"Px" to '%s' %#"Px"\n",
|
| frame->pc(),
|
| Function::Handle(target_code.function()).ToFullyQualifiedCString(),
|
| target_code.EntryPoint());
|
| @@ -1608,7 +1608,7 @@
|
| CopyFrame(optimized_code, *caller_frame);
|
| if (FLAG_trace_deoptimization) {
|
| Function& function = Function::Handle(optimized_code.function());
|
| - OS::Print("Deoptimizing (reason %d '%s') at pc %#"Px" '%s' (count %d)\n",
|
| + OS::PrintErr("Deoptimizing (reason %d '%s') at pc %#"Px" '%s' (count %d)\n",
|
| deopt_reason,
|
| DeoptReasonToText(deopt_reason),
|
| caller_frame->pc(),
|
| @@ -1660,7 +1660,7 @@
|
| }
|
| if (FLAG_trace_deoptimization_verbose) {
|
| for (intptr_t i = 0; i < len; i++) {
|
| - OS::Print("*%"Pd". [%p] %#014"Px" [%s]\n",
|
| + OS::PrintErr("*%"Pd". [%p] %#014"Px" [%s]\n",
|
| i,
|
| &start[i],
|
| start[i],
|
| @@ -1726,7 +1726,7 @@
|
| *slot = Double::New(current->value());
|
|
|
| if (FLAG_trace_deoptimization_verbose) {
|
| - OS::Print("materializing double at %"Px": %g\n",
|
| + OS::PrintErr("materializing double at %"Px": %g\n",
|
| reinterpret_cast<uword>(current->slot()),
|
| current->value());
|
| }
|
| @@ -1745,7 +1745,7 @@
|
| *slot = Mint::New(current->value());
|
|
|
| if (FLAG_trace_deoptimization_verbose) {
|
| - OS::Print("materializing mint at %"Px": %"Pd64"\n",
|
| + OS::PrintErr("materializing mint at %"Px": %"Pd64"\n",
|
| reinterpret_cast<uword>(current->slot()),
|
| current->value());
|
| }
|
| @@ -1765,8 +1765,8 @@
|
| intptr_t line, column;
|
| script.GetTokenLocation(token_pos, &line, &column);
|
| String& line_string = String::Handle(script.GetLine(line));
|
| - OS::Print(" Function: %s\n", top_function.ToFullyQualifiedCString());
|
| - OS::Print(" Line %"Pd": '%s'\n", line, line_string.ToCString());
|
| + OS::PrintErr(" Function: %s\n", top_function.ToFullyQualifiedCString());
|
| + OS::PrintErr(" Line %"Pd": '%s'\n", line, line_string.ToCString());
|
| }
|
| }
|
|
|
|
|