Commit c61ac2cd authored by whesse@chromium.org's avatar whesse@chromium.org

X64 Crankshaft: Add DoOuterContext to x64 lithium.

Review URL: http://codereview.chromium.org/6570008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6914 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 791c9e2c
...@@ -2205,6 +2205,15 @@ void LCodeGen::DoContext(LContext* instr) { ...@@ -2205,6 +2205,15 @@ void LCodeGen::DoContext(LContext* instr) {
} }
void LCodeGen::DoOuterContext(LOuterContext* instr) {
Register context = ToRegister(instr->context());
Register result = ToRegister(instr->result());
__ movq(result,
Operand(context, Context::SlotOffset(Context::CLOSURE_INDEX)));
__ movq(result, FieldOperand(result, JSFunction::kContextOffset));
}
void LCodeGen::DoGlobalObject(LGlobalObject* instr) { void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
__ movq(result, GlobalObjectOperand()); __ movq(result, GlobalObjectOperand());
......
...@@ -1190,8 +1190,8 @@ LInstruction* LChunkBuilder::DoContext(HContext* instr) { ...@@ -1190,8 +1190,8 @@ LInstruction* LChunkBuilder::DoContext(HContext* instr) {
LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) { LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
Abort("Unimplemented: DoOuterContext"); LOperand* context = UseRegisterAtStart(instr->value());
return NULL; return DefineAsRegister(new LOuterContext(context));
} }
......
...@@ -129,6 +129,7 @@ class LCodeGen; ...@@ -129,6 +129,7 @@ class LCodeGen;
V(NumberUntagD) \ V(NumberUntagD) \
V(ObjectLiteral) \ V(ObjectLiteral) \
V(OsrEntry) \ V(OsrEntry) \
V(OuterContext) \
V(Parameter) \ V(Parameter) \
V(PixelArrayLength) \ V(PixelArrayLength) \
V(Power) \ V(Power) \
...@@ -1280,6 +1281,18 @@ class LContext: public LTemplateInstruction<1, 0, 0> { ...@@ -1280,6 +1281,18 @@ class LContext: public LTemplateInstruction<1, 0, 0> {
}; };
class LOuterContext: public LTemplateInstruction<1, 1, 0> {
public:
explicit LOuterContext(LOperand* context) {
inputs_[0] = context;
}
DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
LOperand* context() { return InputAt(0); }
};
class LGlobalObject: public LTemplateInstruction<1, 0, 0> { class LGlobalObject: public LTemplateInstruction<1, 0, 0> {
public: public:
DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object") DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
......
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