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

Side by Side Diff: runtime/vm/code_generator.cc

Issue 10933019: Improve moves of Smi and null objects. Add result cid to List constructor calls. Add tracing of inl… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/assembler_macros.h" 7 #include "vm/assembler_macros.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 14 matching lines...) Expand all
25 #include "vm/verifier.h" 25 #include "vm/verifier.h"
26 26
27 namespace dart { 27 namespace dart {
28 28
29 DEFINE_FLAG(bool, deoptimize_alot, false, 29 DEFINE_FLAG(bool, deoptimize_alot, false,
30 "Deoptimizes all live frames when we are about to return to Dart code from" 30 "Deoptimizes all live frames when we are about to return to Dart code from"
31 " native entries."); 31 " native entries.");
32 DEFINE_FLAG(bool, inline_cache, true, "Enable inline caches"); 32 DEFINE_FLAG(bool, inline_cache, true, "Enable inline caches");
33 DEFINE_FLAG(bool, trace_deopt, false, "Trace deoptimization"); 33 DEFINE_FLAG(bool, trace_deopt, false, "Trace deoptimization");
34 DEFINE_FLAG(bool, trace_ic, false, "Trace IC handling"); 34 DEFINE_FLAG(bool, trace_ic, false, "Trace IC handling");
35 DEFINE_FLAG(bool, trace_ic_miss_in_optimized, false,
36 "Trace IC miss in optimized code");
35 DEFINE_FLAG(bool, trace_patching, false, "Trace patching of code."); 37 DEFINE_FLAG(bool, trace_patching, false, "Trace patching of code.");
36 DEFINE_FLAG(bool, trace_runtime_calls, false, "Trace runtime calls"); 38 DEFINE_FLAG(bool, trace_runtime_calls, false, "Trace runtime calls");
37 DEFINE_FLAG(int, optimization_counter_threshold, 2000, 39 DEFINE_FLAG(int, optimization_counter_threshold, 2000,
38 "Function's usage-counter value before it is optimized, -1 means never"); 40 "Function's usage-counter value before it is optimized, -1 means never");
39 DECLARE_FLAG(bool, enable_type_checks); 41 DECLARE_FLAG(bool, enable_type_checks);
40 DECLARE_FLAG(bool, trace_type_checks); 42 DECLARE_FLAG(bool, trace_type_checks);
41 DECLARE_FLAG(bool, report_usage_count); 43 DECLARE_FLAG(bool, report_usage_count);
42 DECLARE_FLAG(int, deoptimization_counter_threshold); 44 DECLARE_FLAG(int, deoptimization_counter_threshold);
43 DEFINE_FLAG(charp, optimization_filter, NULL, "Optimize only named function"); 45 DEFINE_FLAG(charp, optimization_filter, NULL, "Optimize only named function");
44 DEFINE_FLAG(bool, trace_failed_optimization_attempts, false, 46 DEFINE_FLAG(bool, trace_failed_optimization_attempts, false,
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 ic_data.AddReceiverCheck(Class::Handle(args[0]->clazz()).id(), 915 ic_data.AddReceiverCheck(Class::Handle(args[0]->clazz()).id(),
914 target_function); 916 target_function);
915 } else { 917 } else {
916 GrowableArray<intptr_t> class_ids(args.length()); 918 GrowableArray<intptr_t> class_ids(args.length());
917 ASSERT(ic_data.num_args_tested() == args.length()); 919 ASSERT(ic_data.num_args_tested() == args.length());
918 for (intptr_t i = 0; i < args.length(); i++) { 920 for (intptr_t i = 0; i < args.length(); i++) {
919 class_ids.Add(Class::Handle(args[i]->clazz()).id()); 921 class_ids.Add(Class::Handle(args[i]->clazz()).id());
920 } 922 }
921 ic_data.AddCheck(class_ids, target_function); 923 ic_data.AddCheck(class_ids, target_function);
922 } 924 }
925 if (FLAG_trace_ic_miss_in_optimized) {
926 const Code& caller = Code::Handle(Code::LookupCode(caller_frame->pc()));
927 if (caller.is_optimized()) {
928 OS::Print("IC miss in optimized code; call %s -> %s\n",
929 Function::Handle(caller.function()).ToCString(),
930 target_function.ToCString());
931 }
932 }
923 if (FLAG_trace_ic) { 933 if (FLAG_trace_ic) {
924 OS::Print("InlineCacheMissHandler %d call at %#"Px"' " 934 OS::Print("InlineCacheMissHandler %d call at %#"Px"' "
925 "adding <%s> id:%"Pd" -> <%s>\n", 935 "adding <%s> id:%"Pd" -> <%s>\n",
926 args.length(), 936 args.length(),
927 caller_frame->pc(), 937 caller_frame->pc(),
928 Class::Handle(receiver.clazz()).ToCString(), 938 Class::Handle(receiver.clazz()).ToCString(),
929 Class::Handle(receiver.clazz()).id(), 939 Class::Handle(receiver.clazz()).id(),
930 target_function.ToCString()); 940 target_function.ToCString());
931 } 941 }
932 return target_function.raw(); 942 return target_function.raw();
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 current->slot(), 1703 current->slot(),
1694 current->value()); 1704 current->value());
1695 } 1705 }
1696 1706
1697 delete current; 1707 delete current;
1698 } 1708 }
1699 } 1709 }
1700 1710
1701 1711
1702 } // namespace dart 1712 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698