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

Side by Side Diff: src/hydrogen-escape-analysis.cc

Issue 23533003: Implement fixpoint iteration for escape analysis. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 252 }
253 } 253 }
254 254
255 // All uses have been handled. 255 // All uses have been handled.
256 ASSERT(allocate->HasNoUses()); 256 ASSERT(allocate->HasNoUses());
257 allocate->DeleteAndReplaceWith(NULL); 257 allocate->DeleteAndReplaceWith(NULL);
258 } 258 }
259 259
260 260
261 void HEscapeAnalysisPhase::PerformScalarReplacement() { 261 void HEscapeAnalysisPhase::PerformScalarReplacement() {
262 bool maybe_more_work = false;
262 for (int i = 0; i < captured_.length(); i++) { 263 for (int i = 0; i < captured_.length(); i++) {
263 HAllocate* allocate = HAllocate::cast(captured_.at(i)); 264 HAllocate* allocate = HAllocate::cast(captured_.at(i));
264 265
265 // Compute number of scalar values and start with clean slate. 266 // Compute number of scalar values and start with clean slate.
266 if (!allocate->size()->IsInteger32Constant()) continue; 267 if (!allocate->size()->IsInteger32Constant()) continue;
267 int size_in_bytes = allocate->size()->GetInteger32Constant(); 268 int size_in_bytes = allocate->size()->GetInteger32Constant();
268 number_of_values_ = size_in_bytes / kPointerSize; 269 number_of_values_ = size_in_bytes / kPointerSize;
269 number_of_objects_++; 270 number_of_objects_++;
270 block_states_.Clear(); 271 block_states_.Clear();
271 272
272 // Perform actual analysis steps. 273 // Perform actual analysis step.
273 AnalyzeDataFlow(allocate); 274 AnalyzeDataFlow(allocate);
274 275
276 maybe_more_work = true;
275 cumulative_values_ += number_of_values_; 277 cumulative_values_ += number_of_values_;
276 ASSERT(allocate->HasNoUses()); 278 ASSERT(allocate->HasNoUses());
277 ASSERT(!allocate->IsLinked()); 279 ASSERT(!allocate->IsLinked());
278 } 280 }
281
282 // Clear captured objects.
283 maybe_more_work_ = maybe_more_work;
284 captured_.Clear();
279 } 285 }
280 286
281 287
282 } } // namespace v8::internal 288 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698