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

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

Issue 1807943002: [fullcodegen] Factor out VisitCallRuntime from archs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
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 3258 matching lines...) Expand 10 before | Expand all | Expand 10 after
3269 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { 3269 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) {
3270 ZoneList<Expression*>* args = expr->arguments(); 3270 ZoneList<Expression*>* args = expr->arguments();
3271 int arg_count = args->length(); 3271 int arg_count = args->length();
3272 3272
3273 SetCallPosition(expr); 3273 SetCallPosition(expr);
3274 __ LoadP(r3, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); 3274 __ LoadP(r3, MemOperand(sp, (arg_count + 1) * kPointerSize), r0);
3275 __ mov(r2, Operand(arg_count)); 3275 __ mov(r2, Operand(arg_count));
3276 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), 3276 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined),
3277 RelocInfo::CODE_TARGET); 3277 RelocInfo::CODE_TARGET);
3278 OperandStackDepthDecrement(arg_count + 1); 3278 OperandStackDepthDecrement(arg_count + 1);
3279 }
3280 3279
3281 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { 3280 // Restore context register.
3282 ZoneList<Expression*>* args = expr->arguments(); 3281 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
3283 int arg_count = args->length();
3284
3285 if (expr->is_jsruntime()) {
3286 Comment cmnt(masm_, "[ CallRuntime");
3287 EmitLoadJSRuntimeFunction(expr);
3288
3289 // Push the arguments ("left-to-right").
3290 for (int i = 0; i < arg_count; i++) {
3291 VisitForStackValue(args->at(i));
3292 }
3293
3294 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
3295 EmitCallJSRuntimeFunction(expr);
3296
3297 // Restore context register.
3298 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
3299
3300 context()->DropAndPlug(1, r2);
3301
3302 } else {
3303 const Runtime::Function* function = expr->function();
3304 switch (function->function_id) {
3305 #define CALL_INTRINSIC_GENERATOR(Name) \
3306 case Runtime::kInline##Name: { \
3307 Comment cmnt(masm_, "[ Inline" #Name); \
3308 return Emit##Name(expr); \
3309 }
3310 FOR_EACH_FULL_CODE_INTRINSIC(CALL_INTRINSIC_GENERATOR)
3311 #undef CALL_INTRINSIC_GENERATOR
3312 default: {
3313 Comment cmnt(masm_, "[ CallRuntime for unhandled intrinsic");
3314 // Push the arguments ("left-to-right").
3315 for (int i = 0; i < arg_count; i++) {
3316 VisitForStackValue(args->at(i));
3317 }
3318
3319 // Call the C runtime function.
3320 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
3321 __ CallRuntime(expr->function(), arg_count);
3322 OperandStackDepthDecrement(arg_count);
3323 context()->Plug(r2);
3324 }
3325 }
3326 }
3327 } 3282 }
3328 3283
3329 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { 3284 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
3330 switch (expr->op()) { 3285 switch (expr->op()) {
3331 case Token::DELETE: { 3286 case Token::DELETE: {
3332 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); 3287 Comment cmnt(masm_, "[ UnaryOperation (DELETE)");
3333 Property* property = expr->expression()->AsProperty(); 3288 Property* property = expr->expression()->AsProperty();
3334 VariableProxy* proxy = expr->expression()->AsVariableProxy(); 3289 VariableProxy* proxy = expr->expression()->AsVariableProxy();
3335 3290
3336 if (property != NULL) { 3291 if (property != NULL) {
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
4029 DCHECK(kOSRBranchInstruction == br_instr); 3984 DCHECK(kOSRBranchInstruction == br_instr);
4030 3985
4031 DCHECK(interrupt_address == 3986 DCHECK(interrupt_address ==
4032 isolate->builtins()->OnStackReplacement()->entry()); 3987 isolate->builtins()->OnStackReplacement()->entry());
4033 return ON_STACK_REPLACEMENT; 3988 return ON_STACK_REPLACEMENT;
4034 } 3989 }
4035 3990
4036 } // namespace internal 3991 } // namespace internal
4037 } // namespace v8 3992 } // namespace v8
4038 #endif // V8_TARGET_ARCH_S390 3993 #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