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 3868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3879 // Call the target. | 3879 // Call the target. |
3880 __ li(a0, Operand(argc)); | 3880 __ li(a0, Operand(argc)); |
3881 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 3881 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
3882 // Restore context register. | 3882 // Restore context register. |
3883 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 3883 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
3884 // Discard the function left on TOS. | 3884 // Discard the function left on TOS. |
3885 context()->DropAndPlug(1, v0); | 3885 context()->DropAndPlug(1, v0); |
3886 } | 3886 } |
3887 | 3887 |
3888 | 3888 |
3889 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { | |
3890 ZoneList<Expression*>* args = expr->arguments(); | |
3891 DCHECK(args->length() >= 2); | |
3892 | |
3893 int arg_count = args->length() - 2; // 2 ~ receiver and function. | |
3894 for (int i = 0; i < arg_count + 1; i++) { | |
3895 VisitForStackValue(args->at(i)); | |
3896 } | |
3897 VisitForAccumulatorValue(args->last()); // Function. | |
3898 | |
3899 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); | |
3900 Label runtime, done; | |
3901 // Check for non-function argument (including proxy). | |
3902 __ JumpIfSmi(v0, &runtime); | |
3903 __ GetObjectType(v0, a1, a1); | |
3904 __ Branch(&runtime, ne, a1, Operand(JS_FUNCTION_TYPE)); | |
3905 | |
3906 // InvokeFunction requires the function in a1. Move it in there. | |
3907 __ mov(a1, result_register()); | |
3908 ParameterCount count(arg_count); | |
3909 __ InvokeFunction(a1, count, CALL_FUNCTION, NullCallWrapper()); | |
3910 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
3911 __ jmp(&done); | |
3912 | |
3913 __ bind(&runtime); | |
3914 __ push(v0); | |
3915 __ CallRuntime(Runtime::kCallFunction, args->length()); | |
3916 __ bind(&done); | |
3917 | |
3918 context()->Plug(v0); | |
3919 } | |
3920 | |
3921 | |
3922 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { | 3889 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { |
3923 ZoneList<Expression*>* args = expr->arguments(); | 3890 ZoneList<Expression*>* args = expr->arguments(); |
3924 DCHECK(args->length() == 2); | 3891 DCHECK(args->length() == 2); |
3925 | 3892 |
3926 // Evaluate new.target and super constructor. | 3893 // Evaluate new.target and super constructor. |
3927 VisitForStackValue(args->at(0)); | 3894 VisitForStackValue(args->at(0)); |
3928 VisitForStackValue(args->at(1)); | 3895 VisitForStackValue(args->at(1)); |
3929 | 3896 |
3930 // Load original constructor into a3. | 3897 // Load original constructor into a3. |
3931 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); | 3898 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); |
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5114 reinterpret_cast<uint64_t>( | 5081 reinterpret_cast<uint64_t>( |
5115 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5082 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5116 return OSR_AFTER_STACK_CHECK; | 5083 return OSR_AFTER_STACK_CHECK; |
5117 } | 5084 } |
5118 | 5085 |
5119 | 5086 |
5120 } // namespace internal | 5087 } // namespace internal |
5121 } // namespace v8 | 5088 } // namespace v8 |
5122 | 5089 |
5123 #endif // V8_TARGET_ARCH_MIPS64 | 5090 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |