Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.cc

Issue 1325573004: [runtime] Replace many buggy uses of %_CallFunction with %_Call. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address feedback. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4064 matching lines...) Expand 10 before | Expand all | Expand 10 after
4075 VisitForAccumulatorValue(args->at(1)); 4075 VisitForAccumulatorValue(args->at(1));
4076 4076
4077 __ pop(a1); 4077 __ pop(a1);
4078 __ mov(a0, result_register()); // StringAddStub requires args in a0, a1. 4078 __ mov(a0, result_register()); // StringAddStub requires args in a0, a1.
4079 StringAddStub stub(isolate(), STRING_ADD_CHECK_BOTH, NOT_TENURED); 4079 StringAddStub stub(isolate(), STRING_ADD_CHECK_BOTH, NOT_TENURED);
4080 __ CallStub(&stub); 4080 __ CallStub(&stub);
4081 context()->Plug(v0); 4081 context()->Plug(v0);
4082 } 4082 }
4083 4083
4084 4084
4085 void FullCodeGenerator::EmitCall(CallRuntime* expr) {
4086 ZoneList<Expression*>* args = expr->arguments();
4087 DCHECK_LE(2, args->length());
4088 // Push target, receiver and arguments onto the stack.
4089 for (Expression* const arg : *args) {
4090 VisitForStackValue(arg);
4091 }
4092 // Move target to a1.
4093 int const argc = args->length() - 2;
4094 __ ld(a1, MemOperand(sp, (argc + 1) * kPointerSize));
4095 // Call the target.
4096 __ li(a0, Operand(argc));
4097 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
4098 // Restore context register.
4099 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
4100 // Discard the function left on TOS.
4101 context()->DropAndPlug(1, v0);
4102 }
4103
4104
4085 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { 4105 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) {
4086 ZoneList<Expression*>* args = expr->arguments(); 4106 ZoneList<Expression*>* args = expr->arguments();
4087 DCHECK(args->length() >= 2); 4107 DCHECK(args->length() >= 2);
4088 4108
4089 int arg_count = args->length() - 2; // 2 ~ receiver and function. 4109 int arg_count = args->length() - 2; // 2 ~ receiver and function.
4090 for (int i = 0; i < arg_count + 1; i++) { 4110 for (int i = 0; i < arg_count + 1; i++) {
4091 VisitForStackValue(args->at(i)); 4111 VisitForStackValue(args->at(i));
4092 } 4112 }
4093 VisitForAccumulatorValue(args->last()); // Function. 4113 VisitForAccumulatorValue(args->last()); // Function.
4094 4114
4095 Label runtime, done; 4115 Label runtime, done;
4096 // Check for non-function argument (including proxy). 4116 // Check for non-function argument (including proxy).
4097 __ JumpIfSmi(v0, &runtime); 4117 __ JumpIfSmi(v0, &runtime);
4098 __ GetObjectType(v0, a1, a1); 4118 __ GetObjectType(v0, a1, a1);
4099 __ Branch(&runtime, ne, a1, Operand(JS_FUNCTION_TYPE)); 4119 __ Branch(&runtime, ne, a1, Operand(JS_FUNCTION_TYPE));
4100 4120
4101 // InvokeFunction requires the function in a1. Move it in there. 4121 // InvokeFunction requires the function in a1. Move it in there.
4102 __ mov(a1, result_register()); 4122 __ mov(a1, result_register());
4103 ParameterCount count(arg_count); 4123 ParameterCount count(arg_count);
4104 __ InvokeFunction(a1, count, CALL_FUNCTION, NullCallWrapper()); 4124 __ InvokeFunction(a1, count, CALL_FUNCTION, NullCallWrapper());
4105 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 4125 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
4106 __ jmp(&done); 4126 __ jmp(&done);
4107 4127
4108 __ bind(&runtime); 4128 __ bind(&runtime);
4109 __ push(v0); 4129 __ push(v0);
4110 __ CallRuntime(Runtime::kCall, args->length()); 4130 __ CallRuntime(Runtime::kCallFunction, args->length());
4111 __ bind(&done); 4131 __ bind(&done);
4112 4132
4113 context()->Plug(v0); 4133 context()->Plug(v0);
4114 } 4134 }
4115 4135
4116 4136
4117 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { 4137 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) {
4118 ZoneList<Expression*>* args = expr->arguments(); 4138 ZoneList<Expression*>* args = expr->arguments();
4119 DCHECK(args->length() == 2); 4139 DCHECK(args->length() == 2);
4120 4140
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
5325 reinterpret_cast<uint64_t>( 5345 reinterpret_cast<uint64_t>(
5326 isolate->builtins()->OsrAfterStackCheck()->entry())); 5346 isolate->builtins()->OsrAfterStackCheck()->entry()));
5327 return OSR_AFTER_STACK_CHECK; 5347 return OSR_AFTER_STACK_CHECK;
5328 } 5348 }
5329 5349
5330 5350
5331 } // namespace internal 5351 } // namespace internal
5332 } // namespace v8 5352 } // namespace v8
5333 5353
5334 #endif // V8_TARGET_ARCH_MIPS64 5354 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698