Remove obsolete instruction HOuterContext.

HOuterContext can be expressed in terms of HLoadNamedField.

R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18867 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
bmeurer@chromium.org 2014-01-28 09:42:24 +00:00
parent 577b2de28b
commit f9575fb82a
14 changed files with 2 additions and 133 deletions

View File

@ -1042,12 +1042,6 @@ LInstruction* LChunkBuilder::DoContext(HContext* instr) {
}
LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
LOperand* context = UseRegisterAtStart(instr->value());
return DefineAsRegister(new(zone()) LOuterContext(context));
}
LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) {
LOperand* context = UseFixed(instr->context(), cp);
return MarkAsCall(new(zone()) LDeclareGlobals(context), instr);

View File

@ -145,7 +145,6 @@ class LCodeGen;
V(NumberTagU) \
V(NumberUntagD) \
V(OsrEntry) \
V(OuterContext) \
V(Parameter) \
V(Power) \
V(PushArgument) \
@ -1775,18 +1774,6 @@ class LContext V8_FINAL : public LTemplateInstruction<1, 0, 0> {
};
class LOuterContext V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
explicit LOuterContext(LOperand* context) {
inputs_[0] = context;
}
LOperand* context() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
};
class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> {
public:
explicit LDeclareGlobals(LOperand* context) {

View File

@ -3619,14 +3619,6 @@ void LCodeGen::DoContext(LContext* instr) {
}
void LCodeGen::DoOuterContext(LOuterContext* instr) {
Register context = ToRegister(instr->context());
Register result = ToRegister(instr->result());
__ ldr(result,
MemOperand(context, Context::SlotOffset(Context::PREVIOUS_INDEX)));
}
void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
ASSERT(ToRegister(instr->context()).is(cp));
__ push(cp); // The context is the first argument.

View File

@ -149,7 +149,6 @@ class LChunkBuilder;
V(Mod) \
V(Mul) \
V(OsrEntry) \
V(OuterContext) \
V(Parameter) \
V(Power) \
V(PushArgument) \
@ -2126,29 +2125,6 @@ class HThisFunction V8_FINAL : public HTemplateInstruction<0> {
};
class HOuterContext V8_FINAL : public HUnaryOperation {
public:
DECLARE_INSTRUCTION_FACTORY_P1(HOuterContext, HValue*);
DECLARE_CONCRETE_INSTRUCTION(OuterContext);
virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
return Representation::Tagged();
}
protected:
virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; }
private:
explicit HOuterContext(HValue* inner) : HUnaryOperation(inner) {
set_representation(Representation::Tagged());
SetFlag(kUseGVN);
}
virtual bool IsDeletable() const V8_OVERRIDE { return true; }
};
class HDeclareGlobals V8_FINAL : public HUnaryOperation {
public:
DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HDeclareGlobals,

View File

@ -4693,7 +4693,8 @@ HValue* HOptimizedGraphBuilder::BuildContextChainWalk(Variable* var) {
HValue* context = environment()->context();
int length = current_info()->scope()->ContextChainLength(var->scope());
while (length-- > 0) {
context = Add<HOuterContext>(context);
context = AddLoadNamedField(
context, HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX));
}
return context;
}

View File

@ -3762,14 +3762,6 @@ void LCodeGen::DoContext(LContext* instr) {
}
void LCodeGen::DoOuterContext(LOuterContext* instr) {
Register context = ToRegister(instr->context());
Register result = ToRegister(instr->result());
__ mov(result,
Operand(context, Context::SlotOffset(Context::PREVIOUS_INDEX)));
}
void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
ASSERT(ToRegister(instr->context()).is(esi));
__ push(esi); // The context is the first argument.

View File

@ -1127,12 +1127,6 @@ LInstruction* LChunkBuilder::DoContext(HContext* instr) {
}
LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
LOperand* context = UseRegisterAtStart(instr->value());
return DefineAsRegister(new(zone()) LOuterContext(context));
}
LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) {
LOperand* context = UseFixed(instr->context(), esi);
return MarkAsCall(new(zone()) LDeclareGlobals(context), instr);

View File

@ -145,7 +145,6 @@ class LCodeGen;
V(NumberTagU) \
V(NumberUntagD) \
V(OsrEntry) \
V(OuterContext) \
V(Parameter) \
V(Power) \
V(PushArgument) \
@ -1778,18 +1777,6 @@ class LContext V8_FINAL : public LTemplateInstruction<1, 0, 0> {
};
class LOuterContext V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
explicit LOuterContext(LOperand* context) {
inputs_[0] = context;
}
LOperand* context() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
};
class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> {
public:
explicit LDeclareGlobals(LOperand* context) {

View File

@ -3494,14 +3494,6 @@ void LCodeGen::DoContext(LContext* instr) {
}
void LCodeGen::DoOuterContext(LOuterContext* instr) {
Register context = ToRegister(instr->context());
Register result = ToRegister(instr->result());
__ lw(result,
MemOperand(context, Context::SlotOffset(Context::PREVIOUS_INDEX)));
}
void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
ASSERT(ToRegister(instr->context()).is(cp));
__ li(scratch0(), instr->hydrogen()->pairs());

View File

@ -1045,12 +1045,6 @@ LInstruction* LChunkBuilder::DoContext(HContext* instr) {
}
LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
LOperand* context = UseRegisterAtStart(instr->value());
return DefineAsRegister(new(zone()) LOuterContext(context));
}
LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) {
LOperand* context = UseFixed(instr->context(), cp);
return MarkAsCall(new(zone()) LDeclareGlobals(context), instr);

View File

@ -144,7 +144,6 @@ class LCodeGen;
V(NumberTagU) \
V(NumberUntagD) \
V(OsrEntry) \
V(OuterContext) \
V(Parameter) \
V(Power) \
V(PushArgument) \
@ -1753,18 +1752,6 @@ class LContext V8_FINAL : public LTemplateInstruction<1, 0, 0> {
};
class LOuterContext V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
explicit LOuterContext(LOperand* context) {
inputs_[0] = context;
}
LOperand* context() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
};
class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> {
public:
explicit LDeclareGlobals(LOperand* context) {

View File

@ -3331,14 +3331,6 @@ void LCodeGen::DoContext(LContext* instr) {
}
void LCodeGen::DoOuterContext(LOuterContext* instr) {
Register context = ToRegister(instr->context());
Register result = ToRegister(instr->result());
__ movp(result,
Operand(context, Context::SlotOffset(Context::PREVIOUS_INDEX)));
}
void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
ASSERT(ToRegister(instr->context()).is(rsi));
__ push(rsi); // The context is the first argument.

View File

@ -1049,12 +1049,6 @@ LInstruction* LChunkBuilder::DoContext(HContext* instr) {
}
LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
LOperand* context = UseRegisterAtStart(instr->value());
return DefineAsRegister(new(zone()) LOuterContext(context));
}
LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) {
LOperand* context = UseFixed(instr->context(), rsi);
return MarkAsCall(new(zone()) LDeclareGlobals(context), instr);

View File

@ -143,7 +143,6 @@ class LCodeGen;
V(NumberTagU) \
V(NumberUntagD) \
V(OsrEntry) \
V(OuterContext) \
V(Parameter) \
V(Power) \
V(PushArgument) \
@ -1720,18 +1719,6 @@ class LContext V8_FINAL : public LTemplateInstruction<1, 0, 0> {
};
class LOuterContext V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
explicit LOuterContext(LOperand* context) {
inputs_[0] = context;
}
LOperand* context() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
};
class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> {
public:
explicit LDeclareGlobals(LOperand* context) {