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 5444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5455 | 5455 |
5456 void CallApiFunctionStub::Generate(MacroAssembler* masm) { | 5456 void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
5457 // ----------- S t a t e ------------- | 5457 // ----------- S t a t e ------------- |
5458 // -- r0 : callee | 5458 // -- r0 : callee |
5459 // -- r4 : call_data | 5459 // -- r4 : call_data |
5460 // -- r2 : holder | 5460 // -- r2 : holder |
5461 // -- r3 : api_function_address | 5461 // -- r3 : api_function_address |
5462 // -- r1 : thunk_arg | 5462 // -- r1 : thunk_arg |
5463 // -- cp : context | 5463 // -- cp : context |
5464 // -- | 5464 // -- |
5465 // -- esp[0] : last argument | 5465 // -- sp[0] : last argument |
5466 // -- ... | 5466 // -- ... |
5467 // -- esp[(argc - 1)* 4] : first argument | 5467 // -- sp[(argc - 1)* 4] : first argument |
5468 // -- esp[argc * 4] : receiver | 5468 // -- sp[argc * 4] : receiver |
5469 // ----------------------------------- | 5469 // ----------------------------------- |
5470 | 5470 |
5471 Register callee = r0; | 5471 Register callee = r0; |
5472 Register call_data = r4; | 5472 Register call_data = r4; |
5473 Register holder = r2; | 5473 Register holder = r2; |
5474 Register api_function_address = r3; | 5474 Register api_function_address = r3; |
5475 Register thunk_arg = r1; | 5475 Register thunk_arg = r1; |
5476 Register context = cp; | 5476 Register context = cp; |
5477 | 5477 |
5478 int argc = ArgumentBits::decode(bit_field_); | 5478 int argc = ArgumentBits::decode(bit_field_); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5560 __ CallApiFunctionAndReturn(api_function_address, | 5560 __ CallApiFunctionAndReturn(api_function_address, |
5561 thunk_ref, | 5561 thunk_ref, |
5562 thunk_arg, | 5562 thunk_arg, |
5563 kStackUnwindSpace, | 5563 kStackUnwindSpace, |
5564 return_value_operand, | 5564 return_value_operand, |
5565 restore_context ? | 5565 restore_context ? |
5566 &context_restore_operand : NULL); | 5566 &context_restore_operand : NULL); |
5567 } | 5567 } |
5568 | 5568 |
5569 | 5569 |
| 5570 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
| 5571 // ----------- S t a t e ------------- |
| 5572 // -- sp[0] : name |
| 5573 // -- sp[4 - kArgsLength*4] : PropertyCallbackArguments object |
| 5574 // -- ... |
| 5575 // -- r3 : api_function_address |
| 5576 // -- r2 : thunk_last_arg |
| 5577 // ----------------------------------- |
| 5578 |
| 5579 Register api_function_address = r3; |
| 5580 Register thunk_last_arg = r2; |
| 5581 |
| 5582 __ mov(r0, sp); // r0 = Handle<Name> |
| 5583 __ add(r1, r0, Operand(1 * kPointerSize)); // r1 = PCA |
| 5584 |
| 5585 const int kApiStackSpace = 1; |
| 5586 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 5587 __ EnterExitFrame(false, kApiStackSpace); |
| 5588 |
| 5589 // Create PropertyAccessorInfo instance on the stack above the exit frame with |
| 5590 // r1 (internal::Object** args_) as the data. |
| 5591 __ str(r1, MemOperand(sp, 1 * kPointerSize)); |
| 5592 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo& |
| 5593 |
| 5594 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; |
| 5595 |
| 5596 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); |
| 5597 ExternalReference::Type thunk_type = |
| 5598 ExternalReference::PROFILING_GETTER_CALL; |
| 5599 ApiFunction thunk_fun(thunk_address); |
| 5600 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, |
| 5601 masm->isolate()); |
| 5602 __ CallApiFunctionAndReturn(api_function_address, |
| 5603 thunk_ref, |
| 5604 thunk_last_arg, |
| 5605 kStackUnwindSpace, |
| 5606 MemOperand(fp, 6 * kPointerSize), |
| 5607 NULL); |
| 5608 } |
| 5609 |
| 5610 |
5570 #undef __ | 5611 #undef __ |
5571 | 5612 |
5572 } } // namespace v8::internal | 5613 } } // namespace v8::internal |
5573 | 5614 |
5574 #endif // V8_TARGET_ARCH_ARM | 5615 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |