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

Side by Side Diff: src/full-codegen/ia32/full-codegen-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/full-codegen.cc ('k') | src/full-codegen/mips/full-codegen-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_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 3398 matching lines...) Expand 10 before | Expand all | Expand 10 after
3409 // Convert the object to an integer. 3409 // Convert the object to an integer.
3410 Label done_convert; 3410 Label done_convert;
3411 __ JumpIfSmi(eax, &done_convert, Label::kNear); 3411 __ JumpIfSmi(eax, &done_convert, Label::kNear);
3412 __ Push(eax); 3412 __ Push(eax);
3413 __ CallRuntime(Runtime::kToInteger); 3413 __ CallRuntime(Runtime::kToInteger);
3414 __ bind(&done_convert); 3414 __ bind(&done_convert);
3415 context()->Plug(eax); 3415 context()->Plug(eax);
3416 } 3416 }
3417 3417
3418 3418
3419 void FullCodeGenerator::EmitToName(CallRuntime* expr) {
3420 ZoneList<Expression*>* args = expr->arguments();
3421 DCHECK_EQ(1, args->length());
3422
3423 // Load the argument into eax and convert it.
3424 VisitForAccumulatorValue(args->at(0));
3425
3426 // Convert the object to a name.
3427 Label convert, done_convert;
3428 __ JumpIfSmi(eax, &convert, Label::kNear);
3429 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
3430 __ CmpObjectType(eax, LAST_NAME_TYPE, ecx);
3431 __ j(below_equal, &done_convert, Label::kNear);
3432 __ bind(&convert);
3433 __ Push(eax);
3434 __ CallRuntime(Runtime::kToName);
3435 __ bind(&done_convert);
3436 context()->Plug(eax);
3437 }
3438
3439
3440 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 3419 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
3441 ZoneList<Expression*>* args = expr->arguments(); 3420 ZoneList<Expression*>* args = expr->arguments();
3442 DCHECK(args->length() == 1); 3421 DCHECK(args->length() == 1);
3443 3422
3444 VisitForAccumulatorValue(args->at(0)); 3423 VisitForAccumulatorValue(args->at(0));
3445 3424
3446 Label done; 3425 Label done;
3447 StringCharFromCodeGenerator generator(eax, ebx); 3426 StringCharFromCodeGenerator generator(eax, ebx);
3448 generator.GenerateFast(masm_); 3427 generator.GenerateFast(masm_);
3449 __ jmp(&done); 3428 __ jmp(&done);
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
4738 Assembler::target_address_at(call_target_address, 4717 Assembler::target_address_at(call_target_address,
4739 unoptimized_code)); 4718 unoptimized_code));
4740 return OSR_AFTER_STACK_CHECK; 4719 return OSR_AFTER_STACK_CHECK;
4741 } 4720 }
4742 4721
4743 4722
4744 } // namespace internal 4723 } // namespace internal
4745 } // namespace v8 4724 } // namespace v8
4746 4725
4747 #endif // V8_TARGET_ARCH_IA32 4726 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698