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 2716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2727 __ bind(&non_function_constructor); | 2727 __ bind(&non_function_constructor); |
2728 __ LoadRoot(rax, Heap::kObject_stringRootIndex); | 2728 __ LoadRoot(rax, Heap::kObject_stringRootIndex); |
2729 | 2729 |
2730 // All done. | 2730 // All done. |
2731 __ bind(&done); | 2731 __ bind(&done); |
2732 | 2732 |
2733 context()->Plug(rax); | 2733 context()->Plug(rax); |
2734 } | 2734 } |
2735 | 2735 |
2736 | 2736 |
2737 void FullCodeGenerator::EmitValueOf(CallRuntime* expr) { | |
2738 ZoneList<Expression*>* args = expr->arguments(); | |
2739 DCHECK(args->length() == 1); | |
2740 | |
2741 VisitForAccumulatorValue(args->at(0)); // Load the object. | |
2742 | |
2743 Label done; | |
2744 // If the object is a smi return the object. | |
2745 __ JumpIfSmi(rax, &done); | |
2746 // If the object is not a value type, return the object. | |
2747 __ CmpObjectType(rax, JS_VALUE_TYPE, rbx); | |
2748 __ j(not_equal, &done); | |
2749 __ movp(rax, FieldOperand(rax, JSValue::kValueOffset)); | |
2750 | |
2751 __ bind(&done); | |
2752 context()->Plug(rax); | |
2753 } | |
2754 | |
2755 | |
2756 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { | 2737 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { |
2757 ZoneList<Expression*>* args = expr->arguments(); | 2738 ZoneList<Expression*>* args = expr->arguments(); |
2758 DCHECK(args->length() == 1); | 2739 DCHECK(args->length() == 1); |
2759 | 2740 |
2760 VisitForAccumulatorValue(args->at(0)); | 2741 VisitForAccumulatorValue(args->at(0)); |
2761 | 2742 |
2762 Label done; | 2743 Label done; |
2763 StringCharFromCodeGenerator generator(rax, rbx); | 2744 StringCharFromCodeGenerator generator(rax, rbx); |
2764 generator.GenerateFast(masm_); | 2745 generator.GenerateFast(masm_); |
2765 __ jmp(&done); | 2746 __ jmp(&done); |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3677 DCHECK_EQ( | 3658 DCHECK_EQ( |
3678 isolate->builtins()->OnStackReplacement()->entry(), | 3659 isolate->builtins()->OnStackReplacement()->entry(), |
3679 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3660 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3680 return ON_STACK_REPLACEMENT; | 3661 return ON_STACK_REPLACEMENT; |
3681 } | 3662 } |
3682 | 3663 |
3683 } // namespace internal | 3664 } // namespace internal |
3684 } // namespace v8 | 3665 } // namespace v8 |
3685 | 3666 |
3686 #endif // V8_TARGET_ARCH_X64 | 3667 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |