OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/compilation-info.h" | 7 #include "src/compilation-info.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 __ fninit(); | 630 __ fninit(); |
631 if (double_result) { | 631 if (double_result) { |
632 __ fld_d(Operand(esp, 0)); | 632 __ fld_d(Operand(esp, 0)); |
633 __ lea(esp, Operand(esp, kDoubleSize)); | 633 __ lea(esp, Operand(esp, kDoubleSize)); |
634 } else { | 634 } else { |
635 __ fld1(); | 635 __ fld1(); |
636 } | 636 } |
637 frame_access_state()->ClearSPDelta(); | 637 frame_access_state()->ClearSPDelta(); |
638 break; | 638 break; |
639 } | 639 } |
640 case kArchTailCallJSFunctionFromJSFunction: | 640 case kArchTailCallJSFunctionFromJSFunction: { |
641 case kArchTailCallJSFunction: { | |
642 Register func = i.InputRegister(0); | 641 Register func = i.InputRegister(0); |
643 if (FLAG_debug_code) { | 642 if (FLAG_debug_code) { |
644 // Check the function's context matches the context argument. | 643 // Check the function's context matches the context argument. |
645 __ cmp(esi, FieldOperand(func, JSFunction::kContextOffset)); | 644 __ cmp(esi, FieldOperand(func, JSFunction::kContextOffset)); |
646 __ Assert(equal, kWrongFunctionContext); | 645 __ Assert(equal, kWrongFunctionContext); |
647 } | 646 } |
648 if (FLAG_debug_code && FLAG_enable_slow_asserts) { | 647 if (FLAG_debug_code && FLAG_enable_slow_asserts) { |
649 __ VerifyX87StackDepth(1); | 648 __ VerifyX87StackDepth(1); |
650 } | 649 } |
651 __ fstp(0); | 650 __ fstp(0); |
652 if (arch_opcode == kArchTailCallJSFunctionFromJSFunction) { | 651 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, no_reg, |
653 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, | 652 no_reg, no_reg); |
654 no_reg, no_reg, no_reg); | |
655 } | |
656 __ jmp(FieldOperand(func, JSFunction::kCodeEntryOffset)); | 653 __ jmp(FieldOperand(func, JSFunction::kCodeEntryOffset)); |
657 frame_access_state()->ClearSPDelta(); | 654 frame_access_state()->ClearSPDelta(); |
658 frame_access_state()->SetFrameAccessToDefault(); | 655 frame_access_state()->SetFrameAccessToDefault(); |
659 break; | 656 break; |
660 } | 657 } |
661 case kArchPrepareCallCFunction: { | 658 case kArchPrepareCallCFunction: { |
662 // Frame alignment requires using FP-relative frame addressing. | 659 // Frame alignment requires using FP-relative frame addressing. |
663 frame_access_state()->SetFrameAccessToFP(); | 660 frame_access_state()->SetFrameAccessToFP(); |
664 int const num_parameters = MiscField::decode(instr->opcode()); | 661 int const num_parameters = MiscField::decode(instr->opcode()); |
665 __ PrepareCallCFunction(num_parameters, i.TempRegister(0)); | 662 __ PrepareCallCFunction(num_parameters, i.TempRegister(0)); |
(...skipping 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2717 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2714 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
2718 __ Nop(padding_size); | 2715 __ Nop(padding_size); |
2719 } | 2716 } |
2720 } | 2717 } |
2721 | 2718 |
2722 #undef __ | 2719 #undef __ |
2723 | 2720 |
2724 } // namespace compiler | 2721 } // namespace compiler |
2725 } // namespace internal | 2722 } // namespace internal |
2726 } // namespace v8 | 2723 } // namespace v8 |
OLD | NEW |