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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 MipsOperandConverter i(this, instr); | 615 MipsOperandConverter i(this, instr); |
616 InstructionCode opcode = instr->opcode(); | 616 InstructionCode opcode = instr->opcode(); |
617 ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode); | 617 ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode); |
618 switch (arch_opcode) { | 618 switch (arch_opcode) { |
619 case kArchCallCodeObject: { | 619 case kArchCallCodeObject: { |
620 EnsureSpaceForLazyDeopt(); | 620 EnsureSpaceForLazyDeopt(); |
621 if (instr->InputAt(0)->IsImmediate()) { | 621 if (instr->InputAt(0)->IsImmediate()) { |
622 __ Call(Handle<Code>::cast(i.InputHeapObject(0)), | 622 __ Call(Handle<Code>::cast(i.InputHeapObject(0)), |
623 RelocInfo::CODE_TARGET); | 623 RelocInfo::CODE_TARGET); |
624 } else { | 624 } else { |
625 __ addiu(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag); | 625 __ Call(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag); |
626 __ Call(at); | |
627 } | 626 } |
628 RecordCallPosition(instr); | 627 RecordCallPosition(instr); |
629 frame_access_state()->ClearSPDelta(); | 628 frame_access_state()->ClearSPDelta(); |
630 break; | 629 break; |
631 } | 630 } |
632 case kArchTailCallCodeObjectFromJSFunction: | 631 case kArchTailCallCodeObjectFromJSFunction: |
633 case kArchTailCallCodeObject: { | 632 case kArchTailCallCodeObject: { |
634 if (arch_opcode == kArchTailCallCodeObjectFromJSFunction) { | 633 if (arch_opcode == kArchTailCallCodeObjectFromJSFunction) { |
635 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, | 634 AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, |
636 i.TempRegister(0), i.TempRegister(1), | 635 i.TempRegister(0), i.TempRegister(1), |
637 i.TempRegister(2)); | 636 i.TempRegister(2)); |
638 } | 637 } |
639 if (instr->InputAt(0)->IsImmediate()) { | 638 if (instr->InputAt(0)->IsImmediate()) { |
640 __ Jump(Handle<Code>::cast(i.InputHeapObject(0)), | 639 __ Jump(Handle<Code>::cast(i.InputHeapObject(0)), |
641 RelocInfo::CODE_TARGET); | 640 RelocInfo::CODE_TARGET); |
642 } else { | 641 } else { |
643 __ addiu(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag); | 642 __ Jump(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag); |
644 __ Jump(at); | |
645 } | 643 } |
646 frame_access_state()->ClearSPDelta(); | 644 frame_access_state()->ClearSPDelta(); |
647 frame_access_state()->SetFrameAccessToDefault(); | 645 frame_access_state()->SetFrameAccessToDefault(); |
648 break; | 646 break; |
649 } | 647 } |
650 case kArchTailCallAddress: { | 648 case kArchTailCallAddress: { |
651 CHECK(!instr->InputAt(0)->IsImmediate()); | 649 CHECK(!instr->InputAt(0)->IsImmediate()); |
652 __ Jump(i.InputRegister(0)); | 650 __ Jump(i.InputRegister(0)); |
653 frame_access_state()->ClearSPDelta(); | 651 frame_access_state()->ClearSPDelta(); |
654 frame_access_state()->SetFrameAccessToDefault(); | 652 frame_access_state()->SetFrameAccessToDefault(); |
(...skipping 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2640 padding_size -= v8::internal::Assembler::kInstrSize; | 2638 padding_size -= v8::internal::Assembler::kInstrSize; |
2641 } | 2639 } |
2642 } | 2640 } |
2643 } | 2641 } |
2644 | 2642 |
2645 #undef __ | 2643 #undef __ |
2646 | 2644 |
2647 } // namespace compiler | 2645 } // namespace compiler |
2648 } // namespace internal | 2646 } // namespace internal |
2649 } // namespace v8 | 2647 } // namespace v8 |
OLD | NEW |