Revision: 6897
Author: [email protected]
Date: Tue Feb 22 06:40:13 2011
Log: X64 Crankshaft: Implement CallKeyed in optimizing compiler.
Review URL: http://codereview.chromium.org/6541069
http://code.google.com/p/v8/source/detail?r=6897

Modified:
 /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc
 /branches/bleeding_edge/src/x64/lithium-x64.cc
 /branches/bleeding_edge/src/x64/lithium-x64.h

=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Tue Feb 22 04:02:47 2011 +++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Tue Feb 22 06:40:13 2011
@@ -2353,7 +2353,12 @@


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


=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.cc      Tue Feb 22 04:02:47 2011
+++ /branches/bleeding_edge/src/x64/lithium-x64.cc      Tue Feb 22 06:40:13 2011
@@ -297,7 +297,7 @@


 void LCallKeyed::PrintDataTo(StringStream* stream) {
-  stream->Add("[ecx] #%d / ", arity());
+  stream->Add("[rcx] #%d / ", arity());
 }


@@ -1216,8 +1216,11 @@


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


=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.h       Tue Feb 22 04:02:47 2011
+++ /branches/bleeding_edge/src/x64/lithium-x64.h       Tue Feb 22 06:40:13 2011
@@ -1294,6 +1294,8 @@

   DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
   DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
+
+  LOperand* key() { return inputs_[0]; }

   virtual void PrintDataTo(StringStream* stream);

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to