| 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/profiler/heap-snapshot-generator.h" | 5 #include "src/profiler/heap-snapshot-generator.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1708 } else { | 1708 } else { |
| 1709 for (Object** p = start; p < end; p++) strong_references_.Add(*p); | 1709 for (Object** p = start; p < end; p++) strong_references_.Add(*p); |
| 1710 } | 1710 } |
| 1711 } | 1711 } |
| 1712 | 1712 |
| 1713 void SetCollectingAllReferences() { collecting_all_references_ = true; } | 1713 void SetCollectingAllReferences() { collecting_all_references_ = true; } |
| 1714 | 1714 |
| 1715 void FillReferences(V8HeapExplorer* explorer) { | 1715 void FillReferences(V8HeapExplorer* explorer) { |
| 1716 DCHECK(strong_references_.length() <= all_references_.length()); | 1716 DCHECK(strong_references_.length() <= all_references_.length()); |
| 1717 Builtins* builtins = heap_->isolate()->builtins(); | 1717 Builtins* builtins = heap_->isolate()->builtins(); |
| 1718 USE(builtins); |
| 1718 int strong_index = 0, all_index = 0, tags_index = 0, builtin_index = 0; | 1719 int strong_index = 0, all_index = 0, tags_index = 0, builtin_index = 0; |
| 1719 while (all_index < all_references_.length()) { | 1720 while (all_index < all_references_.length()) { |
| 1720 bool is_strong = strong_index < strong_references_.length() | 1721 bool is_strong = strong_index < strong_references_.length() |
| 1721 && strong_references_[strong_index] == all_references_[all_index]; | 1722 && strong_references_[strong_index] == all_references_[all_index]; |
| 1722 explorer->SetGcSubrootReference(reference_tags_[tags_index].tag, | 1723 explorer->SetGcSubrootReference(reference_tags_[tags_index].tag, |
| 1723 !is_strong, | 1724 !is_strong, |
| 1724 all_references_[all_index]); | 1725 all_references_[all_index]); |
| 1725 if (reference_tags_[tags_index].tag == | 1726 if (reference_tags_[tags_index].tag == |
| 1726 VisitorSynchronization::kBuiltins) { | 1727 VisitorSynchronization::kBuiltins) { |
| 1727 DCHECK(all_references_[all_index]->IsCode()); | 1728 DCHECK(all_references_[all_index]->IsCode()); |
| (...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3134 for (int i = 1; i < sorted_strings.length(); ++i) { | 3135 for (int i = 1; i < sorted_strings.length(); ++i) { |
| 3135 writer_->AddCharacter(','); | 3136 writer_->AddCharacter(','); |
| 3136 SerializeString(sorted_strings[i]); | 3137 SerializeString(sorted_strings[i]); |
| 3137 if (writer_->aborted()) return; | 3138 if (writer_->aborted()) return; |
| 3138 } | 3139 } |
| 3139 } | 3140 } |
| 3140 | 3141 |
| 3141 | 3142 |
| 3142 } // namespace internal | 3143 } // namespace internal |
| 3143 } // namespace v8 | 3144 } // namespace v8 |
| OLD | NEW |