| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 5294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5305 __ Set(StackSpaceOperand(3), 0); | 5305 __ Set(StackSpaceOperand(3), 0); |
| 5306 | 5306 |
| 5307 #if defined(__MINGW64__) || defined(_WIN64) | 5307 #if defined(__MINGW64__) || defined(_WIN64) |
| 5308 Register arguments_arg = rcx; | 5308 Register arguments_arg = rcx; |
| 5309 Register callback_arg = rdx; | 5309 Register callback_arg = rdx; |
| 5310 #else | 5310 #else |
| 5311 Register arguments_arg = rdi; | 5311 Register arguments_arg = rdi; |
| 5312 Register callback_arg = rsi; | 5312 Register callback_arg = rsi; |
| 5313 #endif | 5313 #endif |
| 5314 | 5314 |
| 5315 // It's okay if callback_arg == api_function_address | 5315 // It's okay if api_function_address == callback_arg |
| 5316 // but not arguments_arg | 5316 // but not arguments_arg |
| 5317 ASSERT(!api_function_address.is(arguments_arg)); | 5317 ASSERT(!api_function_address.is(arguments_arg)); |
| 5318 | 5318 |
| 5319 // v8::InvocationCallback's argument. | 5319 // v8::InvocationCallback's argument. |
| 5320 __ lea(arguments_arg, StackSpaceOperand(0)); | 5320 __ lea(arguments_arg, StackSpaceOperand(0)); |
| 5321 | 5321 |
| 5322 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback); | 5322 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback); |
| 5323 | 5323 |
| 5324 StackArgumentsAccessor args_from_rbp(rbp, FCA::kArgsLength, | 5324 StackArgumentsAccessor args_from_rbp(rbp, FCA::kArgsLength, |
| 5325 ARGUMENTS_DONT_CONTAIN_RECEIVER); | 5325 ARGUMENTS_DONT_CONTAIN_RECEIVER); |
| 5326 Operand context_restore_operand = args_from_rbp.GetArgumentOperand( | 5326 Operand context_restore_operand = args_from_rbp.GetArgumentOperand( |
| 5327 FCA::kArgsLength - 1 - FCA::kContextSaveIndex); | 5327 FCA::kArgsLength - 1 - FCA::kContextSaveIndex); |
| 5328 Operand return_value_operand = args_from_rbp.GetArgumentOperand( | 5328 Operand return_value_operand = args_from_rbp.GetArgumentOperand( |
| 5329 FCA::kArgsLength - 1 - FCA::kReturnValueOffset); | 5329 FCA::kArgsLength - 1 - FCA::kReturnValueOffset); |
| 5330 __ CallApiFunctionAndReturn( | 5330 __ CallApiFunctionAndReturn( |
| 5331 api_function_address, | 5331 api_function_address, |
| 5332 thunk_address, | 5332 thunk_address, |
| 5333 callback_arg, | 5333 callback_arg, |
| 5334 argc + FCA::kArgsLength + 1, | 5334 argc + FCA::kArgsLength + 1, |
| 5335 return_value_operand, | 5335 return_value_operand, |
| 5336 restore_context ? &context_restore_operand : NULL); | 5336 restore_context ? &context_restore_operand : NULL); |
| 5337 } | 5337 } |
| 5338 | 5338 |
| 5339 | 5339 |
| 5340 #undef __ | 5340 #undef __ |
| 5341 | 5341 |
| 5342 } } // namespace v8::internal | 5342 } } // namespace v8::internal |
| 5343 | 5343 |
| 5344 #endif // V8_TARGET_ARCH_X64 | 5344 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |