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/flow_graph.h" | 5 #include "vm/flow_graph.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 // may later add overriding methods. | 437 // may later add overriding methods. |
438 return true; | 438 return true; |
439 } | 439 } |
440 Definition* callee_receiver = call->ArgumentAt(0); | 440 Definition* callee_receiver = call->ArgumentAt(0); |
441 ASSERT(callee_receiver != NULL); | 441 ASSERT(callee_receiver != NULL); |
442 if (function().IsDynamicFunction() && IsReceiver(callee_receiver)) { | 442 if (function().IsDynamicFunction() && IsReceiver(callee_receiver)) { |
443 const String& name = (kind == RawFunction::kMethodExtractor) | 443 const String& name = (kind == RawFunction::kMethodExtractor) |
444 ? String::Handle(zone(), Field::NameFromGetter(call->function_name())) | 444 ? String::Handle(zone(), Field::NameFromGetter(call->function_name())) |
445 : call->function_name(); | 445 : call->function_name(); |
446 const Class& cls = Class::Handle(zone(), function().Owner()); | 446 const Class& cls = Class::Handle(zone(), function().Owner()); |
447 if (!thread()->cha()->HasOverride(cls, name)) { | 447 intptr_t subclass_count = 0; |
| 448 if (!thread()->cha()->HasOverride(cls, name, &subclass_count)) { |
448 if (FLAG_trace_cha) { | 449 if (FLAG_trace_cha) { |
449 THR_Print(" **(CHA) Instance call needs no check, " | 450 THR_Print(" **(CHA) Instance call needs no check, " |
450 "no overrides of '%s' '%s'\n", | 451 "no overrides of '%s' '%s'\n", |
451 name.ToCString(), cls.ToCString()); | 452 name.ToCString(), cls.ToCString()); |
452 } | 453 } |
453 thread()->cha()->AddToLeafClasses(cls); | 454 thread()->cha()->AddToGuardedClasses(cls, subclass_count); |
454 return false; | 455 return false; |
455 } | 456 } |
456 } | 457 } |
457 return true; | 458 return true; |
458 } | 459 } |
459 | 460 |
460 | 461 |
461 | 462 |
462 bool FlowGraph::VerifyUseLists() { | 463 bool FlowGraph::VerifyUseLists() { |
463 // Verify the initial definitions. | 464 // Verify the initial definitions. |
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2047 ReplaceCurrentInstruction(&it, current, replacement); | 2048 ReplaceCurrentInstruction(&it, current, replacement); |
2048 changed = true; | 2049 changed = true; |
2049 } | 2050 } |
2050 } | 2051 } |
2051 } | 2052 } |
2052 return changed; | 2053 return changed; |
2053 } | 2054 } |
2054 | 2055 |
2055 | 2056 |
2056 } // namespace dart | 2057 } // namespace dart |
OLD | NEW |