void LCodeGen::DoCallKeyed(LCallKeyed* instr) {
- Abort("Unimplemented: %s", "DoCallKeyed");
+ ASSERT(ToRegister(instr->key()).is(rcx));
+ ASSERT(ToRegister(instr->result()).is(rax));
+
+ int arity = instr->arity();
+ Handle<Code> ic = StubCache::ComputeKeyedCallInitialize(arity, NOT_IN_LOOP);
+ CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
void LCallKeyed::PrintDataTo(StringStream* stream) {
- stream->Add("[ecx] #%d / ", arity());
+ stream->Add("[rcx] #%d / ", arity());
}
LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) {
- Abort("Unimplemented: %s", "DoCallKeyed");
- return NULL;
+ ASSERT(instr->key()->representation().IsTagged());
+ LOperand* key = UseFixed(instr->key(), rcx);
+ argument_count_ -= instr->argument_count();
+ LCallKeyed* result = new LCallKeyed(key);
+ return MarkAsCall(DefineFixed(result, rax), instr);
}
DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
+ LOperand* key() { return inputs_[0]; }
+
virtual void PrintDataTo(StringStream* stream);
int arity() const { return hydrogen()->argument_count() - 1; }