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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // +Infinity), with the tagged value in a1 and the double value in f0. | 159 // +Infinity), with the tagged value in a1 and the double value in f0. |
160 __ LoadRoot(a1, root_index); | 160 __ LoadRoot(a1, root_index); |
161 __ ldc1(f0, FieldMemOperand(a1, HeapNumber::kValueOffset)); | 161 __ ldc1(f0, FieldMemOperand(a1, HeapNumber::kValueOffset)); |
162 __ mov(a3, a0); | 162 __ mov(a3, a0); |
163 | 163 |
164 Label done_loop, loop; | 164 Label done_loop, loop; |
165 __ bind(&loop); | 165 __ bind(&loop); |
166 { | 166 { |
167 // Check if all parameters done. | 167 // Check if all parameters done. |
168 __ Subu(a0, a0, Operand(1)); | 168 __ Subu(a0, a0, Operand(1)); |
169 __ Branch(USE_DELAY_SLOT, &done_loop, lt, a0, Operand(zero_reg)); | 169 __ Branch(&done_loop, lt, a0, Operand(zero_reg)); |
170 | 170 |
171 // Load the next parameter tagged value into a2. | 171 // Load the next parameter tagged value into a2. |
172 __ sll(at, a0, kPointerSizeLog2); // In delay slot | 172 __ Lsa(at, sp, a0, kPointerSizeLog2); |
173 __ Addu(at, at, sp); | |
174 __ lw(a2, MemOperand(at)); | 173 __ lw(a2, MemOperand(at)); |
175 | 174 |
176 // Load the double value of the parameter into f2, maybe converting the | 175 // Load the double value of the parameter into f2, maybe converting the |
177 // parameter to a number first using the ToNumberStub if necessary. | 176 // parameter to a number first using the ToNumberStub if necessary. |
178 Label convert, convert_smi, convert_number, done_convert; | 177 Label convert, convert_smi, convert_number, done_convert; |
179 __ bind(&convert); | 178 __ bind(&convert); |
180 __ JumpIfSmi(a2, &convert_smi); | 179 __ JumpIfSmi(a2, &convert_smi); |
181 __ lw(t0, FieldMemOperand(a2, HeapObject::kMapOffset)); | 180 __ lw(t0, FieldMemOperand(a2, HeapObject::kMapOffset)); |
182 __ JumpIfRoot(t0, Heap::kHeapNumberMapRootIndex, &convert_number); | 181 __ JumpIfRoot(t0, Heap::kHeapNumberMapRootIndex, &convert_number); |
183 { | 182 { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 __ jmp(&loop); | 230 __ jmp(&loop); |
232 | 231 |
233 // At least one side is NaN, which means that the result will be NaN too. | 232 // At least one side is NaN, which means that the result will be NaN too. |
234 __ bind(&compare_nan); | 233 __ bind(&compare_nan); |
235 __ LoadRoot(a1, Heap::kNanValueRootIndex); | 234 __ LoadRoot(a1, Heap::kNanValueRootIndex); |
236 __ ldc1(f0, FieldMemOperand(a1, HeapNumber::kValueOffset)); | 235 __ ldc1(f0, FieldMemOperand(a1, HeapNumber::kValueOffset)); |
237 __ jmp(&loop); | 236 __ jmp(&loop); |
238 } | 237 } |
239 | 238 |
240 __ bind(&done_loop); | 239 __ bind(&done_loop); |
241 __ sll(a3, a3, kPointerSizeLog2); | 240 __ Lsa(sp, sp, a3, kPointerSizeLog2); |
242 __ addu(sp, sp, a3); | |
243 __ mov(v0, a1); | 241 __ mov(v0, a1); |
244 __ DropAndRet(1); | 242 __ DropAndRet(1); |
245 } | 243 } |
246 | 244 |
247 // static | 245 // static |
248 void Builtins::Generate_NumberConstructor(MacroAssembler* masm) { | 246 void Builtins::Generate_NumberConstructor(MacroAssembler* masm) { |
249 // ----------- S t a t e ------------- | 247 // ----------- S t a t e ------------- |
250 // -- a0 : number of arguments | 248 // -- a0 : number of arguments |
251 // -- a1 : constructor function | 249 // -- a1 : constructor function |
252 // -- ra : return address | 250 // -- ra : return address |
(...skipping 2525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2778 } | 2776 } |
2779 } | 2777 } |
2780 | 2778 |
2781 | 2779 |
2782 #undef __ | 2780 #undef __ |
2783 | 2781 |
2784 } // namespace internal | 2782 } // namespace internal |
2785 } // namespace v8 | 2783 } // namespace v8 |
2786 | 2784 |
2787 #endif // V8_TARGET_ARCH_MIPS | 2785 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |