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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 3248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3259 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); | 3259 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); |
3260 __ Ret(USE_DELAY_SLOT); | 3260 __ Ret(USE_DELAY_SLOT); |
3261 __ lw(v0, FieldMemOperand(a0, Oddball::kToStringOffset)); | 3261 __ lw(v0, FieldMemOperand(a0, Oddball::kToStringOffset)); |
3262 __ bind(¬_oddball); | 3262 __ bind(¬_oddball); |
3263 | 3263 |
3264 __ push(a0); // Push argument. | 3264 __ push(a0); // Push argument. |
3265 __ TailCallRuntime(Runtime::kToString); | 3265 __ TailCallRuntime(Runtime::kToString); |
3266 } | 3266 } |
3267 | 3267 |
3268 | 3268 |
| 3269 void ToNameStub::Generate(MacroAssembler* masm) { |
| 3270 // The ToName stub takes on argument in a0. |
| 3271 Label is_number; |
| 3272 __ JumpIfSmi(a0, &is_number); |
| 3273 |
| 3274 Label not_name; |
| 3275 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); |
| 3276 __ GetObjectType(a0, a1, a1); |
| 3277 // a0: receiver |
| 3278 // a1: receiver instance type |
| 3279 __ Branch(¬_name, gt, a1, Operand(LAST_NAME_TYPE)); |
| 3280 __ Ret(USE_DELAY_SLOT); |
| 3281 __ mov(v0, a0); |
| 3282 __ bind(¬_name); |
| 3283 |
| 3284 Label not_heap_number; |
| 3285 __ Branch(¬_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE)); |
| 3286 __ bind(&is_number); |
| 3287 NumberToStringStub stub(isolate()); |
| 3288 __ TailCallStub(&stub); |
| 3289 __ bind(¬_heap_number); |
| 3290 |
| 3291 Label not_oddball; |
| 3292 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); |
| 3293 __ Ret(USE_DELAY_SLOT); |
| 3294 __ lw(v0, FieldMemOperand(a0, Oddball::kToStringOffset)); |
| 3295 __ bind(¬_oddball); |
| 3296 |
| 3297 __ push(a0); // Push argument. |
| 3298 __ TailCallRuntime(Runtime::kToName); |
| 3299 } |
| 3300 |
| 3301 |
3269 void StringHelper::GenerateFlatOneByteStringEquals( | 3302 void StringHelper::GenerateFlatOneByteStringEquals( |
3270 MacroAssembler* masm, Register left, Register right, Register scratch1, | 3303 MacroAssembler* masm, Register left, Register right, Register scratch1, |
3271 Register scratch2, Register scratch3) { | 3304 Register scratch2, Register scratch3) { |
3272 Register length = scratch1; | 3305 Register length = scratch1; |
3273 | 3306 |
3274 // Compare lengths. | 3307 // Compare lengths. |
3275 Label strings_not_equal, check_zero_length; | 3308 Label strings_not_equal, check_zero_length; |
3276 __ lw(length, FieldMemOperand(left, String::kLengthOffset)); | 3309 __ lw(length, FieldMemOperand(left, String::kLengthOffset)); |
3277 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset)); | 3310 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset)); |
3278 __ Branch(&check_zero_length, eq, length, Operand(scratch2)); | 3311 __ Branch(&check_zero_length, eq, length, Operand(scratch2)); |
(...skipping 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5578 MemOperand(fp, 6 * kPointerSize), NULL); | 5611 MemOperand(fp, 6 * kPointerSize), NULL); |
5579 } | 5612 } |
5580 | 5613 |
5581 | 5614 |
5582 #undef __ | 5615 #undef __ |
5583 | 5616 |
5584 } // namespace internal | 5617 } // namespace internal |
5585 } // namespace v8 | 5618 } // namespace v8 |
5586 | 5619 |
5587 #endif // V8_TARGET_ARCH_MIPS | 5620 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |