Index: src/mips/lithium-mips.cc |
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc |
index 907c5b627da843a5e81f6f0bb6b0823e73c4e711..a7bb56c24b1ce3e886a8be53a75a5c2d79e4872e 100644 |
--- a/src/mips/lithium-mips.cc |
+++ b/src/mips/lithium-mips.cc |
@@ -2361,6 +2361,22 @@ LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { |
LInstruction* LChunkBuilder::DoCapturedObject(HCapturedObject* instr) { |
+ HEnvironment* env = current_block_->last_environment(); |
titzer
2013/08/26 11:27:24
Can we factor out this code to a platform-independ
Michael Starzinger
2013/08/26 16:15:44
Done. I moved it into a static helper on HCaptured
|
+ 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; |
} |