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/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/arm64/macro-assembler-arm64.h" | 8 #include "src/arm64/macro-assembler-arm64.h" |
9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 __ RecordComment(reinterpret_cast<const char*>(comment_string)); | 767 __ RecordComment(reinterpret_cast<const char*>(comment_string)); |
768 break; | 768 break; |
769 } | 769 } |
770 case kArchNop: | 770 case kArchNop: |
771 case kArchThrowTerminator: | 771 case kArchThrowTerminator: |
772 // don't emit code for nops. | 772 // don't emit code for nops. |
773 break; | 773 break; |
774 case kArchDeoptimize: { | 774 case kArchDeoptimize: { |
775 int deopt_state_id = | 775 int deopt_state_id = |
776 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); | 776 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); |
777 CodeGenResult result = | 777 Deoptimizer::BailoutType bailout_type = |
778 AssembleDeoptimizerCall(deopt_state_id, current_source_position_); | 778 Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); |
| 779 CodeGenResult result = AssembleDeoptimizerCall( |
| 780 deopt_state_id, bailout_type, current_source_position_); |
779 if (result != kSuccess) return result; | 781 if (result != kSuccess) return result; |
780 break; | 782 break; |
781 } | 783 } |
782 case kArchRet: | 784 case kArchRet: |
783 AssembleReturn(instr->InputAt(0)); | 785 AssembleReturn(instr->InputAt(0)); |
784 break; | 786 break; |
785 case kArchStackPointer: | 787 case kArchStackPointer: |
786 __ mov(i.OutputRegister(), masm()->StackPointer()); | 788 __ mov(i.OutputRegister(), masm()->StackPointer()); |
787 break; | 789 break; |
788 case kArchFramePointer: | 790 case kArchFramePointer: |
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1798 __ Br(temp); | 1800 __ Br(temp); |
1799 __ StartBlockPools(); | 1801 __ StartBlockPools(); |
1800 __ Bind(&table); | 1802 __ Bind(&table); |
1801 for (size_t index = 0; index < case_count; ++index) { | 1803 for (size_t index = 0; index < case_count; ++index) { |
1802 __ B(GetLabel(i.InputRpo(index + 2))); | 1804 __ B(GetLabel(i.InputRpo(index + 2))); |
1803 } | 1805 } |
1804 __ EndBlockPools(); | 1806 __ EndBlockPools(); |
1805 } | 1807 } |
1806 | 1808 |
1807 CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( | 1809 CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( |
1808 int deoptimization_id, SourcePosition pos) { | 1810 int deoptimization_id, Deoptimizer::BailoutType bailout_type, |
1809 DeoptimizeKind deoptimization_kind = GetDeoptimizationKind(deoptimization_id); | 1811 SourcePosition pos) { |
1810 DeoptimizeReason deoptimization_reason = | |
1811 GetDeoptimizationReason(deoptimization_id); | |
1812 Deoptimizer::BailoutType bailout_type = | |
1813 deoptimization_kind == DeoptimizeKind::kSoft ? Deoptimizer::SOFT | |
1814 : Deoptimizer::EAGER; | |
1815 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 1812 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
1816 isolate(), deoptimization_id, bailout_type); | 1813 isolate(), deoptimization_id, bailout_type); |
1817 if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; | 1814 if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; |
| 1815 DeoptimizeReason deoptimization_reason = |
| 1816 GetDeoptimizationReason(deoptimization_id); |
1818 __ RecordDeoptReason(deoptimization_reason, pos, deoptimization_id); | 1817 __ RecordDeoptReason(deoptimization_reason, pos, deoptimization_id); |
1819 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 1818 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
1820 return kSuccess; | 1819 return kSuccess; |
1821 } | 1820 } |
1822 | 1821 |
1823 void CodeGenerator::FinishFrame(Frame* frame) { | 1822 void CodeGenerator::FinishFrame(Frame* frame) { |
1824 frame->AlignFrame(16); | 1823 frame->AlignFrame(16); |
1825 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1824 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1826 | 1825 |
1827 if (descriptor->UseNativeStack() || descriptor->IsCFunctionCall()) { | 1826 if (descriptor->UseNativeStack() || descriptor->IsCFunctionCall()) { |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2175 padding_size -= kInstructionSize; | 2174 padding_size -= kInstructionSize; |
2176 } | 2175 } |
2177 } | 2176 } |
2178 } | 2177 } |
2179 | 2178 |
2180 #undef __ | 2179 #undef __ |
2181 | 2180 |
2182 } // namespace compiler | 2181 } // namespace compiler |
2183 } // namespace internal | 2182 } // namespace internal |
2184 } // namespace v8 | 2183 } // namespace v8 |
OLD | NEW |