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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 3510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3521 // Convert the object to an integer. | 3521 // Convert the object to an integer. |
3522 Label done_convert; | 3522 Label done_convert; |
3523 __ JumpIfSmi(r3, &done_convert); | 3523 __ JumpIfSmi(r3, &done_convert); |
3524 __ Push(r3); | 3524 __ Push(r3); |
3525 __ CallRuntime(Runtime::kToInteger); | 3525 __ CallRuntime(Runtime::kToInteger); |
3526 __ bind(&done_convert); | 3526 __ bind(&done_convert); |
3527 context()->Plug(r3); | 3527 context()->Plug(r3); |
3528 } | 3528 } |
3529 | 3529 |
3530 | 3530 |
3531 void FullCodeGenerator::EmitToName(CallRuntime* expr) { | |
3532 ZoneList<Expression*>* args = expr->arguments(); | |
3533 DCHECK_EQ(1, args->length()); | |
3534 | |
3535 // Load the argument into r3 and convert it. | |
3536 VisitForAccumulatorValue(args->at(0)); | |
3537 | |
3538 Label convert, done_convert; | |
3539 __ JumpIfSmi(r3, &convert); | |
3540 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); | |
3541 __ CompareObjectType(r3, r4, r4, LAST_NAME_TYPE); | |
3542 __ ble(&done_convert); | |
3543 __ bind(&convert); | |
3544 __ Push(r3); | |
3545 __ CallRuntime(Runtime::kToName); | |
3546 __ bind(&done_convert); | |
3547 context()->Plug(r3); | |
3548 } | |
3549 | |
3550 | |
3551 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { | 3531 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { |
3552 ZoneList<Expression*>* args = expr->arguments(); | 3532 ZoneList<Expression*>* args = expr->arguments(); |
3553 DCHECK(args->length() == 1); | 3533 DCHECK(args->length() == 1); |
3554 VisitForAccumulatorValue(args->at(0)); | 3534 VisitForAccumulatorValue(args->at(0)); |
3555 | 3535 |
3556 Label done; | 3536 Label done; |
3557 StringCharFromCodeGenerator generator(r3, r4); | 3537 StringCharFromCodeGenerator generator(r3, r4); |
3558 generator.GenerateFast(masm_); | 3538 generator.GenerateFast(masm_); |
3559 __ b(&done); | 3539 __ b(&done); |
3560 | 3540 |
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4807 return ON_STACK_REPLACEMENT; | 4787 return ON_STACK_REPLACEMENT; |
4808 } | 4788 } |
4809 | 4789 |
4810 DCHECK(interrupt_address == | 4790 DCHECK(interrupt_address == |
4811 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4791 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4812 return OSR_AFTER_STACK_CHECK; | 4792 return OSR_AFTER_STACK_CHECK; |
4813 } | 4793 } |
4814 } // namespace internal | 4794 } // namespace internal |
4815 } // namespace v8 | 4795 } // namespace v8 |
4816 #endif // V8_TARGET_ARCH_PPC | 4796 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |