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...) Expand 10 before | Expand all | Expand 10 after 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(Register function, | 3731 void MacroAssembler::InvokeFunction(Handle<JSFunction> 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 | |
3743 // Get the function and setup the context. | 3740 // Get the function and setup the context. |
| 3741 li(a1, function); |
3744 lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); | 3742 lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); |
3745 | 3743 |
3746 // We call indirectly through the code field in the function to | 3744 // We call indirectly through the code field in the function to |
3747 // allow recompilation to take effect without changing any of the | 3745 // allow recompilation to take effect without changing any of the |
3748 // call sites. | 3746 // call sites. |
3749 lw(a3, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); | 3747 lw(a3, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); |
3750 InvokeCode(a3, expected, actual, flag, call_wrapper, call_kind); | 3748 InvokeCode(a3, expected, actual, flag, call_wrapper, call_kind); |
3751 } | 3749 } |
3752 | 3750 |
3753 | 3751 |
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 | |
3765 void MacroAssembler::IsObjectJSObjectType(Register heap_object, | 3752 void MacroAssembler::IsObjectJSObjectType(Register heap_object, |
3766 Register map, | 3753 Register map, |
3767 Register scratch, | 3754 Register scratch, |
3768 Label* fail) { | 3755 Label* fail) { |
3769 lw(map, FieldMemOperand(heap_object, HeapObject::kMapOffset)); | 3756 lw(map, FieldMemOperand(heap_object, HeapObject::kMapOffset)); |
3770 IsInstanceJSObjectType(map, scratch, fail); | 3757 IsInstanceJSObjectType(map, scratch, fail); |
3771 } | 3758 } |
3772 | 3759 |
3773 | 3760 |
3774 void MacroAssembler::IsInstanceJSObjectType(Register map, | 3761 void MacroAssembler::IsInstanceJSObjectType(Register map, |
(...skipping 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5768 opcode == BGTZL); | 5755 opcode == BGTZL); |
5769 opcode = (cond == eq) ? BEQ : BNE; | 5756 opcode = (cond == eq) ? BEQ : BNE; |
5770 instr = (instr & ~kOpcodeMask) | opcode; | 5757 instr = (instr & ~kOpcodeMask) | opcode; |
5771 masm_.emit(instr); | 5758 masm_.emit(instr); |
5772 } | 5759 } |
5773 | 5760 |
5774 | 5761 |
5775 } } // namespace v8::internal | 5762 } } // namespace v8::internal |
5776 | 5763 |
5777 #endif // V8_TARGET_ARCH_MIPS | 5764 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |