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 5622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5633 // -- sp[argc * 4] : receiver | 5633 // -- sp[argc * 4] : receiver |
5634 // ----------------------------------- | 5634 // ----------------------------------- |
5635 | 5635 |
5636 Register callee = a0; | 5636 Register callee = a0; |
5637 Register call_data = t0; | 5637 Register call_data = t0; |
5638 Register holder = a2; | 5638 Register holder = a2; |
5639 Register api_function_address = a1; | 5639 Register api_function_address = a1; |
5640 Register context = cp; | 5640 Register context = cp; |
5641 | 5641 |
5642 int argc = ArgumentBits::decode(bit_field_); | 5642 int argc = ArgumentBits::decode(bit_field_); |
5643 bool restore_context = RestoreContextBits::decode(bit_field_); | 5643 bool is_store = IsStoreBits::decode(bit_field_); |
5644 bool call_data_undefined = CallDataUndefinedBits::decode(bit_field_); | 5644 bool call_data_undefined = CallDataUndefinedBits::decode(bit_field_); |
5645 | 5645 |
5646 typedef FunctionCallbackArguments FCA; | 5646 typedef FunctionCallbackArguments FCA; |
5647 | 5647 |
5648 STATIC_ASSERT(FCA::kContextSaveIndex == 6); | 5648 STATIC_ASSERT(FCA::kContextSaveIndex == 6); |
5649 STATIC_ASSERT(FCA::kCalleeIndex == 5); | 5649 STATIC_ASSERT(FCA::kCalleeIndex == 5); |
5650 STATIC_ASSERT(FCA::kDataIndex == 4); | 5650 STATIC_ASSERT(FCA::kDataIndex == 4); |
5651 STATIC_ASSERT(FCA::kReturnValueOffset == 3); | 5651 STATIC_ASSERT(FCA::kReturnValueOffset == 3); |
5652 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); | 5652 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); |
5653 STATIC_ASSERT(FCA::kIsolateIndex == 1); | 5653 STATIC_ASSERT(FCA::kIsolateIndex == 1); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5700 const int kStackUnwindSpace = argc + FCA::kArgsLength + 1; | 5700 const int kStackUnwindSpace = argc + FCA::kArgsLength + 1; |
5701 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback); | 5701 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback); |
5702 ExternalReference::Type thunk_type = ExternalReference::PROFILING_API_CALL; | 5702 ExternalReference::Type thunk_type = ExternalReference::PROFILING_API_CALL; |
5703 ApiFunction thunk_fun(thunk_address); | 5703 ApiFunction thunk_fun(thunk_address); |
5704 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, | 5704 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, |
5705 masm->isolate()); | 5705 masm->isolate()); |
5706 | 5706 |
5707 AllowExternalCallThatCantCauseGC scope(masm); | 5707 AllowExternalCallThatCantCauseGC scope(masm); |
5708 MemOperand context_restore_operand( | 5708 MemOperand context_restore_operand( |
5709 fp, (2 + FCA::kContextSaveIndex) * kPointerSize); | 5709 fp, (2 + FCA::kContextSaveIndex) * kPointerSize); |
5710 MemOperand return_value_operand(fp, | 5710 // Stores return the first js argument. |
5711 (2 + FCA::kReturnValueOffset) * kPointerSize); | 5711 int return_value_offset = |
| 5712 2 + (is_store ? FCA::kArgsLength : FCA::kReturnValueOffset); |
| 5713 MemOperand return_value_operand(fp, return_value_offset * kPointerSize); |
5712 | 5714 |
5713 __ CallApiFunctionAndReturn(api_function_address, | 5715 __ CallApiFunctionAndReturn(api_function_address, |
5714 thunk_ref, | 5716 thunk_ref, |
5715 kStackUnwindSpace, | 5717 kStackUnwindSpace, |
5716 return_value_operand, | 5718 return_value_operand, |
5717 restore_context ? | 5719 &context_restore_operand); |
5718 &context_restore_operand : NULL); | |
5719 } | 5720 } |
5720 | 5721 |
5721 | 5722 |
5722 void CallApiGetterStub::Generate(MacroAssembler* masm) { | 5723 void CallApiGetterStub::Generate(MacroAssembler* masm) { |
5723 // ----------- S t a t e ------------- | 5724 // ----------- S t a t e ------------- |
5724 // -- sp[0] : name | 5725 // -- sp[0] : name |
5725 // -- sp[4 - kArgsLength*4] : PropertyCallbackArguments object | 5726 // -- sp[4 - kArgsLength*4] : PropertyCallbackArguments object |
5726 // -- ... | 5727 // -- ... |
5727 // -- a2 : api_function_address | 5728 // -- a2 : api_function_address |
5728 // ----------------------------------- | 5729 // ----------------------------------- |
(...skipping 26 matching lines...) Expand all Loading... |
5755 MemOperand(fp, 6 * kPointerSize), | 5756 MemOperand(fp, 6 * kPointerSize), |
5756 NULL); | 5757 NULL); |
5757 } | 5758 } |
5758 | 5759 |
5759 | 5760 |
5760 #undef __ | 5761 #undef __ |
5761 | 5762 |
5762 } } // namespace v8::internal | 5763 } } // namespace v8::internal |
5763 | 5764 |
5764 #endif // V8_TARGET_ARCH_MIPS | 5765 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |