Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Unified Diff: src/x64/lithium-x64.cc

Issue 22819011: Fix replaying of captured objects during chunk building. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Copied^H^H^HPorted to other architectures. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/x64/lithium-x64.cc
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
index a449d8efc82614188c9cbcc3109c3cd2912aeab7..c13ea9e5929f3d6196a5daaa04e2af5cdfc8552c 100644
--- a/src/x64/lithium-x64.cc
+++ b/src/x64/lithium-x64.cc
@@ -2374,6 +2374,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;
}

Powered by Google App Engine
This is Rietveld 408576698