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/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2378 __ b(ne, ¬_oddball); | 2378 __ b(ne, ¬_oddball); |
2379 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset)); | 2379 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset)); |
2380 __ Ret(); | 2380 __ Ret(); |
2381 __ bind(¬_oddball); | 2381 __ bind(¬_oddball); |
2382 | 2382 |
2383 __ push(r0); // Push argument. | 2383 __ push(r0); // Push argument. |
2384 __ TailCallRuntime(Runtime::kToString); | 2384 __ TailCallRuntime(Runtime::kToString); |
2385 } | 2385 } |
2386 | 2386 |
2387 | 2387 |
2388 void ToNameStub::Generate(MacroAssembler* masm) { | |
2389 // The ToName stub takes one argument in r0. | |
2390 Label is_number; | |
2391 __ JumpIfSmi(r0, &is_number); | |
2392 | |
2393 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); | |
2394 __ CompareObjectType(r0, r1, r1, LAST_NAME_TYPE); | |
2395 // r0: receiver | |
2396 // r1: receiver instance type | |
2397 __ Ret(ls); | |
2398 | |
2399 Label not_heap_number; | |
2400 __ cmp(r1, Operand(HEAP_NUMBER_TYPE)); | |
2401 __ b(ne, ¬_heap_number); | |
2402 __ bind(&is_number); | |
2403 NumberToStringStub stub(isolate()); | |
2404 __ TailCallStub(&stub); | |
2405 __ bind(¬_heap_number); | |
2406 | |
2407 Label not_oddball; | |
2408 __ cmp(r1, Operand(ODDBALL_TYPE)); | |
2409 __ b(ne, ¬_oddball); | |
2410 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset)); | |
2411 __ Ret(); | |
2412 __ bind(¬_oddball); | |
2413 | |
2414 __ push(r0); // Push argument. | |
2415 __ TailCallRuntime(Runtime::kToName); | |
2416 } | |
2417 | |
2418 | |
2419 void StringHelper::GenerateFlatOneByteStringEquals( | 2388 void StringHelper::GenerateFlatOneByteStringEquals( |
2420 MacroAssembler* masm, Register left, Register right, Register scratch1, | 2389 MacroAssembler* masm, Register left, Register right, Register scratch1, |
2421 Register scratch2, Register scratch3) { | 2390 Register scratch2, Register scratch3) { |
2422 Register length = scratch1; | 2391 Register length = scratch1; |
2423 | 2392 |
2424 // Compare lengths. | 2393 // Compare lengths. |
2425 Label strings_not_equal, check_zero_length; | 2394 Label strings_not_equal, check_zero_length; |
2426 __ ldr(length, FieldMemOperand(left, String::kLengthOffset)); | 2395 __ ldr(length, FieldMemOperand(left, String::kLengthOffset)); |
2427 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset)); | 2396 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset)); |
2428 __ cmp(length, scratch2); | 2397 __ cmp(length, scratch2); |
(...skipping 2785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5214 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5183 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5215 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5184 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5216 } | 5185 } |
5217 | 5186 |
5218 #undef __ | 5187 #undef __ |
5219 | 5188 |
5220 } // namespace internal | 5189 } // namespace internal |
5221 } // namespace v8 | 5190 } // namespace v8 |
5222 | 5191 |
5223 #endif // V8_TARGET_ARCH_ARM | 5192 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |