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

Unified Diff: src/ia32/lithium-ia32.cc

Issue 10581014: BoundsCheck should be extended to support array_bounds_checks_elimination (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 6 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 | « src/ia32/lithium-ia32.h ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-ia32.cc
===================================================================
--- src/ia32/lithium-ia32.cc (revision 11854)
+++ src/ia32/lithium-ia32.cc (working copy)
@@ -1659,9 +1659,16 @@
LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
- return AssignEnvironment(new(zone()) LBoundsCheck(
- UseRegisterOrConstantAtStart(instr->index()),
- UseAtStart(instr->length())));
+ if (instr->index()->IsConstant() ||
+ (instr->lower_offset() == 0 && instr->upper_offset() == 0)) {
+ return AssignEnvironment(new(zone()) LBoundsCheck(
+ UseRegisterOrConstantAtStart(instr->index()),
+ UseAtStart(instr->length()), NULL));
+ } else {
+ return AssignEnvironment(new(zone()) LBoundsCheck(
+ UseRegisterOrConstant(instr->index()),
+ UseAtStart(instr->length()), TempRegister()));
+ }
}
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698