| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 6 | 6 |
| 7 #include "v8.h" | 7 #include "v8.h" |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_MIPS | 9 #if V8_TARGET_ARCH_MIPS |
| 10 | 10 |
| (...skipping 3997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4008 mov(v0, s0); | 4008 mov(v0, s0); |
| 4009 jmp(&leave_exit_frame); | 4009 jmp(&leave_exit_frame); |
| 4010 } | 4010 } |
| 4011 | 4011 |
| 4012 | 4012 |
| 4013 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { | 4013 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { |
| 4014 return has_frame_ || !stub->SometimesSetsUpAFrame(); | 4014 return has_frame_ || !stub->SometimesSetsUpAFrame(); |
| 4015 } | 4015 } |
| 4016 | 4016 |
| 4017 | 4017 |
| 4018 void MacroAssembler::IllegalOperation(int num_arguments) { | |
| 4019 if (num_arguments > 0) { | |
| 4020 addiu(sp, sp, num_arguments * kPointerSize); | |
| 4021 } | |
| 4022 LoadRoot(v0, Heap::kUndefinedValueRootIndex); | |
| 4023 } | |
| 4024 | |
| 4025 | |
| 4026 void MacroAssembler::IndexFromHash(Register hash, | 4018 void MacroAssembler::IndexFromHash(Register hash, |
| 4027 Register index) { | 4019 Register index) { |
| 4028 // If the hash field contains an array index pick it out. The assert checks | 4020 // If the hash field contains an array index pick it out. The assert checks |
| 4029 // that the constants for the maximum number of digits for an array index | 4021 // that the constants for the maximum number of digits for an array index |
| 4030 // cached in the hash field and the number of bits reserved for it does not | 4022 // cached in the hash field and the number of bits reserved for it does not |
| 4031 // conflict. | 4023 // conflict. |
| 4032 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < | 4024 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < |
| 4033 (1 << String::kArrayIndexValueBits)); | 4025 (1 << String::kArrayIndexValueBits)); |
| 4034 // We want the smi-tagged index in key. kArrayIndexValueMask has zeros in | 4026 // We want the smi-tagged index in key. kArrayIndexValueMask has zeros in |
| 4035 // the low kHashShift bits. | 4027 // the low kHashShift bits. |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4170 | 4162 |
| 4171 | 4163 |
| 4172 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 4164 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
| 4173 int num_arguments, | 4165 int num_arguments, |
| 4174 SaveFPRegsMode save_doubles) { | 4166 SaveFPRegsMode save_doubles) { |
| 4175 // All parameters are on the stack. v0 has the return value after call. | 4167 // All parameters are on the stack. v0 has the return value after call. |
| 4176 | 4168 |
| 4177 // If the expected number of arguments of the runtime function is | 4169 // If the expected number of arguments of the runtime function is |
| 4178 // constant, we check that the actual number of arguments match the | 4170 // constant, we check that the actual number of arguments match the |
| 4179 // expectation. | 4171 // expectation. |
| 4180 if (f->nargs >= 0 && f->nargs != num_arguments) { | 4172 CHECK(f->nargs < 0 || f->nargs == num_arguments); |
| 4181 IllegalOperation(num_arguments); | |
| 4182 return; | |
| 4183 } | |
| 4184 | 4173 |
| 4185 // TODO(1236192): Most runtime routines don't need the number of | 4174 // TODO(1236192): Most runtime routines don't need the number of |
| 4186 // arguments passed in because it is constant. At some point we | 4175 // arguments passed in because it is constant. At some point we |
| 4187 // should remove this need and make the runtime routine entry code | 4176 // should remove this need and make the runtime routine entry code |
| 4188 // smarter. | 4177 // smarter. |
| 4189 PrepareCEntryArgs(num_arguments); | 4178 PrepareCEntryArgs(num_arguments); |
| 4190 PrepareCEntryFunction(ExternalReference(f, isolate())); | 4179 PrepareCEntryFunction(ExternalReference(f, isolate())); |
| 4191 CEntryStub stub(isolate(), 1, save_doubles); | 4180 CEntryStub stub(isolate(), 1, save_doubles); |
| 4192 CallStub(&stub); | 4181 CallStub(&stub); |
| 4193 } | 4182 } |
| (...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5746 } | 5735 } |
| 5747 if (ms.shift() > 0) sra(result, result, ms.shift()); | 5736 if (ms.shift() > 0) sra(result, result, ms.shift()); |
| 5748 srl(at, dividend, 31); | 5737 srl(at, dividend, 31); |
| 5749 Addu(result, result, Operand(at)); | 5738 Addu(result, result, Operand(at)); |
| 5750 } | 5739 } |
| 5751 | 5740 |
| 5752 | 5741 |
| 5753 } } // namespace v8::internal | 5742 } } // namespace v8::internal |
| 5754 | 5743 |
| 5755 #endif // V8_TARGET_ARCH_MIPS | 5744 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |