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 2482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2493 // r3: from index (untagged) | 2493 // r3: from index (untagged) |
2494 __ SmiTag(r3, r3); | 2494 __ SmiTag(r3, r3); |
2495 StringCharAtGenerator generator(r0, r3, r2, r0, &runtime, &runtime, &runtime, | 2495 StringCharAtGenerator generator(r0, r3, r2, r0, &runtime, &runtime, &runtime, |
2496 RECEIVER_IS_STRING); | 2496 RECEIVER_IS_STRING); |
2497 generator.GenerateFast(masm); | 2497 generator.GenerateFast(masm); |
2498 __ Drop(3); | 2498 __ Drop(3); |
2499 __ Ret(); | 2499 __ Ret(); |
2500 generator.SkipSlow(masm, &runtime); | 2500 generator.SkipSlow(masm, &runtime); |
2501 } | 2501 } |
2502 | 2502 |
2503 | |
2504 void ToNumberStub::Generate(MacroAssembler* masm) { | |
2505 // The ToNumber stub takes one argument in r0. | |
2506 STATIC_ASSERT(kSmiTag == 0); | |
2507 __ tst(r0, Operand(kSmiTagMask)); | |
2508 __ Ret(eq); | |
2509 | |
2510 __ CompareObjectType(r0, r1, r1, HEAP_NUMBER_TYPE); | |
2511 // r0: receiver | |
2512 // r1: receiver instance type | |
2513 __ Ret(eq); | |
2514 | |
2515 NonNumberToNumberStub stub(masm->isolate()); | |
2516 __ TailCallStub(&stub); | |
2517 } | |
2518 | |
2519 void NonNumberToNumberStub::Generate(MacroAssembler* masm) { | |
2520 // The NonNumberToNumber stub takes one argument in r0. | |
2521 __ AssertNotNumber(r0); | |
2522 | |
2523 __ CompareObjectType(r0, r1, r1, FIRST_NONSTRING_TYPE); | |
2524 // r0: receiver | |
2525 // r1: receiver instance type | |
2526 __ Jump(isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET, lo); | |
2527 | |
2528 Label not_oddball; | |
2529 __ cmp(r1, Operand(ODDBALL_TYPE)); | |
2530 __ b(ne, ¬_oddball); | |
2531 __ ldr(r0, FieldMemOperand(r0, Oddball::kToNumberOffset)); | |
2532 __ Ret(); | |
2533 __ bind(¬_oddball); | |
2534 | |
2535 __ Push(r0); // Push argument. | |
2536 __ TailCallRuntime(Runtime::kToNumber); | |
2537 } | |
2538 | |
2539 void ToStringStub::Generate(MacroAssembler* masm) { | 2503 void ToStringStub::Generate(MacroAssembler* masm) { |
2540 // The ToString stub takes one argument in r0. | 2504 // The ToString stub takes one argument in r0. |
2541 Label is_number; | 2505 Label is_number; |
2542 __ JumpIfSmi(r0, &is_number); | 2506 __ JumpIfSmi(r0, &is_number); |
2543 | 2507 |
2544 __ CompareObjectType(r0, r1, r1, FIRST_NONSTRING_TYPE); | 2508 __ CompareObjectType(r0, r1, r1, FIRST_NONSTRING_TYPE); |
2545 // r0: receiver | 2509 // r0: receiver |
2546 // r1: receiver instance type | 2510 // r1: receiver instance type |
2547 __ Ret(lo); | 2511 __ Ret(lo); |
2548 | 2512 |
(...skipping 2877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5426 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5390 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5427 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5391 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5428 } | 5392 } |
5429 | 5393 |
5430 #undef __ | 5394 #undef __ |
5431 | 5395 |
5432 } // namespace internal | 5396 } // namespace internal |
5433 } // namespace v8 | 5397 } // namespace v8 |
5434 | 5398 |
5435 #endif // V8_TARGET_ARCH_ARM | 5399 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |