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

Unified Diff: runtime/vm/kernel_to_il.cc

Issue 2794373002: VM [KERNEL] Use simpleInstanceOf in kernel. (Closed)
Patch Set: Created 3 years, 8 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
Index: runtime/vm/kernel_to_il.cc
diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc
index 901f07226295286ba579db3c88bd85ac4c323f92..0234480b69ca373f6fc1dbd3de73b037cdeffa61 100644
--- a/runtime/vm/kernel_to_il.cc
+++ b/runtime/vm/kernel_to_il.cc
@@ -5053,6 +5053,18 @@ void FlowGraphBuilder::VisitIsExpression(IsExpression* node) {
} else {
instructions += PushArgument();
+ // See if simple instanceOf is applicable.
+ if (simpleInstanceOfType(type)) {
+ instructions += Constant(type);
+ instructions += PushArgument(); // Type.
+ instructions += InstanceCall(
+ node->position(),
+ dart::Library::PrivateCoreLibName(Symbols::_simpleInstanceOf()),
+ Token::kIS, 2, 2); // 2 checked arguments.
+ fragment_ = instructions;
+ return;
+ }
+
if (!type.IsInstantiated()) {
instructions += LoadInstantiatorTypeArguments();
} else {
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/object.h » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698