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

Unified Diff: src/hydrogen-bce.cc

Issue 1133343003: Fix harmless HGraph verification failure after hoisting inlined bounds checks (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: git add testcase Created 5 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
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-487608.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-bce.cc
diff --git a/src/hydrogen-bce.cc b/src/hydrogen-bce.cc
index 729317eec67776d1c0ec689634c262a453fed3ca..48c1f770d80797fee5d195906f52e7eb11ea67ef 100644
--- a/src/hydrogen-bce.cc
+++ b/src/hydrogen-bce.cc
@@ -231,12 +231,15 @@ class BoundsCheckBbData: public ZoneObject {
HArithmeticBinaryOperation::cast(index_raw);
HValue* left_input = index->left();
HValue* right_input = index->right();
+ HValue* context = index->context();
bool must_move_index = false;
bool must_move_left_input = false;
bool must_move_right_input = false;
+ bool must_move_context = false;
for (HInstruction* cursor = end_of_scan_range; cursor != insert_before;) {
if (cursor == left_input) must_move_left_input = true;
if (cursor == right_input) must_move_right_input = true;
+ if (cursor == context) must_move_context = true;
if (cursor == index) must_move_index = true;
if (cursor->previous() == NULL) {
cursor = cursor->block()->dominator()->end();
@@ -258,6 +261,11 @@ class BoundsCheckBbData: public ZoneObject {
HConstant::cast(right_input)->Unlink();
HConstant::cast(right_input)->InsertBefore(index);
}
+ if (must_move_context) {
+ // Contexts are always constants.
+ HConstant::cast(context)->Unlink();
+ HConstant::cast(context)->InsertBefore(index);
+ }
} else if (index_raw->IsConstant()) {
HConstant* index = HConstant::cast(index_raw);
bool must_move = false;
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-487608.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698