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 3710 matching lines...) Loading... |
3721 FieldMemOperand(code_reg, | 3721 FieldMemOperand(code_reg, |
3722 SharedFunctionInfo::kFormalParameterCountOffset)); | 3722 SharedFunctionInfo::kFormalParameterCountOffset)); |
3723 sra(expected_reg, expected_reg, kSmiTagSize); | 3723 sra(expected_reg, expected_reg, kSmiTagSize); |
3724 lw(code_reg, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); | 3724 lw(code_reg, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); |
3725 | 3725 |
3726 ParameterCount expected(expected_reg); | 3726 ParameterCount expected(expected_reg); |
3727 InvokeCode(code_reg, expected, actual, flag, call_wrapper, call_kind); | 3727 InvokeCode(code_reg, expected, actual, flag, call_wrapper, call_kind); |
3728 } | 3728 } |
3729 | 3729 |
3730 | 3730 |
3731 void MacroAssembler::InvokeFunction(Handle<JSFunction> function, | 3731 void MacroAssembler::InvokeFunction(Register function, |
3732 const ParameterCount& expected, | 3732 const ParameterCount& expected, |
3733 const ParameterCount& actual, | 3733 const ParameterCount& actual, |
3734 InvokeFlag flag, | 3734 InvokeFlag flag, |
3735 const CallWrapper& call_wrapper, | 3735 const CallWrapper& call_wrapper, |
3736 CallKind call_kind) { | 3736 CallKind call_kind) { |
3737 // You can't call a function without a valid frame. | 3737 // You can't call a function without a valid frame. |
3738 ASSERT(flag == JUMP_FUNCTION || has_frame()); | 3738 ASSERT(flag == JUMP_FUNCTION || has_frame()); |
3739 | 3739 |
| 3740 // Contract with called JS functions requires that function is passed in a1. |
| 3741 ASSERT(function.is(a1)); |
| 3742 |
3740 // Get the function and setup the context. | 3743 // Get the function and setup the context. |
3741 li(a1, function); | |
3742 lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); | 3744 lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); |
3743 | 3745 |
3744 // We call indirectly through the code field in the function to | 3746 // We call indirectly through the code field in the function to |
3745 // allow recompilation to take effect without changing any of the | 3747 // allow recompilation to take effect without changing any of the |
3746 // call sites. | 3748 // call sites. |
3747 lw(a3, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); | 3749 lw(a3, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); |
3748 InvokeCode(a3, expected, actual, flag, call_wrapper, call_kind); | 3750 InvokeCode(a3, expected, actual, flag, call_wrapper, call_kind); |
3749 } | 3751 } |
3750 | 3752 |
3751 | 3753 |
| 3754 void MacroAssembler::InvokeFunction(Handle<JSFunction> function, |
| 3755 const ParameterCount& expected, |
| 3756 const ParameterCount& actual, |
| 3757 InvokeFlag flag, |
| 3758 const CallWrapper& call_wrapper, |
| 3759 CallKind call_kind) { |
| 3760 li(a1, function); |
| 3761 InvokeFunction(a1, expected, actual, flag, call_wrapper, call_kind); |
| 3762 } |
| 3763 |
| 3764 |
3752 void MacroAssembler::IsObjectJSObjectType(Register heap_object, | 3765 void MacroAssembler::IsObjectJSObjectType(Register heap_object, |
3753 Register map, | 3766 Register map, |
3754 Register scratch, | 3767 Register scratch, |
3755 Label* fail) { | 3768 Label* fail) { |
3756 lw(map, FieldMemOperand(heap_object, HeapObject::kMapOffset)); | 3769 lw(map, FieldMemOperand(heap_object, HeapObject::kMapOffset)); |
3757 IsInstanceJSObjectType(map, scratch, fail); | 3770 IsInstanceJSObjectType(map, scratch, fail); |
3758 } | 3771 } |
3759 | 3772 |
3760 | 3773 |
3761 void MacroAssembler::IsInstanceJSObjectType(Register map, | 3774 void MacroAssembler::IsInstanceJSObjectType(Register map, |
(...skipping 1993 matching lines...) Loading... |
5755 opcode == BGTZL); | 5768 opcode == BGTZL); |
5756 opcode = (cond == eq) ? BEQ : BNE; | 5769 opcode = (cond == eq) ? BEQ : BNE; |
5757 instr = (instr & ~kOpcodeMask) | opcode; | 5770 instr = (instr & ~kOpcodeMask) | opcode; |
5758 masm_.emit(instr); | 5771 masm_.emit(instr); |
5759 } | 5772 } |
5760 | 5773 |
5761 | 5774 |
5762 } } // namespace v8::internal | 5775 } } // namespace v8::internal |
5763 | 5776 |
5764 #endif // V8_TARGET_ARCH_MIPS | 5777 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |