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

Unified Diff: src/x64/lithium-x64.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/x64/lithium-x64.h ('k') | test/mjsunit/array-bounds-check-removal.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-x64.cc
===================================================================
--- src/x64/lithium-x64.cc (revision 11854)
+++ src/x64/lithium-x64.cc (working copy)
@@ -1601,9 +1601,16 @@
LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
- LOperand* value = UseRegisterOrConstantAtStart(instr->index());
- LOperand* length = Use(instr->length());
- return AssignEnvironment(new(zone()) LBoundsCheck(value, length));
+ if (instr->index()->IsConstant() ||
+ (instr->lower_offset() == 0 && instr->upper_offset() == 0)) {
+ return AssignEnvironment(new(zone()) LBoundsCheck(
+ UseRegisterOrConstantAtStart(instr->index()),
+ Use(instr->length()), NULL));
+ } else {
+ return AssignEnvironment(new(zone()) LBoundsCheck(
+ UseRegisterOrConstant(instr->index()),
+ Use(instr->length()), TempRegister()));
+ }
}
« no previous file with comments | « src/x64/lithium-x64.h ('k') | test/mjsunit/array-bounds-check-removal.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698