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

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: Put behind a flag. Created 7 years, 2 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/flag-definitions.h ('k') | src/hydrogen-instructions.h » ('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 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 void HEscapeAnalysisPhase::PerformScalarReplacement() { 299 void HEscapeAnalysisPhase::PerformScalarReplacement() {
300 for (int i = 0; i < captured_.length(); i++) { 300 for (int i = 0; i < captured_.length(); i++) {
301 HAllocate* allocate = HAllocate::cast(captured_.at(i)); 301 HAllocate* allocate = HAllocate::cast(captured_.at(i));
302 302
303 // Compute number of scalar values and start with clean slate. 303 // Compute number of scalar values and start with clean slate.
304 int size_in_bytes = allocate->size()->GetInteger32Constant(); 304 int size_in_bytes = allocate->size()->GetInteger32Constant();
305 number_of_values_ = size_in_bytes / kPointerSize; 305 number_of_values_ = size_in_bytes / kPointerSize;
306 number_of_objects_++; 306 number_of_objects_++;
307 block_states_.Clear(); 307 block_states_.Clear();
308 308
309 // Perform actual analysis steps. 309 // Perform actual analysis step.
310 AnalyzeDataFlow(allocate); 310 AnalyzeDataFlow(allocate);
311 311
312 cumulative_values_ += number_of_values_; 312 cumulative_values_ += number_of_values_;
313 ASSERT(allocate->HasNoUses()); 313 ASSERT(allocate->HasNoUses());
314 ASSERT(!allocate->IsLinked()); 314 ASSERT(!allocate->IsLinked());
315 } 315 }
316 } 316 }
317 317
318 318
319 void HEscapeAnalysisPhase::Run() { 319 void HEscapeAnalysisPhase::Run() {
320 // TODO(mstarzinger): We disable escape analysis with OSR for now, because 320 // TODO(mstarzinger): We disable escape analysis with OSR for now, because
321 // spill slots might be uninitialized. Needs investigation. 321 // spill slots might be uninitialized. Needs investigation.
322 if (graph()->has_osr()) return; 322 if (graph()->has_osr()) return;
323 CollectCapturedValues(); 323 int max_fixpoint_iteration_count = FLAG_escape_analysis_iterations;
324 PerformScalarReplacement(); 324 for (int i = 0; i < max_fixpoint_iteration_count; i++) {
325 CollectCapturedValues();
326 if (captured_.is_empty()) break;
327 PerformScalarReplacement();
328 captured_.Clear();
329 }
325 } 330 }
326 331
327 332
328 } } // namespace v8::internal 333 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698