From 8e1796a4b0ff85de180fe4128cdff7ccd58e9e5b Mon Sep 17 00:00:00 2001 From: "whesse@chromium.org" Date: Wed, 16 Feb 2011 15:15:52 +0000 Subject: [PATCH] X64 Crankshaft: Implement LCallFunction. Review URL: http://codereview.chromium.org/6529052 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6825 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/x64/lithium-codegen-x64.cc | 8 +++++++- src/x64/lithium-x64.h | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index cca52f4..d9930e8 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -2142,7 +2142,13 @@ void LCodeGen::DoCallNamed(LCallNamed* instr) { 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); } diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h index 237a61a..87cf145 100644 --- a/src/x64/lithium-x64.h +++ b/src/x64/lithium-x64.h @@ -1313,11 +1313,16 @@ class LCallNamed: public LTemplateInstruction<1, 0, 0> { }; -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; } }; -- 2.7.4