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/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2647 __ bind(&non_function_constructor); | 2647 __ bind(&non_function_constructor); |
2648 __ LoadRoot(rax, Heap::kObject_stringRootIndex); | 2648 __ LoadRoot(rax, Heap::kObject_stringRootIndex); |
2649 | 2649 |
2650 // All done. | 2650 // All done. |
2651 __ bind(&done); | 2651 __ bind(&done); |
2652 | 2652 |
2653 context()->Plug(rax); | 2653 context()->Plug(rax); |
2654 } | 2654 } |
2655 | 2655 |
2656 | 2656 |
2657 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { | |
2658 ZoneList<Expression*>* args = expr->arguments(); | |
2659 DCHECK(args->length() == 1); | |
2660 | |
2661 VisitForAccumulatorValue(args->at(0)); | |
2662 | |
2663 Label done; | |
2664 StringCharFromCodeGenerator generator(rax, rbx); | |
2665 generator.GenerateFast(masm_); | |
2666 __ jmp(&done); | |
2667 | |
2668 NopRuntimeCallHelper call_helper; | |
2669 generator.GenerateSlow(masm_, call_helper); | |
2670 | |
2671 __ bind(&done); | |
2672 context()->Plug(rbx); | |
2673 } | |
2674 | |
2675 | |
2676 void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) { | 2657 void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) { |
2677 ZoneList<Expression*>* args = expr->arguments(); | 2658 ZoneList<Expression*>* args = expr->arguments(); |
2678 DCHECK(args->length() == 2); | 2659 DCHECK(args->length() == 2); |
2679 | 2660 |
2680 VisitForStackValue(args->at(0)); | 2661 VisitForStackValue(args->at(0)); |
2681 VisitForAccumulatorValue(args->at(1)); | 2662 VisitForAccumulatorValue(args->at(1)); |
2682 | 2663 |
2683 Register object = rbx; | 2664 Register object = rbx; |
2684 Register index = rax; | 2665 Register index = rax; |
2685 Register result = rdx; | 2666 Register result = rdx; |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3573 DCHECK_EQ( | 3554 DCHECK_EQ( |
3574 isolate->builtins()->OnStackReplacement()->entry(), | 3555 isolate->builtins()->OnStackReplacement()->entry(), |
3575 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3556 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3576 return ON_STACK_REPLACEMENT; | 3557 return ON_STACK_REPLACEMENT; |
3577 } | 3558 } |
3578 | 3559 |
3579 } // namespace internal | 3560 } // namespace internal |
3580 } // namespace v8 | 3561 } // namespace v8 |
3581 | 3562 |
3582 #endif // V8_TARGET_ARCH_X64 | 3563 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |