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 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // Load the double value of the parameter into f2, maybe converting the | 172 // Load the double value of the parameter into f2, maybe converting the |
173 // parameter to a number first using the ToNumberStub if necessary. | 173 // parameter to a number first using the ToNumberStub if necessary. |
174 Label convert, convert_smi, convert_number, done_convert; | 174 Label convert, convert_smi, convert_number, done_convert; |
175 __ bind(&convert); | 175 __ bind(&convert); |
176 __ JumpIfSmi(a2, &convert_smi); | 176 __ JumpIfSmi(a2, &convert_smi); |
177 __ ld(a4, FieldMemOperand(a2, HeapObject::kMapOffset)); | 177 __ ld(a4, FieldMemOperand(a2, HeapObject::kMapOffset)); |
178 __ JumpIfRoot(a4, Heap::kHeapNumberMapRootIndex, &convert_number); | 178 __ JumpIfRoot(a4, Heap::kHeapNumberMapRootIndex, &convert_number); |
179 { | 179 { |
180 // Parameter is not a Number, use the ToNumberStub to convert it. | 180 // Parameter is not a Number, use the ToNumberStub to convert it. |
181 FrameScope scope(masm, StackFrame::INTERNAL); | 181 FrameScope scope(masm, StackFrame::INTERNAL); |
| 182 __ SmiTag(a0); |
| 183 __ SmiTag(a3); |
182 __ Push(a0, a1, a3); | 184 __ Push(a0, a1, a3); |
183 __ mov(a0, a2); | 185 __ mov(a0, a2); |
184 ToNumberStub stub(masm->isolate()); | 186 ToNumberStub stub(masm->isolate()); |
185 __ CallStub(&stub); | 187 __ CallStub(&stub); |
186 __ mov(a2, v0); | 188 __ mov(a2, v0); |
187 __ Pop(a0, a1, a3); | 189 __ Pop(a0, a1, a3); |
188 { | 190 { |
189 // Restore the double accumulator value (f0). | 191 // Restore the double accumulator value (f0). |
190 Label restore_smi, done_restore; | 192 Label restore_smi, done_restore; |
191 __ JumpIfSmi(a1, &restore_smi); | 193 __ JumpIfSmi(a1, &restore_smi); |
192 __ ldc1(f0, FieldMemOperand(a1, HeapNumber::kValueOffset)); | 194 __ ldc1(f0, FieldMemOperand(a1, HeapNumber::kValueOffset)); |
193 __ jmp(&done_restore); | 195 __ jmp(&done_restore); |
194 __ bind(&restore_smi); | 196 __ bind(&restore_smi); |
195 __ SmiToDoubleFPURegister(a1, f0, a4); | 197 __ SmiToDoubleFPURegister(a1, f0, a4); |
196 __ bind(&done_restore); | 198 __ bind(&done_restore); |
197 } | 199 } |
| 200 __ SmiUntag(a3); |
| 201 __ SmiUntag(a0); |
198 } | 202 } |
199 __ jmp(&convert); | 203 __ jmp(&convert); |
200 __ bind(&convert_number); | 204 __ bind(&convert_number); |
201 __ ldc1(f2, FieldMemOperand(a2, HeapNumber::kValueOffset)); | 205 __ ldc1(f2, FieldMemOperand(a2, HeapNumber::kValueOffset)); |
202 __ jmp(&done_convert); | 206 __ jmp(&done_convert); |
203 __ bind(&convert_smi); | 207 __ bind(&convert_smi); |
204 __ SmiToDoubleFPURegister(a2, f2, a4); | 208 __ SmiToDoubleFPURegister(a2, f2, a4); |
205 __ bind(&done_convert); | 209 __ bind(&done_convert); |
206 | 210 |
207 // Perform the actual comparison with using Min/Max macro instructions the | 211 // Perform the actual comparison with using Min/Max macro instructions the |
(...skipping 2379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2587 } | 2591 } |
2588 } | 2592 } |
2589 | 2593 |
2590 | 2594 |
2591 #undef __ | 2595 #undef __ |
2592 | 2596 |
2593 } // namespace internal | 2597 } // namespace internal |
2594 } // namespace v8 | 2598 } // namespace v8 |
2595 | 2599 |
2596 #endif // V8_TARGET_ARCH_MIPS64 | 2600 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |