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 2932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2943 | 2943 |
2944 | 2944 |
2945 void FullCodeGenerator::EmitCall(Call* expr, CallICState::CallType call_type) { | 2945 void FullCodeGenerator::EmitCall(Call* expr, CallICState::CallType call_type) { |
2946 // Load the arguments. | 2946 // Load the arguments. |
2947 ZoneList<Expression*>* args = expr->arguments(); | 2947 ZoneList<Expression*>* args = expr->arguments(); |
2948 int arg_count = args->length(); | 2948 int arg_count = args->length(); |
2949 for (int i = 0; i < arg_count; i++) { | 2949 for (int i = 0; i < arg_count; i++) { |
2950 VisitForStackValue(args->at(i)); | 2950 VisitForStackValue(args->at(i)); |
2951 } | 2951 } |
2952 | 2952 |
| 2953 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
2953 // Record source position of the IC call. | 2954 // Record source position of the IC call. |
2954 SetCallPosition(expr, arg_count); | 2955 SetCallPosition(expr, arg_count); |
2955 Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, call_type).code(); | 2956 Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, call_type).code(); |
2956 __ li(a3, Operand(SmiFromSlot(expr->CallFeedbackICSlot()))); | 2957 __ li(a3, Operand(SmiFromSlot(expr->CallFeedbackICSlot()))); |
2957 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 2958 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
2958 // Don't assign a type feedback id to the IC, since type feedback is provided | 2959 // Don't assign a type feedback id to the IC, since type feedback is provided |
2959 // by the vector above. | 2960 // by the vector above. |
2960 CallIC(ic); | 2961 CallIC(ic); |
2961 RecordJSReturnSite(expr); | 2962 RecordJSReturnSite(expr); |
2962 // Restore context register. | 2963 // Restore context register. |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3909 } | 3910 } |
3910 | 3911 |
3911 | 3912 |
3912 void FullCodeGenerator::EmitCall(CallRuntime* expr) { | 3913 void FullCodeGenerator::EmitCall(CallRuntime* expr) { |
3913 ZoneList<Expression*>* args = expr->arguments(); | 3914 ZoneList<Expression*>* args = expr->arguments(); |
3914 DCHECK_LE(2, args->length()); | 3915 DCHECK_LE(2, args->length()); |
3915 // Push target, receiver and arguments onto the stack. | 3916 // Push target, receiver and arguments onto the stack. |
3916 for (Expression* const arg : *args) { | 3917 for (Expression* const arg : *args) { |
3917 VisitForStackValue(arg); | 3918 VisitForStackValue(arg); |
3918 } | 3919 } |
| 3920 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
3919 // Move target to a1. | 3921 // Move target to a1. |
3920 int const argc = args->length() - 2; | 3922 int const argc = args->length() - 2; |
3921 __ ld(a1, MemOperand(sp, (argc + 1) * kPointerSize)); | 3923 __ ld(a1, MemOperand(sp, (argc + 1) * kPointerSize)); |
3922 // Call the target. | 3924 // Call the target. |
3923 __ li(a0, Operand(argc)); | 3925 __ li(a0, Operand(argc)); |
3924 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 3926 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
3925 // Restore context register. | 3927 // Restore context register. |
3926 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 3928 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
3927 // Discard the function left on TOS. | 3929 // Discard the function left on TOS. |
3928 context()->DropAndPlug(1, v0); | 3930 context()->DropAndPlug(1, v0); |
3929 } | 3931 } |
3930 | 3932 |
3931 | 3933 |
3932 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { | 3934 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { |
3933 ZoneList<Expression*>* args = expr->arguments(); | 3935 ZoneList<Expression*>* args = expr->arguments(); |
3934 DCHECK(args->length() >= 2); | 3936 DCHECK(args->length() >= 2); |
3935 | 3937 |
3936 int arg_count = args->length() - 2; // 2 ~ receiver and function. | 3938 int arg_count = args->length() - 2; // 2 ~ receiver and function. |
3937 for (int i = 0; i < arg_count + 1; i++) { | 3939 for (int i = 0; i < arg_count + 1; i++) { |
3938 VisitForStackValue(args->at(i)); | 3940 VisitForStackValue(args->at(i)); |
3939 } | 3941 } |
3940 VisitForAccumulatorValue(args->last()); // Function. | 3942 VisitForAccumulatorValue(args->last()); // Function. |
3941 | 3943 |
| 3944 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
3942 Label runtime, done; | 3945 Label runtime, done; |
3943 // Check for non-function argument (including proxy). | 3946 // Check for non-function argument (including proxy). |
3944 __ JumpIfSmi(v0, &runtime); | 3947 __ JumpIfSmi(v0, &runtime); |
3945 __ GetObjectType(v0, a1, a1); | 3948 __ GetObjectType(v0, a1, a1); |
3946 __ Branch(&runtime, ne, a1, Operand(JS_FUNCTION_TYPE)); | 3949 __ Branch(&runtime, ne, a1, Operand(JS_FUNCTION_TYPE)); |
3947 | 3950 |
3948 // InvokeFunction requires the function in a1. Move it in there. | 3951 // InvokeFunction requires the function in a1. Move it in there. |
3949 __ mov(a1, result_register()); | 3952 __ mov(a1, result_register()); |
3950 ParameterCount count(arg_count); | 3953 ParameterCount count(arg_count); |
3951 __ InvokeFunction(a1, count, CALL_FUNCTION, NullCallWrapper()); | 3954 __ InvokeFunction(a1, count, CALL_FUNCTION, NullCallWrapper()); |
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5156 reinterpret_cast<uint64_t>( | 5159 reinterpret_cast<uint64_t>( |
5157 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5160 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5158 return OSR_AFTER_STACK_CHECK; | 5161 return OSR_AFTER_STACK_CHECK; |
5159 } | 5162 } |
5160 | 5163 |
5161 | 5164 |
5162 } // namespace internal | 5165 } // namespace internal |
5163 } // namespace v8 | 5166 } // namespace v8 |
5164 | 5167 |
5165 #endif // V8_TARGET_ARCH_MIPS64 | 5168 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |