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 4118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4129 } else { | 4129 } else { |
4130 subu(dst, left, right); | 4130 subu(dst, left, right); |
4131 xor_(overflow_dst, dst, left); | 4131 xor_(overflow_dst, dst, left); |
4132 xor_(scratch, left, right); | 4132 xor_(scratch, left, right); |
4133 and_(overflow_dst, scratch, overflow_dst); | 4133 and_(overflow_dst, scratch, overflow_dst); |
4134 } | 4134 } |
4135 } | 4135 } |
4136 | 4136 |
4137 | 4137 |
4138 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 4138 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
4139 int num_arguments) { | 4139 int num_arguments, |
| 4140 SaveFPRegsMode save_doubles) { |
4140 // All parameters are on the stack. v0 has the return value after call. | 4141 // All parameters are on the stack. v0 has the return value after call. |
4141 | 4142 |
4142 // If the expected number of arguments of the runtime function is | 4143 // If the expected number of arguments of the runtime function is |
4143 // constant, we check that the actual number of arguments match the | 4144 // constant, we check that the actual number of arguments match the |
4144 // expectation. | 4145 // expectation. |
4145 if (f->nargs >= 0 && f->nargs != num_arguments) { | 4146 if (f->nargs >= 0 && f->nargs != num_arguments) { |
4146 IllegalOperation(num_arguments); | 4147 IllegalOperation(num_arguments); |
4147 return; | 4148 return; |
4148 } | 4149 } |
4149 | 4150 |
4150 // TODO(1236192): Most runtime routines don't need the number of | 4151 // TODO(1236192): Most runtime routines don't need the number of |
4151 // arguments passed in because it is constant. At some point we | 4152 // arguments passed in because it is constant. At some point we |
4152 // should remove this need and make the runtime routine entry code | 4153 // should remove this need and make the runtime routine entry code |
4153 // smarter. | 4154 // smarter. |
4154 PrepareCEntryArgs(num_arguments); | 4155 PrepareCEntryArgs(num_arguments); |
4155 PrepareCEntryFunction(ExternalReference(f, isolate())); | 4156 PrepareCEntryFunction(ExternalReference(f, isolate())); |
4156 CEntryStub stub(1); | 4157 CEntryStub stub(1, save_doubles); |
4157 CallStub(&stub); | 4158 CallStub(&stub); |
4158 } | 4159 } |
4159 | 4160 |
4160 | 4161 |
4161 void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) { | |
4162 const Runtime::Function* function = Runtime::FunctionForId(id); | |
4163 PrepareCEntryArgs(function->nargs); | |
4164 PrepareCEntryFunction(ExternalReference(function, isolate())); | |
4165 CEntryStub stub(1, kSaveFPRegs); | |
4166 CallStub(&stub); | |
4167 } | |
4168 | |
4169 | |
4170 void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) { | |
4171 CallRuntime(Runtime::FunctionForId(fid), num_arguments); | |
4172 } | |
4173 | |
4174 | |
4175 void MacroAssembler::CallExternalReference(const ExternalReference& ext, | 4162 void MacroAssembler::CallExternalReference(const ExternalReference& ext, |
4176 int num_arguments, | 4163 int num_arguments, |
4177 BranchDelaySlot bd) { | 4164 BranchDelaySlot bd) { |
4178 PrepareCEntryArgs(num_arguments); | 4165 PrepareCEntryArgs(num_arguments); |
4179 PrepareCEntryFunction(ext); | 4166 PrepareCEntryFunction(ext); |
4180 | 4167 |
4181 CEntryStub stub(1); | 4168 CEntryStub stub(1); |
4182 CallStub(&stub, TypeFeedbackId::None(), al, zero_reg, Operand(zero_reg), bd); | 4169 CallStub(&stub, TypeFeedbackId::None(), al, zero_reg, Operand(zero_reg), bd); |
4183 } | 4170 } |
4184 | 4171 |
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5691 opcode == BGTZL); | 5678 opcode == BGTZL); |
5692 opcode = (cond == eq) ? BEQ : BNE; | 5679 opcode = (cond == eq) ? BEQ : BNE; |
5693 instr = (instr & ~kOpcodeMask) | opcode; | 5680 instr = (instr & ~kOpcodeMask) | opcode; |
5694 masm_.emit(instr); | 5681 masm_.emit(instr); |
5695 } | 5682 } |
5696 | 5683 |
5697 | 5684 |
5698 } } // namespace v8::internal | 5685 } } // namespace v8::internal |
5699 | 5686 |
5700 #endif // V8_TARGET_ARCH_MIPS | 5687 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |