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

Unified Diff: runtime/vm/flow_graph_compiler_mips.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_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_mips.cc
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index 8e568c90feddde7553665af195527cfbe3e1ca01..8aea6080046af6893f18aa40979dd1c8cca9a99b 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -381,11 +381,8 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
} else {
__ beq(T0, ZR, is_not_instance_lbl);
}
- // Compare if the classes are equal.
const Register kClassIdReg = T0;
__ LoadClassId(kClassIdReg, kInstanceReg);
- __ BranchEqual(kClassIdReg, Immediate(type_class.id()), is_instance_lbl);
-
// See ClassFinalizer::ResolveSuperTypeAndInterfaces for list of restricted
// interfaces.
// Bool interface can be implemented only by core class Bool.
@@ -394,10 +391,6 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
__ b(is_not_instance_lbl);
return false;
}
- if (type.IsDartFunctionType()) {
- // Check if instance is a closure.
- __ BranchEqual(kClassIdReg, Immediate(kClosureCid), is_instance_lbl);
- }
// Custom checking for numbers (Smi, Mint, Bigint and Double).
// Note that instance is not Smi (checked above).
if (type.IsSubtypeOf(
@@ -410,6 +403,15 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
GenerateStringTypeCheck(kClassIdReg, is_instance_lbl, is_not_instance_lbl);
return false;
}
+ if (type.IsDartFunctionType()) {
+ // Check if instance is a closure.
+ __ BranchEqual(kClassIdReg, Immediate(kClosureCid), is_instance_lbl);
+ return true; // Fall through
+ }
+ // Compare if the classes are equal.
+ if (!type_class.is_abstract()) {
+ __ BranchEqual(kClassIdReg, Immediate(type_class.id()), is_instance_lbl);
+ }
// Otherwise fallthrough.
return true;
}
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698