| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 "Trace deoptimization verbose"); | 44 "Trace deoptimization verbose"); |
| 45 DEFINE_FLAG(bool, trace_failed_optimization_attempts, false, | 45 DEFINE_FLAG(bool, trace_failed_optimization_attempts, false, |
| 46 "Traces all failed optimization attempts"); | 46 "Traces all failed optimization attempts"); |
| 47 DEFINE_FLAG(bool, trace_ic, false, "Trace IC handling"); | 47 DEFINE_FLAG(bool, trace_ic, false, "Trace IC handling"); |
| 48 DEFINE_FLAG(bool, trace_ic_miss_in_optimized, false, | 48 DEFINE_FLAG(bool, trace_ic_miss_in_optimized, false, |
| 49 "Trace IC miss in optimized code"); | 49 "Trace IC miss in optimized code"); |
| 50 DEFINE_FLAG(bool, trace_optimized_ic_calls, false, | 50 DEFINE_FLAG(bool, trace_optimized_ic_calls, false, |
| 51 "Trace IC calls in optimized code."); | 51 "Trace IC calls in optimized code."); |
| 52 DEFINE_FLAG(bool, trace_patching, false, "Trace patching of code."); | 52 DEFINE_FLAG(bool, trace_patching, false, "Trace patching of code."); |
| 53 DEFINE_FLAG(bool, trace_runtime_calls, false, "Trace runtime calls"); | 53 DEFINE_FLAG(bool, trace_runtime_calls, false, "Trace runtime calls"); |
| 54 DEFINE_FLAG(bool, trace_type_checks, false, "Trace runtime type checks."); |
| 54 | 55 |
| 55 DECLARE_FLAG(int, deoptimization_counter_threshold); | 56 DECLARE_FLAG(int, deoptimization_counter_threshold); |
| 56 DECLARE_FLAG(bool, enable_type_checks); | 57 DECLARE_FLAG(bool, enable_type_checks); |
| 57 DECLARE_FLAG(bool, report_usage_count); | 58 DECLARE_FLAG(bool, report_usage_count); |
| 58 DECLARE_FLAG(bool, trace_type_checks); | |
| 59 | 59 |
| 60 DEFINE_FLAG(bool, use_osr, true, "Use on-stack replacement."); | 60 DEFINE_FLAG(bool, use_osr, true, "Use on-stack replacement."); |
| 61 DEFINE_FLAG(bool, trace_osr, false, "Trace attempts at on-stack replacement."); | 61 DEFINE_FLAG(bool, trace_osr, false, "Trace attempts at on-stack replacement."); |
| 62 | 62 |
| 63 | 63 |
| 64 DEFINE_RUNTIME_ENTRY(TraceFunctionEntry, 1) { | 64 DEFINE_RUNTIME_ENTRY(TraceFunctionEntry, 1) { |
| 65 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); | 65 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); |
| 66 const String& function_name = String::Handle(function.name()); | 66 const String& function_name = String::Handle(function.name()); |
| 67 const String& class_name = | 67 const String& class_name = |
| 68 String::Handle(Class::Handle(function.Owner()).Name()); | 68 String::Handle(Class::Handle(function.Owner()).Name()); |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 static void UpdateTypeTestCache( | 425 static void UpdateTypeTestCache( |
| 426 const Instance& instance, | 426 const Instance& instance, |
| 427 const AbstractType& type, | 427 const AbstractType& type, |
| 428 const Instance& instantiator, | 428 const Instance& instantiator, |
| 429 const AbstractTypeArguments& incoming_instantiator_type_arguments, | 429 const AbstractTypeArguments& incoming_instantiator_type_arguments, |
| 430 const Bool& result, | 430 const Bool& result, |
| 431 const SubtypeTestCache& new_cache) { | 431 const SubtypeTestCache& new_cache) { |
| 432 // Since the test is expensive, don't do it unless necessary. | 432 // Since the test is expensive, don't do it unless necessary. |
| 433 // The list of disallowed cases will decrease as they are implemented in | 433 // The list of disallowed cases will decrease as they are implemented in |
| 434 // inlined assembly. | 434 // inlined assembly. |
| 435 if (new_cache.IsNull()) return; | 435 if (new_cache.IsNull()) { |
| 436 if (FLAG_trace_type_checks) { |
| 437 OS::Print("UpdateTypeTestCache: cache is null\n"); |
| 438 } |
| 439 return; |
| 440 } |
| 436 // Instantiator type arguments may be canonicalized later. | 441 // Instantiator type arguments may be canonicalized later. |
| 437 AbstractTypeArguments& instantiator_type_arguments = | 442 AbstractTypeArguments& instantiator_type_arguments = |
| 438 AbstractTypeArguments::Handle(incoming_instantiator_type_arguments.raw()); | 443 AbstractTypeArguments::Handle(incoming_instantiator_type_arguments.raw()); |
| 439 AbstractTypeArguments& instance_type_arguments = | 444 AbstractTypeArguments& instance_type_arguments = |
| 440 AbstractTypeArguments::Handle(); | 445 AbstractTypeArguments::Handle(); |
| 441 const Class& instance_class = Class::Handle(instance.clazz()); | 446 const Class& instance_class = Class::Handle(instance.clazz()); |
| 442 | 447 |
| 443 // Canonicalize type arguments. | 448 // Canonicalize type arguments. |
| 444 bool type_arguments_replaced = false; | 449 bool type_arguments_replaced = false; |
| 445 if (instance_class.NumTypeArguments() > 0) { | 450 if (instance_class.NumTypeArguments() > 0) { |
| (...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1699 // of the given value. | 1704 // of the given value. |
| 1700 // Arg0: Field object; | 1705 // Arg0: Field object; |
| 1701 // Arg1: Value that is being stored. | 1706 // Arg1: Value that is being stored. |
| 1702 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { | 1707 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { |
| 1703 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); | 1708 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
| 1704 const Object& value = Object::Handle(arguments.ArgAt(1)); | 1709 const Object& value = Object::Handle(arguments.ArgAt(1)); |
| 1705 field.UpdateGuardedCidAndLength(value); | 1710 field.UpdateGuardedCidAndLength(value); |
| 1706 } | 1711 } |
| 1707 | 1712 |
| 1708 } // namespace dart | 1713 } // namespace dart |
| OLD | NEW |