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

Unified Diff: src/x64/macro-assembler-x64.cc

Issue 6778018: Only pass isolate parameter to C helper functions that need it. (Closed)
Patch Set: Created 9 years, 9 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 | « src/x64/full-codegen-x64.cc ('k') | src/x64/regexp-macro-assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/macro-assembler-x64.cc
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
index 654814c1e6be3403b60d15e00ae7e1f559ae1d6e..5f33a06c5cdc58b643925e4c23fc90e97d022c02 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -2851,9 +2851,6 @@ void MacroAssembler::PrepareCallCFunction(int num_arguments) {
ASSERT(frame_alignment != 0);
ASSERT(num_arguments >= 0);
- // Reserve space for Isolate address which is always passed as last parameter
- num_arguments += 1;
-
// Make stack end at alignment and allocate space for arguments and old rsp.
movq(kScratchRegister, rsp);
ASSERT(IsPowerOf2(frame_alignment));
@@ -2873,26 +2870,6 @@ void MacroAssembler::CallCFunction(ExternalReference function,
void MacroAssembler::CallCFunction(Register function, int num_arguments) {
- // Pass current isolate address as additional parameter.
- if (num_arguments < kRegisterPassedArguments) {
-#ifdef _WIN64
- // First four arguments are passed in registers on Windows.
- Register arg_to_reg[] = {rcx, rdx, r8, r9};
-#else
- // First six arguments are passed in registers on other platforms.
- Register arg_to_reg[] = {rdi, rsi, rdx, rcx, r8, r9};
-#endif
- Register reg = arg_to_reg[num_arguments];
- LoadAddress(reg, ExternalReference::isolate_address());
- } else {
- // Push Isolate pointer after all parameters.
- int argument_slots_on_stack =
- ArgumentStackSlotsForCFunctionCall(num_arguments);
- LoadAddress(kScratchRegister, ExternalReference::isolate_address());
- movq(Operand(rsp, argument_slots_on_stack * kPointerSize),
- kScratchRegister);
- }
-
// Check stack alignment.
if (emit_debug_code()) {
CheckStackAlignment();
@@ -2901,7 +2878,6 @@ void MacroAssembler::CallCFunction(Register function, int num_arguments) {
call(function);
ASSERT(OS::ActivationFrameAlignment() != 0);
ASSERT(num_arguments >= 0);
- num_arguments += 1;
int argument_slots_on_stack =
ArgumentStackSlotsForCFunctionCall(num_arguments);
movq(rsp, Operand(rsp, argument_slots_on_stack * kPointerSize));
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | src/x64/regexp-macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698