| 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // Load the double value of the parameter into f2, maybe converting the | 173 // Load the double value of the parameter into f2, maybe converting the |
| 174 // parameter to a number first using the ToNumberStub if necessary. | 174 // parameter to a number first using the ToNumberStub if necessary. |
| 175 Label convert, convert_smi, convert_number, done_convert; | 175 Label convert, convert_smi, convert_number, done_convert; |
| 176 __ bind(&convert); | 176 __ bind(&convert); |
| 177 __ JumpIfSmi(a2, &convert_smi); | 177 __ JumpIfSmi(a2, &convert_smi); |
| 178 __ lw(t0, FieldMemOperand(a2, HeapObject::kMapOffset)); | 178 __ lw(t0, FieldMemOperand(a2, HeapObject::kMapOffset)); |
| 179 __ JumpIfRoot(t0, Heap::kHeapNumberMapRootIndex, &convert_number); | 179 __ JumpIfRoot(t0, Heap::kHeapNumberMapRootIndex, &convert_number); |
| 180 { | 180 { |
| 181 // Parameter is not a Number, use the ToNumberStub to convert it. | 181 // Parameter is not a Number, use the ToNumberStub to convert it. |
| 182 FrameScope scope(masm, StackFrame::INTERNAL); | 182 FrameScope scope(masm, StackFrame::INTERNAL); |
| 183 __ SmiTag(a0); |
| 184 __ SmiTag(a3); |
| 183 __ Push(a0, a1, a3); | 185 __ Push(a0, a1, a3); |
| 184 __ mov(a0, a2); | 186 __ mov(a0, a2); |
| 185 ToNumberStub stub(masm->isolate()); | 187 ToNumberStub stub(masm->isolate()); |
| 186 __ CallStub(&stub); | 188 __ CallStub(&stub); |
| 187 __ mov(a2, v0); | 189 __ mov(a2, v0); |
| 188 __ Pop(a0, a1, a3); | 190 __ Pop(a0, a1, a3); |
| 189 { | 191 { |
| 190 // Restore the double accumulator value (f0). | 192 // Restore the double accumulator value (f0). |
| 191 Label restore_smi, done_restore; | 193 Label restore_smi, done_restore; |
| 192 __ JumpIfSmi(a1, &restore_smi); | 194 __ JumpIfSmi(a1, &restore_smi); |
| 193 __ ldc1(f0, FieldMemOperand(a1, HeapNumber::kValueOffset)); | 195 __ ldc1(f0, FieldMemOperand(a1, HeapNumber::kValueOffset)); |
| 194 __ jmp(&done_restore); | 196 __ jmp(&done_restore); |
| 195 __ bind(&restore_smi); | 197 __ bind(&restore_smi); |
| 196 __ SmiToDoubleFPURegister(a1, f0, t0); | 198 __ SmiToDoubleFPURegister(a1, f0, t0); |
| 197 __ bind(&done_restore); | 199 __ bind(&done_restore); |
| 198 } | 200 } |
| 201 __ SmiUntag(a3); |
| 202 __ SmiUntag(a0); |
| 199 } | 203 } |
| 200 __ jmp(&convert); | 204 __ jmp(&convert); |
| 201 __ bind(&convert_number); | 205 __ bind(&convert_number); |
| 202 __ ldc1(f2, FieldMemOperand(a2, HeapNumber::kValueOffset)); | 206 __ ldc1(f2, FieldMemOperand(a2, HeapNumber::kValueOffset)); |
| 203 __ jmp(&done_convert); | 207 __ jmp(&done_convert); |
| 204 __ bind(&convert_smi); | 208 __ bind(&convert_smi); |
| 205 __ SmiToDoubleFPURegister(a2, f2, t0); | 209 __ SmiToDoubleFPURegister(a2, f2, t0); |
| 206 __ bind(&done_convert); | 210 __ bind(&done_convert); |
| 207 | 211 |
| 208 // Perform the actual comparison with using Min/Max macro instructions the | 212 // Perform the actual comparison with using Min/Max macro instructions the |
| (...skipping 2388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2597 } | 2601 } |
| 2598 } | 2602 } |
| 2599 | 2603 |
| 2600 | 2604 |
| 2601 #undef __ | 2605 #undef __ |
| 2602 | 2606 |
| 2603 } // namespace internal | 2607 } // namespace internal |
| 2604 } // namespace v8 | 2608 } // namespace v8 |
| 2605 | 2609 |
| 2606 #endif // V8_TARGET_ARCH_MIPS | 2610 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |