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 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2004 // result = receiver[f](arg); | 2004 // result = receiver[f](arg); |
2005 __ bind(&l_call); | 2005 __ bind(&l_call); |
2006 __ LoadP(load_receiver, MemOperand(sp, kPointerSize)); | 2006 __ LoadP(load_receiver, MemOperand(sp, kPointerSize)); |
2007 __ LoadP(load_name, MemOperand(sp, 2 * kPointerSize)); | 2007 __ LoadP(load_name, MemOperand(sp, 2 * kPointerSize)); |
2008 __ mov(LoadDescriptor::SlotRegister(), | 2008 __ mov(LoadDescriptor::SlotRegister(), |
2009 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); | 2009 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); |
2010 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); | 2010 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); |
2011 CallIC(ic, TypeFeedbackId::None()); | 2011 CallIC(ic, TypeFeedbackId::None()); |
2012 __ mr(r4, r3); | 2012 __ mr(r4, r3); |
2013 __ StoreP(r4, MemOperand(sp, 2 * kPointerSize)); | 2013 __ StoreP(r4, MemOperand(sp, 2 * kPointerSize)); |
2014 SetCallPosition(expr, 1); | 2014 SetCallPosition(expr); |
2015 __ li(r3, Operand(1)); | 2015 __ li(r3, Operand(1)); |
2016 __ Call( | 2016 __ Call( |
2017 isolate()->builtins()->Call(ConvertReceiverMode::kNotNullOrUndefined), | 2017 isolate()->builtins()->Call(ConvertReceiverMode::kNotNullOrUndefined), |
2018 RelocInfo::CODE_TARGET); | 2018 RelocInfo::CODE_TARGET); |
2019 | 2019 |
2020 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2020 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2021 __ Drop(1); // The function is still on the stack; drop it. | 2021 __ Drop(1); // The function is still on the stack; drop it. |
2022 | 2022 |
2023 // if (!result.done) goto l_try; | 2023 // if (!result.done) goto l_try; |
2024 __ Move(load_receiver, r3); | 2024 __ Move(load_receiver, r3); |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2860 | 2860 |
2861 void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) { | 2861 void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) { |
2862 // Load the arguments. | 2862 // Load the arguments. |
2863 ZoneList<Expression*>* args = expr->arguments(); | 2863 ZoneList<Expression*>* args = expr->arguments(); |
2864 int arg_count = args->length(); | 2864 int arg_count = args->length(); |
2865 for (int i = 0; i < arg_count; i++) { | 2865 for (int i = 0; i < arg_count; i++) { |
2866 VisitForStackValue(args->at(i)); | 2866 VisitForStackValue(args->at(i)); |
2867 } | 2867 } |
2868 | 2868 |
2869 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); | 2869 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
2870 SetCallPosition(expr, arg_count); | 2870 SetCallPosition(expr); |
2871 Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, mode).code(); | 2871 Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, mode).code(); |
2872 __ LoadSmiLiteral(r6, SmiFromSlot(expr->CallFeedbackICSlot())); | 2872 __ LoadSmiLiteral(r6, SmiFromSlot(expr->CallFeedbackICSlot())); |
2873 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); | 2873 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); |
2874 // Don't assign a type feedback id to the IC, since type feedback is provided | 2874 // Don't assign a type feedback id to the IC, since type feedback is provided |
2875 // by the vector above. | 2875 // by the vector above. |
2876 CallIC(ic); | 2876 CallIC(ic); |
2877 | 2877 |
2878 RecordJSReturnSite(expr); | 2878 RecordJSReturnSite(expr); |
2879 // Restore context register. | 2879 // Restore context register. |
2880 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2880 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2968 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); | 2968 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); |
2969 __ push(r4); | 2969 __ push(r4); |
2970 EmitResolvePossiblyDirectEval(arg_count); | 2970 EmitResolvePossiblyDirectEval(arg_count); |
2971 | 2971 |
2972 // Touch up the stack with the resolved function. | 2972 // Touch up the stack with the resolved function. |
2973 __ StoreP(r3, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); | 2973 __ StoreP(r3, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); |
2974 | 2974 |
2975 PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS); | 2975 PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS); |
2976 | 2976 |
2977 // Record source position for debugger. | 2977 // Record source position for debugger. |
2978 SetCallPosition(expr, arg_count); | 2978 SetCallPosition(expr); |
2979 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); | 2979 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); |
2980 __ mov(r3, Operand(arg_count)); | 2980 __ mov(r3, Operand(arg_count)); |
2981 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 2981 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
2982 RecordJSReturnSite(expr); | 2982 RecordJSReturnSite(expr); |
2983 // Restore context register. | 2983 // Restore context register. |
2984 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2984 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2985 context()->DropAndPlug(1, r3); | 2985 context()->DropAndPlug(1, r3); |
2986 } | 2986 } |
2987 | 2987 |
2988 | 2988 |
(...skipping 11 matching lines...) Expand all Loading... |
3000 | 3000 |
3001 // Push the arguments ("left-to-right") on the stack. | 3001 // Push the arguments ("left-to-right") on the stack. |
3002 ZoneList<Expression*>* args = expr->arguments(); | 3002 ZoneList<Expression*>* args = expr->arguments(); |
3003 int arg_count = args->length(); | 3003 int arg_count = args->length(); |
3004 for (int i = 0; i < arg_count; i++) { | 3004 for (int i = 0; i < arg_count; i++) { |
3005 VisitForStackValue(args->at(i)); | 3005 VisitForStackValue(args->at(i)); |
3006 } | 3006 } |
3007 | 3007 |
3008 // Call the construct call builtin that handles allocation and | 3008 // Call the construct call builtin that handles allocation and |
3009 // constructor invocation. | 3009 // constructor invocation. |
3010 SetConstructCallPosition(expr, arg_count); | 3010 SetConstructCallPosition(expr); |
3011 | 3011 |
3012 // Load function and argument count into r4 and r3. | 3012 // Load function and argument count into r4 and r3. |
3013 __ mov(r3, Operand(arg_count)); | 3013 __ mov(r3, Operand(arg_count)); |
3014 __ LoadP(r4, MemOperand(sp, arg_count * kPointerSize), r0); | 3014 __ LoadP(r4, MemOperand(sp, arg_count * kPointerSize), r0); |
3015 | 3015 |
3016 // Record call targets in unoptimized code. | 3016 // Record call targets in unoptimized code. |
3017 __ EmitLoadTypeFeedbackVector(r5); | 3017 __ EmitLoadTypeFeedbackVector(r5); |
3018 __ LoadSmiLiteral(r6, SmiFromSlot(expr->CallNewFeedbackSlot())); | 3018 __ LoadSmiLiteral(r6, SmiFromSlot(expr->CallNewFeedbackSlot())); |
3019 | 3019 |
3020 Handle<Code> code = CodeFactory::ConstructIC(isolate()).code(); | 3020 Handle<Code> code = CodeFactory::ConstructIC(isolate()).code(); |
(...skipping 15 matching lines...) Expand all Loading... |
3036 | 3036 |
3037 // Push the arguments ("left-to-right") on the stack. | 3037 // Push the arguments ("left-to-right") on the stack. |
3038 ZoneList<Expression*>* args = expr->arguments(); | 3038 ZoneList<Expression*>* args = expr->arguments(); |
3039 int arg_count = args->length(); | 3039 int arg_count = args->length(); |
3040 for (int i = 0; i < arg_count; i++) { | 3040 for (int i = 0; i < arg_count; i++) { |
3041 VisitForStackValue(args->at(i)); | 3041 VisitForStackValue(args->at(i)); |
3042 } | 3042 } |
3043 | 3043 |
3044 // Call the construct call builtin that handles allocation and | 3044 // Call the construct call builtin that handles allocation and |
3045 // constructor invocation. | 3045 // constructor invocation. |
3046 SetConstructCallPosition(expr, arg_count); | 3046 SetConstructCallPosition(expr); |
3047 | 3047 |
3048 // Load new target into r6. | 3048 // Load new target into r6. |
3049 VisitForAccumulatorValue(super_call_ref->new_target_var()); | 3049 VisitForAccumulatorValue(super_call_ref->new_target_var()); |
3050 __ mr(r6, result_register()); | 3050 __ mr(r6, result_register()); |
3051 | 3051 |
3052 // Load function and argument count into r1 and r0. | 3052 // Load function and argument count into r1 and r0. |
3053 __ mov(r3, Operand(arg_count)); | 3053 __ mov(r3, Operand(arg_count)); |
3054 __ LoadP(r4, MemOperand(sp, arg_count * kPointerSize)); | 3054 __ LoadP(r4, MemOperand(sp, arg_count * kPointerSize)); |
3055 | 3055 |
3056 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 3056 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3737 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { | 3737 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { |
3738 ZoneList<Expression*>* args = expr->arguments(); | 3738 ZoneList<Expression*>* args = expr->arguments(); |
3739 DCHECK(args->length() == 2); | 3739 DCHECK(args->length() == 2); |
3740 | 3740 |
3741 // Evaluate new.target and super constructor. | 3741 // Evaluate new.target and super constructor. |
3742 VisitForStackValue(args->at(0)); | 3742 VisitForStackValue(args->at(0)); |
3743 VisitForStackValue(args->at(1)); | 3743 VisitForStackValue(args->at(1)); |
3744 | 3744 |
3745 // Call the construct call builtin that handles allocation and | 3745 // Call the construct call builtin that handles allocation and |
3746 // constructor invocation. | 3746 // constructor invocation. |
3747 SetConstructCallPosition(expr, 0); | 3747 SetConstructCallPosition(expr); |
3748 | 3748 |
3749 // Check if the calling frame is an arguments adaptor frame. | 3749 // Check if the calling frame is an arguments adaptor frame. |
3750 Label adaptor_frame, args_set_up, runtime; | 3750 Label adaptor_frame, args_set_up, runtime; |
3751 __ LoadP(r5, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 3751 __ LoadP(r5, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
3752 __ LoadP(r7, MemOperand(r5, StandardFrameConstants::kContextOffset)); | 3752 __ LoadP(r7, MemOperand(r5, StandardFrameConstants::kContextOffset)); |
3753 | 3753 |
3754 // Load super constructor, new target into r4, r6. | 3754 // Load super constructor, new target into r4, r6. |
3755 __ LoadP(r4, MemOperand(sp)); | 3755 __ LoadP(r4, MemOperand(sp)); |
3756 __ LoadP(r6, MemOperand(sp, 1 * kPointerSize)); | 3756 __ LoadP(r6, MemOperand(sp, 1 * kPointerSize)); |
3757 | 3757 |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4128 __ push(r3); | 4128 __ push(r3); |
4129 | 4129 |
4130 __ LoadNativeContextSlot(expr->context_index(), r3); | 4130 __ LoadNativeContextSlot(expr->context_index(), r3); |
4131 } | 4131 } |
4132 | 4132 |
4133 | 4133 |
4134 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { | 4134 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
4135 ZoneList<Expression*>* args = expr->arguments(); | 4135 ZoneList<Expression*>* args = expr->arguments(); |
4136 int arg_count = args->length(); | 4136 int arg_count = args->length(); |
4137 | 4137 |
4138 SetCallPosition(expr, arg_count); | 4138 SetCallPosition(expr); |
4139 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); | 4139 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); |
4140 __ mov(r3, Operand(arg_count)); | 4140 __ mov(r3, Operand(arg_count)); |
4141 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), | 4141 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), |
4142 RelocInfo::CODE_TARGET); | 4142 RelocInfo::CODE_TARGET); |
4143 } | 4143 } |
4144 | 4144 |
4145 | 4145 |
4146 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 4146 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
4147 ZoneList<Expression*>* args = expr->arguments(); | 4147 ZoneList<Expression*>* args = expr->arguments(); |
4148 int arg_count = args->length(); | 4148 int arg_count = args->length(); |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4919 return ON_STACK_REPLACEMENT; | 4919 return ON_STACK_REPLACEMENT; |
4920 } | 4920 } |
4921 | 4921 |
4922 DCHECK(interrupt_address == | 4922 DCHECK(interrupt_address == |
4923 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4923 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4924 return OSR_AFTER_STACK_CHECK; | 4924 return OSR_AFTER_STACK_CHECK; |
4925 } | 4925 } |
4926 } // namespace internal | 4926 } // namespace internal |
4927 } // namespace v8 | 4927 } // namespace v8 |
4928 #endif // V8_TARGET_ARCH_PPC | 4928 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |