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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 22819011: Fix replaying of captured objects during chunk building. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment by Ben Titzer. Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2271 matching lines...) Expand 10 before | Expand all | Expand 10 after
2282 } else { 2282 } else {
2283 stream->Add(" push "); 2283 stream->Add(" push ");
2284 } 2284 }
2285 values_[i]->PrintNameTo(stream); 2285 values_[i]->PrintNameTo(stream);
2286 if (i > 0) stream->Add(","); 2286 if (i > 0) stream->Add(",");
2287 } 2287 }
2288 } 2288 }
2289 } 2289 }
2290 2290
2291 2291
2292 // Replay captured objects by replacing all captured objects with the
2293 // same capture id in the current and all outer environments.
2294 void HCapturedObject::ReplayEnvironment(HEnvironment* env) {
2295 ASSERT(env != NULL);
2296 while (env != NULL) {
2297 for (int i = 0; i < env->length(); ++i) {
2298 HValue* value = env->values()->at(i);
2299 if (value->IsCapturedObject() &&
2300 HCapturedObject::cast(value)->capture_id() == this->capture_id()) {
2301 env->SetValueAt(i, this);
2302 }
2303 }
2304 env = env->outer();
2305 }
2306 }
2307
2308
2292 void HEnterInlined::RegisterReturnTarget(HBasicBlock* return_target, 2309 void HEnterInlined::RegisterReturnTarget(HBasicBlock* return_target,
2293 Zone* zone) { 2310 Zone* zone) {
2294 ASSERT(return_target->IsInlineReturnTarget()); 2311 ASSERT(return_target->IsInlineReturnTarget());
2295 return_targets_.Add(return_target, zone); 2312 return_targets_.Add(return_target, zone);
2296 } 2313 }
2297 2314
2298 2315
2299 void HEnterInlined::PrintDataTo(StringStream* stream) { 2316 void HEnterInlined::PrintDataTo(StringStream* stream) {
2300 SmartArrayPointer<char> name = function()->debug_name()->ToCString(); 2317 SmartArrayPointer<char> name = function()->debug_name()->ToCString();
2301 stream->Add("%s, id=%d", *name, function()->id().ToInt()); 2318 stream->Add("%s, id=%d", *name, function()->id().ToInt());
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after
3994 break; 4011 break;
3995 case kExternalMemory: 4012 case kExternalMemory:
3996 stream->Add("[external-memory]"); 4013 stream->Add("[external-memory]");
3997 break; 4014 break;
3998 } 4015 }
3999 4016
4000 stream->Add("@%d", offset()); 4017 stream->Add("@%d", offset());
4001 } 4018 }
4002 4019
4003 } } // namespace v8::internal 4020 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698