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

Side by Side Diff: src/compiler/ast-loop-assignment-analyzer.cc

Issue 886733005: [turbofan] OSR loops assign all local variables. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
« src/bit-vector.h ('K') | « src/bit-vector.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/ast-loop-assignment-analyzer.h" 5 #include "src/compiler/ast-loop-assignment-analyzer.h"
6 #include "src/parser.h" 6 #include "src/parser.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace compiler { 10 namespace compiler {
(...skipping 12 matching lines...) Expand all
23 VisitStatements(info()->function()->body()); 23 VisitStatements(info()->function()->body());
24 result_ = NULL; 24 result_ = NULL;
25 return a; 25 return a;
26 } 26 }
27 27
28 28
29 void ALAA::Enter(IterationStatement* loop) { 29 void ALAA::Enter(IterationStatement* loop) {
30 int num_variables = 1 + info()->scope()->num_parameters() + 30 int num_variables = 1 + info()->scope()->num_parameters() +
31 info()->scope()->num_stack_slots(); 31 info()->scope()->num_stack_slots();
32 BitVector* bits = new (zone()) BitVector(num_variables, zone()); 32 BitVector* bits = new (zone()) BitVector(num_variables, zone());
33 if (info()->is_osr() && info()->osr_ast_id() == loop->OsrEntryId())
Michael Starzinger 2015/02/06 14:59:32 Sigh ... :/
34 bits->AddAll();
33 loop_stack_.push_back(bits); 35 loop_stack_.push_back(bits);
34 } 36 }
35 37
36 38
37 void ALAA::Exit(IterationStatement* loop) { 39 void ALAA::Exit(IterationStatement* loop) {
38 DCHECK(loop_stack_.size() > 0); 40 DCHECK(loop_stack_.size() > 0);
39 BitVector* bits = loop_stack_.back(); 41 BitVector* bits = loop_stack_.back();
40 loop_stack_.pop_back(); 42 loop_stack_.pop_back();
41 if (!loop_stack_.empty()) { 43 if (!loop_stack_.empty()) {
42 loop_stack_.back()->Union(*bits); 44 loop_stack_.back()->Union(*bits);
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 int count = 0; 298 int count = 0;
297 int var_index = AstLoopAssignmentAnalyzer::GetVariableIndex(scope, var); 299 int var_index = AstLoopAssignmentAnalyzer::GetVariableIndex(scope, var);
298 for (size_t i = 0; i < list_.size(); i++) { 300 for (size_t i = 0; i < list_.size(); i++) {
299 if (list_[i].second->Contains(var_index)) count++; 301 if (list_[i].second->Contains(var_index)) count++;
300 } 302 }
301 return count; 303 return count;
302 } 304 }
303 } 305 }
304 } 306 }
305 } // namespace v8::internal::compiler 307 } // namespace v8::internal::compiler
OLDNEW
« src/bit-vector.h ('K') | « src/bit-vector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698