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 5411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5422 __ CallApiFunctionAndReturn(api_function_address, | 5422 __ CallApiFunctionAndReturn(api_function_address, |
5423 thunk_address, | 5423 thunk_address, |
5424 ApiParameterOperand(1), | 5424 ApiParameterOperand(1), |
5425 argc + FCA::kArgsLength + 1, | 5425 argc + FCA::kArgsLength + 1, |
5426 return_value_operand, | 5426 return_value_operand, |
5427 restore_context ? | 5427 restore_context ? |
5428 &context_restore_operand : NULL); | 5428 &context_restore_operand : NULL); |
5429 } | 5429 } |
5430 | 5430 |
5431 | 5431 |
| 5432 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
| 5433 // ----------- S t a t e ------------- |
| 5434 // -- esp[0] : return address |
| 5435 // -- esp[4] : name |
| 5436 // -- esp[8 - kArgsLength*4] : PropertyCallbackArguments object |
| 5437 // -- ... |
| 5438 // -- edx : api_function_address |
| 5439 // ----------------------------------- |
| 5440 |
| 5441 // array for v8::Arguments::values_, handler for name and pointer |
| 5442 // to the values (it considered as smi in GC). |
| 5443 const int kStackSpace = PropertyCallbackArguments::kArgsLength + 2; |
| 5444 // Allocate space for opional callback address parameter in case |
| 5445 // CPU profiler is active. |
| 5446 const int kApiArgc = 2 + 1; |
| 5447 |
| 5448 Register api_function_address = edx; |
| 5449 Register scratch = ebx; |
| 5450 |
| 5451 // load address of name |
| 5452 __ lea(scratch, Operand(esp, 1 * kPointerSize)); |
| 5453 |
| 5454 __ PrepareCallApiFunction(kApiArgc); |
| 5455 __ mov(ApiParameterOperand(0), scratch); // name. |
| 5456 __ add(scratch, Immediate(kPointerSize)); |
| 5457 __ mov(ApiParameterOperand(1), scratch); // arguments pointer. |
| 5458 |
| 5459 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); |
| 5460 |
| 5461 __ CallApiFunctionAndReturn(api_function_address, |
| 5462 thunk_address, |
| 5463 ApiParameterOperand(2), |
| 5464 kStackSpace, |
| 5465 Operand(ebp, 7 * kPointerSize), |
| 5466 NULL); |
| 5467 } |
| 5468 |
| 5469 |
5432 #undef __ | 5470 #undef __ |
5433 | 5471 |
5434 } } // namespace v8::internal | 5472 } } // namespace v8::internal |
5435 | 5473 |
5436 #endif // V8_TARGET_ARCH_IA32 | 5474 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |