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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 15507006: Improve constant propagation for Mint and Smi. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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
« runtime/vm/flow_graph_optimizer.cc ('K') | « 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 22973)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -4,6 +4,7 @@
#include "vm/intermediate_language.h"
+#include "vm/bigint_operations.h"
#include "vm/bit_vector.h"
#include "vm/dart_entry.h"
#include "vm/flow_graph_allocator.h"
@@ -193,6 +194,16 @@
}
+ConstantInstr::ConstantInstr(const Object& value) : value_(value) {
+ // Check that the value is not an incorrect Integer presentation.
Kevin Millikin (Google) 2013/05/22 07:50:35 presentation ==> representation?
srdjan 2013/05/22 15:13:33 Done.
+ ASSERT(!value.IsBigint() ||
+ !BigintOperations::FitsIntoSmi(Bigint::Cast(value)));
+ ASSERT(!value.IsBigint() ||
+ !BigintOperations::FitsIntoInt64(Bigint::Cast(value)));
+ ASSERT(!value.IsMint() || !Smi::IsValid64(Mint::Cast(value).AsInt64Value()));
+}
+
+
bool ConstantInstr::AttributesEqual(Instruction* other) const {
ConstantInstr* other_constant = other->AsConstant();
ASSERT(other_constant != NULL);
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698