Author: [email protected]
Date: Wed Jun 24 08:02:46 2009
New Revision: 2266

Modified:
    branches/bleeding_edge/src/x64/builtins-x64.cc

Log:
X64 implementation: GenerateAdaptor builtin.
Review URL: http://codereview.chromium.org/146085

Modified: branches/bleeding_edge/src/x64/builtins-x64.cc
==============================================================================
--- branches/bleeding_edge/src/x64/builtins-x64.cc      (original)
+++ branches/bleeding_edge/src/x64/builtins-x64.cc      Wed Jun 24 08:02:46 2009
@@ -34,11 +34,20 @@

  #define __ ACCESS_MASM(masm)

-void Builtins::Generate_Adaptor(MacroAssembler* masm,
-                                Builtins::CFunctionId id) {
-  masm->int3();  // UNIMPLEMENTED.
+void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) {
+  // TODO(1238487): Don't pass the function in a static variable.
+  ExternalReference passed = ExternalReference::builtin_passed_function();
+  __ movq(kScratchRegister, passed.address(),  
RelocInfo::EXTERNAL_REFERENCE);
+  __ movq(Operand(kScratchRegister, 0), rdi);
+
+  // The actual argument count has already been loaded into register
+  // rax, but JumpToBuiltin expects rax to contain the number of
+  // arguments including the receiver.
+  __ incq(rax);
+  __ JumpToBuiltin(ExternalReference(id));
  }

+
  static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
    __ push(rbp);
    __ movq(rbp, rsp);
@@ -161,10 +170,12 @@

  void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
    masm->int3();  // UNIMPLEMENTED.
+  masm->movq(kScratchRegister, Immediate(0xBEFA));  // Debugging aid.
  }

  void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
    masm->int3();  // UNIMPLEMENTED.
+  masm->movq(kScratchRegister, Immediate(0xBEFC));  // Debugging aid.
  }



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

Reply via email to