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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 3358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3369 // a2: length | 3369 // a2: length |
3370 // a3: from index (untagged) | 3370 // a3: from index (untagged) |
3371 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, | 3371 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, |
3372 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); | 3372 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); |
3373 generator.GenerateFast(masm); | 3373 generator.GenerateFast(masm); |
3374 __ DropAndRet(3); | 3374 __ DropAndRet(3); |
3375 generator.SkipSlow(masm, &runtime); | 3375 generator.SkipSlow(masm, &runtime); |
3376 } | 3376 } |
3377 | 3377 |
3378 | 3378 |
| 3379 void ToNumberStub::Generate(MacroAssembler* masm) { |
| 3380 // The ToNumber stub takes one argument in a0. |
| 3381 Label check_heap_number, call_builtin; |
| 3382 __ JumpIfNotSmi(a0, &check_heap_number); |
| 3383 __ Ret(USE_DELAY_SLOT); |
| 3384 __ mov(v0, a0); |
| 3385 |
| 3386 __ bind(&check_heap_number); |
| 3387 __ ld(a1, FieldMemOperand(a0, HeapObject::kMapOffset)); |
| 3388 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
| 3389 __ Branch(&call_builtin, ne, a1, Operand(at)); |
| 3390 __ Ret(USE_DELAY_SLOT); |
| 3391 __ mov(v0, a0); |
| 3392 |
| 3393 __ bind(&call_builtin); |
| 3394 __ push(a0); |
| 3395 __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION); |
| 3396 } |
| 3397 |
| 3398 |
3379 void StringHelper::GenerateFlatOneByteStringEquals( | 3399 void StringHelper::GenerateFlatOneByteStringEquals( |
3380 MacroAssembler* masm, Register left, Register right, Register scratch1, | 3400 MacroAssembler* masm, Register left, Register right, Register scratch1, |
3381 Register scratch2, Register scratch3) { | 3401 Register scratch2, Register scratch3) { |
3382 Register length = scratch1; | 3402 Register length = scratch1; |
3383 | 3403 |
3384 // Compare lengths. | 3404 // Compare lengths. |
3385 Label strings_not_equal, check_zero_length; | 3405 Label strings_not_equal, check_zero_length; |
3386 __ ld(length, FieldMemOperand(left, String::kLengthOffset)); | 3406 __ ld(length, FieldMemOperand(left, String::kLengthOffset)); |
3387 __ ld(scratch2, FieldMemOperand(right, String::kLengthOffset)); | 3407 __ ld(scratch2, FieldMemOperand(right, String::kLengthOffset)); |
3388 __ Branch(&check_zero_length, eq, length, Operand(scratch2)); | 3408 __ Branch(&check_zero_length, eq, length, Operand(scratch2)); |
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4962 MemOperand(fp, 6 * kPointerSize), | 4982 MemOperand(fp, 6 * kPointerSize), |
4963 NULL); | 4983 NULL); |
4964 } | 4984 } |
4965 | 4985 |
4966 | 4986 |
4967 #undef __ | 4987 #undef __ |
4968 | 4988 |
4969 } } // namespace v8::internal | 4989 } } // namespace v8::internal |
4970 | 4990 |
4971 #endif // V8_TARGET_ARCH_MIPS64 | 4991 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |