Commit e6c7ca36 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

X64: Add the global object as parameter to the GlobalReceiver instruction

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7222 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c83f0a71
......@@ -2354,9 +2354,9 @@ void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) {
Register global = ToRegister(instr->global());
Register result = ToRegister(instr->result());
__ movq(result, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
__ movq(result, FieldOperand(result, GlobalObject::kGlobalReceiverOffset));
__ movq(result, FieldOperand(global, GlobalObject::kGlobalReceiverOffset));
}
......
......@@ -1199,7 +1199,8 @@ LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) {
LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
return DefineAsRegister(new LGlobalReceiver);
LOperand* global_object = UseRegisterAtStart(instr->value());
return DefineAsRegister(new LGlobalReceiver(global_object));
}
......
......@@ -1331,9 +1331,15 @@ class LGlobalObject: public LTemplateInstruction<1, 0, 0> {
};
class LGlobalReceiver: public LTemplateInstruction<1, 0, 0> {
class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> {
public:
explicit LGlobalReceiver(LOperand* global_object) {
inputs_[0] = global_object;
}
DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
LOperand* global() { return InputAt(0); }
};
......
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