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
This commit is contained in:
sgjesse@chromium.org 2011-03-17 12:34:24 +00:00
parent c83f0a715e
commit e6c7ca3642
3 changed files with 11 additions and 4 deletions

View File

@ -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));
}

View File

@ -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));
}

View File

@ -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); }
};