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

Unified Diff: src/hydrogen.cc

Issue 11445016: Make keyed operations use the unchecked index but still depend on the checked one. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments. Created 8 years 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 1590ab36698d9d5b98605111966ed17b8c7bc2a8..8019a12039f8434ffe38ec9003dc36448668fbf9 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3326,8 +3326,8 @@ bool HGraph::Optimize(SmartArrayPointer<char>* bailout_reason) {
HStackCheckEliminator sce(this);
sce.Process();
- EliminateRedundantBoundsChecks();
- DehoistSimpleArrayIndexComputations();
+ if (FLAG_array_bounds_checks_elimination) EliminateRedundantBoundsChecks();
+ if (FLAG_array_index_dehoisting) DehoistSimpleArrayIndexComputations();
if (FLAG_dead_code_elimination) DeadCodeElimination();
return true;
@@ -3484,7 +3484,7 @@ class BoundsCheckBbData: public ZoneObject {
}
if (!keep_new_check) {
- new_check->DeleteAndReplaceWith(NULL);
+ new_check->DeleteAndReplaceWith(new_check->index());
}
}
@@ -3591,21 +3591,13 @@ class BoundsCheckTable : private ZoneHashMap {
// Eliminates checks in bb and recursively in the dominated blocks.
-// Also replace the results of check instructions with the original value, if
-// the result is used. This is safe now, since we don't do code motion after
-// this point. It enables better register allocation since the value produced
-// by check instructions is really a copy of the original value.
void HGraph::EliminateRedundantBoundsChecks(HBasicBlock* bb,
BoundsCheckTable* table) {
BoundsCheckBbData* bb_data_list = NULL;
for (HInstruction* i = bb->first(); i != NULL; i = i->next()) {
if (!i->IsBoundsCheck()) continue;
-
HBoundsCheck* check = HBoundsCheck::cast(i);
- check->ReplaceAllUsesWith(check->index());
-
- if (!FLAG_array_bounds_checks_elimination) continue;
int32_t offset;
BoundsCheckKey* key =
@@ -3624,7 +3616,7 @@ void HGraph::EliminateRedundantBoundsChecks(HBasicBlock* bb,
NULL);
*data_p = bb_data_list;
} else if (data->OffsetIsCovered(offset)) {
- check->DeleteAndReplaceWith(NULL);
+ check->DeleteAndReplaceWith(check->index());
} else if (data->BasicBlock() == bb) {
data->CoverCheck(check, offset);
} else {
@@ -3719,8 +3711,6 @@ static void DehoistArrayIndex(ArrayInstructionInterface* array_operation) {
void HGraph::DehoistSimpleArrayIndexComputations() {
- if (!FLAG_array_index_dehoisting) return;
-
HPhase phase("H_Dehoist index computations", this);
for (int i = 0; i < blocks()->length(); ++i) {
for (HInstruction* instr = blocks()->at(i)->first();
« 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