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

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

Issue 1846683006: [stubs] Introduce ToIntegerStub and unify the handling of %_ToInteger. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 3022 matching lines...) Expand 10 before | Expand all | Expand 10 after
3033 __ SmiTag(index, index); 3033 __ SmiTag(index, index);
3034 } 3034 }
3035 3035
3036 __ SmiUntag(value); 3036 __ SmiUntag(value);
3037 __ SmiToShortArrayOffset(r1, index); 3037 __ SmiToShortArrayOffset(r1, index);
3038 __ StoreHalfWord(value, MemOperand(r1, string, SeqTwoByteString::kHeaderSize - 3038 __ StoreHalfWord(value, MemOperand(r1, string, SeqTwoByteString::kHeaderSize -
3039 kHeapObjectTag)); 3039 kHeapObjectTag));
3040 context()->Plug(string); 3040 context()->Plug(string);
3041 } 3041 }
3042 3042
3043 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) {
3044 ZoneList<Expression*>* args = expr->arguments();
3045 DCHECK_EQ(1, args->length());
3046
3047 // Load the argument into r2 and convert it.
3048 VisitForAccumulatorValue(args->at(0));
3049
3050 // Convert the object to an integer.
3051 Label done_convert;
3052 __ JumpIfSmi(r2, &done_convert);
3053 __ Push(r2);
3054 __ CallRuntime(Runtime::kToInteger);
3055 __ bind(&done_convert);
3056 context()->Plug(r2);
3057 }
3058
3059 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 3043 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
3060 ZoneList<Expression*>* args = expr->arguments(); 3044 ZoneList<Expression*>* args = expr->arguments();
3061 DCHECK(args->length() == 1); 3045 DCHECK(args->length() == 1);
3062 VisitForAccumulatorValue(args->at(0)); 3046 VisitForAccumulatorValue(args->at(0));
3063 3047
3064 Label done; 3048 Label done;
3065 StringCharFromCodeGenerator generator(r2, r3); 3049 StringCharFromCodeGenerator generator(r2, r3);
3066 generator.GenerateFast(masm_); 3050 generator.GenerateFast(masm_);
3067 __ b(&done); 3051 __ b(&done);
3068 3052
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
3987 DCHECK(kOSRBranchInstruction == br_instr); 3971 DCHECK(kOSRBranchInstruction == br_instr);
3988 3972
3989 DCHECK(interrupt_address == 3973 DCHECK(interrupt_address ==
3990 isolate->builtins()->OnStackReplacement()->entry()); 3974 isolate->builtins()->OnStackReplacement()->entry());
3991 return ON_STACK_REPLACEMENT; 3975 return ON_STACK_REPLACEMENT;
3992 } 3976 }
3993 3977
3994 } // namespace internal 3978 } // namespace internal
3995 } // namespace v8 3979 } // namespace v8
3996 #endif // V8_TARGET_ARCH_S390 3980 #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