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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 3333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3344 // a3: from index (untagged) | 3344 // a3: from index (untagged) |
3345 __ SmiTag(a3, a3); | 3345 __ SmiTag(a3, a3); |
3346 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, | 3346 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, |
3347 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); | 3347 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); |
3348 generator.GenerateFast(masm); | 3348 generator.GenerateFast(masm); |
3349 __ DropAndRet(3); | 3349 __ DropAndRet(3); |
3350 generator.SkipSlow(masm, &runtime); | 3350 generator.SkipSlow(masm, &runtime); |
3351 } | 3351 } |
3352 | 3352 |
3353 | 3353 |
| 3354 void ToNumberStub::Generate(MacroAssembler* masm) { |
| 3355 // The ToNumber stub takes one argument in a0. |
| 3356 Label check_heap_number, call_builtin; |
| 3357 __ JumpIfNotSmi(a0, &check_heap_number); |
| 3358 __ Ret(USE_DELAY_SLOT); |
| 3359 __ mov(v0, a0); |
| 3360 |
| 3361 __ bind(&check_heap_number); |
| 3362 __ lw(a1, FieldMemOperand(a0, HeapObject::kMapOffset)); |
| 3363 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
| 3364 __ Branch(&call_builtin, ne, a1, Operand(at)); |
| 3365 __ Ret(USE_DELAY_SLOT); |
| 3366 __ mov(v0, a0); |
| 3367 |
| 3368 __ bind(&call_builtin); |
| 3369 __ push(a0); |
| 3370 __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION); |
| 3371 } |
| 3372 |
| 3373 |
3354 void StringHelper::GenerateFlatOneByteStringEquals( | 3374 void StringHelper::GenerateFlatOneByteStringEquals( |
3355 MacroAssembler* masm, Register left, Register right, Register scratch1, | 3375 MacroAssembler* masm, Register left, Register right, Register scratch1, |
3356 Register scratch2, Register scratch3) { | 3376 Register scratch2, Register scratch3) { |
3357 Register length = scratch1; | 3377 Register length = scratch1; |
3358 | 3378 |
3359 // Compare lengths. | 3379 // Compare lengths. |
3360 Label strings_not_equal, check_zero_length; | 3380 Label strings_not_equal, check_zero_length; |
3361 __ lw(length, FieldMemOperand(left, String::kLengthOffset)); | 3381 __ lw(length, FieldMemOperand(left, String::kLengthOffset)); |
3362 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset)); | 3382 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset)); |
3363 __ Branch(&check_zero_length, eq, length, Operand(scratch2)); | 3383 __ Branch(&check_zero_length, eq, length, Operand(scratch2)); |
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4936 MemOperand(fp, 6 * kPointerSize), | 4956 MemOperand(fp, 6 * kPointerSize), |
4937 NULL); | 4957 NULL); |
4938 } | 4958 } |
4939 | 4959 |
4940 | 4960 |
4941 #undef __ | 4961 #undef __ |
4942 | 4962 |
4943 } } // namespace v8::internal | 4963 } } // namespace v8::internal |
4944 | 4964 |
4945 #endif // V8_TARGET_ARCH_MIPS | 4965 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |