OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/hydrogen.h" | 5 #include "src/hydrogen.h" |
6 #include "src/hydrogen-gvn.h" | 6 #include "src/hydrogen-gvn.h" |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 | 442 |
443 bool SideEffectsTracker::ComputeGlobalVar(Unique<Cell> cell, int* index) { | 443 bool SideEffectsTracker::ComputeGlobalVar(Unique<Cell> cell, int* index) { |
444 for (int i = 0; i < num_global_vars_; ++i) { | 444 for (int i = 0; i < num_global_vars_; ++i) { |
445 if (cell == global_vars_[i]) { | 445 if (cell == global_vars_[i]) { |
446 *index = i; | 446 *index = i; |
447 return true; | 447 return true; |
448 } | 448 } |
449 } | 449 } |
450 if (num_global_vars_ < kNumberOfGlobalVars) { | 450 if (num_global_vars_ < kNumberOfGlobalVars) { |
451 if (FLAG_trace_gvn) { | 451 if (FLAG_trace_gvn) { |
452 HeapStringAllocator allocator; | 452 OFStream os(stdout); |
453 StringStream stream(&allocator); | 453 os << "Tracking global var [" << *cell.handle() << "] " |
454 stream.Add("Tracking global var [%p] (mapped to index %d)\n", | 454 << "(mapped to index " << num_global_vars_ << ")" << endl; |
455 *cell.handle(), num_global_vars_); | |
456 stream.OutputToStdOut(); | |
457 } | 455 } |
458 *index = num_global_vars_; | 456 *index = num_global_vars_; |
459 global_vars_[num_global_vars_++] = cell; | 457 global_vars_[num_global_vars_++] = cell; |
460 return true; | 458 return true; |
461 } | 459 } |
462 return false; | 460 return false; |
463 } | 461 } |
464 | 462 |
465 | 463 |
466 bool SideEffectsTracker::ComputeInobjectField(HObjectAccess access, | 464 bool SideEffectsTracker::ComputeInobjectField(HObjectAccess access, |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 dominated); | 902 dominated); |
905 successor_map->Kill(side_effects_on_all_paths); | 903 successor_map->Kill(side_effects_on_all_paths); |
906 successor_dominators->Kill(side_effects_on_all_paths); | 904 successor_dominators->Kill(side_effects_on_all_paths); |
907 } | 905 } |
908 } | 906 } |
909 current = next; | 907 current = next; |
910 } | 908 } |
911 } | 909 } |
912 | 910 |
913 } } // namespace v8::internal | 911 } } // namespace v8::internal |
OLD | NEW |