OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |