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 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 if (FLAG_debug_code) { | 841 if (FLAG_debug_code) { |
842 // Check the function's context matches the context argument. | 842 // Check the function's context matches the context argument. |
843 __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset)); | 843 __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset)); |
844 __ Assert(equal, kWrongFunctionContext); | 844 __ Assert(equal, kWrongFunctionContext); |
845 } | 845 } |
846 __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset)); | 846 __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset)); |
847 frame_access_state()->ClearSPDelta(); | 847 frame_access_state()->ClearSPDelta(); |
848 RecordCallPosition(instr); | 848 RecordCallPosition(instr); |
849 break; | 849 break; |
850 } | 850 } |
851 case kArchTailCallJSFunctionFromJSFunction: | 851 case kArchTailCallJSFunctionFromJSFunction: { |
852 case kArchTailCallJSFunction: { | |
853 Register func = i.InputRegister(0); | 852 Register func = i.InputRegister(0); |
854 if (FLAG_debug_code) { | 853 if (FLAG_debug_code) { |
855 // Check the function's context matches the context argument. | 854 // Check the function's context matches the context argument. |
856 __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset)); | 855 __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset)); |
857 __ Assert(equal, kWrongFunctionContext); | 856 __ Assert(equal, kWrongFunctionContext); |
858 } | 857 } |
859 if (arch_opcode == kArchTailCallJSFunctionFromJSFunction) { | 858 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, |
860 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, | 859 i.TempRegister(0), i.TempRegister(1), |
861 i.TempRegister(0), i.TempRegister(1), | 860 i.TempRegister(2)); |
862 i.TempRegister(2)); | |
863 } | |
864 __ jmp(FieldOperand(func, JSFunction::kCodeEntryOffset)); | 861 __ jmp(FieldOperand(func, JSFunction::kCodeEntryOffset)); |
865 frame_access_state()->ClearSPDelta(); | 862 frame_access_state()->ClearSPDelta(); |
866 frame_access_state()->SetFrameAccessToDefault(); | 863 frame_access_state()->SetFrameAccessToDefault(); |
867 break; | 864 break; |
868 } | 865 } |
869 case kArchPrepareCallCFunction: { | 866 case kArchPrepareCallCFunction: { |
870 // Frame alignment requires using FP-relative frame addressing. | 867 // Frame alignment requires using FP-relative frame addressing. |
871 frame_access_state()->SetFrameAccessToFP(); | 868 frame_access_state()->SetFrameAccessToFP(); |
872 int const num_parameters = MiscField::decode(instr->opcode()); | 869 int const num_parameters = MiscField::decode(instr->opcode()); |
873 __ PrepareCallCFunction(num_parameters); | 870 __ PrepareCallCFunction(num_parameters); |
(...skipping 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2756 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2753 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
2757 __ Nop(padding_size); | 2754 __ Nop(padding_size); |
2758 } | 2755 } |
2759 } | 2756 } |
2760 | 2757 |
2761 #undef __ | 2758 #undef __ |
2762 | 2759 |
2763 } // namespace compiler | 2760 } // namespace compiler |
2764 } // namespace internal | 2761 } // namespace internal |
2765 } // namespace v8 | 2762 } // namespace v8 |
OLD | NEW |