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

Side by Side Diff: src/ia32/code-stubs-ia32.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/full-codegen/x64/full-codegen-x64.cc ('k') | src/ia32/interface-descriptors-ia32.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_IA32 5 #if V8_TARGET_ARCH_IA32
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 3140 matching lines...) Expand 10 before | Expand all | Expand 10 after
3151 __ Ret(); 3151 __ Ret();
3152 __ bind(&not_oddball); 3152 __ bind(&not_oddball);
3153 3153
3154 __ pop(ecx); // Pop return address. 3154 __ pop(ecx); // Pop return address.
3155 __ push(eax); // Push argument. 3155 __ push(eax); // Push argument.
3156 __ push(ecx); // Push return address. 3156 __ push(ecx); // Push return address.
3157 __ TailCallRuntime(Runtime::kToString); 3157 __ TailCallRuntime(Runtime::kToString);
3158 } 3158 }
3159 3159
3160 3160
3161 void ToNameStub::Generate(MacroAssembler* masm) {
3162 // The ToName stub takes one argument in eax.
3163 Label is_number;
3164 __ JumpIfSmi(eax, &is_number, Label::kNear);
3165
3166 Label not_name;
3167 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
3168 __ CmpObjectType(eax, LAST_NAME_TYPE, edi);
3169 // eax: receiver
3170 // edi: receiver map
3171 __ j(above, &not_name, Label::kNear);
3172 __ Ret();
3173 __ bind(&not_name);
3174
3175 Label not_heap_number;
3176 __ CompareMap(eax, masm->isolate()->factory()->heap_number_map());
3177 __ j(not_equal, &not_heap_number, Label::kNear);
3178 __ bind(&is_number);
3179 NumberToStringStub stub(isolate());
3180 __ TailCallStub(&stub);
3181 __ bind(&not_heap_number);
3182
3183 Label not_oddball;
3184 __ CmpInstanceType(edi, ODDBALL_TYPE);
3185 __ j(not_equal, &not_oddball, Label::kNear);
3186 __ mov(eax, FieldOperand(eax, Oddball::kToStringOffset));
3187 __ Ret();
3188 __ bind(&not_oddball);
3189
3190 __ pop(ecx); // Pop return address.
3191 __ push(eax); // Push argument.
3192 __ push(ecx); // Push return address.
3193 __ TailCallRuntime(Runtime::kToName);
3194 }
3195
3196
3161 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, 3197 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm,
3162 Register left, 3198 Register left,
3163 Register right, 3199 Register right,
3164 Register scratch1, 3200 Register scratch1,
3165 Register scratch2) { 3201 Register scratch2) {
3166 Register length = scratch1; 3202 Register length = scratch1;
3167 3203
3168 // Compare lengths. 3204 // Compare lengths.
3169 Label strings_not_equal, check_zero_length; 3205 Label strings_not_equal, check_zero_length;
3170 __ mov(length, FieldOperand(left, String::kLengthOffset)); 3206 __ mov(length, FieldOperand(left, String::kLengthOffset));
(...skipping 2527 matching lines...) Expand 10 before | Expand all | Expand 10 after
5698 Operand(ebp, 7 * kPointerSize), NULL); 5734 Operand(ebp, 7 * kPointerSize), NULL);
5699 } 5735 }
5700 5736
5701 5737
5702 #undef __ 5738 #undef __
5703 5739
5704 } // namespace internal 5740 } // namespace internal
5705 } // namespace v8 5741 } // namespace v8
5706 5742
5707 #endif // V8_TARGET_ARCH_IA32 5743 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698