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

Side by Side Diff: src/profiler/heap-snapshot-generator.cc

Issue 2810653002: Add a host parameter to ObjectVisitor methods. (Closed)
Patch Set: rebase Created 3 years, 8 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
« no previous file with comments | « src/ppc/assembler-ppc-inl.h ('k') | src/s390/assembler-s390-inl.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 // 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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 class IndexedReferencesExtractor : public ObjectVisitor { 966 class IndexedReferencesExtractor : public ObjectVisitor {
967 public: 967 public:
968 IndexedReferencesExtractor(V8HeapExplorer* generator, HeapObject* parent_obj, 968 IndexedReferencesExtractor(V8HeapExplorer* generator, HeapObject* parent_obj,
969 int parent) 969 int parent)
970 : generator_(generator), 970 : generator_(generator),
971 parent_obj_(parent_obj), 971 parent_obj_(parent_obj),
972 parent_start_(HeapObject::RawField(parent_obj_, 0)), 972 parent_start_(HeapObject::RawField(parent_obj_, 0)),
973 parent_end_(HeapObject::RawField(parent_obj_, parent_obj_->Size())), 973 parent_end_(HeapObject::RawField(parent_obj_, parent_obj_->Size())),
974 parent_(parent), 974 parent_(parent),
975 next_index_(0) {} 975 next_index_(0) {}
976 void VisitCodeEntry(Address entry_address) override { 976 void VisitCodeEntry(JSFunction* host, Address entry_address) override {
977 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address)); 977 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address));
978 generator_->SetInternalReference(parent_obj_, parent_, "code", code); 978 generator_->SetInternalReference(parent_obj_, parent_, "code", code);
979 generator_->TagCodeObject(code); 979 generator_->TagCodeObject(code);
980 } 980 }
981 void VisitPointers(Object** start, Object** end) override { 981 void VisitPointers(HeapObject* host, Object** start, Object** end) override {
982 for (Object** p = start; p < end; p++) { 982 for (Object** p = start; p < end; p++) {
983 int index = static_cast<int>(p - HeapObject::RawField(parent_obj_, 0)); 983 int index = static_cast<int>(p - HeapObject::RawField(parent_obj_, 0));
984 ++next_index_; 984 ++next_index_;
985 // |p| could be outside of the object, e.g., while visiting RelocInfo of 985 // |p| could be outside of the object, e.g., while visiting RelocInfo of
986 // code objects. 986 // code objects.
987 if (p >= parent_start_ && p < parent_end_ && generator_->marks_[index]) { 987 if (p >= parent_start_ && p < parent_end_ && generator_->marks_[index]) {
988 generator_->marks_[index] = false; 988 generator_->marks_[index] = false;
989 continue; 989 continue;
990 } 990 }
991 generator_->SetHiddenReference(parent_obj_, parent_, next_index_, *p, 991 generator_->SetHiddenReference(parent_obj_, parent_, next_index_, *p,
(...skipping 2144 matching lines...) Expand 10 before | Expand all | Expand 10 after
3136 for (int i = 1; i < sorted_strings.length(); ++i) { 3136 for (int i = 1; i < sorted_strings.length(); ++i) {
3137 writer_->AddCharacter(','); 3137 writer_->AddCharacter(',');
3138 SerializeString(sorted_strings[i]); 3138 SerializeString(sorted_strings[i]);
3139 if (writer_->aborted()) return; 3139 if (writer_->aborted()) return;
3140 } 3140 }
3141 } 3141 }
3142 3142
3143 3143
3144 } // namespace internal 3144 } // namespace internal
3145 } // namespace v8 3145 } // namespace v8
OLDNEW
« no previous file with comments | « src/ppc/assembler-ppc-inl.h ('k') | src/s390/assembler-s390-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698