| Index: src/compiler/code-generator.cc
|
| diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
|
| index edfdaa79caa440022756e017347eda6c750a7b98..689588ea74f75ec3b640ffbf1df72f1b7a81087c 100644
|
| --- a/src/compiler/code-generator.cc
|
| +++ b/src/compiler/code-generator.cc
|
| @@ -310,6 +310,27 @@ int CodeGenerator::DefineDeoptimizationLiteral(Handle<Object> literal) {
|
| }
|
|
|
|
|
| +void CodeGenerator::BuildTranslationForFrameStateDescriptor(
|
| + FrameStateDescriptor* descriptor, Instruction* instr,
|
| + Translation* translation, int frame_state_offset) {
|
| + // Oldest parent must be added to translation first.
|
| + if (descriptor->parent() != NULL) {
|
| + BuildTranslationForFrameStateDescriptor(
|
| + descriptor->parent(), instr, translation,
|
| + frame_state_offset + descriptor->size());
|
| + }
|
| +
|
| + translation->BeginJSFrame(
|
| + descriptor->bailout_id(), Translation::kSelfLiteralId,
|
| + descriptor->size() - descriptor->parameters_count());
|
| +
|
| + for (int i = 0; i < descriptor->size(); i++) {
|
| + AddTranslationForOperand(translation, instr,
|
| + instr->InputAt(i + frame_state_offset));
|
| + }
|
| +}
|
| +
|
| +
|
| int CodeGenerator::BuildTranslation(Instruction* instr,
|
| int frame_state_offset) {
|
| InstructionOperandConverter i(this, instr);
|
| @@ -321,15 +342,10 @@ int CodeGenerator::BuildTranslation(Instruction* instr,
|
|
|
| FrameStateDescriptor* descriptor =
|
| code()->GetDeoptimizationEntry(deoptimization_id);
|
| - Translation translation(&translations_, 1, 1, zone());
|
| - translation.BeginJSFrame(descriptor->bailout_id(),
|
| - Translation::kSelfLiteralId,
|
| - descriptor->size() - descriptor->parameters_count());
|
| -
|
| - for (int i = 0; i < descriptor->size(); i++) {
|
| - AddTranslationForOperand(&translation, instr,
|
| - instr->InputAt(i + frame_state_offset));
|
| - }
|
| + int frame_count = descriptor->GetFrameCount();
|
| + Translation translation(&translations_, frame_count, frame_count, zone());
|
| + BuildTranslationForFrameStateDescriptor(descriptor, instr, &translation,
|
| + frame_state_offset);
|
|
|
| deoptimization_states_[deoptimization_id] =
|
| new (zone()) DeoptimizationState(translation.index());
|
|
|