Commit 7617705d authored by tebbi's avatar tebbi Committed by Commit bot

[turbofan] Attach source positions to deopt info.

R=bmeurer@chromium.org,jarin@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2366993002
Cr-Commit-Position: refs/heads/master@{#39733}
parent f1be3907
...@@ -753,8 +753,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -753,8 +753,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
Deoptimizer::BailoutType bailout_type = Deoptimizer::BailoutType bailout_type =
Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); Deoptimizer::BailoutType(MiscField::decode(instr->opcode()));
CodeGenResult result = CodeGenResult result = AssembleDeoptimizerCall(
AssembleDeoptimizerCall(deopt_state_id, bailout_type); deopt_state_id, bailout_type, current_source_position_);
if (result != kSuccess) return result; if (result != kSuccess) return result;
break; break;
} }
...@@ -1639,7 +1639,8 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { ...@@ -1639,7 +1639,8 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
} }
CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
int deoptimization_id, Deoptimizer::BailoutType bailout_type) { int deoptimization_id, Deoptimizer::BailoutType bailout_type,
SourcePosition pos) {
Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
isolate(), deoptimization_id, bailout_type); isolate(), deoptimization_id, bailout_type);
// TODO(turbofan): We should be able to generate better code by sharing the // TODO(turbofan): We should be able to generate better code by sharing the
...@@ -1648,7 +1649,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( ...@@ -1648,7 +1649,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts;
DeoptimizeReason deoptimization_reason = DeoptimizeReason deoptimization_reason =
GetDeoptimizationReason(deoptimization_id); GetDeoptimizationReason(deoptimization_id);
__ RecordDeoptReason(deoptimization_reason, 0, deoptimization_id); __ RecordDeoptReason(deoptimization_reason, pos.raw(), deoptimization_id);
__ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
__ CheckConstPool(false, false); __ CheckConstPool(false, false);
return kSuccess; return kSuccess;
......
...@@ -780,8 +780,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -780,8 +780,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
Deoptimizer::BailoutType bailout_type = Deoptimizer::BailoutType bailout_type =
Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); Deoptimizer::BailoutType(MiscField::decode(instr->opcode()));
CodeGenResult result = CodeGenResult result = AssembleDeoptimizerCall(
AssembleDeoptimizerCall(deopt_state_id, bailout_type); deopt_state_id, bailout_type, current_source_position_);
if (result != kSuccess) return result; if (result != kSuccess) return result;
break; break;
} }
...@@ -1752,13 +1752,14 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { ...@@ -1752,13 +1752,14 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
} }
CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
int deoptimization_id, Deoptimizer::BailoutType bailout_type) { int deoptimization_id, Deoptimizer::BailoutType bailout_type,
SourcePosition pos) {
Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
isolate(), deoptimization_id, bailout_type); isolate(), deoptimization_id, bailout_type);
if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts;
DeoptimizeReason deoptimization_reason = DeoptimizeReason deoptimization_reason =
GetDeoptimizationReason(deoptimization_id); GetDeoptimizationReason(deoptimization_id);
__ RecordDeoptReason(deoptimization_reason, 0, deoptimization_id); __ RecordDeoptReason(deoptimization_reason, pos.raw(), deoptimization_id);
__ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
return kSuccess; return kSuccess;
} }
......
...@@ -170,15 +170,17 @@ class InstructionOperandConverter { ...@@ -170,15 +170,17 @@ class InstructionOperandConverter {
// Eager deoptimization exit. // Eager deoptimization exit.
class DeoptimizationExit : public ZoneObject { class DeoptimizationExit : public ZoneObject {
public: public:
explicit DeoptimizationExit(int deoptimization_id) explicit DeoptimizationExit(int deoptimization_id, SourcePosition pos)
: deoptimization_id_(deoptimization_id) {} : deoptimization_id_(deoptimization_id), pos_(pos) {}
int deoptimization_id() const { return deoptimization_id_; } int deoptimization_id() const { return deoptimization_id_; }
Label* label() { return &label_; } Label* label() { return &label_; }
SourcePosition pos() const { return pos_; }
private: private:
int const deoptimization_id_; int const deoptimization_id_;
Label label_; Label label_;
SourcePosition const pos_;
}; };
// Generator for out-of-line code that is emitted after the main code is done. // Generator for out-of-line code that is emitted after the main code is done.
......
...@@ -188,7 +188,8 @@ Handle<Code> CodeGenerator::GenerateCode() { ...@@ -188,7 +188,8 @@ Handle<Code> CodeGenerator::GenerateCode() {
// Assemble all eager deoptimization exits. // Assemble all eager deoptimization exits.
for (DeoptimizationExit* exit : deoptimization_exits_) { for (DeoptimizationExit* exit : deoptimization_exits_) {
masm()->bind(exit->label()); masm()->bind(exit->label());
AssembleDeoptimizerCall(exit->deoptimization_id(), Deoptimizer::EAGER); AssembleDeoptimizerCall(exit->deoptimization_id(), Deoptimizer::EAGER,
exit->pos());
} }
// Ensure there is space for lazy deoptimization in the code. // Ensure there is space for lazy deoptimization in the code.
...@@ -924,8 +925,8 @@ DeoptimizationExit* CodeGenerator::AddDeoptimizationExit( ...@@ -924,8 +925,8 @@ DeoptimizationExit* CodeGenerator::AddDeoptimizationExit(
Instruction* instr, size_t frame_state_offset) { Instruction* instr, size_t frame_state_offset) {
int const deoptimization_id = BuildTranslation( int const deoptimization_id = BuildTranslation(
instr, -1, frame_state_offset, OutputFrameStateCombine::Ignore()); instr, -1, frame_state_offset, OutputFrameStateCombine::Ignore());
DeoptimizationExit* const exit = DeoptimizationExit* const exit = new (zone())
new (zone()) DeoptimizationExit(deoptimization_id); DeoptimizationExit(deoptimization_id, current_source_position_);
deoptimization_exits_.push_back(exit); deoptimization_exits_.push_back(exit);
return exit; return exit;
} }
......
...@@ -120,7 +120,8 @@ class CodeGenerator final : public GapResolver::Assembler { ...@@ -120,7 +120,8 @@ class CodeGenerator final : public GapResolver::Assembler {
void AssembleArchTableSwitch(Instruction* instr); void AssembleArchTableSwitch(Instruction* instr);
CodeGenResult AssembleDeoptimizerCall(int deoptimization_id, CodeGenResult AssembleDeoptimizerCall(int deoptimization_id,
Deoptimizer::BailoutType bailout_type); Deoptimizer::BailoutType bailout_type,
SourcePosition pos);
// Generates an architecture-specific, descriptor-specific prologue // Generates an architecture-specific, descriptor-specific prologue
// to set up a stack frame. // to set up a stack frame.
......
...@@ -646,8 +646,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -646,8 +646,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
Deoptimizer::BailoutType bailout_type = Deoptimizer::BailoutType bailout_type =
Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); Deoptimizer::BailoutType(MiscField::decode(instr->opcode()));
CodeGenResult result = CodeGenResult result = AssembleDeoptimizerCall(
AssembleDeoptimizerCall(deopt_state_id, bailout_type); deopt_state_id, bailout_type, current_source_position_);
if (result != kSuccess) return result; if (result != kSuccess) return result;
break; break;
} }
...@@ -1783,13 +1783,14 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { ...@@ -1783,13 +1783,14 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
} }
CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
int deoptimization_id, Deoptimizer::BailoutType bailout_type) { int deoptimization_id, Deoptimizer::BailoutType bailout_type,
SourcePosition pos) {
Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
isolate(), deoptimization_id, bailout_type); isolate(), deoptimization_id, bailout_type);
if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts;
DeoptimizeReason deoptimization_reason = DeoptimizeReason deoptimization_reason =
GetDeoptimizationReason(deoptimization_id); GetDeoptimizationReason(deoptimization_id);
__ RecordDeoptReason(deoptimization_reason, 0, deoptimization_id); __ RecordDeoptReason(deoptimization_reason, pos.raw(), deoptimization_id);
__ call(deopt_entry, RelocInfo::RUNTIME_ENTRY); __ call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
return kSuccess; return kSuccess;
} }
......
...@@ -707,8 +707,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -707,8 +707,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
Deoptimizer::BailoutType bailout_type = Deoptimizer::BailoutType bailout_type =
Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); Deoptimizer::BailoutType(MiscField::decode(instr->opcode()));
CodeGenResult result = CodeGenResult result = AssembleDeoptimizerCall(
AssembleDeoptimizerCall(deopt_state_id, bailout_type); deopt_state_id, bailout_type, current_source_position_);
if (result != kSuccess) return result; if (result != kSuccess) return result;
break; break;
} }
...@@ -1877,13 +1877,14 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { ...@@ -1877,13 +1877,14 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
} }
CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
int deoptimization_id, Deoptimizer::BailoutType bailout_type) { int deoptimization_id, Deoptimizer::BailoutType bailout_type,
SourcePosition pos) {
Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
isolate(), deoptimization_id, bailout_type); isolate(), deoptimization_id, bailout_type);
if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts;
DeoptimizeReason deoptimization_reason = DeoptimizeReason deoptimization_reason =
GetDeoptimizationReason(deoptimization_id); GetDeoptimizationReason(deoptimization_id);
__ RecordDeoptReason(deoptimization_reason, 0, deoptimization_id); __ RecordDeoptReason(deoptimization_reason, pos.raw(), deoptimization_id);
__ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
return kSuccess; return kSuccess;
} }
......
...@@ -716,8 +716,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -716,8 +716,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
Deoptimizer::BailoutType bailout_type = Deoptimizer::BailoutType bailout_type =
Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); Deoptimizer::BailoutType(MiscField::decode(instr->opcode()));
CodeGenResult result = CodeGenResult result = AssembleDeoptimizerCall(
AssembleDeoptimizerCall(deopt_state_id, bailout_type); deopt_state_id, bailout_type, current_source_position_);
if (result != kSuccess) return result; if (result != kSuccess) return result;
break; break;
} }
...@@ -2199,13 +2199,14 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { ...@@ -2199,13 +2199,14 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
} }
CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
int deoptimization_id, Deoptimizer::BailoutType bailout_type) { int deoptimization_id, Deoptimizer::BailoutType bailout_type,
SourcePosition pos) {
Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
isolate(), deoptimization_id, bailout_type); isolate(), deoptimization_id, bailout_type);
if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts;
DeoptimizeReason deoptimization_reason = DeoptimizeReason deoptimization_reason =
GetDeoptimizationReason(deoptimization_id); GetDeoptimizationReason(deoptimization_id);
__ RecordDeoptReason(deoptimization_reason, 0, deoptimization_id); __ RecordDeoptReason(deoptimization_reason, pos.raw(), deoptimization_id);
__ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
return kSuccess; return kSuccess;
} }
......
...@@ -1087,8 +1087,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1087,8 +1087,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
Deoptimizer::BailoutType bailout_type = Deoptimizer::BailoutType bailout_type =
Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); Deoptimizer::BailoutType(MiscField::decode(instr->opcode()));
CodeGenResult result = CodeGenResult result = AssembleDeoptimizerCall(
AssembleDeoptimizerCall(deopt_state_id, bailout_type); deopt_state_id, bailout_type, current_source_position_);
if (result != kSuccess) return result; if (result != kSuccess) return result;
break; break;
} }
...@@ -2068,7 +2068,8 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { ...@@ -2068,7 +2068,8 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
} }
CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
int deoptimization_id, Deoptimizer::BailoutType bailout_type) { int deoptimization_id, Deoptimizer::BailoutType bailout_type,
SourcePosition pos) {
Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
isolate(), deoptimization_id, bailout_type); isolate(), deoptimization_id, bailout_type);
// TODO(turbofan): We should be able to generate better code by sharing the // TODO(turbofan): We should be able to generate better code by sharing the
...@@ -2077,7 +2078,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( ...@@ -2077,7 +2078,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts;
DeoptimizeReason deoptimization_reason = DeoptimizeReason deoptimization_reason =
GetDeoptimizationReason(deoptimization_id); GetDeoptimizationReason(deoptimization_id);
__ RecordDeoptReason(deoptimization_reason, 0, deoptimization_id); __ RecordDeoptReason(deoptimization_reason, pos.raw(), deoptimization_id);
__ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
return kSuccess; return kSuccess;
} }
......
...@@ -989,8 +989,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -989,8 +989,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
Deoptimizer::BailoutType bailout_type = Deoptimizer::BailoutType bailout_type =
Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); Deoptimizer::BailoutType(MiscField::decode(instr->opcode()));
CodeGenResult result = CodeGenResult result = AssembleDeoptimizerCall(
AssembleDeoptimizerCall(deopt_state_id, bailout_type); deopt_state_id, bailout_type, current_source_position_);
if (result != kSuccess) return result; if (result != kSuccess) return result;
break; break;
} }
...@@ -2192,7 +2192,8 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { ...@@ -2192,7 +2192,8 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
} }
CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
int deoptimization_id, Deoptimizer::BailoutType bailout_type) { int deoptimization_id, Deoptimizer::BailoutType bailout_type,
SourcePosition pos) {
Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
isolate(), deoptimization_id, bailout_type); isolate(), deoptimization_id, bailout_type);
// TODO(turbofan): We should be able to generate better code by sharing the // TODO(turbofan): We should be able to generate better code by sharing the
...@@ -2201,7 +2202,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( ...@@ -2201,7 +2202,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts;
DeoptimizeReason deoptimization_reason = DeoptimizeReason deoptimization_reason =
GetDeoptimizationReason(deoptimization_id); GetDeoptimizationReason(deoptimization_id);
__ RecordDeoptReason(deoptimization_reason, 0, deoptimization_id); __ RecordDeoptReason(deoptimization_reason, pos.raw(), deoptimization_id);
__ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
return kSuccess; return kSuccess;
} }
......
...@@ -910,8 +910,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -910,8 +910,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
Deoptimizer::BailoutType bailout_type = Deoptimizer::BailoutType bailout_type =
Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); Deoptimizer::BailoutType(MiscField::decode(instr->opcode()));
CodeGenResult result = CodeGenResult result = AssembleDeoptimizerCall(
AssembleDeoptimizerCall(deopt_state_id, bailout_type); deopt_state_id, bailout_type, current_source_position_);
if (result != kSuccess) return result; if (result != kSuccess) return result;
break; break;
} }
...@@ -2304,13 +2304,14 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { ...@@ -2304,13 +2304,14 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
} }
CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
int deoptimization_id, Deoptimizer::BailoutType bailout_type) { int deoptimization_id, Deoptimizer::BailoutType bailout_type,
SourcePosition pos) {
Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
isolate(), deoptimization_id, bailout_type); isolate(), deoptimization_id, bailout_type);
if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts;
DeoptimizeReason deoptimization_reason = DeoptimizeReason deoptimization_reason =
GetDeoptimizationReason(deoptimization_id); GetDeoptimizationReason(deoptimization_id);
__ RecordDeoptReason(deoptimization_reason, 0, deoptimization_id); __ RecordDeoptReason(deoptimization_reason, pos.raw(), deoptimization_id);
__ call(deopt_entry, RelocInfo::RUNTIME_ENTRY); __ call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
return kSuccess; return kSuccess;
} }
......
...@@ -743,8 +743,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -743,8 +743,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
Deoptimizer::BailoutType bailout_type = Deoptimizer::BailoutType bailout_type =
Deoptimizer::BailoutType(MiscField::decode(instr->opcode())); Deoptimizer::BailoutType(MiscField::decode(instr->opcode()));
CodeGenResult result = CodeGenResult result = AssembleDeoptimizerCall(
AssembleDeoptimizerCall(deopt_state_id, bailout_type); deopt_state_id, bailout_type, current_source_position_);
if (result != kSuccess) return result; if (result != kSuccess) return result;
break; break;
} }
...@@ -2238,13 +2238,14 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { ...@@ -2238,13 +2238,14 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
} }
CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
int deoptimization_id, Deoptimizer::BailoutType bailout_type) { int deoptimization_id, Deoptimizer::BailoutType bailout_type,
SourcePosition pos) {
Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
isolate(), deoptimization_id, bailout_type); isolate(), deoptimization_id, bailout_type);
if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts;
DeoptimizeReason deoptimization_reason = DeoptimizeReason deoptimization_reason =
GetDeoptimizationReason(deoptimization_id); GetDeoptimizationReason(deoptimization_id);
__ RecordDeoptReason(deoptimization_reason, 0, deoptimization_id); __ RecordDeoptReason(deoptimization_reason, pos.raw(), deoptimization_id);
__ call(deopt_entry, RelocInfo::RUNTIME_ENTRY); __ call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
return kSuccess; return kSuccess;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment