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 #include "src/compilation-info.h" | 6 #include "src/compilation-info.h" |
7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/osr.h" | 10 #include "src/compiler/osr.h" |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 __ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg)); | 632 __ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg)); |
633 } | 633 } |
634 | 634 |
635 __ lw(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); | 635 __ lw(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); |
636 __ Call(at); | 636 __ Call(at); |
637 RecordCallPosition(instr); | 637 RecordCallPosition(instr); |
638 frame_access_state()->ClearSPDelta(); | 638 frame_access_state()->ClearSPDelta(); |
639 frame_access_state()->SetFrameAccessToDefault(); | 639 frame_access_state()->SetFrameAccessToDefault(); |
640 break; | 640 break; |
641 } | 641 } |
642 case kArchTailCallJSFunctionFromJSFunction: | 642 case kArchTailCallJSFunctionFromJSFunction: { |
643 case kArchTailCallJSFunction: { | |
644 Register func = i.InputRegister(0); | 643 Register func = i.InputRegister(0); |
645 if (FLAG_debug_code) { | 644 if (FLAG_debug_code) { |
646 // Check the function's context matches the context argument. | 645 // Check the function's context matches the context argument. |
647 __ lw(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset)); | 646 __ lw(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset)); |
648 __ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg)); | 647 __ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg)); |
649 } | 648 } |
650 | 649 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, |
651 if (arch_opcode == kArchTailCallJSFunctionFromJSFunction) { | 650 i.TempRegister(0), i.TempRegister(1), |
652 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, | 651 i.TempRegister(2)); |
653 i.TempRegister(0), i.TempRegister(1), | |
654 i.TempRegister(2)); | |
655 } | |
656 __ lw(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); | 652 __ lw(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); |
657 __ Jump(at); | 653 __ Jump(at); |
658 frame_access_state()->ClearSPDelta(); | 654 frame_access_state()->ClearSPDelta(); |
659 break; | 655 break; |
660 } | 656 } |
661 case kArchPrepareCallCFunction: { | 657 case kArchPrepareCallCFunction: { |
662 int const num_parameters = MiscField::decode(instr->opcode()); | 658 int const num_parameters = MiscField::decode(instr->opcode()); |
663 __ PrepareCallCFunction(num_parameters, kScratchReg); | 659 __ PrepareCallCFunction(num_parameters, kScratchReg); |
664 // Frame alignment requires using FP-relative frame addressing. | 660 // Frame alignment requires using FP-relative frame addressing. |
665 frame_access_state()->SetFrameAccessToFP(); | 661 frame_access_state()->SetFrameAccessToFP(); |
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2255 padding_size -= v8::internal::Assembler::kInstrSize; | 2251 padding_size -= v8::internal::Assembler::kInstrSize; |
2256 } | 2252 } |
2257 } | 2253 } |
2258 } | 2254 } |
2259 | 2255 |
2260 #undef __ | 2256 #undef __ |
2261 | 2257 |
2262 } // namespace compiler | 2258 } // namespace compiler |
2263 } // namespace internal | 2259 } // namespace internal |
2264 } // namespace v8 | 2260 } // namespace v8 |
OLD | NEW |