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 3005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3016 | 3016 |
3017 // Load function and argument count into r4 and r3. | 3017 // Load function and argument count into r4 and r3. |
3018 __ mov(r3, Operand(arg_count)); | 3018 __ mov(r3, Operand(arg_count)); |
3019 __ LoadP(r4, MemOperand(sp, arg_count * kPointerSize), r0); | 3019 __ LoadP(r4, MemOperand(sp, arg_count * kPointerSize), r0); |
3020 | 3020 |
3021 // Record call targets in unoptimized code. | 3021 // Record call targets in unoptimized code. |
3022 __ EmitLoadTypeFeedbackVector(r5); | 3022 __ EmitLoadTypeFeedbackVector(r5); |
3023 __ LoadSmiLiteral(r6, SmiFromSlot(expr->CallNewFeedbackSlot())); | 3023 __ LoadSmiLiteral(r6, SmiFromSlot(expr->CallNewFeedbackSlot())); |
3024 | 3024 |
3025 CallConstructStub stub(isolate()); | 3025 CallConstructStub stub(isolate()); |
3026 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3026 __ Call(stub.GetCode(), RelocInfo::CODE_TARGET); |
3027 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 3027 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
3028 // Restore context register. | 3028 // Restore context register. |
3029 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 3029 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
3030 context()->Plug(r3); | 3030 context()->Plug(r3); |
3031 } | 3031 } |
3032 | 3032 |
3033 | 3033 |
3034 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | 3034 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
3035 SuperCallReference* super_call_ref = | 3035 SuperCallReference* super_call_ref = |
3036 expr->expression()->AsSuperCallReference(); | 3036 expr->expression()->AsSuperCallReference(); |
(...skipping 14 matching lines...) Expand all Loading... |
3051 SetConstructCallPosition(expr, arg_count); | 3051 SetConstructCallPosition(expr, arg_count); |
3052 | 3052 |
3053 // Load new target into r6. | 3053 // Load new target into r6. |
3054 VisitForAccumulatorValue(super_call_ref->new_target_var()); | 3054 VisitForAccumulatorValue(super_call_ref->new_target_var()); |
3055 __ mr(r6, result_register()); | 3055 __ mr(r6, result_register()); |
3056 | 3056 |
3057 // Load function and argument count into r1 and r0. | 3057 // Load function and argument count into r1 and r0. |
3058 __ mov(r3, Operand(arg_count)); | 3058 __ mov(r3, Operand(arg_count)); |
3059 __ LoadP(r4, MemOperand(sp, arg_count * kPointerSize)); | 3059 __ LoadP(r4, MemOperand(sp, arg_count * kPointerSize)); |
3060 | 3060 |
3061 __ Call(isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); | 3061 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
3062 | 3062 |
3063 RecordJSReturnSite(expr); | 3063 RecordJSReturnSite(expr); |
3064 | 3064 |
3065 // Restore context register. | 3065 // Restore context register. |
3066 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 3066 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
3067 context()->Plug(r3); | 3067 context()->Plug(r3); |
3068 } | 3068 } |
3069 | 3069 |
3070 | 3070 |
3071 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 3071 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3813 Label loop; | 3813 Label loop; |
3814 __ mtctr(r3); | 3814 __ mtctr(r3); |
3815 __ bind(&loop); | 3815 __ bind(&loop); |
3816 // Pre-decrement in order to skip receiver. | 3816 // Pre-decrement in order to skip receiver. |
3817 __ LoadPU(r7, MemOperand(r5, -kPointerSize)); | 3817 __ LoadPU(r7, MemOperand(r5, -kPointerSize)); |
3818 __ Push(r7); | 3818 __ Push(r7); |
3819 __ bdnz(&loop); | 3819 __ bdnz(&loop); |
3820 } | 3820 } |
3821 | 3821 |
3822 __ bind(&args_set_up); | 3822 __ bind(&args_set_up); |
3823 __ Call(isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); | 3823 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
3824 | 3824 |
3825 // Restore context register. | 3825 // Restore context register. |
3826 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 3826 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
3827 | 3827 |
3828 context()->DropAndPlug(1, r3); | 3828 context()->DropAndPlug(1, r3); |
3829 } | 3829 } |
3830 | 3830 |
3831 | 3831 |
3832 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { | 3832 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { |
3833 ZoneList<Expression*>* args = expr->arguments(); | 3833 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4961 return ON_STACK_REPLACEMENT; | 4961 return ON_STACK_REPLACEMENT; |
4962 } | 4962 } |
4963 | 4963 |
4964 DCHECK(interrupt_address == | 4964 DCHECK(interrupt_address == |
4965 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4965 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4966 return OSR_AFTER_STACK_CHECK; | 4966 return OSR_AFTER_STACK_CHECK; |
4967 } | 4967 } |
4968 } // namespace internal | 4968 } // namespace internal |
4969 } // namespace v8 | 4969 } // namespace v8 |
4970 #endif // V8_TARGET_ARCH_PPC | 4970 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |