OLD | NEW |
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 29 matching lines...) Expand all Loading... |
40 DEFINE_FLAG(charp, optimization_filter, NULL, "Optimize only named function"); | 40 DEFINE_FLAG(charp, optimization_filter, NULL, "Optimize only named function"); |
41 DEFINE_FLAG(bool, trace_failed_optimization_attempts, false, | 41 DEFINE_FLAG(bool, trace_failed_optimization_attempts, false, |
42 "Traces all failed optimization attempts"); | 42 "Traces all failed optimization attempts"); |
43 | 43 |
44 | 44 |
45 DEFINE_RUNTIME_ENTRY(TraceFunctionEntry, 1) { | 45 DEFINE_RUNTIME_ENTRY(TraceFunctionEntry, 1) { |
46 ASSERT(arguments.Count() == kTraceFunctionEntryRuntimeEntry.argument_count()); | 46 ASSERT(arguments.Count() == kTraceFunctionEntryRuntimeEntry.argument_count()); |
47 const Function& function = Function::CheckedHandle(arguments.At(0)); | 47 const Function& function = Function::CheckedHandle(arguments.At(0)); |
48 const String& function_name = String::Handle(function.name()); | 48 const String& function_name = String::Handle(function.name()); |
49 const String& class_name = | 49 const String& class_name = |
50 String::Handle(Class::Handle(function.owner()).Name()); | 50 String::Handle(Class::Handle(function.Owner()).Name()); |
51 OS::Print("> Entering '%s.%s'\n", | 51 OS::Print("> Entering '%s.%s'\n", |
52 class_name.ToCString(), function_name.ToCString()); | 52 class_name.ToCString(), function_name.ToCString()); |
53 } | 53 } |
54 | 54 |
55 | 55 |
56 DEFINE_RUNTIME_ENTRY(TraceFunctionExit, 1) { | 56 DEFINE_RUNTIME_ENTRY(TraceFunctionExit, 1) { |
57 ASSERT(arguments.Count() == kTraceFunctionExitRuntimeEntry.argument_count()); | 57 ASSERT(arguments.Count() == kTraceFunctionExitRuntimeEntry.argument_count()); |
58 const Function& function = Function::CheckedHandle(arguments.At(0)); | 58 const Function& function = Function::CheckedHandle(arguments.At(0)); |
59 const String& function_name = String::Handle(function.name()); | 59 const String& function_name = String::Handle(function.name()); |
60 const String& class_name = | 60 const String& class_name = |
61 String::Handle(Class::Handle(function.owner()).Name()); | 61 String::Handle(Class::Handle(function.Owner()).Name()); |
62 OS::Print("< Exiting '%s.%s'\n", | 62 OS::Print("< Exiting '%s.%s'\n", |
63 class_name.ToCString(), function_name.ToCString()); | 63 class_name.ToCString(), function_name.ToCString()); |
64 } | 64 } |
65 | 65 |
66 | 66 |
67 // Allocation of a fixed length array of given element type. | 67 // Allocation of a fixed length array of given element type. |
68 // This runtime entry is never called for allocating a List of a generic type, | 68 // This runtime entry is never called for allocating a List of a generic type, |
69 // because a prior run time call instantiates the element type if necessary. | 69 // because a prior run time call instantiates the element type if necessary. |
70 // Arg0: array length. | 70 // Arg0: array length. |
71 // Arg1: array element type. | 71 // Arg1: array element type. |
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1614 function.set_usage_counter(0); | 1614 function.set_usage_counter(0); |
1615 function.set_deoptimization_counter(function.deoptimization_counter() + 1); | 1615 function.set_deoptimization_counter(function.deoptimization_counter() + 1); |
1616 | 1616 |
1617 if (function.HasOptimizedCode()) { | 1617 if (function.HasOptimizedCode()) { |
1618 function.SwitchToUnoptimizedCode(); | 1618 function.SwitchToUnoptimizedCode(); |
1619 } | 1619 } |
1620 } | 1620 } |
1621 END_LEAF_RUNTIME_ENTRY | 1621 END_LEAF_RUNTIME_ENTRY |
1622 | 1622 |
1623 } // namespace dart | 1623 } // namespace dart |
OLD | NEW |