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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 3101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3112 __ b(ne, ¬_oddball); | 3112 __ b(ne, ¬_oddball); |
3113 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset)); | 3113 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset)); |
3114 __ Ret(); | 3114 __ Ret(); |
3115 __ bind(¬_oddball); | 3115 __ bind(¬_oddball); |
3116 | 3116 |
3117 __ push(r0); // Push argument. | 3117 __ push(r0); // Push argument. |
3118 __ TailCallRuntime(Runtime::kToString); | 3118 __ TailCallRuntime(Runtime::kToString); |
3119 } | 3119 } |
3120 | 3120 |
3121 | 3121 |
| 3122 void ToNameStub::Generate(MacroAssembler* masm) { |
| 3123 // The ToName stub takes one argument in r0. |
| 3124 Label is_number; |
| 3125 __ JumpIfSmi(r0, &is_number); |
| 3126 |
| 3127 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); |
| 3128 __ CompareObjectType(r0, r1, r1, LAST_NAME_TYPE); |
| 3129 // r0: receiver |
| 3130 // r1: receiver instance type |
| 3131 __ Ret(ls); |
| 3132 |
| 3133 Label not_heap_number; |
| 3134 __ cmp(r1, Operand(HEAP_NUMBER_TYPE)); |
| 3135 __ b(ne, ¬_heap_number); |
| 3136 __ bind(&is_number); |
| 3137 NumberToStringStub stub(isolate()); |
| 3138 __ TailCallStub(&stub); |
| 3139 __ bind(¬_heap_number); |
| 3140 |
| 3141 Label not_oddball; |
| 3142 __ cmp(r1, Operand(ODDBALL_TYPE)); |
| 3143 __ b(ne, ¬_oddball); |
| 3144 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset)); |
| 3145 __ Ret(); |
| 3146 __ bind(¬_oddball); |
| 3147 |
| 3148 __ push(r0); // Push argument. |
| 3149 __ TailCallRuntime(Runtime::kToName); |
| 3150 } |
| 3151 |
| 3152 |
3122 void StringHelper::GenerateFlatOneByteStringEquals( | 3153 void StringHelper::GenerateFlatOneByteStringEquals( |
3123 MacroAssembler* masm, Register left, Register right, Register scratch1, | 3154 MacroAssembler* masm, Register left, Register right, Register scratch1, |
3124 Register scratch2, Register scratch3) { | 3155 Register scratch2, Register scratch3) { |
3125 Register length = scratch1; | 3156 Register length = scratch1; |
3126 | 3157 |
3127 // Compare lengths. | 3158 // Compare lengths. |
3128 Label strings_not_equal, check_zero_length; | 3159 Label strings_not_equal, check_zero_length; |
3129 __ ldr(length, FieldMemOperand(left, String::kLengthOffset)); | 3160 __ ldr(length, FieldMemOperand(left, String::kLengthOffset)); |
3130 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset)); | 3161 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset)); |
3131 __ cmp(length, scratch2); | 3162 __ cmp(length, scratch2); |
(...skipping 2275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5407 MemOperand(fp, 6 * kPointerSize), NULL); | 5438 MemOperand(fp, 6 * kPointerSize), NULL); |
5408 } | 5439 } |
5409 | 5440 |
5410 | 5441 |
5411 #undef __ | 5442 #undef __ |
5412 | 5443 |
5413 } // namespace internal | 5444 } // namespace internal |
5414 } // namespace v8 | 5445 } // namespace v8 |
5415 | 5446 |
5416 #endif // V8_TARGET_ARCH_ARM | 5447 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |