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

Unified Diff: src/hydrogen.cc

Issue 16035016: Allow boundscheck elimination to work on Smi keys. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment Created 7 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 | « no previous file | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 8765cb9e2ff63c6a53bdf447b657bc20a0a8d412..14e0d4b7786650d86d5d0fb18bfd9c4ab625175d 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4115,7 +4115,7 @@ class BoundsCheckKey : public ZoneObject {
static BoundsCheckKey* Create(Zone* zone,
HBoundsCheck* check,
int32_t* offset) {
- if (!check->index()->representation().IsInteger32()) return NULL;
+ if (!check->index()->representation().IsSmiOrInteger32()) return NULL;
HValue* index_base = NULL;
HConstant* constant = NULL;
@@ -4211,7 +4211,7 @@ class BoundsCheckBbData: public ZoneObject {
// returns false, otherwise it returns true.
bool CoverCheck(HBoundsCheck* new_check,
int32_t new_offset) {
- ASSERT(new_check->index()->representation().IsInteger32());
+ ASSERT(new_check->index()->representation().IsSmiOrInteger32());
bool keep_new_check = false;
if (new_offset > upper_offset_) {
@@ -4320,8 +4320,8 @@ class BoundsCheckBbData: public ZoneObject {
HValue* index_context = IndexContext(*add, check);
if (index_context == NULL) return false;
- HConstant* new_constant = new(BasicBlock()->zone())
- HConstant(new_offset, Representation::Integer32());
+ HConstant* new_constant = new(BasicBlock()->zone()) HConstant(
+ new_offset, representation);
if (*add == NULL) {
new_constant->InsertBefore(check);
(*add) = HAdd::New(
@@ -4453,7 +4453,7 @@ void HGraph::EliminateRedundantBoundsChecks() {
static void DehoistArrayIndex(ArrayInstructionInterface* array_operation) {
HValue* index = array_operation->GetKey()->ActualValue();
- if (!index->representation().IsInteger32()) return;
+ if (!index->representation().IsSmiOrInteger32()) return;
HConstant* constant;
HValue* subexpression;
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698