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/aot_optimizer.h" | 5 #include "vm/aot_optimizer.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/branch_optimizer.h" | 8 #include "vm/branch_optimizer.h" |
9 #include "vm/cha.h" | 9 #include "vm/cha.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2060 | 2060 |
2061 // Private classes cannot be subclassed by later loaded libs. | 2061 // Private classes cannot be subclassed by later loaded libs. |
2062 if (!type_class.IsPrivate()) { | 2062 if (!type_class.IsPrivate()) { |
2063 if (FLAG_use_cha_deopt || isolate()->all_classes_finalized()) { | 2063 if (FLAG_use_cha_deopt || isolate()->all_classes_finalized()) { |
2064 if (FLAG_trace_cha) { | 2064 if (FLAG_trace_cha) { |
2065 THR_Print(" **(CHA) Typecheck as class equality since no " | 2065 THR_Print(" **(CHA) Typecheck as class equality since no " |
2066 "subclasses: %s\n", | 2066 "subclasses: %s\n", |
2067 type_class.ToCString()); | 2067 type_class.ToCString()); |
2068 } | 2068 } |
2069 if (FLAG_use_cha_deopt) { | 2069 if (FLAG_use_cha_deopt) { |
2070 thread()->cha()->AddToLeafClasses(type_class); | 2070 thread()->cha()->AddToGuardedClasses(type_class, /*subclass_count=*/0); |
Florian Schneider
2016/05/20 11:23:28
You can remove this, or add ASSERT(!FLAG_use_cha_d
Vyacheslav Egorov (Google)
2016/05/20 11:31:21
Done.
| |
2071 } | 2071 } |
2072 } else { | 2072 } else { |
2073 return false; | 2073 return false; |
2074 } | 2074 } |
2075 } | 2075 } |
2076 const intptr_t num_type_args = type_class.NumTypeArguments(); | 2076 const intptr_t num_type_args = type_class.NumTypeArguments(); |
2077 if (num_type_args > 0) { | 2077 if (num_type_args > 0) { |
2078 // Only raw types can be directly compared, thus disregarding type | 2078 // Only raw types can be directly compared, thus disregarding type |
2079 // arguments. | 2079 // arguments. |
2080 const intptr_t num_type_params = type_class.NumTypeParameters(); | 2080 const intptr_t num_type_params = type_class.NumTypeParameters(); |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2449 const Array& args_desc_array = Array::Handle(Z, | 2449 const Array& args_desc_array = Array::Handle(Z, |
2450 ArgumentsDescriptor::New(instr->ArgumentCount(), | 2450 ArgumentsDescriptor::New(instr->ArgumentCount(), |
2451 instr->argument_names())); | 2451 instr->argument_names())); |
2452 ArgumentsDescriptor args_desc(args_desc_array); | 2452 ArgumentsDescriptor args_desc(args_desc_array); |
2453 const Function& function = Function::Handle(Z, | 2453 const Function& function = Function::Handle(Z, |
2454 Resolver::ResolveDynamicForReceiverClass( | 2454 Resolver::ResolveDynamicForReceiverClass( |
2455 receiver_class, | 2455 receiver_class, |
2456 instr->function_name(), | 2456 instr->function_name(), |
2457 args_desc)); | 2457 args_desc)); |
2458 if (!function.IsNull()) { | 2458 if (!function.IsNull()) { |
2459 intptr_t subclasses = 0; | |
2459 if (!thread()->cha()->HasOverride(receiver_class, | 2460 if (!thread()->cha()->HasOverride(receiver_class, |
2460 instr->function_name())) { | 2461 instr->function_name(), |
2462 &subclasses)) { | |
2461 if (FLAG_trace_cha) { | 2463 if (FLAG_trace_cha) { |
2462 THR_Print(" **(CHA) Instance call needs no check, " | 2464 THR_Print(" **(CHA) Instance call needs no check, " |
2463 "no overrides of '%s' '%s'\n", | 2465 "no overrides of '%s' '%s'\n", |
2464 instr->function_name().ToCString(), receiver_class.ToCString()); | 2466 instr->function_name().ToCString(), receiver_class.ToCString()); |
2465 } | 2467 } |
2466 | 2468 |
2467 // Create fake IC data with the resolved target. | 2469 // Create fake IC data with the resolved target. |
2468 const ICData& ic_data = ICData::Handle( | 2470 const ICData& ic_data = ICData::Handle( |
2469 ICData::New(flow_graph_->function(), | 2471 ICData::New(flow_graph_->function(), |
2470 instr->function_name(), | 2472 instr->function_name(), |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2776 | 2778 |
2777 // Discard the environment from the original instruction because the store | 2779 // Discard the environment from the original instruction because the store |
2778 // can't deoptimize. | 2780 // can't deoptimize. |
2779 instr->RemoveEnvironment(); | 2781 instr->RemoveEnvironment(); |
2780 ReplaceCall(instr, store); | 2782 ReplaceCall(instr, store); |
2781 return true; | 2783 return true; |
2782 } | 2784 } |
2783 | 2785 |
2784 | 2786 |
2785 } // namespace dart | 2787 } // namespace dart |
OLD | NEW |