OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 8231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8242 // rsp: stack pointer (restored after C call). | 8242 // rsp: stack pointer (restored after C call). |
8243 // r14: number of arguments including receiver (C callee-saved). | 8243 // r14: number of arguments including receiver (C callee-saved). |
8244 // r15: pointer to the first argument (C callee-saved). | 8244 // r15: pointer to the first argument (C callee-saved). |
8245 // This pointer is reused in LeaveExitFrame(), so it is stored in a | 8245 // This pointer is reused in LeaveExitFrame(), so it is stored in a |
8246 // callee-saved register. | 8246 // callee-saved register. |
8247 | 8247 |
8248 // Simple results returned in rax (both AMD64 and Win64 calling conventions). | 8248 // Simple results returned in rax (both AMD64 and Win64 calling conventions). |
8249 // Complex results must be written to address passed as first argument. | 8249 // Complex results must be written to address passed as first argument. |
8250 // AMD64 calling convention: a struct of two pointers in rax+rdx | 8250 // AMD64 calling convention: a struct of two pointers in rax+rdx |
8251 | 8251 |
| 8252 // Check stack alignment. |
| 8253 if (FLAG_debug_code) { |
| 8254 __ CheckStackAlignment(); |
| 8255 } |
| 8256 |
8252 if (do_gc) { | 8257 if (do_gc) { |
8253 // Pass failure code returned from last attempt as first argument to GC. | 8258 // Pass failure code returned from last attempt as first argument to |
| 8259 // PerformGC. No need to use PrepareCallCFunction/CallCFunction here as the |
| 8260 // stack is known to be aligned. This function takes one argument which is |
| 8261 // passed in register. |
8254 #ifdef _WIN64 | 8262 #ifdef _WIN64 |
8255 __ movq(rcx, rax); | 8263 __ movq(rcx, rax); |
8256 #else // ! defined(_WIN64) | 8264 #else // ! defined(_WIN64) |
8257 __ movq(rdi, rax); | 8265 __ movq(rdi, rax); |
8258 #endif | 8266 #endif |
8259 __ movq(kScratchRegister, | 8267 __ movq(kScratchRegister, |
8260 FUNCTION_ADDR(Runtime::PerformGC), | 8268 FUNCTION_ADDR(Runtime::PerformGC), |
8261 RelocInfo::RUNTIME_ENTRY); | 8269 RelocInfo::RUNTIME_ENTRY); |
8262 __ call(kScratchRegister); | 8270 __ call(kScratchRegister); |
8263 } | 8271 } |
(...skipping 2165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10429 // Call the function from C++. | 10437 // Call the function from C++. |
10430 return FUNCTION_CAST<ModuloFunction>(buffer); | 10438 return FUNCTION_CAST<ModuloFunction>(buffer); |
10431 } | 10439 } |
10432 | 10440 |
10433 #endif | 10441 #endif |
10434 | 10442 |
10435 | 10443 |
10436 #undef __ | 10444 #undef __ |
10437 | 10445 |
10438 } } // namespace v8::internal | 10446 } } // namespace v8::internal |
OLD | NEW |