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

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

Issue 2682143002: [compiler] Pass deoptimization_kind through DeoptimizeParameters and FlagsContinuation (Closed)
Patch Set: fix Created 3 years, 10 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
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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 __ RecordComment(reinterpret_cast<const char*>(comment_string)); 725 __ RecordComment(reinterpret_cast<const char*>(comment_string));
726 break; 726 break;
727 } 727 }
728 case kArchNop: 728 case kArchNop:
729 case kArchThrowTerminator: 729 case kArchThrowTerminator:
730 // don't emit code for nops. 730 // don't emit code for nops.
731 break; 731 break;
732 case kArchDeoptimize: { 732 case kArchDeoptimize: {
733 int deopt_state_id = 733 int deopt_state_id =
734 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); 734 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
735 Deoptimizer::BailoutType bailout_type = 735 CodeGenResult result =
736 Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); 736 AssembleDeoptimizerCall(deopt_state_id, current_source_position_);
737 CodeGenResult result = AssembleDeoptimizerCall(
738 deopt_state_id, bailout_type, current_source_position_);
739 if (result != kSuccess) return result; 737 if (result != kSuccess) return result;
740 break; 738 break;
741 } 739 }
742 case kArchRet: 740 case kArchRet:
743 AssembleReturn(instr->InputAt(0)); 741 AssembleReturn(instr->InputAt(0));
744 break; 742 break;
745 case kArchStackPointer: 743 case kArchStackPointer:
746 __ mov(i.OutputRegister(), sp); 744 __ mov(i.OutputRegister(), sp);
747 break; 745 break;
748 case kArchFramePointer: 746 case kArchFramePointer:
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 MipsOperandConverter i(this, instr); 1977 MipsOperandConverter i(this, instr);
1980 Register input = i.InputRegister(0); 1978 Register input = i.InputRegister(0);
1981 size_t const case_count = instr->InputCount() - 2; 1979 size_t const case_count = instr->InputCount() - 2;
1982 __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count)); 1980 __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count));
1983 __ GenerateSwitchTable(input, case_count, [&i, this](size_t index) { 1981 __ GenerateSwitchTable(input, case_count, [&i, this](size_t index) {
1984 return GetLabel(i.InputRpo(index + 2)); 1982 return GetLabel(i.InputRpo(index + 2));
1985 }); 1983 });
1986 } 1984 }
1987 1985
1988 CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( 1986 CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
1989 int deoptimization_id, Deoptimizer::BailoutType bailout_type, 1987 int deoptimization_id, SourcePosition pos) {
1990 SourcePosition pos) { 1988 DeoptimizeKind deoptimization_kind = GetDeoptimizationKind(deoptimization_id);
1989 DeoptimizeReason deoptimization_reason =
1990 GetDeoptimizationReason(deoptimization_id);
1991 Deoptimizer::BailoutType bailout_type =
1992 deoptimization_kind == DeoptimizeKind::kSoft ? Deoptimizer::SOFT
1993 : Deoptimizer::EAGER;
1991 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( 1994 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
1992 isolate(), deoptimization_id, bailout_type); 1995 isolate(), deoptimization_id, bailout_type);
1993 if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; 1996 if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts;
1994 DeoptimizeReason deoptimization_reason =
1995 GetDeoptimizationReason(deoptimization_id);
1996 __ RecordDeoptReason(deoptimization_reason, pos, deoptimization_id); 1997 __ RecordDeoptReason(deoptimization_reason, pos, deoptimization_id);
1997 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); 1998 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
1998 return kSuccess; 1999 return kSuccess;
1999 } 2000 }
2000 2001
2001 void CodeGenerator::FinishFrame(Frame* frame) { 2002 void CodeGenerator::FinishFrame(Frame* frame) {
2002 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); 2003 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
2003 2004
2004 const RegList saves_fpu = descriptor->CalleeSavedFPRegisters(); 2005 const RegList saves_fpu = descriptor->CalleeSavedFPRegisters();
2005 if (saves_fpu != 0) { 2006 if (saves_fpu != 0) {
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
2373 padding_size -= v8::internal::Assembler::kInstrSize; 2374 padding_size -= v8::internal::Assembler::kInstrSize;
2374 } 2375 }
2375 } 2376 }
2376 } 2377 }
2377 2378
2378 #undef __ 2379 #undef __
2379 2380
2380 } // namespace compiler 2381 } // namespace compiler
2381 } // namespace internal 2382 } // namespace internal
2382 } // namespace v8 2383 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/instruction-selector-impl.h ('k') | src/compiler/mips/instruction-selector-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698