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

Side by Side Diff: src/full-codegen/x64/full-codegen-x64.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/mips64/full-codegen-mips64.cc ('k') | src/ia32/code-stubs-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_X64 5 #if V8_TARGET_ARCH_X64
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 3380 matching lines...) Expand 10 before | Expand all | Expand 10 after
3391 // Convert the object to an integer. 3391 // Convert the object to an integer.
3392 Label done_convert; 3392 Label done_convert;
3393 __ JumpIfSmi(rax, &done_convert, Label::kNear); 3393 __ JumpIfSmi(rax, &done_convert, Label::kNear);
3394 __ Push(rax); 3394 __ Push(rax);
3395 __ CallRuntime(Runtime::kToInteger); 3395 __ CallRuntime(Runtime::kToInteger);
3396 __ bind(&done_convert); 3396 __ bind(&done_convert);
3397 context()->Plug(rax); 3397 context()->Plug(rax);
3398 } 3398 }
3399 3399
3400 3400
3401 void FullCodeGenerator::EmitToName(CallRuntime* expr) {
3402 ZoneList<Expression*>* args = expr->arguments();
3403 DCHECK_EQ(1, args->length());
3404
3405 // Load the argument into rax and convert it.
3406 VisitForAccumulatorValue(args->at(0));
3407
3408 // Convert the object to a name.
3409 Label convert, done_convert;
3410 __ JumpIfSmi(rax, &convert, Label::kNear);
3411 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
3412 __ CmpObjectType(rax, LAST_NAME_TYPE, rcx);
3413 __ j(below_equal, &done_convert, Label::kNear);
3414 __ bind(&convert);
3415 __ Push(rax);
3416 __ CallRuntime(Runtime::kToName);
3417 __ bind(&done_convert);
3418 context()->Plug(rax);
3419 }
3420
3421
3422 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 3401 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
3423 ZoneList<Expression*>* args = expr->arguments(); 3402 ZoneList<Expression*>* args = expr->arguments();
3424 DCHECK(args->length() == 1); 3403 DCHECK(args->length() == 1);
3425 3404
3426 VisitForAccumulatorValue(args->at(0)); 3405 VisitForAccumulatorValue(args->at(0));
3427 3406
3428 Label done; 3407 Label done;
3429 StringCharFromCodeGenerator generator(rax, rbx); 3408 StringCharFromCodeGenerator generator(rax, rbx);
3430 generator.GenerateFast(masm_); 3409 generator.GenerateFast(masm_);
3431 __ jmp(&done); 3410 __ jmp(&done);
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
4740 Assembler::target_address_at(call_target_address, 4719 Assembler::target_address_at(call_target_address,
4741 unoptimized_code)); 4720 unoptimized_code));
4742 return OSR_AFTER_STACK_CHECK; 4721 return OSR_AFTER_STACK_CHECK;
4743 } 4722 }
4744 4723
4745 4724
4746 } // namespace internal 4725 } // namespace internal
4747 } // namespace v8 4726 } // namespace v8
4748 4727
4749 #endif // V8_TARGET_ARCH_X64 4728 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698