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

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 1622493002: [stubs] Introduce ToNameStub to implement %_ToName. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix BuildNumberToString type in Crankshaft. Created 4 years, 11 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/interface-descriptors.cc ('k') | src/mips/interface-descriptors-mips.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 3248 matching lines...) Expand 10 before | Expand all | Expand 10 after
3259 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE)); 3259 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
3260 __ Ret(USE_DELAY_SLOT); 3260 __ Ret(USE_DELAY_SLOT);
3261 __ lw(v0, FieldMemOperand(a0, Oddball::kToStringOffset)); 3261 __ lw(v0, FieldMemOperand(a0, Oddball::kToStringOffset));
3262 __ bind(&not_oddball); 3262 __ bind(&not_oddball);
3263 3263
3264 __ push(a0); // Push argument. 3264 __ push(a0); // Push argument.
3265 __ TailCallRuntime(Runtime::kToString); 3265 __ TailCallRuntime(Runtime::kToString);
3266 } 3266 }
3267 3267
3268 3268
3269 void ToNameStub::Generate(MacroAssembler* masm) {
3270 // The ToName stub takes on argument in a0.
3271 Label is_number;
3272 __ JumpIfSmi(a0, &is_number);
3273
3274 Label not_name;
3275 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
3276 __ GetObjectType(a0, a1, a1);
3277 // a0: receiver
3278 // a1: receiver instance type
3279 __ Branch(&not_name, gt, a1, Operand(LAST_NAME_TYPE));
3280 __ Ret(USE_DELAY_SLOT);
3281 __ mov(v0, a0);
3282 __ bind(&not_name);
3283
3284 Label not_heap_number;
3285 __ Branch(&not_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE));
3286 __ bind(&is_number);
3287 NumberToStringStub stub(isolate());
3288 __ TailCallStub(&stub);
3289 __ bind(&not_heap_number);
3290
3291 Label not_oddball;
3292 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
3293 __ Ret(USE_DELAY_SLOT);
3294 __ lw(v0, FieldMemOperand(a0, Oddball::kToStringOffset));
3295 __ bind(&not_oddball);
3296
3297 __ push(a0); // Push argument.
3298 __ TailCallRuntime(Runtime::kToName);
3299 }
3300
3301
3269 void StringHelper::GenerateFlatOneByteStringEquals( 3302 void StringHelper::GenerateFlatOneByteStringEquals(
3270 MacroAssembler* masm, Register left, Register right, Register scratch1, 3303 MacroAssembler* masm, Register left, Register right, Register scratch1,
3271 Register scratch2, Register scratch3) { 3304 Register scratch2, Register scratch3) {
3272 Register length = scratch1; 3305 Register length = scratch1;
3273 3306
3274 // Compare lengths. 3307 // Compare lengths.
3275 Label strings_not_equal, check_zero_length; 3308 Label strings_not_equal, check_zero_length;
3276 __ lw(length, FieldMemOperand(left, String::kLengthOffset)); 3309 __ lw(length, FieldMemOperand(left, String::kLengthOffset));
3277 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset)); 3310 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset));
3278 __ Branch(&check_zero_length, eq, length, Operand(scratch2)); 3311 __ Branch(&check_zero_length, eq, length, Operand(scratch2));
(...skipping 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after
5578 MemOperand(fp, 6 * kPointerSize), NULL); 5611 MemOperand(fp, 6 * kPointerSize), NULL);
5579 } 5612 }
5580 5613
5581 5614
5582 #undef __ 5615 #undef __
5583 5616
5584 } // namespace internal 5617 } // namespace internal
5585 } // namespace v8 5618 } // namespace v8
5586 5619
5587 #endif // V8_TARGET_ARCH_MIPS 5620 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/interface-descriptors.cc ('k') | src/mips/interface-descriptors-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698