| 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 4107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4118 } else { | 4118 } else { |
| 4119 subu(dst, left, right); | 4119 subu(dst, left, right); |
| 4120 xor_(overflow_dst, dst, left); | 4120 xor_(overflow_dst, dst, left); |
| 4121 xor_(scratch, left, right); | 4121 xor_(scratch, left, right); |
| 4122 and_(overflow_dst, scratch, overflow_dst); | 4122 and_(overflow_dst, scratch, overflow_dst); |
| 4123 } | 4123 } |
| 4124 } | 4124 } |
| 4125 | 4125 |
| 4126 | 4126 |
| 4127 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 4127 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
| 4128 int num_arguments) { | 4128 int num_arguments, |
| 4129 SaveFPRegsMode save_doubles) { |
| 4129 // All parameters are on the stack. v0 has the return value after call. | 4130 // All parameters are on the stack. v0 has the return value after call. |
| 4130 | 4131 |
| 4131 // If the expected number of arguments of the runtime function is | 4132 // If the expected number of arguments of the runtime function is |
| 4132 // constant, we check that the actual number of arguments match the | 4133 // constant, we check that the actual number of arguments match the |
| 4133 // expectation. | 4134 // expectation. |
| 4134 if (f->nargs >= 0 && f->nargs != num_arguments) { | 4135 if (f->nargs >= 0 && f->nargs != num_arguments) { |
| 4135 IllegalOperation(num_arguments); | 4136 IllegalOperation(num_arguments); |
| 4136 return; | 4137 return; |
| 4137 } | 4138 } |
| 4138 | 4139 |
| 4139 // TODO(1236192): Most runtime routines don't need the number of | 4140 // TODO(1236192): Most runtime routines don't need the number of |
| 4140 // arguments passed in because it is constant. At some point we | 4141 // arguments passed in because it is constant. At some point we |
| 4141 // should remove this need and make the runtime routine entry code | 4142 // should remove this need and make the runtime routine entry code |
| 4142 // smarter. | 4143 // smarter. |
| 4143 PrepareCEntryArgs(num_arguments); | 4144 PrepareCEntryArgs(num_arguments); |
| 4144 PrepareCEntryFunction(ExternalReference(f, isolate())); | 4145 PrepareCEntryFunction(ExternalReference(f, isolate())); |
| 4145 CEntryStub stub(1); | 4146 CEntryStub stub(1, save_doubles); |
| 4146 CallStub(&stub); | 4147 CallStub(&stub); |
| 4147 } | 4148 } |
| 4148 | 4149 |
| 4149 | 4150 |
| 4150 void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) { | 4151 void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) { |
| 4151 const Runtime::Function* function = Runtime::FunctionForId(id); | 4152 const Runtime::Function* function = Runtime::FunctionForId(id); |
| 4152 PrepareCEntryArgs(function->nargs); | 4153 PrepareCEntryArgs(function->nargs); |
| 4153 PrepareCEntryFunction(ExternalReference(function, isolate())); | 4154 PrepareCEntryFunction(ExternalReference(function, isolate())); |
| 4154 CEntryStub stub(1, kSaveFPRegs); | 4155 CEntryStub stub(1, kSaveFPRegs); |
| 4155 CallStub(&stub); | 4156 CallStub(&stub); |
| 4156 } | 4157 } |
| 4157 | 4158 |
| 4158 | 4159 |
| 4159 void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) { | 4160 void MacroAssembler::CallRuntime(Runtime::FunctionId fid, |
| 4160 CallRuntime(Runtime::FunctionForId(fid), num_arguments); | 4161 int num_arguments, |
| 4162 SaveFPRegsMode save_doubles) { |
| 4163 CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles); |
| 4161 } | 4164 } |
| 4162 | 4165 |
| 4163 | 4166 |
| 4164 void MacroAssembler::CallExternalReference(const ExternalReference& ext, | 4167 void MacroAssembler::CallExternalReference(const ExternalReference& ext, |
| 4165 int num_arguments, | 4168 int num_arguments, |
| 4166 BranchDelaySlot bd) { | 4169 BranchDelaySlot bd) { |
| 4167 PrepareCEntryArgs(num_arguments); | 4170 PrepareCEntryArgs(num_arguments); |
| 4168 PrepareCEntryFunction(ext); | 4171 PrepareCEntryFunction(ext); |
| 4169 | 4172 |
| 4170 CEntryStub stub(1); | 4173 CEntryStub stub(1); |
| (...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5596 opcode == BGTZL); | 5599 opcode == BGTZL); |
| 5597 opcode = (cond == eq) ? BEQ : BNE; | 5600 opcode = (cond == eq) ? BEQ : BNE; |
| 5598 instr = (instr & ~kOpcodeMask) | opcode; | 5601 instr = (instr & ~kOpcodeMask) | opcode; |
| 5599 masm_.emit(instr); | 5602 masm_.emit(instr); |
| 5600 } | 5603 } |
| 5601 | 5604 |
| 5602 | 5605 |
| 5603 } } // namespace v8::internal | 5606 } } // namespace v8::internal |
| 5604 | 5607 |
| 5605 #endif // V8_TARGET_ARCH_MIPS | 5608 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |