| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 FieldMemOperand(func, JSFunction::kContextOffset)); | 917 FieldMemOperand(func, JSFunction::kContextOffset)); |
| 918 __ CmpP(cp, kScratchReg); | 918 __ CmpP(cp, kScratchReg); |
| 919 __ Assert(eq, kWrongFunctionContext); | 919 __ Assert(eq, kWrongFunctionContext); |
| 920 } | 920 } |
| 921 __ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); | 921 __ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); |
| 922 __ Call(ip); | 922 __ Call(ip); |
| 923 RecordCallPosition(instr); | 923 RecordCallPosition(instr); |
| 924 frame_access_state()->ClearSPDelta(); | 924 frame_access_state()->ClearSPDelta(); |
| 925 break; | 925 break; |
| 926 } | 926 } |
| 927 case kArchTailCallJSFunctionFromJSFunction: | 927 case kArchTailCallJSFunctionFromJSFunction: { |
| 928 case kArchTailCallJSFunction: { | |
| 929 Register func = i.InputRegister(0); | 928 Register func = i.InputRegister(0); |
| 930 if (FLAG_debug_code) { | 929 if (FLAG_debug_code) { |
| 931 // Check the function's context matches the context argument. | 930 // Check the function's context matches the context argument. |
| 932 __ LoadP(kScratchReg, | 931 __ LoadP(kScratchReg, |
| 933 FieldMemOperand(func, JSFunction::kContextOffset)); | 932 FieldMemOperand(func, JSFunction::kContextOffset)); |
| 934 __ CmpP(cp, kScratchReg); | 933 __ CmpP(cp, kScratchReg); |
| 935 __ Assert(eq, kWrongFunctionContext); | 934 __ Assert(eq, kWrongFunctionContext); |
| 936 } | 935 } |
| 937 if (opcode == kArchTailCallJSFunctionFromJSFunction) { | 936 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, |
| 938 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, | 937 i.TempRegister(0), i.TempRegister(1), |
| 939 i.TempRegister(0), i.TempRegister(1), | 938 i.TempRegister(2)); |
| 940 i.TempRegister(2)); | |
| 941 } | |
| 942 __ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); | 939 __ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); |
| 943 __ Jump(ip); | 940 __ Jump(ip); |
| 944 frame_access_state()->ClearSPDelta(); | 941 frame_access_state()->ClearSPDelta(); |
| 945 frame_access_state()->SetFrameAccessToDefault(); | 942 frame_access_state()->SetFrameAccessToDefault(); |
| 946 break; | 943 break; |
| 947 } | 944 } |
| 948 case kArchPrepareCallCFunction: { | 945 case kArchPrepareCallCFunction: { |
| 949 int const num_parameters = MiscField::decode(instr->opcode()); | 946 int const num_parameters = MiscField::decode(instr->opcode()); |
| 950 __ PrepareCallCFunction(num_parameters, kScratchReg); | 947 __ PrepareCallCFunction(num_parameters, kScratchReg); |
| 951 // Frame alignment requires using FP-relative frame addressing. | 948 // Frame alignment requires using FP-relative frame addressing. |
| (...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2563 padding_size -= 2; | 2560 padding_size -= 2; |
| 2564 } | 2561 } |
| 2565 } | 2562 } |
| 2566 } | 2563 } |
| 2567 | 2564 |
| 2568 #undef __ | 2565 #undef __ |
| 2569 | 2566 |
| 2570 } // namespace compiler | 2567 } // namespace compiler |
| 2571 } // namespace internal | 2568 } // namespace internal |
| 2572 } // namespace v8 | 2569 } // namespace v8 |
| OLD | NEW |