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

Side by Side Diff: src/hydrogen-bce.cc

Issue 339583003: Do not eliminate bounds checks for "<const> - x". (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-385054.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/hydrogen-bce.h" 5 #include "src/hydrogen-bce.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 9
10 10
(...skipping 29 matching lines...) Expand all
40 if (index->left()->IsConstant()) { 40 if (index->left()->IsConstant()) {
41 constant = HConstant::cast(index->left()); 41 constant = HConstant::cast(index->left());
42 index_base = index->right(); 42 index_base = index->right();
43 } else if (index->right()->IsConstant()) { 43 } else if (index->right()->IsConstant()) {
44 constant = HConstant::cast(index->right()); 44 constant = HConstant::cast(index->right());
45 index_base = index->left(); 45 index_base = index->left();
46 } 46 }
47 } else if (check->index()->IsSub()) { 47 } else if (check->index()->IsSub()) {
48 HSub* index = HSub::cast(check->index()); 48 HSub* index = HSub::cast(check->index());
49 is_sub = true; 49 is_sub = true;
50 if (index->left()->IsConstant()) { 50 if (index->right()->IsConstant()) {
51 constant = HConstant::cast(index->left());
52 index_base = index->right();
53 } else if (index->right()->IsConstant()) {
54 constant = HConstant::cast(index->right()); 51 constant = HConstant::cast(index->right());
55 index_base = index->left(); 52 index_base = index->left();
56 } 53 }
57 } else if (check->index()->IsConstant()) { 54 } else if (check->index()->IsConstant()) {
58 index_base = check->block()->graph()->GetConstant0(); 55 index_base = check->block()->graph()->GetConstant0();
59 constant = HConstant::cast(check->index()); 56 constant = HConstant::cast(check->index());
60 } 57 }
61 58
62 if (constant != NULL && constant->HasInteger32Value()) { 59 if (constant != NULL && constant->HasInteger32Value()) {
63 *offset = is_sub ? - constant->Integer32Value() 60 *offset = is_sub ? - constant->Integer32Value()
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 if (data->FatherInDominatorTree()) { 456 if (data->FatherInDominatorTree()) {
460 table_.Insert(data->Key(), data->FatherInDominatorTree(), zone()); 457 table_.Insert(data->Key(), data->FatherInDominatorTree(), zone());
461 } else { 458 } else {
462 table_.Delete(data->Key()); 459 table_.Delete(data->Key());
463 } 460 }
464 data = data->NextInBasicBlock(); 461 data = data->NextInBasicBlock();
465 } 462 }
466 } 463 }
467 464
468 } } // namespace v8::internal 465 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-385054.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698