Index: src/compiler/code-generator.cc |
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc |
index cfe4f06606d1062abc5af529135fd89b95bb2b3b..bde8d57e118bdbb9dc43fe97dd2c9e437e881c83 100644 |
--- a/src/compiler/code-generator.cc |
+++ b/src/compiler/code-generator.cc |
@@ -28,7 +28,8 @@ CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage, |
deoptimization_literals_(code->zone()), |
translations_(code->zone()), |
last_lazy_deopt_pc_(0), |
- ools_(nullptr) { |
+ ools_(nullptr), |
+ osr_pc_offset_(-1) { |
for (int i = 0; i < code->InstructionBlockCount(); ++i) { |
new (&labels_[i]) Label; |
} |
@@ -236,7 +237,7 @@ void CodeGenerator::AssembleGap(GapInstruction* instr) { |
void CodeGenerator::PopulateDeoptimizationData(Handle<Code> code_object) { |
CompilationInfo* info = this->info(); |
int deopt_count = static_cast<int>(deoptimization_states_.size()); |
- if (deopt_count == 0) return; |
+ if (deopt_count == 0 && !info->is_osr()) return; |
Handle<DeoptimizationInputData> data = |
DeoptimizationInputData::New(isolate(), deopt_count, TENURED); |
@@ -267,9 +268,15 @@ void CodeGenerator::PopulateDeoptimizationData(Handle<Code> code_object) { |
} |
// No OSR in Turbofan yet... |
Benedikt Meurer
2014/12/18 11:21:22
Remove this comment.
titzer
2015/01/09 14:17:47
Done.
|
- BailoutId osr_ast_id = BailoutId::None(); |
- data->SetOsrAstId(Smi::FromInt(osr_ast_id.ToInt())); |
- data->SetOsrPcOffset(Smi::FromInt(-1)); |
+ if (info->is_osr()) { |
+ DCHECK(osr_pc_offset_ >= 0); |
+ data->SetOsrAstId(Smi::FromInt(info_->osr_ast_id().ToInt())); |
+ data->SetOsrPcOffset(Smi::FromInt(osr_pc_offset_)); |
+ } else { |
+ BailoutId osr_ast_id = BailoutId::None(); |
+ data->SetOsrAstId(Smi::FromInt(osr_ast_id.ToInt())); |
+ data->SetOsrPcOffset(Smi::FromInt(-1)); |
+ } |
// Populate deoptimization entries. |
for (int i = 0; i < deopt_count; i++) { |