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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 // Check the function's context matches the context argument. | 641 // Check the function's context matches the context argument. |
642 __ ld(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset)); | 642 __ ld(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset)); |
643 __ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg)); | 643 __ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg)); |
644 } | 644 } |
645 __ ld(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); | 645 __ ld(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); |
646 __ Call(at); | 646 __ Call(at); |
647 RecordCallPosition(instr); | 647 RecordCallPosition(instr); |
648 frame_access_state()->ClearSPDelta(); | 648 frame_access_state()->ClearSPDelta(); |
649 break; | 649 break; |
650 } | 650 } |
651 case kArchTailCallJSFunctionFromJSFunction: | 651 case kArchTailCallJSFunctionFromJSFunction: { |
652 case kArchTailCallJSFunction: { | |
653 Register func = i.InputRegister(0); | 652 Register func = i.InputRegister(0); |
654 if (FLAG_debug_code) { | 653 if (FLAG_debug_code) { |
655 // Check the function's context matches the context argument. | 654 // Check the function's context matches the context argument. |
656 __ ld(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset)); | 655 __ ld(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset)); |
657 __ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg)); | 656 __ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg)); |
658 } | 657 } |
659 if (arch_opcode == kArchTailCallJSFunctionFromJSFunction) { | 658 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, |
660 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, | 659 i.TempRegister(0), i.TempRegister(1), |
661 i.TempRegister(0), i.TempRegister(1), | 660 i.TempRegister(2)); |
662 i.TempRegister(2)); | |
663 } | |
664 __ ld(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); | 661 __ ld(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); |
665 __ Jump(at); | 662 __ Jump(at); |
666 frame_access_state()->ClearSPDelta(); | 663 frame_access_state()->ClearSPDelta(); |
667 frame_access_state()->SetFrameAccessToDefault(); | 664 frame_access_state()->SetFrameAccessToDefault(); |
668 break; | 665 break; |
669 } | 666 } |
670 case kArchPrepareCallCFunction: { | 667 case kArchPrepareCallCFunction: { |
671 int const num_parameters = MiscField::decode(instr->opcode()); | 668 int const num_parameters = MiscField::decode(instr->opcode()); |
672 __ PrepareCallCFunction(num_parameters, kScratchReg); | 669 __ PrepareCallCFunction(num_parameters, kScratchReg); |
673 // Frame alignment requires using FP-relative frame addressing. | 670 // Frame alignment requires using FP-relative frame addressing. |
(...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2529 padding_size -= v8::internal::Assembler::kInstrSize; | 2526 padding_size -= v8::internal::Assembler::kInstrSize; |
2530 } | 2527 } |
2531 } | 2528 } |
2532 } | 2529 } |
2533 | 2530 |
2534 #undef __ | 2531 #undef __ |
2535 | 2532 |
2536 } // namespace compiler | 2533 } // namespace compiler |
2537 } // namespace internal | 2534 } // namespace internal |
2538 } // namespace v8 | 2535 } // namespace v8 |
OLD | NEW |