| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // tag is shifted away. | 241 // tag is shifted away. |
| 242 void MacroAssembler::RecordWrite(Register object, | 242 void MacroAssembler::RecordWrite(Register object, |
| 243 Register address, | 243 Register address, |
| 244 Register value, | 244 Register value, |
| 245 RAStatus ra_status, | 245 RAStatus ra_status, |
| 246 SaveFPRegsMode fp_mode, | 246 SaveFPRegsMode fp_mode, |
| 247 RememberedSetAction remembered_set_action, | 247 RememberedSetAction remembered_set_action, |
| 248 SmiCheck smi_check) { | 248 SmiCheck smi_check) { |
| 249 ASSERT(!AreAliased(object, address, value, t8)); | 249 ASSERT(!AreAliased(object, address, value, t8)); |
| 250 ASSERT(!AreAliased(object, address, value, t9)); | 250 ASSERT(!AreAliased(object, address, value, t9)); |
| 251 // The compiled code assumes that record write doesn't change the | |
| 252 // context register, so we check that none of the clobbered | |
| 253 // registers are cp. | |
| 254 ASSERT(!address.is(cp) && !value.is(cp)); | |
| 255 | 251 |
| 256 if (emit_debug_code()) { | 252 if (emit_debug_code()) { |
| 257 lw(at, MemOperand(address)); | 253 lw(at, MemOperand(address)); |
| 258 Assert( | 254 Assert( |
| 259 eq, kWrongAddressOrValuePassedToRecordWrite, at, Operand(value)); | 255 eq, kWrongAddressOrValuePassedToRecordWrite, at, Operand(value)); |
| 260 } | 256 } |
| 261 | 257 |
| 262 Label done; | 258 Label done; |
| 263 | 259 |
| 264 if (smi_check == INLINE_SMI_CHECK) { | 260 if (smi_check == INLINE_SMI_CHECK) { |
| (...skipping 3864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4129 } else { | 4125 } else { |
| 4130 subu(dst, left, right); | 4126 subu(dst, left, right); |
| 4131 xor_(overflow_dst, dst, left); | 4127 xor_(overflow_dst, dst, left); |
| 4132 xor_(scratch, left, right); | 4128 xor_(scratch, left, right); |
| 4133 and_(overflow_dst, scratch, overflow_dst); | 4129 and_(overflow_dst, scratch, overflow_dst); |
| 4134 } | 4130 } |
| 4135 } | 4131 } |
| 4136 | 4132 |
| 4137 | 4133 |
| 4138 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 4134 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
| 4139 int num_arguments) { | 4135 int num_arguments, |
| 4136 SaveFPRegsMode save_doubles) { |
| 4140 // All parameters are on the stack. v0 has the return value after call. | 4137 // All parameters are on the stack. v0 has the return value after call. |
| 4141 | 4138 |
| 4142 // If the expected number of arguments of the runtime function is | 4139 // If the expected number of arguments of the runtime function is |
| 4143 // constant, we check that the actual number of arguments match the | 4140 // constant, we check that the actual number of arguments match the |
| 4144 // expectation. | 4141 // expectation. |
| 4145 if (f->nargs >= 0 && f->nargs != num_arguments) { | 4142 if (f->nargs >= 0 && f->nargs != num_arguments) { |
| 4146 IllegalOperation(num_arguments); | 4143 IllegalOperation(num_arguments); |
| 4147 return; | 4144 return; |
| 4148 } | 4145 } |
| 4149 | 4146 |
| 4150 // TODO(1236192): Most runtime routines don't need the number of | 4147 // TODO(1236192): Most runtime routines don't need the number of |
| 4151 // arguments passed in because it is constant. At some point we | 4148 // arguments passed in because it is constant. At some point we |
| 4152 // should remove this need and make the runtime routine entry code | 4149 // should remove this need and make the runtime routine entry code |
| 4153 // smarter. | 4150 // smarter. |
| 4154 PrepareCEntryArgs(num_arguments); | 4151 PrepareCEntryArgs(num_arguments); |
| 4155 PrepareCEntryFunction(ExternalReference(f, isolate())); | 4152 PrepareCEntryFunction(ExternalReference(f, isolate())); |
| 4156 CEntryStub stub(1); | 4153 CEntryStub stub(1, save_doubles); |
| 4157 CallStub(&stub); | 4154 CallStub(&stub); |
| 4158 } | 4155 } |
| 4159 | 4156 |
| 4160 | 4157 |
| 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, | 4158 void MacroAssembler::CallExternalReference(const ExternalReference& ext, |
| 4176 int num_arguments, | 4159 int num_arguments, |
| 4177 BranchDelaySlot bd) { | 4160 BranchDelaySlot bd) { |
| 4178 PrepareCEntryArgs(num_arguments); | 4161 PrepareCEntryArgs(num_arguments); |
| 4179 PrepareCEntryFunction(ext); | 4162 PrepareCEntryFunction(ext); |
| 4180 | 4163 |
| 4181 CEntryStub stub(1); | 4164 CEntryStub stub(1); |
| 4182 CallStub(&stub, TypeFeedbackId::None(), al, zero_reg, Operand(zero_reg), bd); | 4165 CallStub(&stub, TypeFeedbackId::None(), al, zero_reg, Operand(zero_reg), bd); |
| 4183 } | 4166 } |
| 4184 | 4167 |
| (...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5691 opcode == BGTZL); | 5674 opcode == BGTZL); |
| 5692 opcode = (cond == eq) ? BEQ : BNE; | 5675 opcode = (cond == eq) ? BEQ : BNE; |
| 5693 instr = (instr & ~kOpcodeMask) | opcode; | 5676 instr = (instr & ~kOpcodeMask) | opcode; |
| 5694 masm_.emit(instr); | 5677 masm_.emit(instr); |
| 5695 } | 5678 } |
| 5696 | 5679 |
| 5697 | 5680 |
| 5698 } } // namespace v8::internal | 5681 } } // namespace v8::internal |
| 5699 | 5682 |
| 5700 #endif // V8_TARGET_ARCH_MIPS | 5683 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |