OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2424 // r6: from index (untagged) | 2424 // r6: from index (untagged) |
2425 __ SmiTag(r6, r6); | 2425 __ SmiTag(r6, r6); |
2426 StringCharAtGenerator generator(r3, r6, r5, r3, &runtime, &runtime, &runtime, | 2426 StringCharAtGenerator generator(r3, r6, r5, r3, &runtime, &runtime, &runtime, |
2427 RECEIVER_IS_STRING); | 2427 RECEIVER_IS_STRING); |
2428 generator.GenerateFast(masm); | 2428 generator.GenerateFast(masm); |
2429 __ Drop(3); | 2429 __ Drop(3); |
2430 __ Ret(); | 2430 __ Ret(); |
2431 generator.SkipSlow(masm, &runtime); | 2431 generator.SkipSlow(masm, &runtime); |
2432 } | 2432 } |
2433 | 2433 |
2434 void ToStringStub::Generate(MacroAssembler* masm) { | |
2435 // The ToString stub takes one argument in r3. | |
2436 Label is_number; | |
2437 __ JumpIfSmi(r3, &is_number); | |
2438 | |
2439 __ CompareObjectType(r3, r4, r4, FIRST_NONSTRING_TYPE); | |
2440 // r3: receiver | |
2441 // r4: receiver instance type | |
2442 __ Ret(lt); | |
2443 | |
2444 Label not_heap_number; | |
2445 __ cmpi(r4, Operand(HEAP_NUMBER_TYPE)); | |
2446 __ bne(¬_heap_number); | |
2447 __ bind(&is_number); | |
2448 NumberToStringStub stub(isolate()); | |
2449 __ TailCallStub(&stub); | |
2450 __ bind(¬_heap_number); | |
2451 | |
2452 Label not_oddball; | |
2453 __ cmpi(r4, Operand(ODDBALL_TYPE)); | |
2454 __ bne(¬_oddball); | |
2455 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToStringOffset)); | |
2456 __ Ret(); | |
2457 __ bind(¬_oddball); | |
2458 | |
2459 __ push(r3); // Push argument. | |
2460 __ TailCallRuntime(Runtime::kToString); | |
2461 } | |
2462 | |
2463 | 2434 |
2464 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, | 2435 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, |
2465 Register left, | 2436 Register left, |
2466 Register right, | 2437 Register right, |
2467 Register scratch1, | 2438 Register scratch1, |
2468 Register scratch2) { | 2439 Register scratch2) { |
2469 Register length = scratch1; | 2440 Register length = scratch1; |
2470 | 2441 |
2471 // Compare lengths. | 2442 // Compare lengths. |
2472 Label strings_not_equal, check_zero_length; | 2443 Label strings_not_equal, check_zero_length; |
(...skipping 2965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5438 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); | 5409 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); |
5439 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5410 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5440 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5411 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5441 } | 5412 } |
5442 | 5413 |
5443 #undef __ | 5414 #undef __ |
5444 } // namespace internal | 5415 } // namespace internal |
5445 } // namespace v8 | 5416 } // namespace v8 |
5446 | 5417 |
5447 #endif // V8_TARGET_ARCH_PPC | 5418 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |