X64 Crankshaft: Implement CallKeyed in optimizing compiler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6897 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
whesse@chromium.org 2011-02-22 14:40:13 +00:00
parent 25f2f21f50
commit 08377c8449
3 changed files with 14 additions and 4 deletions

View File

@ -2353,7 +2353,12 @@ void LCodeGen::DoUnaryMathOperation(LUnaryMathOperation* instr) {
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);
}

View File

@ -297,7 +297,7 @@ void LLoadContextSlot::PrintDataTo(StringStream* stream) {
void LCallKeyed::PrintDataTo(StringStream* stream) {
stream->Add("[ecx] #%d / ", arity());
stream->Add("[rcx] #%d / ", arity());
}
@ -1216,8 +1216,11 @@ LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
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);
}

View File

@ -1295,6 +1295,8 @@ class LCallKeyed: public LTemplateInstruction<1, 1, 0> {
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; }