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

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

Issue 2302923002: [stubs] Port ToName stub to TurboFan. (Closed)
Patch Set: Addressed nits. Created 4 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/code-stubs.cc ('k') | src/interpreter/interpreter.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/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after
2316 __ Ret(); 2316 __ Ret();
2317 __ bind(&not_oddball); 2317 __ bind(&not_oddball);
2318 2318
2319 __ pop(ecx); // Pop return address. 2319 __ pop(ecx); // Pop return address.
2320 __ push(eax); // Push argument. 2320 __ push(eax); // Push argument.
2321 __ push(ecx); // Push return address. 2321 __ push(ecx); // Push return address.
2322 __ TailCallRuntime(Runtime::kToString); 2322 __ TailCallRuntime(Runtime::kToString);
2323 } 2323 }
2324 2324
2325 2325
2326 void ToNameStub::Generate(MacroAssembler* masm) {
2327 // The ToName stub takes one argument in eax.
2328 Label is_number;
2329 __ JumpIfSmi(eax, &is_number, Label::kNear);
2330
2331 Label not_name;
2332 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
2333 __ CmpObjectType(eax, LAST_NAME_TYPE, edi);
2334 // eax: receiver
2335 // edi: receiver map
2336 __ j(above, &not_name, Label::kNear);
2337 __ Ret();
2338 __ bind(&not_name);
2339
2340 Label not_heap_number;
2341 __ CompareMap(eax, masm->isolate()->factory()->heap_number_map());
2342 __ j(not_equal, &not_heap_number, Label::kNear);
2343 __ bind(&is_number);
2344 NumberToStringStub stub(isolate());
2345 __ TailCallStub(&stub);
2346 __ bind(&not_heap_number);
2347
2348 Label not_oddball;
2349 __ CmpInstanceType(edi, ODDBALL_TYPE);
2350 __ j(not_equal, &not_oddball, Label::kNear);
2351 __ mov(eax, FieldOperand(eax, Oddball::kToStringOffset));
2352 __ Ret();
2353 __ bind(&not_oddball);
2354
2355 __ pop(ecx); // Pop return address.
2356 __ push(eax); // Push argument.
2357 __ push(ecx); // Push return address.
2358 __ TailCallRuntime(Runtime::kToName);
2359 }
2360
2361
2362 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, 2326 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm,
2363 Register left, 2327 Register left,
2364 Register right, 2328 Register right,
2365 Register scratch1, 2329 Register scratch1,
2366 Register scratch2) { 2330 Register scratch2) {
2367 Register length = scratch1; 2331 Register length = scratch1;
2368 2332
2369 // Compare lengths. 2333 // Compare lengths.
2370 Label strings_not_equal, check_zero_length; 2334 Label strings_not_equal, check_zero_length;
2371 __ mov(length, FieldOperand(left, String::kLengthOffset)); 2335 __ mov(length, FieldOperand(left, String::kLengthOffset));
(...skipping 3114 matching lines...) Expand 10 before | Expand all | Expand 10 after
5486 kStackUnwindSpace, nullptr, return_value_operand, 5450 kStackUnwindSpace, nullptr, return_value_operand,
5487 NULL); 5451 NULL);
5488 } 5452 }
5489 5453
5490 #undef __ 5454 #undef __
5491 5455
5492 } // namespace internal 5456 } // namespace internal
5493 } // namespace v8 5457 } // namespace v8
5494 5458
5495 #endif // V8_TARGET_ARCH_IA32 5459 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698