Commit e4215c6a authored by plind44@gmail.com's avatar plind44@gmail.com

MIPS: Simplify known successor block lowering.

Port r21589 (a9f3228)

BUG=
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/306053011

Patch from Balazs Kilvady <kilvadyb@homejinni.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21610 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d6500b6c
...@@ -849,7 +849,14 @@ void LChunkBuilder::VisitInstruction(HInstruction* current) { ...@@ -849,7 +849,14 @@ void LChunkBuilder::VisitInstruction(HInstruction* current) {
chunk_->AddInstruction(dummy, current_block_); chunk_->AddInstruction(dummy, current_block_);
} }
} else { } else {
instr = current->CompileToLithium(this); HBasicBlock* successor;
if (current->IsControlInstruction() &&
HControlInstruction::cast(current)->KnownSuccessorBlock(&successor) &&
successor != NULL) {
instr = new(zone()) LGoto(successor);
} else {
instr = current->CompileToLithium(this);
}
} }
argument_count_ += current->argument_delta(); argument_count_ += current->argument_delta();
...@@ -935,9 +942,6 @@ LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { ...@@ -935,9 +942,6 @@ LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
LInstruction* goto_instr = CheckElideControlInstruction(instr);
if (goto_instr != NULL) return goto_instr;
HValue* value = instr->value(); HValue* value = instr->value();
Representation r = value->representation(); Representation r = value->representation();
HType type = value->type(); HType type = value->type();
...@@ -957,9 +961,6 @@ LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { ...@@ -957,9 +961,6 @@ LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
LInstruction* goto_instr = CheckElideControlInstruction(instr);
if (goto_instr != NULL) return goto_instr;
ASSERT(instr->value()->representation().IsTagged()); ASSERT(instr->value()->representation().IsTagged());
LOperand* value = UseRegisterAtStart(instr->value()); LOperand* value = UseRegisterAtStart(instr->value());
LOperand* temp = TempRegister(); LOperand* temp = TempRegister();
...@@ -1628,8 +1629,6 @@ LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { ...@@ -1628,8 +1629,6 @@ LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
LInstruction* LChunkBuilder::DoCompareNumericAndBranch( LInstruction* LChunkBuilder::DoCompareNumericAndBranch(
HCompareNumericAndBranch* instr) { HCompareNumericAndBranch* instr) {
LInstruction* goto_instr = CheckElideControlInstruction(instr);
if (goto_instr != NULL) return goto_instr;
Representation r = instr->representation(); Representation r = instr->representation();
if (r.IsSmiOrInteger32()) { if (r.IsSmiOrInteger32()) {
ASSERT(instr->left()->representation().Equals(r)); ASSERT(instr->left()->representation().Equals(r));
...@@ -1650,8 +1649,6 @@ LInstruction* LChunkBuilder::DoCompareNumericAndBranch( ...@@ -1650,8 +1649,6 @@ LInstruction* LChunkBuilder::DoCompareNumericAndBranch(
LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch(
HCompareObjectEqAndBranch* instr) { HCompareObjectEqAndBranch* instr) {
LInstruction* goto_instr = CheckElideControlInstruction(instr);
if (goto_instr != NULL) return goto_instr;
LOperand* left = UseRegisterAtStart(instr->left()); LOperand* left = UseRegisterAtStart(instr->left());
LOperand* right = UseRegisterAtStart(instr->right()); LOperand* right = UseRegisterAtStart(instr->right());
return new(zone()) LCmpObjectEqAndBranch(left, right); return new(zone()) LCmpObjectEqAndBranch(left, right);
...@@ -1667,8 +1664,6 @@ LInstruction* LChunkBuilder::DoCompareHoleAndBranch( ...@@ -1667,8 +1664,6 @@ LInstruction* LChunkBuilder::DoCompareHoleAndBranch(
LInstruction* LChunkBuilder::DoCompareMinusZeroAndBranch( LInstruction* LChunkBuilder::DoCompareMinusZeroAndBranch(
HCompareMinusZeroAndBranch* instr) { HCompareMinusZeroAndBranch* instr) {
LInstruction* goto_instr = CheckElideControlInstruction(instr);
if (goto_instr != NULL) return goto_instr;
LOperand* value = UseRegister(instr->value()); LOperand* value = UseRegister(instr->value());
LOperand* scratch = TempRegister(); LOperand* scratch = TempRegister();
return new(zone()) LCompareMinusZeroAndBranch(value, scratch); return new(zone()) LCompareMinusZeroAndBranch(value, scratch);
...@@ -2433,9 +2428,6 @@ LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) { ...@@ -2433,9 +2428,6 @@ LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) { LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) {
LInstruction* goto_instr = CheckElideControlInstruction(instr);
if (goto_instr != NULL) return goto_instr;
return new(zone()) LTypeofIsAndBranch(UseTempRegister(instr->value())); return new(zone()) LTypeofIsAndBranch(UseTempRegister(instr->value()));
} }
......
...@@ -2655,8 +2655,6 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase { ...@@ -2655,8 +2655,6 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
// Build the sequence for the graph. // Build the sequence for the graph.
LPlatformChunk* Build(); LPlatformChunk* Build();
LInstruction* CheckElideControlInstruction(HControlInstruction* instr);
// Declare methods that deal with the individual node types. // Declare methods that deal with the individual node types.
#define DECLARE_DO(type) LInstruction* Do##type(H##type* node); #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment