Revision: 6825
Author: [email protected]
Date: Wed Feb 16 07:15:52 2011
Log: X64 Crankshaft: Implement LCallFunction.
Review URL: http://codereview.chromium.org/6529052
http://code.google.com/p/v8/source/detail?r=6825

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

=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Wed Feb 16 07:15:20 2011 +++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Wed Feb 16 07:15:52 2011
@@ -2142,7 +2142,13 @@


 void LCodeGen::DoCallFunction(LCallFunction* instr) {
-  Abort("Unimplemented: %s", "DoCallFunction");
+  ASSERT(ToRegister(instr->context()).is(rsi));
+  ASSERT(ToRegister(instr->result()).is(rax));
+
+  int arity = instr->arity();
+  CallFunctionStub stub(arity, NOT_IN_LOOP, RECEIVER_MIGHT_BE_VALUE);
+  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+  __ Drop(1);
 }


=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.h       Wed Feb 16 07:15:20 2011
+++ /branches/bleeding_edge/src/x64/lithium-x64.h       Wed Feb 16 07:15:52 2011
@@ -1313,11 +1313,16 @@
 };


-class LCallFunction: public LTemplateInstruction<1, 0, 0> {
+class LCallFunction: public LTemplateInstruction<1, 1, 0> {
  public:
+  explicit LCallFunction(LOperand* context) {
+    inputs_[0] = context;
+  }
+
   DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
   DECLARE_HYDROGEN_ACCESSOR(CallFunction)

+  LOperand* context() { return inputs_[0]; }
   int arity() const { return hydrogen()->argument_count() - 2; }
 };

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

Reply via email to