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 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 } | 773 } |
774 case kArchNop: | 774 case kArchNop: |
775 case kArchThrowTerminator: | 775 case kArchThrowTerminator: |
776 // don't emit code for nops. | 776 // don't emit code for nops. |
777 break; | 777 break; |
778 case kArchDeoptimize: { | 778 case kArchDeoptimize: { |
779 int deopt_state_id = | 779 int deopt_state_id = |
780 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); | 780 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); |
781 Deoptimizer::BailoutType bailout_type = | 781 Deoptimizer::BailoutType bailout_type = |
782 Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); | 782 Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); |
783 CodeGenResult result = | 783 CodeGenResult result = AssembleDeoptimizerCall( |
784 AssembleDeoptimizerCall(deopt_state_id, bailout_type); | 784 deopt_state_id, bailout_type, current_source_position_); |
785 if (result != kSuccess) return result; | 785 if (result != kSuccess) return result; |
786 break; | 786 break; |
787 } | 787 } |
788 case kArchRet: | 788 case kArchRet: |
789 AssembleReturn(); | 789 AssembleReturn(); |
790 break; | 790 break; |
791 case kArchStackPointer: | 791 case kArchStackPointer: |
792 __ mov(i.OutputRegister(), masm()->StackPointer()); | 792 __ mov(i.OutputRegister(), masm()->StackPointer()); |
793 break; | 793 break; |
794 case kArchFramePointer: | 794 case kArchFramePointer: |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 __ Br(temp); | 1745 __ Br(temp); |
1746 __ StartBlockPools(); | 1746 __ StartBlockPools(); |
1747 __ Bind(&table); | 1747 __ Bind(&table); |
1748 for (size_t index = 0; index < case_count; ++index) { | 1748 for (size_t index = 0; index < case_count; ++index) { |
1749 __ B(GetLabel(i.InputRpo(index + 2))); | 1749 __ B(GetLabel(i.InputRpo(index + 2))); |
1750 } | 1750 } |
1751 __ EndBlockPools(); | 1751 __ EndBlockPools(); |
1752 } | 1752 } |
1753 | 1753 |
1754 CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( | 1754 CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( |
1755 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { | 1755 int deoptimization_id, Deoptimizer::BailoutType bailout_type, |
| 1756 SourcePosition pos) { |
1756 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 1757 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
1757 isolate(), deoptimization_id, bailout_type); | 1758 isolate(), deoptimization_id, bailout_type); |
1758 if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; | 1759 if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; |
1759 DeoptimizeReason deoptimization_reason = | 1760 DeoptimizeReason deoptimization_reason = |
1760 GetDeoptimizationReason(deoptimization_id); | 1761 GetDeoptimizationReason(deoptimization_id); |
1761 __ RecordDeoptReason(deoptimization_reason, 0, deoptimization_id); | 1762 __ RecordDeoptReason(deoptimization_reason, pos.raw(), deoptimization_id); |
1762 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 1763 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
1763 return kSuccess; | 1764 return kSuccess; |
1764 } | 1765 } |
1765 | 1766 |
1766 void CodeGenerator::FinishFrame(Frame* frame) { | 1767 void CodeGenerator::FinishFrame(Frame* frame) { |
1767 frame->AlignFrame(16); | 1768 frame->AlignFrame(16); |
1768 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1769 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1769 | 1770 |
1770 if (descriptor->UseNativeStack() || descriptor->IsCFunctionCall()) { | 1771 if (descriptor->UseNativeStack() || descriptor->IsCFunctionCall()) { |
1771 __ SetStackPointer(csp); | 1772 __ SetStackPointer(csp); |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2082 padding_size -= kInstructionSize; | 2083 padding_size -= kInstructionSize; |
2083 } | 2084 } |
2084 } | 2085 } |
2085 } | 2086 } |
2086 | 2087 |
2087 #undef __ | 2088 #undef __ |
2088 | 2089 |
2089 } // namespace compiler | 2090 } // namespace compiler |
2090 } // namespace internal | 2091 } // namespace internal |
2091 } // namespace v8 | 2092 } // namespace v8 |
OLD | NEW |