| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4980 __ mov(ApiParameterOperand(3), scratch); | 4980 __ mov(ApiParameterOperand(3), scratch); |
| 4981 // FunctionCallbackInfo::length_. | 4981 // FunctionCallbackInfo::length_. |
| 4982 __ Move(ApiParameterOperand(4), Immediate(argc)); | 4982 __ Move(ApiParameterOperand(4), Immediate(argc)); |
| 4983 // FunctionCallbackInfo::is_construct_call_. | 4983 // FunctionCallbackInfo::is_construct_call_. |
| 4984 __ Move(ApiParameterOperand(5), Immediate(0)); | 4984 __ Move(ApiParameterOperand(5), Immediate(0)); |
| 4985 | 4985 |
| 4986 // v8::InvocationCallback's argument. | 4986 // v8::InvocationCallback's argument. |
| 4987 __ lea(scratch, ApiParameterOperand(2)); | 4987 __ lea(scratch, ApiParameterOperand(2)); |
| 4988 __ mov(ApiParameterOperand(0), scratch); | 4988 __ mov(ApiParameterOperand(0), scratch); |
| 4989 | 4989 |
| 4990 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback); | 4990 ExternalReference thunk_ref = |
| 4991 ExternalReference::invoke_function_callback(isolate()); |
| 4991 | 4992 |
| 4992 Operand context_restore_operand(ebp, | 4993 Operand context_restore_operand(ebp, |
| 4993 (2 + FCA::kContextSaveIndex) * kPointerSize); | 4994 (2 + FCA::kContextSaveIndex) * kPointerSize); |
| 4994 // Stores return the first js argument | 4995 // Stores return the first js argument |
| 4995 int return_value_offset = 0; | 4996 int return_value_offset = 0; |
| 4996 if (is_store) { | 4997 if (is_store) { |
| 4997 return_value_offset = 2 + FCA::kArgsLength; | 4998 return_value_offset = 2 + FCA::kArgsLength; |
| 4998 } else { | 4999 } else { |
| 4999 return_value_offset = 2 + FCA::kReturnValueOffset; | 5000 return_value_offset = 2 + FCA::kReturnValueOffset; |
| 5000 } | 5001 } |
| 5001 Operand return_value_operand(ebp, return_value_offset * kPointerSize); | 5002 Operand return_value_operand(ebp, return_value_offset * kPointerSize); |
| 5002 __ CallApiFunctionAndReturn(api_function_address, | 5003 __ CallApiFunctionAndReturn(api_function_address, |
| 5003 thunk_address, | 5004 thunk_ref, |
| 5004 ApiParameterOperand(1), | 5005 ApiParameterOperand(1), |
| 5005 argc + FCA::kArgsLength + 1, | 5006 argc + FCA::kArgsLength + 1, |
| 5006 return_value_operand, | 5007 return_value_operand, |
| 5007 &context_restore_operand); | 5008 &context_restore_operand); |
| 5008 } | 5009 } |
| 5009 | 5010 |
| 5010 | 5011 |
| 5011 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5012 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
| 5012 // ----------- S t a t e ------------- | 5013 // ----------- S t a t e ------------- |
| 5013 // -- esp[0] : return address | 5014 // -- esp[0] : return address |
| (...skipping 14 matching lines...) Expand all Loading... |
| 5028 Register scratch = ebx; | 5029 Register scratch = ebx; |
| 5029 | 5030 |
| 5030 // load address of name | 5031 // load address of name |
| 5031 __ lea(scratch, Operand(esp, 1 * kPointerSize)); | 5032 __ lea(scratch, Operand(esp, 1 * kPointerSize)); |
| 5032 | 5033 |
| 5033 __ PrepareCallApiFunction(kApiArgc); | 5034 __ PrepareCallApiFunction(kApiArgc); |
| 5034 __ mov(ApiParameterOperand(0), scratch); // name. | 5035 __ mov(ApiParameterOperand(0), scratch); // name. |
| 5035 __ add(scratch, Immediate(kPointerSize)); | 5036 __ add(scratch, Immediate(kPointerSize)); |
| 5036 __ mov(ApiParameterOperand(1), scratch); // arguments pointer. | 5037 __ mov(ApiParameterOperand(1), scratch); // arguments pointer. |
| 5037 | 5038 |
| 5038 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); | 5039 ExternalReference thunk_ref = |
| 5040 ExternalReference::invoke_accessor_getter_callback(isolate()); |
| 5039 | 5041 |
| 5040 __ CallApiFunctionAndReturn(api_function_address, | 5042 __ CallApiFunctionAndReturn(api_function_address, |
| 5041 thunk_address, | 5043 thunk_ref, |
| 5042 ApiParameterOperand(2), | 5044 ApiParameterOperand(2), |
| 5043 kStackSpace, | 5045 kStackSpace, |
| 5044 Operand(ebp, 7 * kPointerSize), | 5046 Operand(ebp, 7 * kPointerSize), |
| 5045 NULL); | 5047 NULL); |
| 5046 } | 5048 } |
| 5047 | 5049 |
| 5048 | 5050 |
| 5049 #undef __ | 5051 #undef __ |
| 5050 | 5052 |
| 5051 } } // namespace v8::internal | 5053 } } // namespace v8::internal |
| 5052 | 5054 |
| 5053 #endif // V8_TARGET_ARCH_IA32 | 5055 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |