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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 1186113011: Some cleanup and be more conservative when guessing cids: use only current leaf classes; otherwise … (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: y Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/cha_test.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 6e894982823c3ff2532adc216cf371e0de025f25..c1f207b1f7f095e8e1e3bb786e5e57e54afe80b8 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -163,7 +163,6 @@ static bool IsNumberCid(intptr_t cid) {
// Attempt to build ICData for call using propagated class-ids.
bool FlowGraphOptimizer::TryCreateICData(InstanceCallInstr* call) {
- return false;
ASSERT(call->HasICData());
if (call->ic_data()->NumberOfChecks() > 0) {
// This occurs when an instance call has too many checks, will be converted
@@ -242,7 +241,9 @@ bool FlowGraphOptimizer::TryCreateICData(InstanceCallInstr* call) {
if ((call->token_kind() == Token::kGET) ||
(call->token_kind() == Token::kSET)) {
const Class& owner_class = Class::Handle(Z, function().Owner());
- if (!owner_class.is_abstract()) {
+ if (!owner_class.is_abstract() &&
+ !CHA::HasSubclasses(owner_class) &&
+ !CHA::IsImplemented(owner_class)) {
// Quite aggressive: if functions's owner has a a getter/setter of that
// name we add a check and call the setter directly. Considerable
// performance improvement, some increase in code space.
@@ -4008,9 +4009,9 @@ bool FlowGraphOptimizer::TypeCheckAsClassEquality(const AbstractType& type) {
// Signature classes have different type checking rules.
if (type_class.IsSignatureClass()) return false;
// Could be an interface check?
- if (thread()->cha()->IsImplemented(type_class)) return false;
+ if (CHA::IsImplemented(type_class)) return false;
// Check if there are subclasses.
- if (thread()->cha()->HasSubclasses(type_class)) {
+ if (CHA::HasSubclasses(type_class)) {
return false;
}
« no previous file with comments | « runtime/vm/cha_test.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698