Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index 2c4799e632e026f02d5afbcbec13c8c13a44e664..0bcc6d5851a49b6435a04ad2540c9d428e3b1408 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -2564,6 +2564,22 @@ LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { |
LInstruction* LChunkBuilder::DoCapturedObject(HCapturedObject* instr) { |
+ HEnvironment* env = current_block_->last_environment(); |
+ ASSERT(env != NULL); |
+ |
+ // Replay captured objects by replacing all captured objects with the |
+ // same capture id in the current and all outer environments. |
+ while (env != NULL) { |
+ for (int i = 0; i < env->length(); ++i) { |
+ HValue* value = env->values()->at(i); |
+ if (value->IsCapturedObject() && |
+ HCapturedObject::cast(value)->capture_id() == instr->capture_id()) { |
+ env->SetValueAt(i, instr); |
+ } |
+ } |
+ env = env->outer(); |
+ } |
+ |
// There are no real uses of a captured object. |
return NULL; |
} |