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

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

Issue 1319973007: [runtime] Add %ToString and %_ToString and remove the TO_STRING builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/ia32/builtins-ia32.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 3257 matching lines...) Expand 10 before | Expand all | Expand 10 after
3268 __ Ret(); 3268 __ Ret();
3269 __ bind(&not_oddball); 3269 __ bind(&not_oddball);
3270 3270
3271 __ pop(ecx); // Pop return address. 3271 __ pop(ecx); // Pop return address.
3272 __ push(eax); // Push argument. 3272 __ push(eax); // Push argument.
3273 __ push(ecx); // Push return address. 3273 __ push(ecx); // Push return address.
3274 __ TailCallRuntime(Runtime::kToNumber, 1, 1); 3274 __ TailCallRuntime(Runtime::kToNumber, 1, 1);
3275 } 3275 }
3276 3276
3277 3277
3278 void ToStringStub::Generate(MacroAssembler* masm) {
3279 // The ToString stub takes one argument in eax.
3280 Label is_number;
3281 __ JumpIfSmi(eax, &is_number, Label::kNear);
3282
3283 Label not_string;
3284 __ CmpObjectType(eax, FIRST_NONSTRING_TYPE, edi);
3285 // eax: receiver
3286 // edi: receiver map
3287 __ j(above_equal, &not_string, Label::kNear);
3288 __ Ret();
3289 __ bind(&not_string);
3290
3291 Label not_heap_number;
3292 __ CompareMap(eax, masm->isolate()->factory()->heap_number_map());
3293 __ j(not_equal, &not_heap_number, Label::kNear);
3294 __ bind(&is_number);
3295 NumberToStringStub stub(isolate());
3296 __ TailCallStub(&stub);
3297 __ bind(&not_heap_number);
3298
3299 Label not_oddball;
3300 __ CmpInstanceType(edi, ODDBALL_TYPE);
3301 __ j(not_equal, &not_oddball, Label::kNear);
3302 __ mov(eax, FieldOperand(eax, Oddball::kToStringOffset));
3303 __ Ret();
3304 __ bind(&not_oddball);
3305
3306 __ pop(ecx); // Pop return address.
3307 __ push(eax); // Push argument.
3308 __ push(ecx); // Push return address.
3309 __ TailCallRuntime(Runtime::kToString, 1, 1);
3310 }
3311
3312
3278 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, 3313 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm,
3279 Register left, 3314 Register left,
3280 Register right, 3315 Register right,
3281 Register scratch1, 3316 Register scratch1,
3282 Register scratch2) { 3317 Register scratch2) {
3283 Register length = scratch1; 3318 Register length = scratch1;
3284 3319
3285 // Compare lengths. 3320 // Compare lengths.
3286 Label strings_not_equal, check_zero_length; 3321 Label strings_not_equal, check_zero_length;
3287 __ mov(length, FieldOperand(left, String::kLengthOffset)); 3322 __ mov(length, FieldOperand(left, String::kLengthOffset));
(...skipping 2248 matching lines...) Expand 10 before | Expand all | Expand 10 after
5536 Operand(ebp, 7 * kPointerSize), NULL); 5571 Operand(ebp, 7 * kPointerSize), NULL);
5537 } 5572 }
5538 5573
5539 5574
5540 #undef __ 5575 #undef __
5541 5576
5542 } // namespace internal 5577 } // namespace internal
5543 } // namespace v8 5578 } // namespace v8
5544 5579
5545 #endif // V8_TARGET_ARCH_IA32 5580 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698