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

Side by Side Diff: src/profile-generator.h

Issue 10007009: External references should not affect dominance relation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing comments. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/profile-generator.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 return index_; 470 return index_;
471 } 471 }
472 const char* name() { 472 const char* name() {
473 ASSERT(type_ == kContextVariable 473 ASSERT(type_ == kContextVariable
474 || type_ == kProperty 474 || type_ == kProperty
475 || type_ == kInternal 475 || type_ == kInternal
476 || type_ == kShortcut); 476 || type_ == kShortcut);
477 return name_; 477 return name_;
478 } 478 }
479 HeapEntry* to() { return to_; } 479 HeapEntry* to() { return to_; }
480 480 INLINE(HeapEntry* from());
481 HeapEntry* From();
482 481
483 private: 482 private:
484 int child_index_ : 29; 483 int child_index_ : 29;
485 unsigned type_ : 3; 484 unsigned type_ : 3;
486 union { 485 union {
487 int index_; 486 int index_;
488 const char* name_; 487 const char* name_;
489 }; 488 };
490 HeapEntry* to_; 489 HeapEntry* to_;
491 490
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 Vector<HeapGraphEdge*> retainers() { 554 Vector<HeapGraphEdge*> retainers() {
556 return Vector<HeapGraphEdge*>(retainers_arr(), retainers_count_); } 555 return Vector<HeapGraphEdge*>(retainers_arr(), retainers_count_); }
557 HeapEntry* dominator() { return dominator_; } 556 HeapEntry* dominator() { return dominator_; }
558 void set_dominator(HeapEntry* entry) { 557 void set_dominator(HeapEntry* entry) {
559 ASSERT(entry != NULL); 558 ASSERT(entry != NULL);
560 dominator_ = entry; 559 dominator_ = entry;
561 } 560 }
562 void clear_paint() { painted_ = false; } 561 void clear_paint() { painted_ = false; }
563 bool painted() { return painted_; } 562 bool painted() { return painted_; }
564 void paint() { painted_ = true; } 563 void paint() { painted_ = true; }
564 bool reachable_from_window() { return reachable_from_window_; }
565 void set_reachable_from_window() { reachable_from_window_ = true; }
565 566
566 void SetIndexedReference(HeapGraphEdge::Type type, 567 void SetIndexedReference(HeapGraphEdge::Type type,
567 int child_index, 568 int child_index,
568 int index, 569 int index,
569 HeapEntry* entry, 570 HeapEntry* entry,
570 int retainer_index); 571 int retainer_index);
571 void SetNamedReference(HeapGraphEdge::Type type, 572 void SetNamedReference(HeapGraphEdge::Type type,
572 int child_index, 573 int child_index,
573 const char* name, 574 const char* name,
574 HeapEntry* entry, 575 HeapEntry* entry,
(...skipping 16 matching lines...) Expand all
591 private: 592 private:
592 HeapGraphEdge* children_arr() { 593 HeapGraphEdge* children_arr() {
593 return reinterpret_cast<HeapGraphEdge*>(this + 1); 594 return reinterpret_cast<HeapGraphEdge*>(this + 1);
594 } 595 }
595 HeapGraphEdge** retainers_arr() { 596 HeapGraphEdge** retainers_arr() {
596 return reinterpret_cast<HeapGraphEdge**>(children_arr() + children_count_); 597 return reinterpret_cast<HeapGraphEdge**>(children_arr() + children_count_);
597 } 598 }
598 const char* TypeAsString(); 599 const char* TypeAsString();
599 600
600 unsigned painted_: 1; 601 unsigned painted_: 1;
602 unsigned reachable_from_window_: 1;
601 unsigned type_: 4; 603 unsigned type_: 4;
602 int children_count_: 27; 604 int children_count_: 26;
603 int retainers_count_; 605 int retainers_count_;
604 int self_size_; 606 int self_size_;
605 union { 607 union {
606 int ordered_index_; // Used during dominator tree building. 608 int ordered_index_; // Used during dominator tree building.
607 int retained_size_; // At that moment, there is no retained size yet. 609 int retained_size_; // At that moment, there is no retained size yet.
608 }; 610 };
609 SnapshotObjectId id_; 611 SnapshotObjectId id_;
610 HeapEntry* dominator_; 612 HeapEntry* dominator_;
611 HeapSnapshot* snapshot_; 613 HeapSnapshot* snapshot_;
612 const char* name_; 614 const char* name_;
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 HeapSnapshotGenerator(HeapSnapshot* snapshot, 1092 HeapSnapshotGenerator(HeapSnapshot* snapshot,
1091 v8::ActivityControl* control); 1093 v8::ActivityControl* control);
1092 bool GenerateSnapshot(); 1094 bool GenerateSnapshot();
1093 1095
1094 private: 1096 private:
1095 bool BuildDominatorTree(const Vector<HeapEntry*>& entries, 1097 bool BuildDominatorTree(const Vector<HeapEntry*>& entries,
1096 Vector<int>* dominators); 1098 Vector<int>* dominators);
1097 bool CalculateRetainedSizes(); 1099 bool CalculateRetainedSizes();
1098 bool CountEntriesAndReferences(); 1100 bool CountEntriesAndReferences();
1099 bool FillReferences(); 1101 bool FillReferences();
1100 void FillReversePostorderIndexes(Vector<HeapEntry*>* entries); 1102 void FillPostorderIndexes(Vector<HeapEntry*>* entries);
1103 void MarkWindowReachableObjects();
1101 void ProgressStep(); 1104 void ProgressStep();
1102 bool ProgressReport(bool force = false); 1105 bool ProgressReport(bool force = false);
1103 bool SetEntriesDominators(); 1106 bool SetEntriesDominators();
1104 void SetProgressTotal(int iterations_count); 1107 void SetProgressTotal(int iterations_count);
1105 1108
1106 HeapSnapshot* snapshot_; 1109 HeapSnapshot* snapshot_;
1107 v8::ActivityControl* control_; 1110 v8::ActivityControl* control_;
1108 V8HeapExplorer v8_heap_explorer_; 1111 V8HeapExplorer v8_heap_explorer_;
1109 NativeObjectsExplorer dom_explorer_; 1112 NativeObjectsExplorer dom_explorer_;
1110 // Mapping from HeapThing pointers to HeapEntry* pointers. 1113 // Mapping from HeapThing pointers to HeapEntry* pointers.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 1168
1166 friend class HeapSnapshotJSONSerializerEnumerator; 1169 friend class HeapSnapshotJSONSerializerEnumerator;
1167 friend class HeapSnapshotJSONSerializerIterator; 1170 friend class HeapSnapshotJSONSerializerIterator;
1168 1171
1169 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); 1172 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer);
1170 }; 1173 };
1171 1174
1172 } } // namespace v8::internal 1175 } } // namespace v8::internal
1173 1176
1174 #endif // V8_PROFILE_GENERATOR_H_ 1177 #endif // V8_PROFILE_GENERATOR_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/profile-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698