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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 14979007: - Canonicalize array bounds checks to avoid deopting when comparing (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
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 22689)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -2339,6 +2339,12 @@
}
+Instruction* CheckArrayBoundInstr::Canonicalize(FlowGraph* flow_graph) {
+ return IsRedundant(RangeBoundary::FromDefinition(length()->definition())) ?
+ NULL : this;
+}
+
+
intptr_t CheckArrayBoundInstr::LengthOffsetFor(intptr_t class_id) {
if (RawObject::IsExternalTypedDataClassId(class_id)) {
return ExternalTypedData::length_offset();

Powered by Google App Engine
This is Rietveld 408576698