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/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 3214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3225 __ bne(¬_oddball); | 3225 __ bne(¬_oddball); |
3226 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToStringOffset)); | 3226 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToStringOffset)); |
3227 __ Ret(); | 3227 __ Ret(); |
3228 __ bind(¬_oddball); | 3228 __ bind(¬_oddball); |
3229 | 3229 |
3230 __ push(r3); // Push argument. | 3230 __ push(r3); // Push argument. |
3231 __ TailCallRuntime(Runtime::kToString); | 3231 __ TailCallRuntime(Runtime::kToString); |
3232 } | 3232 } |
3233 | 3233 |
3234 | 3234 |
| 3235 void ToNameStub::Generate(MacroAssembler* masm) { |
| 3236 // The ToName stub takes one argument in r3. |
| 3237 Label is_number; |
| 3238 __ JumpIfSmi(r3, &is_number); |
| 3239 |
| 3240 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); |
| 3241 __ CompareObjectType(r3, r4, r4, LAST_NAME_TYPE); |
| 3242 // r3: receiver |
| 3243 // r4: receiver instance type |
| 3244 __ Ret(le); |
| 3245 |
| 3246 Label not_heap_number; |
| 3247 __ cmpi(r4, Operand(HEAP_NUMBER_TYPE)); |
| 3248 __ bne(¬_heap_number); |
| 3249 __ bind(&is_number); |
| 3250 NumberToStringStub stub(isolate()); |
| 3251 __ TailCallStub(&stub); |
| 3252 __ bind(¬_heap_number); |
| 3253 |
| 3254 Label not_oddball; |
| 3255 __ cmpi(r4, Operand(ODDBALL_TYPE)); |
| 3256 __ bne(¬_oddball); |
| 3257 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToStringOffset)); |
| 3258 __ Ret(); |
| 3259 __ bind(¬_oddball); |
| 3260 |
| 3261 __ push(r3); // Push argument. |
| 3262 __ TailCallRuntime(Runtime::kToName); |
| 3263 } |
| 3264 |
| 3265 |
3235 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, | 3266 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, |
3236 Register left, | 3267 Register left, |
3237 Register right, | 3268 Register right, |
3238 Register scratch1, | 3269 Register scratch1, |
3239 Register scratch2) { | 3270 Register scratch2) { |
3240 Register length = scratch1; | 3271 Register length = scratch1; |
3241 | 3272 |
3242 // Compare lengths. | 3273 // Compare lengths. |
3243 Label strings_not_equal, check_zero_length; | 3274 Label strings_not_equal, check_zero_length; |
3244 __ LoadP(length, FieldMemOperand(left, String::kLengthOffset)); | 3275 __ LoadP(length, FieldMemOperand(left, String::kLengthOffset)); |
(...skipping 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5649 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5680 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5650 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5681 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5651 } | 5682 } |
5652 | 5683 |
5653 | 5684 |
5654 #undef __ | 5685 #undef __ |
5655 } // namespace internal | 5686 } // namespace internal |
5656 } // namespace v8 | 5687 } // namespace v8 |
5657 | 5688 |
5658 #endif // V8_TARGET_ARCH_PPC | 5689 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |