OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 __ bind(&l_call); | 2042 __ bind(&l_call); |
2043 __ ld(load_receiver, MemOperand(sp, kPointerSize)); | 2043 __ ld(load_receiver, MemOperand(sp, kPointerSize)); |
2044 __ ld(load_name, MemOperand(sp, 2 * kPointerSize)); | 2044 __ ld(load_name, MemOperand(sp, 2 * kPointerSize)); |
2045 __ li(LoadDescriptor::SlotRegister(), | 2045 __ li(LoadDescriptor::SlotRegister(), |
2046 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); | 2046 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); |
2047 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); | 2047 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); |
2048 CallIC(ic, TypeFeedbackId::None()); | 2048 CallIC(ic, TypeFeedbackId::None()); |
2049 __ mov(a0, v0); | 2049 __ mov(a0, v0); |
2050 __ mov(a1, a0); | 2050 __ mov(a1, a0); |
2051 __ sd(a1, MemOperand(sp, 2 * kPointerSize)); | 2051 __ sd(a1, MemOperand(sp, 2 * kPointerSize)); |
2052 SetCallPosition(expr, 1); | 2052 SetCallPosition(expr); |
2053 __ li(a0, Operand(1)); | 2053 __ li(a0, Operand(1)); |
2054 __ Call( | 2054 __ Call( |
2055 isolate()->builtins()->Call(ConvertReceiverMode::kNotNullOrUndefined), | 2055 isolate()->builtins()->Call(ConvertReceiverMode::kNotNullOrUndefined), |
2056 RelocInfo::CODE_TARGET); | 2056 RelocInfo::CODE_TARGET); |
2057 | 2057 |
2058 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2058 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2059 __ Drop(1); // The function is still on the stack; drop it. | 2059 __ Drop(1); // The function is still on the stack; drop it. |
2060 | 2060 |
2061 // if (!result.done) goto l_try; | 2061 // if (!result.done) goto l_try; |
2062 __ Move(load_receiver, v0); | 2062 __ Move(load_receiver, v0); |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2867 void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) { | 2867 void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) { |
2868 // Load the arguments. | 2868 // Load the arguments. |
2869 ZoneList<Expression*>* args = expr->arguments(); | 2869 ZoneList<Expression*>* args = expr->arguments(); |
2870 int arg_count = args->length(); | 2870 int arg_count = args->length(); |
2871 for (int i = 0; i < arg_count; i++) { | 2871 for (int i = 0; i < arg_count; i++) { |
2872 VisitForStackValue(args->at(i)); | 2872 VisitForStackValue(args->at(i)); |
2873 } | 2873 } |
2874 | 2874 |
2875 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); | 2875 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
2876 // Record source position of the IC call. | 2876 // Record source position of the IC call. |
2877 SetCallPosition(expr, arg_count); | 2877 SetCallPosition(expr); |
2878 Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, mode).code(); | 2878 Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, mode).code(); |
2879 __ li(a3, Operand(SmiFromSlot(expr->CallFeedbackICSlot()))); | 2879 __ li(a3, Operand(SmiFromSlot(expr->CallFeedbackICSlot()))); |
2880 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 2880 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
2881 // Don't assign a type feedback id to the IC, since type feedback is provided | 2881 // Don't assign a type feedback id to the IC, since type feedback is provided |
2882 // by the vector above. | 2882 // by the vector above. |
2883 CallIC(ic); | 2883 CallIC(ic); |
2884 RecordJSReturnSite(expr); | 2884 RecordJSReturnSite(expr); |
2885 // Restore context register. | 2885 // Restore context register. |
2886 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2886 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2887 context()->DropAndPlug(1, v0); | 2887 context()->DropAndPlug(1, v0); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2973 // resolve eval. | 2973 // resolve eval. |
2974 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 2974 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
2975 __ push(a1); | 2975 __ push(a1); |
2976 EmitResolvePossiblyDirectEval(arg_count); | 2976 EmitResolvePossiblyDirectEval(arg_count); |
2977 | 2977 |
2978 // Touch up the stack with the resolved function. | 2978 // Touch up the stack with the resolved function. |
2979 __ sd(v0, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 2979 __ sd(v0, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
2980 | 2980 |
2981 PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS); | 2981 PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS); |
2982 // Record source position for debugger. | 2982 // Record source position for debugger. |
2983 SetCallPosition(expr, arg_count); | 2983 SetCallPosition(expr); |
2984 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 2984 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
2985 __ li(a0, Operand(arg_count)); | 2985 __ li(a0, Operand(arg_count)); |
2986 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 2986 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
2987 RecordJSReturnSite(expr); | 2987 RecordJSReturnSite(expr); |
2988 // Restore context register. | 2988 // Restore context register. |
2989 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2989 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2990 context()->DropAndPlug(1, v0); | 2990 context()->DropAndPlug(1, v0); |
2991 } | 2991 } |
2992 | 2992 |
2993 | 2993 |
(...skipping 11 matching lines...) Expand all Loading... |
3005 | 3005 |
3006 // Push the arguments ("left-to-right") on the stack. | 3006 // Push the arguments ("left-to-right") on the stack. |
3007 ZoneList<Expression*>* args = expr->arguments(); | 3007 ZoneList<Expression*>* args = expr->arguments(); |
3008 int arg_count = args->length(); | 3008 int arg_count = args->length(); |
3009 for (int i = 0; i < arg_count; i++) { | 3009 for (int i = 0; i < arg_count; i++) { |
3010 VisitForStackValue(args->at(i)); | 3010 VisitForStackValue(args->at(i)); |
3011 } | 3011 } |
3012 | 3012 |
3013 // Call the construct call builtin that handles allocation and | 3013 // Call the construct call builtin that handles allocation and |
3014 // constructor invocation. | 3014 // constructor invocation. |
3015 SetConstructCallPosition(expr, arg_count); | 3015 SetConstructCallPosition(expr); |
3016 | 3016 |
3017 // Load function and argument count into a1 and a0. | 3017 // Load function and argument count into a1 and a0. |
3018 __ li(a0, Operand(arg_count)); | 3018 __ li(a0, Operand(arg_count)); |
3019 __ ld(a1, MemOperand(sp, arg_count * kPointerSize)); | 3019 __ ld(a1, MemOperand(sp, arg_count * kPointerSize)); |
3020 | 3020 |
3021 // Record call targets in unoptimized code. | 3021 // Record call targets in unoptimized code. |
3022 __ EmitLoadTypeFeedbackVector(a2); | 3022 __ EmitLoadTypeFeedbackVector(a2); |
3023 __ li(a3, Operand(SmiFromSlot(expr->CallNewFeedbackSlot()))); | 3023 __ li(a3, Operand(SmiFromSlot(expr->CallNewFeedbackSlot()))); |
3024 | 3024 |
3025 Handle<Code> code = CodeFactory::ConstructIC(isolate()).code(); | 3025 Handle<Code> code = CodeFactory::ConstructIC(isolate()).code(); |
(...skipping 15 matching lines...) Expand all Loading... |
3041 | 3041 |
3042 // Push the arguments ("left-to-right") on the stack. | 3042 // Push the arguments ("left-to-right") on the stack. |
3043 ZoneList<Expression*>* args = expr->arguments(); | 3043 ZoneList<Expression*>* args = expr->arguments(); |
3044 int arg_count = args->length(); | 3044 int arg_count = args->length(); |
3045 for (int i = 0; i < arg_count; i++) { | 3045 for (int i = 0; i < arg_count; i++) { |
3046 VisitForStackValue(args->at(i)); | 3046 VisitForStackValue(args->at(i)); |
3047 } | 3047 } |
3048 | 3048 |
3049 // Call the construct call builtin that handles allocation and | 3049 // Call the construct call builtin that handles allocation and |
3050 // constructor invocation. | 3050 // constructor invocation. |
3051 SetConstructCallPosition(expr, arg_count); | 3051 SetConstructCallPosition(expr); |
3052 | 3052 |
3053 // Load new target into a3. | 3053 // Load new target into a3. |
3054 VisitForAccumulatorValue(super_call_ref->new_target_var()); | 3054 VisitForAccumulatorValue(super_call_ref->new_target_var()); |
3055 __ mov(a3, result_register()); | 3055 __ mov(a3, result_register()); |
3056 | 3056 |
3057 // Load function and argument count into a1 and a0. | 3057 // Load function and argument count into a1 and a0. |
3058 __ li(a0, Operand(arg_count)); | 3058 __ li(a0, Operand(arg_count)); |
3059 __ ld(a1, MemOperand(sp, arg_count * kPointerSize)); | 3059 __ ld(a1, MemOperand(sp, arg_count * kPointerSize)); |
3060 | 3060 |
3061 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 3061 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3792 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { | 3792 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { |
3793 ZoneList<Expression*>* args = expr->arguments(); | 3793 ZoneList<Expression*>* args = expr->arguments(); |
3794 DCHECK(args->length() == 2); | 3794 DCHECK(args->length() == 2); |
3795 | 3795 |
3796 // Evaluate new.target and super constructor. | 3796 // Evaluate new.target and super constructor. |
3797 VisitForStackValue(args->at(0)); | 3797 VisitForStackValue(args->at(0)); |
3798 VisitForStackValue(args->at(1)); | 3798 VisitForStackValue(args->at(1)); |
3799 | 3799 |
3800 // Call the construct call builtin that handles allocation and | 3800 // Call the construct call builtin that handles allocation and |
3801 // constructor invocation. | 3801 // constructor invocation. |
3802 SetConstructCallPosition(expr, 0); | 3802 SetConstructCallPosition(expr); |
3803 | 3803 |
3804 // Load new target into a3. | 3804 // Load new target into a3. |
3805 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); | 3805 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); |
3806 | 3806 |
3807 // Check if the calling frame is an arguments adaptor frame. | 3807 // Check if the calling frame is an arguments adaptor frame. |
3808 Label adaptor_frame, args_set_up, runtime; | 3808 Label adaptor_frame, args_set_up, runtime; |
3809 __ ld(a2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 3809 __ ld(a2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
3810 __ ld(a4, MemOperand(a2, StandardFrameConstants::kContextOffset)); | 3810 __ ld(a4, MemOperand(a2, StandardFrameConstants::kContextOffset)); |
3811 __ Branch(&adaptor_frame, eq, a4, | 3811 __ Branch(&adaptor_frame, eq, a4, |
3812 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 3812 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4166 __ push(v0); | 4166 __ push(v0); |
4167 | 4167 |
4168 __ LoadNativeContextSlot(expr->context_index(), v0); | 4168 __ LoadNativeContextSlot(expr->context_index(), v0); |
4169 } | 4169 } |
4170 | 4170 |
4171 | 4171 |
4172 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { | 4172 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
4173 ZoneList<Expression*>* args = expr->arguments(); | 4173 ZoneList<Expression*>* args = expr->arguments(); |
4174 int arg_count = args->length(); | 4174 int arg_count = args->length(); |
4175 | 4175 |
4176 SetCallPosition(expr, arg_count); | 4176 SetCallPosition(expr); |
4177 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 4177 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
4178 __ li(a0, Operand(arg_count)); | 4178 __ li(a0, Operand(arg_count)); |
4179 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), | 4179 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), |
4180 RelocInfo::CODE_TARGET); | 4180 RelocInfo::CODE_TARGET); |
4181 } | 4181 } |
4182 | 4182 |
4183 | 4183 |
4184 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 4184 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
4185 ZoneList<Expression*>* args = expr->arguments(); | 4185 ZoneList<Expression*>* args = expr->arguments(); |
4186 int arg_count = args->length(); | 4186 int arg_count = args->length(); |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4977 reinterpret_cast<uint64_t>( | 4977 reinterpret_cast<uint64_t>( |
4978 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4978 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4979 return OSR_AFTER_STACK_CHECK; | 4979 return OSR_AFTER_STACK_CHECK; |
4980 } | 4980 } |
4981 | 4981 |
4982 | 4982 |
4983 } // namespace internal | 4983 } // namespace internal |
4984 } // namespace v8 | 4984 } // namespace v8 |
4985 | 4985 |
4986 #endif // V8_TARGET_ARCH_MIPS64 | 4986 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |