Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/compiler/mips/code-generator-mips.cc

Issue 2366993002: [turbofan] Attach source positions to deopt info. (Closed)
Patch Set: DeoptimizationExit::pos_ made const Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 } 700 }
701 case kArchNop: 701 case kArchNop:
702 case kArchThrowTerminator: 702 case kArchThrowTerminator:
703 // don't emit code for nops. 703 // don't emit code for nops.
704 break; 704 break;
705 case kArchDeoptimize: { 705 case kArchDeoptimize: {
706 int deopt_state_id = 706 int deopt_state_id =
707 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); 707 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
708 Deoptimizer::BailoutType bailout_type = 708 Deoptimizer::BailoutType bailout_type =
709 Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); 709 Deoptimizer::BailoutType(MiscField::decode(instr->opcode()));
710 CodeGenResult result = 710 CodeGenResult result = AssembleDeoptimizerCall(
711 AssembleDeoptimizerCall(deopt_state_id, bailout_type); 711 deopt_state_id, bailout_type, current_source_position_);
712 if (result != kSuccess) return result; 712 if (result != kSuccess) return result;
713 break; 713 break;
714 } 714 }
715 case kArchRet: 715 case kArchRet:
716 AssembleReturn(); 716 AssembleReturn();
717 break; 717 break;
718 case kArchStackPointer: 718 case kArchStackPointer:
719 __ mov(i.OutputRegister(), sp); 719 __ mov(i.OutputRegister(), sp);
720 break; 720 break;
721 case kArchFramePointer: 721 case kArchFramePointer:
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1833 MipsOperandConverter i(this, instr); 1833 MipsOperandConverter i(this, instr);
1834 Register input = i.InputRegister(0); 1834 Register input = i.InputRegister(0);
1835 size_t const case_count = instr->InputCount() - 2; 1835 size_t const case_count = instr->InputCount() - 2;
1836 __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count)); 1836 __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count));
1837 __ GenerateSwitchTable(input, case_count, [&i, this](size_t index) { 1837 __ GenerateSwitchTable(input, case_count, [&i, this](size_t index) {
1838 return GetLabel(i.InputRpo(index + 2)); 1838 return GetLabel(i.InputRpo(index + 2));
1839 }); 1839 });
1840 } 1840 }
1841 1841
1842 CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( 1842 CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
1843 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { 1843 int deoptimization_id, Deoptimizer::BailoutType bailout_type,
1844 SourcePosition pos) {
1844 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( 1845 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
1845 isolate(), deoptimization_id, bailout_type); 1846 isolate(), deoptimization_id, bailout_type);
1846 if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; 1847 if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts;
1847 DeoptimizeReason deoptimization_reason = 1848 DeoptimizeReason deoptimization_reason =
1848 GetDeoptimizationReason(deoptimization_id); 1849 GetDeoptimizationReason(deoptimization_id);
1849 __ RecordDeoptReason(deoptimization_reason, 0, deoptimization_id); 1850 __ RecordDeoptReason(deoptimization_reason, pos.raw(), deoptimization_id);
1850 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); 1851 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
1851 return kSuccess; 1852 return kSuccess;
1852 } 1853 }
1853 1854
1854 void CodeGenerator::FinishFrame(Frame* frame) { 1855 void CodeGenerator::FinishFrame(Frame* frame) {
1855 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); 1856 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
1856 1857
1857 const RegList saves_fpu = descriptor->CalleeSavedFPRegisters(); 1858 const RegList saves_fpu = descriptor->CalleeSavedFPRegisters();
1858 if (saves_fpu != 0) { 1859 if (saves_fpu != 0) {
1859 frame->AlignSavedCalleeRegisterSlots(); 1860 frame->AlignSavedCalleeRegisterSlots();
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2209 padding_size -= v8::internal::Assembler::kInstrSize; 2210 padding_size -= v8::internal::Assembler::kInstrSize;
2210 } 2211 }
2211 } 2212 }
2212 } 2213 }
2213 2214
2214 #undef __ 2215 #undef __
2215 2216
2216 } // namespace compiler 2217 } // namespace compiler
2217 } // namespace internal 2218 } // namespace internal
2218 } // namespace v8 2219 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698