OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 __ cmp(cp, kScratchReg); | 1005 __ cmp(cp, kScratchReg); |
1006 __ Assert(eq, kWrongFunctionContext); | 1006 __ Assert(eq, kWrongFunctionContext); |
1007 } | 1007 } |
1008 __ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); | 1008 __ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); |
1009 __ Call(ip); | 1009 __ Call(ip); |
1010 RecordCallPosition(instr); | 1010 RecordCallPosition(instr); |
1011 DCHECK_EQ(LeaveRC, i.OutputRCBit()); | 1011 DCHECK_EQ(LeaveRC, i.OutputRCBit()); |
1012 frame_access_state()->ClearSPDelta(); | 1012 frame_access_state()->ClearSPDelta(); |
1013 break; | 1013 break; |
1014 } | 1014 } |
1015 case kArchTailCallJSFunctionFromJSFunction: | 1015 case kArchTailCallJSFunctionFromJSFunction: { |
1016 case kArchTailCallJSFunction: { | |
1017 Register func = i.InputRegister(0); | 1016 Register func = i.InputRegister(0); |
1018 if (FLAG_debug_code) { | 1017 if (FLAG_debug_code) { |
1019 // Check the function's context matches the context argument. | 1018 // Check the function's context matches the context argument. |
1020 __ LoadP(kScratchReg, | 1019 __ LoadP(kScratchReg, |
1021 FieldMemOperand(func, JSFunction::kContextOffset)); | 1020 FieldMemOperand(func, JSFunction::kContextOffset)); |
1022 __ cmp(cp, kScratchReg); | 1021 __ cmp(cp, kScratchReg); |
1023 __ Assert(eq, kWrongFunctionContext); | 1022 __ Assert(eq, kWrongFunctionContext); |
1024 } | 1023 } |
1025 if (opcode == kArchTailCallJSFunctionFromJSFunction) { | 1024 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, |
1026 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, | 1025 i.TempRegister(0), i.TempRegister(1), |
1027 i.TempRegister(0), i.TempRegister(1), | 1026 i.TempRegister(2)); |
1028 i.TempRegister(2)); | |
1029 } | |
1030 __ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); | 1027 __ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); |
1031 __ Jump(ip); | 1028 __ Jump(ip); |
1032 DCHECK_EQ(LeaveRC, i.OutputRCBit()); | 1029 DCHECK_EQ(LeaveRC, i.OutputRCBit()); |
1033 frame_access_state()->ClearSPDelta(); | 1030 frame_access_state()->ClearSPDelta(); |
1034 frame_access_state()->SetFrameAccessToDefault(); | 1031 frame_access_state()->SetFrameAccessToDefault(); |
1035 break; | 1032 break; |
1036 } | 1033 } |
1037 case kArchPrepareCallCFunction: { | 1034 case kArchPrepareCallCFunction: { |
1038 int const num_parameters = MiscField::decode(instr->opcode()); | 1035 int const num_parameters = MiscField::decode(instr->opcode()); |
1039 __ PrepareCallCFunction(num_parameters, kScratchReg); | 1036 __ PrepareCallCFunction(num_parameters, kScratchReg); |
(...skipping 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2444 padding_size -= v8::internal::Assembler::kInstrSize; | 2441 padding_size -= v8::internal::Assembler::kInstrSize; |
2445 } | 2442 } |
2446 } | 2443 } |
2447 } | 2444 } |
2448 | 2445 |
2449 #undef __ | 2446 #undef __ |
2450 | 2447 |
2451 } // namespace compiler | 2448 } // namespace compiler |
2452 } // namespace internal | 2449 } // namespace internal |
2453 } // namespace v8 | 2450 } // namespace v8 |
OLD | NEW |