| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index bf508dac28d7aeea2af3cfa3eb5281c7d0f83513..559dcd91109a808cef72f530e9c7a54dcab2d433 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -597,6 +597,11 @@ HConstant* HGraph::GetConstantInt32(SetOncePointer<HConstant>* pointer,
|
| }
|
|
|
|
|
| +HConstant* HGraph::GetConstant0() {
|
| + return GetConstantInt32(&constant_0_, 0);
|
| +}
|
| +
|
| +
|
| HConstant* HGraph::GetConstant1() {
|
| return GetConstantInt32(&constant_1_, 1);
|
| }
|
| @@ -3499,6 +3504,11 @@ bool HGraph::Optimize(SmartArrayPointer<char>* bailout_reason) {
|
| HStackCheckEliminator sce(this);
|
| sce.Process();
|
|
|
| + if (FLAG_use_ssi) {
|
| + BuildSsi();
|
| + CleanupSsi();
|
| + }
|
| +
|
| EliminateRedundantBoundsChecks();
|
| DehoistSimpleArrayIndexComputations();
|
| if (FLAG_dead_code_elimination) DeadCodeElimination();
|
| @@ -3939,6 +3949,28 @@ void HGraph::DehoistSimpleArrayIndexComputations() {
|
| }
|
|
|
|
|
| +void HGraph::BuildSsi() {
|
| + HPhase phase("H_Build SSI", this);
|
| + entry_block()->BuildSsiRecursively();
|
| +}
|
| +
|
| +
|
| +void HGraph::CleanupSsi() {
|
| + HPhase phase("H_Cleanup SSI", this);
|
| + for (int b_index = 0; b_index < blocks()->length(); b_index++) {
|
| + HBasicBlock* block = blocks()->at(b_index);
|
| + HInstruction* current = block->first();
|
| + while (current != NULL) {
|
| + HInstruction* next = current->next();
|
| + if (current->IsSsiDefinition()) {
|
| + current->DeleteAndReplaceWith(current->ValueBeforeSsi());
|
| + }
|
| + current = next;
|
| + }
|
| + }
|
| +}
|
| +
|
| +
|
| void HGraph::DeadCodeElimination() {
|
| HPhase phase("H_Dead code elimination", this);
|
| ZoneList<HInstruction*> worklist(blocks_.length(), zone());
|
|
|