Index: src/ia32/lithium-codegen-ia32.cc |
=================================================================== |
--- src/ia32/lithium-codegen-ia32.cc (revision 6270) |
+++ src/ia32/lithium-codegen-ia32.cc (working copy) |
@@ -261,6 +261,45 @@ |
} |
+void LCodeGen::WriteTranslation(LEnvironment* environment, |
+ Translation* translation) { |
+ if (environment == NULL) return; |
+ |
+ // The translation includes one command per value in the environment. |
+ int translation_size = environment->values()->length(); |
+ // The output frame height does not include the parameters. |
+ int height = translation_size - environment->parameter_count(); |
+ |
+ WriteTranslation(environment->outer(), translation); |
+ int closure_id = DefineDeoptimizationLiteral(environment->closure()); |
+ translation->BeginFrame(environment->ast_id(), closure_id, height); |
+ for (int i = 0; i < translation_size; ++i) { |
+ LOperand* value = environment->values()->at(i); |
+ // spilled_registers_ and spilled_double_registers_ are either |
+ // both NULL or both set. |
+ if (environment->spilled_registers() != NULL && value != NULL) { |
+ if (value->IsRegister() && |
+ environment->spilled_registers()[value->index()] != NULL) { |
+ translation->MarkDuplicate(); |
+ AddToTranslation(translation, |
+ environment->spilled_registers()[value->index()], |
+ environment->HasTaggedValueAt(i)); |
+ } else if ( |
+ value->IsDoubleRegister() && |
+ environment->spilled_double_registers()[value->index()] != NULL) { |
+ translation->MarkDuplicate(); |
+ AddToTranslation( |
+ translation, |
+ environment->spilled_double_registers()[value->index()], |
+ false); |
+ } |
+ } |
+ |
+ AddToTranslation(translation, value, environment->HasTaggedValueAt(i)); |
+ } |
+} |
+ |
+ |
void LCodeGen::AddToTranslation(Translation* translation, |
LOperand* op, |
bool is_tagged) { |
@@ -385,7 +424,7 @@ |
++frame_count; |
} |
Translation translation(&translations_, frame_count); |
- environment->WriteTranslation(this, &translation); |
+ WriteTranslation(environment, &translation); |
int deoptimization_index = deoptimizations_.length(); |
environment->Register(deoptimization_index, translation.index()); |
deoptimizations_.Add(environment); |