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

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

Issue 125049: X64: Call runtime function from JS stack frame. (Closed)
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 | src/x64/frames-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/codegen-x64.cc
diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc
index 0fe3e11927526f0e2bb42d704f4777e2f1fa9253..75ba13dcf1b93edd6e732594099c403bfa21e5e2 100644
--- a/src/x64/codegen-x64.cc
+++ b/src/x64/codegen-x64.cc
@@ -429,12 +429,12 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
StackFrame::Type frame_type,
bool do_gc,
bool always_allocate_scope) {
- // rax: result parameter for PerformGC, if any
- // rbx: pointer to C function (C callee-saved)
- // rbp: frame pointer (restored after C call)
- // rsp: stack pointer (restored after C call)
- // rdi: number of arguments including receiver (C callee-saved)
- // rsi: pointer to the first argument (C callee-saved)
+ // rax: result parameter for PerformGC, if any.
William Hesse 2009/06/12 12:45:04 What does "result parameter" mean? This is really
Lasse Reichstein 2009/06/12 13:09:13 After the code of GenerateCore, the following code
William Hesse 2009/06/12 14:56:51 I would comment it as: // rax: result of the previ
+ // rbx: pointer to C function (C callee-saved).
+ // rbp: frame pointer (restored after C call).
+ // rsp: stack pointer (restored after C call).
+ // rdi: number of arguments including receiver.
William Hesse 2009/06/12 12:45:04 rdi is also callee-saved. Maybe specify the Unix/
Lasse Reichstein 2009/06/12 13:09:13 The rdi register is only callee-save in the Window
+ // r15: pointer to the first argument (C callee-saved)
if (do_gc) {
__ movq(Operand(rsp, 0), rax); // Result.
@@ -455,10 +455,11 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
#ifdef __MSVC__
// MSVC passes arguments in rcx, rdx, r8, r9
__ movq(rcx, rdi); // argc.
- __ movq(rdx, rsi); // argv.
+ __ movq(rdx, r15); // argv.
#else // ! defined(__MSVC__)
+ __ movq(rsi, r15); // argv.
// GCC passes arguments in rdi, rsi, rdx, rcx, r8, r9.
- // First two arguments are already in rdi, rsi.
+ // First arguments is already in rdi.
William Hesse 2009/06/12 12:45:04 argument
Lasse Reichstein 2009/06/12 13:09:13 fixed.
#endif
__ call(rbx);
// Result is in rax - do not destroy this register!
@@ -588,12 +589,12 @@ void CEntryStub::GenerateBody(MacroAssembler* masm, bool is_debug_break) {
// Enter the exit frame that transitions from JavaScript to C++.
__ EnterExitFrame(frame_type);
- // rax: result parameter for PerformGC, if any (setup below)
- // rbx: pointer to builtin function (C callee-saved)
- // rbp: frame pointer (restored after C call)
- // rsp: stack pointer (restored after C call)
- // rdi: number of arguments including receiver (C callee-saved)
- // rsi: argv pointer (C callee-saved)
+ // rax: result parameter for PerformGC, if any (setup below).
+ // rbx: pointer to builtin function (C callee-saved).
+ // rbp: frame pointer (restored after C call).
+ // rsp: stack pointer (restored after C call).
+ // rdi: number of arguments including receiver.
William Hesse 2009/06/12 12:45:04 Why isn't this marked as C callee-saved? Or if it
Lasse Reichstein 2009/06/12 13:09:13 It's not callee-saved in the Unix 64-bit ABI, but
+ // r15: argv pointer (C callee-saved).
Label throw_out_of_memory_exception;
Label throw_normal_exception;
« no previous file with comments | « no previous file | src/x64/frames-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698