OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |