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

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

Issue 1811563002: [fullcodegen] Avoid arguments juggling when calling a JS runtime function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@call-js-runtime
Patch Set: Created 4 years, 9 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/ppc/full-codegen-ppc.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_S390 5 #if V8_TARGET_ARCH_S390
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 3239 matching lines...) Expand 10 before | Expand all | Expand 10 after
3250 __ b(&done); 3250 __ b(&done);
3251 3251
3252 __ bind(&runtime); 3252 __ bind(&runtime);
3253 CallRuntimeWithOperands(Runtime::kCreateIterResultObject); 3253 CallRuntimeWithOperands(Runtime::kCreateIterResultObject);
3254 3254
3255 __ bind(&done); 3255 __ bind(&done);
3256 context()->Plug(r2); 3256 context()->Plug(r2);
3257 } 3257 }
3258 3258
3259 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { 3259 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
3260 // Push function.
3261 __ LoadNativeContextSlot(expr->context_index(), r2);
3262 PushOperand(r2);
3263
3260 // Push undefined as the receiver. 3264 // Push undefined as the receiver.
3261 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); 3265 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
3262 PushOperand(r2); 3266 PushOperand(r2);
3263
3264 __ LoadNativeContextSlot(expr->context_index(), r2);
3265 } 3267 }
3266 3268
3267 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { 3269 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) {
3268 ZoneList<Expression*>* args = expr->arguments(); 3270 ZoneList<Expression*>* args = expr->arguments();
3269 int arg_count = args->length(); 3271 int arg_count = args->length();
3270 3272
3271 SetCallPosition(expr); 3273 SetCallPosition(expr);
3272 __ LoadP(r3, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); 3274 __ LoadP(r3, MemOperand(sp, (arg_count + 1) * kPointerSize), r0);
3273 __ mov(r2, Operand(arg_count)); 3275 __ mov(r2, Operand(arg_count));
3274 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), 3276 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined),
3275 RelocInfo::CODE_TARGET); 3277 RelocInfo::CODE_TARGET);
3276 OperandStackDepthDecrement(arg_count + 1); 3278 OperandStackDepthDecrement(arg_count + 1);
3277 } 3279 }
3278 3280
3279 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { 3281 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
3280 ZoneList<Expression*>* args = expr->arguments(); 3282 ZoneList<Expression*>* args = expr->arguments();
3281 int arg_count = args->length(); 3283 int arg_count = args->length();
3282 3284
3283 if (expr->is_jsruntime()) { 3285 if (expr->is_jsruntime()) {
3284 Comment cmnt(masm_, "[ CallRuntime"); 3286 Comment cmnt(masm_, "[ CallRuntime");
3285 EmitLoadJSRuntimeFunction(expr); 3287 EmitLoadJSRuntimeFunction(expr);
3286 3288
3287 // Push the target function under the receiver.
3288 __ LoadP(ip, MemOperand(sp, 0));
3289 PushOperand(ip);
3290 __ StoreP(r2, MemOperand(sp, kPointerSize));
3291
3292 // Push the arguments ("left-to-right"). 3289 // Push the arguments ("left-to-right").
3293 for (int i = 0; i < arg_count; i++) { 3290 for (int i = 0; i < arg_count; i++) {
3294 VisitForStackValue(args->at(i)); 3291 VisitForStackValue(args->at(i));
3295 } 3292 }
3296 3293
3297 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); 3294 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
3298 EmitCallJSRuntimeFunction(expr); 3295 EmitCallJSRuntimeFunction(expr);
3299 3296
3300 // Restore context register. 3297 // Restore context register.
3301 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 3298 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
4032 DCHECK(kOSRBranchInstruction == br_instr); 4029 DCHECK(kOSRBranchInstruction == br_instr);
4033 4030
4034 DCHECK(interrupt_address == 4031 DCHECK(interrupt_address ==
4035 isolate->builtins()->OnStackReplacement()->entry()); 4032 isolate->builtins()->OnStackReplacement()->entry());
4036 return ON_STACK_REPLACEMENT; 4033 return ON_STACK_REPLACEMENT;
4037 } 4034 }
4038 4035
4039 } // namespace internal 4036 } // namespace internal
4040 } // namespace v8 4037 } // namespace v8
4041 #endif // V8_TARGET_ARCH_S390 4038 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/full-codegen/ppc/full-codegen-ppc.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