Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: src/x64/builtins-x64.cc

Issue 146085: X64 implementation: GenerateAdaptor builtin. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/builtins-x64.cc
===================================================================
--- src/x64/builtins-x64.cc (revision 2264)
+++ src/x64/builtins-x64.cc (working copy)
@@ -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.
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698