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

Side by Side Diff: src/full-codegen/ppc/full-codegen-ppc.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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after
3114 } 3114 }
3115 3115
3116 __ SmiUntag(value); 3116 __ SmiUntag(value);
3117 __ addi(ip, string, Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); 3117 __ addi(ip, string, Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
3118 __ SmiToShortArrayOffset(r0, index); 3118 __ SmiToShortArrayOffset(r0, index);
3119 __ sthx(value, MemOperand(ip, r0)); 3119 __ sthx(value, MemOperand(ip, r0));
3120 context()->Plug(string); 3120 context()->Plug(string);
3121 } 3121 }
3122 3122
3123 3123
3124 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) {
3125 ZoneList<Expression*>* args = expr->arguments();
3126 DCHECK_EQ(1, args->length());
3127
3128 // Load the argument into r3 and convert it.
3129 VisitForAccumulatorValue(args->at(0));
3130
3131 // Convert the object to an integer.
3132 Label done_convert;
3133 __ JumpIfSmi(r3, &done_convert);
3134 __ Push(r3);
3135 __ CallRuntime(Runtime::kToInteger);
3136 __ bind(&done_convert);
3137 context()->Plug(r3);
3138 }
3139
3140
3141 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 3124 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
3142 ZoneList<Expression*>* args = expr->arguments(); 3125 ZoneList<Expression*>* args = expr->arguments();
3143 DCHECK(args->length() == 1); 3126 DCHECK(args->length() == 1);
3144 VisitForAccumulatorValue(args->at(0)); 3127 VisitForAccumulatorValue(args->at(0));
3145 3128
3146 Label done; 3129 Label done;
3147 StringCharFromCodeGenerator generator(r3, r4); 3130 StringCharFromCodeGenerator generator(r3, r4);
3148 generator.GenerateFast(masm_); 3131 generator.GenerateFast(masm_);
3149 __ b(&done); 3132 __ b(&done);
3150 3133
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
4089 4072
4090 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); 4073 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address)));
4091 4074
4092 DCHECK(interrupt_address == 4075 DCHECK(interrupt_address ==
4093 isolate->builtins()->OnStackReplacement()->entry()); 4076 isolate->builtins()->OnStackReplacement()->entry());
4094 return ON_STACK_REPLACEMENT; 4077 return ON_STACK_REPLACEMENT;
4095 } 4078 }
4096 } // namespace internal 4079 } // namespace internal
4097 } // namespace v8 4080 } // namespace v8
4098 #endif // V8_TARGET_ARCH_PPC 4081 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/full-codegen/s390/full-codegen-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698