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 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/base/division-by-constant.h" | 9 #include "src/base/division-by-constant.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 4066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4077 | 4077 |
4078 // The code below is made a lot easier because the calling code already sets | 4078 // The code below is made a lot easier because the calling code already sets |
4079 // up actual and expected registers according to the contract if values are | 4079 // up actual and expected registers according to the contract if values are |
4080 // passed in registers. | 4080 // passed in registers. |
4081 DCHECK(actual.is_immediate() || actual.reg().is(a0)); | 4081 DCHECK(actual.is_immediate() || actual.reg().is(a0)); |
4082 DCHECK(expected.is_immediate() || expected.reg().is(a2)); | 4082 DCHECK(expected.is_immediate() || expected.reg().is(a2)); |
4083 DCHECK((!code_constant.is_null() && code_reg.is(no_reg)) || code_reg.is(a3)); | 4083 DCHECK((!code_constant.is_null() && code_reg.is(no_reg)) || code_reg.is(a3)); |
4084 | 4084 |
4085 if (expected.is_immediate()) { | 4085 if (expected.is_immediate()) { |
4086 DCHECK(actual.is_immediate()); | 4086 DCHECK(actual.is_immediate()); |
| 4087 li(a0, Operand(actual.immediate())); |
4087 if (expected.immediate() == actual.immediate()) { | 4088 if (expected.immediate() == actual.immediate()) { |
4088 definitely_matches = true; | 4089 definitely_matches = true; |
4089 } else { | 4090 } else { |
4090 li(a0, Operand(actual.immediate())); | |
4091 const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel; | 4091 const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel; |
4092 if (expected.immediate() == sentinel) { | 4092 if (expected.immediate() == sentinel) { |
4093 // Don't worry about adapting arguments for builtins that | 4093 // Don't worry about adapting arguments for builtins that |
4094 // don't want that done. Skip adaption code by making it look | 4094 // don't want that done. Skip adaption code by making it look |
4095 // like we have a match between expected and actual number of | 4095 // like we have a match between expected and actual number of |
4096 // arguments. | 4096 // arguments. |
4097 definitely_matches = true; | 4097 definitely_matches = true; |
4098 } else { | 4098 } else { |
4099 *definitely_mismatches = true; | 4099 *definitely_mismatches = true; |
4100 li(a2, Operand(expected.immediate())); | 4100 li(a2, Operand(expected.immediate())); |
4101 } | 4101 } |
4102 } | 4102 } |
4103 } else if (actual.is_immediate()) { | 4103 } else if (actual.is_immediate()) { |
4104 Branch(®ular_invoke, eq, expected.reg(), Operand(actual.immediate())); | |
4105 li(a0, Operand(actual.immediate())); | 4104 li(a0, Operand(actual.immediate())); |
| 4105 Branch(®ular_invoke, eq, expected.reg(), Operand(a0)); |
4106 } else { | 4106 } else { |
4107 Branch(®ular_invoke, eq, expected.reg(), Operand(actual.reg())); | 4107 Branch(®ular_invoke, eq, expected.reg(), Operand(actual.reg())); |
4108 } | 4108 } |
4109 | 4109 |
4110 if (!definitely_matches) { | 4110 if (!definitely_matches) { |
4111 if (!code_constant.is_null()) { | 4111 if (!code_constant.is_null()) { |
4112 li(a3, Operand(code_constant)); | 4112 li(a3, Operand(code_constant)); |
4113 daddiu(a3, a3, Code::kHeaderSize - kHeapObjectTag); | 4113 daddiu(a3, a3, Code::kHeaderSize - kHeapObjectTag); |
4114 } | 4114 } |
4115 | 4115 |
(...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6207 if (mag.shift > 0) sra(result, result, mag.shift); | 6207 if (mag.shift > 0) sra(result, result, mag.shift); |
6208 srl(at, dividend, 31); | 6208 srl(at, dividend, 31); |
6209 Addu(result, result, Operand(at)); | 6209 Addu(result, result, Operand(at)); |
6210 } | 6210 } |
6211 | 6211 |
6212 | 6212 |
6213 } // namespace internal | 6213 } // namespace internal |
6214 } // namespace v8 | 6214 } // namespace v8 |
6215 | 6215 |
6216 #endif // V8_TARGET_ARCH_MIPS64 | 6216 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |