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

Unified Diff: runtime/vm/flow_graph_compiler_arm64.cc

Issue 2257803003: VM: Better code for is-checks and checked mode checks with simple types (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_arm64.cc
diff --git a/runtime/vm/flow_graph_compiler_arm64.cc b/runtime/vm/flow_graph_compiler_arm64.cc
index 5dd2308580d4db556a76e8adddb9f7df989ae81c..c7a544f51894b8c970b75f95d6f634bdee0cc2ca 100644
--- a/runtime/vm/flow_graph_compiler_arm64.cc
+++ b/runtime/vm/flow_graph_compiler_arm64.cc
@@ -382,11 +382,8 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
} else {
__ b(is_not_instance_lbl, EQ);
}
- // Compare if the classes are equal.
const Register kClassIdReg = R2;
__ LoadClassId(kClassIdReg, kInstanceReg);
- __ CompareImmediate(kClassIdReg, type_class.id());
- __ b(is_instance_lbl, EQ);
// See ClassFinalizer::ResolveSuperTypeAndInterfaces for list of restricted
// interfaces.
// Bool interface can be implemented only by core class Bool.
@@ -396,11 +393,6 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
__ b(is_not_instance_lbl);
return false;
}
- if (type.IsDartFunctionType()) {
- // Check if instance is a closure.
- __ CompareImmediate(kClassIdReg, kClosureCid);
- __ b(is_instance_lbl, EQ);
- }
// Custom checking for numbers (Smi, Mint, Bigint and Double).
// Note that instance is not Smi (checked above).
if (type.IsSubtypeOf(
@@ -413,6 +405,17 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
GenerateStringTypeCheck(kClassIdReg, is_instance_lbl, is_not_instance_lbl);
return false;
}
+ if (type.IsDartFunctionType()) {
+ // Check if instance is a closure.
+ __ CompareImmediate(kClassIdReg, kClosureCid);
+ __ b(is_instance_lbl, EQ);
+ return true; // Fall through
+ }
+ // Compare if the classes are equal.
+ if (!type_class.is_abstract()) {
+ __ CompareImmediate(kClassIdReg, type_class.id());
+ __ b(is_instance_lbl, EQ);
+ }
// Otherwise fallthrough.
return true;
}
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698