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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.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/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.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 3111 matching lines...) Expand 10 before | Expand all | Expand 10 after
3122 string, 3122 string,
3123 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); 3123 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
3124 __ dsra(index, index, 32 - 1); 3124 __ dsra(index, index, 32 - 1);
3125 __ Daddu(at, at, index); 3125 __ Daddu(at, at, index);
3126 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); 3126 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0);
3127 __ sh(value, MemOperand(at)); 3127 __ sh(value, MemOperand(at));
3128 context()->Plug(string); 3128 context()->Plug(string);
3129 } 3129 }
3130 3130
3131 3131
3132 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) {
3133 ZoneList<Expression*>* args = expr->arguments();
3134 DCHECK_EQ(1, args->length());
3135
3136 // Load the argument into v0 and convert it.
3137 VisitForAccumulatorValue(args->at(0));
3138
3139 // Convert the object to an integer.
3140 Label done_convert;
3141 __ JumpIfSmi(v0, &done_convert);
3142 __ Push(v0);
3143 __ CallRuntime(Runtime::kToInteger);
3144 __ bind(&done_convert);
3145 context()->Plug(v0);
3146 }
3147
3148
3149 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 3132 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
3150 ZoneList<Expression*>* args = expr->arguments(); 3133 ZoneList<Expression*>* args = expr->arguments();
3151 DCHECK(args->length() == 1); 3134 DCHECK(args->length() == 1);
3152 3135
3153 VisitForAccumulatorValue(args->at(0)); 3136 VisitForAccumulatorValue(args->at(0));
3154 3137
3155 Label done; 3138 Label done;
3156 StringCharFromCodeGenerator generator(v0, a1); 3139 StringCharFromCodeGenerator generator(v0, a1);
3157 generator.GenerateFast(masm_); 3140 generator.GenerateFast(masm_);
3158 __ jmp(&done); 3141 __ jmp(&done);
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
4129 reinterpret_cast<uint64_t>( 4112 reinterpret_cast<uint64_t>(
4130 isolate->builtins()->OnStackReplacement()->entry())); 4113 isolate->builtins()->OnStackReplacement()->entry()));
4131 return ON_STACK_REPLACEMENT; 4114 return ON_STACK_REPLACEMENT;
4132 } 4115 }
4133 4116
4134 4117
4135 } // namespace internal 4118 } // namespace internal
4136 } // namespace v8 4119 } // namespace v8
4137 4120
4138 #endif // V8_TARGET_ARCH_MIPS64 4121 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698