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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 11191002: Optimize type checks for boolean expressions using class-id information. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 13679)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -1336,6 +1336,12 @@
}
+Definition* AssertBooleanInstr::Canonicalize() {
+ const intptr_t value_cid = value()->ResultCid();
+ return (value_cid == kBoolCid) ? value()->definition() : this;
+}
+
+
Definition* StrictCompareInstr::Canonicalize() {
if (!right()->BindsToConstant()) return this;
const Object& right_constant = right()->BoundConstant();
@@ -1353,10 +1359,10 @@
Instruction* CheckClassInstr::Canonicalize() {
- const intptr_t v_cid = value()->ResultCid();
+ const intptr_t value_cid = value()->ResultCid();
const intptr_t num_checks = unary_checks().NumberOfChecks();
if ((num_checks == 1) &&
- (v_cid == unary_checks().GetReceiverClassIdAt(0))) {
+ (value_cid == unary_checks().GetReceiverClassIdAt(0))) {
// No checks needed.
return NULL;
}
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698