| 1 | /* |
| 2 | * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * |
| 8 | * 1. Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer in the |
| 12 | * documentation and/or other materials provided with the distribution. |
| 13 | * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of |
| 14 | * its contributors may be used to endorse or promote products derived |
| 15 | * from this software without specific prior written permission. |
| 16 | * |
| 17 | * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
| 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 20 | * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
| 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
| 28 | |
| 29 | #ifndef ProfileNode_h |
| 30 | #define ProfileNode_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/profiler/ProfileNode.h:30:9`! |
| 31 | |
| 32 | #include "CallIdentifier.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/profiler/CallIdentifier.h`/ |
| 33 | #include <wtf/Vector.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h`/ |
| 34 | #include <wtf/RefCounted.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefCounted.h`/ |
| 35 | #include <wtf/RefPtr.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefPtr.h`/ |
| 36 | |
| 37 | namespace JSCcxx . . $ QTJSC/ { |
| 38 | |
| 39 | class ProfileNodecxx . . $ QTJSC/ProfileNode#; |
| 40 | |
| 41 | typedef Vector<RefPtr<ProfileNode> >::const_iterator StackIteratorcxx . . $ QTJSC/StackIterator#; |
| 42 | typedef HashCountedSet<UString::Rep*> FunctionCallHashCountcxx . . $ QTJSC/FunctionCallHashCount#; |
| 43 | |
| 44 | class ProfileNodecxx . . $ QTJSC/ProfileNode# : public RefCounted<ProfileNode> { |
| 45 | public: |
| 46 | static PassRefPtrcxx . . $ PassRefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#> createcxx . . $ QTJSC/ProfileNode#create(bd53ffd7dbfd77da).(const CallIdentifiercxx . . $ QTJSC/CallIdentifier#& callIdentifier, ProfileNodecxx . . $ QTJSC/ProfileNode#* headNode, ProfileNodecxx . . $ QTJSC/ProfileNode#* parentNode) |
| 47 | { |
| 48 | return adoptRefcxx . . $ adoptRef(e761da608bb8c29c).(new ProfileNodecxx . . $ QTJSC/ProfileNode#ProfileNode(ccbbc6087b523190).(callIdentifier, headNode, parentNode)); |
| 49 | } |
| 50 | static PassRefPtrcxx . . $ PassRefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#> createcxx . . $ QTJSC/ProfileNode#create(1729d7d3924380b9).(ProfileNodecxx . . $ QTJSC/ProfileNode#* headNode, ProfileNodecxx . . $ QTJSC/ProfileNode#* node) |
| 51 | { |
| 52 | return adoptRefcxx . . $ adoptRef(e761da608bb8c29c).(new ProfileNodecxx . . $ QTJSC/ProfileNode#ProfileNode(f41e2251b97b4da5).(headNode, node)); |
| 53 | } |
| 54 | |
| 55 | bool operatorcxx . . $ QTJSC/ProfileNode#`operator==`(6e652a6689f554bb).==(ProfileNodecxx . . $ QTJSC/ProfileNode#* node) { return m_callIdentifier == node->callIdentifier(); } |
| 56 | |
| 57 | ProfileNodecxx . . $ QTJSC/ProfileNode#* willExecutecxx . . $ QTJSC/ProfileNode#willExecute(3c0f6fb234cb72cf).(const CallIdentifiercxx . . $ QTJSC/CallIdentifier#&); |
| 58 | ProfileNodecxx . . $ QTJSC/ProfileNode#* didExecutecxx . . $ QTJSC/ProfileNode#didExecute(211c0f6137bfcd86).(); |
| 59 | |
| 60 | void stopProfilingcxx . . $ QTJSC/ProfileNode#stopProfiling(49f6e7a06ebc5aa8).(); |
| 61 | |
| 62 | // CallIdentifier members |
| 63 | const CallIdentifiercxx . . $ QTJSC/CallIdentifier#& callIdentifiercxx . . $ QTJSC/ProfileNode#callIdentifier(a9dc8f5b9ca27070).() const { return m_callIdentifier; } |
| 64 | const UStringcxx . . $ QTJSC/UString#& functionNamecxx . . $ QTJSC/ProfileNode#functionName(de21ee9ecbd506fd).() const { return m_callIdentifier.m_name; } |
| 65 | const UStringcxx . . $ QTJSC/UString#& urlcxx . . $ QTJSC/ProfileNode#url(de21ee9ecbd506fd).() const { return m_callIdentifier.m_url; } |
| 66 | unsigned lineNumbercxx . . $ QTJSC/ProfileNode#lineNumber(ddd8539a2fcdd4ce).() const { return m_callIdentifier.m_lineNumber; } |
| 67 | |
| 68 | // Relationships |
| 69 | ProfileNodecxx . . $ QTJSC/ProfileNode#* headcxx . . $ QTJSC/ProfileNode#head(52aa179bc17c0068).() const { return m_headcxx . . $ QTJSC/ProfileNode#m_head.; } |
| 70 | void setHeadcxx . . $ QTJSC/ProfileNode#setHead(c2a0125b6ef73b36).(ProfileNodecxx . . $ QTJSC/ProfileNode#* head) { m_headcxx . . $ QTJSC/ProfileNode#m_head. = head; } |
| 71 | ProfileNodecxx . . $ QTJSC/ProfileNode#* parentcxx . . $ QTJSC/ProfileNode#parent(52aa179bc17c0068).() const { return m_parentcxx . . $ QTJSC/ProfileNode#m_parent.; } |
| 72 | void setParentcxx . . $ QTJSC/ProfileNode#setParent(c2a0125b6ef73b36).(ProfileNodecxx . . $ QTJSC/ProfileNode#* parent) { m_parentcxx . . $ QTJSC/ProfileNode#m_parent. = parent; } |
| 73 | ProfileNodecxx . . $ QTJSC/ProfileNode#* nextSiblingcxx . . $ QTJSC/ProfileNode#nextSibling(52aa179bc17c0068).() const { return m_nextSiblingcxx . . $ QTJSC/ProfileNode#m_nextSibling.; } |
| 74 | void setNextSiblingcxx . . $ QTJSC/ProfileNode#setNextSibling(c2a0125b6ef73b36).(ProfileNodecxx . . $ QTJSC/ProfileNode#* nextSibling) { m_nextSiblingcxx . . $ QTJSC/ProfileNode#m_nextSibling. = nextSibling; } |
| 75 | |
| 76 | // Time members |
| 77 | double startTimecxx . . $ QTJSC/ProfileNode#startTime(21b6c25e127938e2).() const { return m_startTimecxx . . $ QTJSC/ProfileNode#m_startTime.; } |
| 78 | void setStartTimecxx . . $ QTJSC/ProfileNode#setStartTime(ba8836b59fb42830).(double startTime) { m_startTimecxx . . $ QTJSC/ProfileNode#m_startTime. = startTime; } |
| 79 | double totalTimecxx . . $ QTJSC/ProfileNode#totalTime(21b6c25e127938e2).() const { return m_visibleTotalTimecxx . . $ QTJSC/ProfileNode#m_visibleTotalTime.; } |
| 80 | double actualTotalTimecxx . . $ QTJSC/ProfileNode#actualTotalTime(21b6c25e127938e2).() const { return m_actualTotalTimecxx . . $ QTJSC/ProfileNode#m_actualTotalTime.; } |
| 81 | void setTotalTimecxx . . $ QTJSC/ProfileNode#setTotalTime(ba8836b59fb42830).(double time) { m_actualTotalTimecxx . . $ QTJSC/ProfileNode#m_actualTotalTime. = time; m_visibleTotalTimecxx . . $ QTJSC/ProfileNode#m_visibleTotalTime. = time; } |
| 82 | void setActualTotalTimecxx . . $ QTJSC/ProfileNode#setActualTotalTime(ba8836b59fb42830).(double time) { m_actualTotalTimecxx . . $ QTJSC/ProfileNode#m_actualTotalTime. = time; } |
| 83 | void setVisibleTotalTimecxx . . $ QTJSC/ProfileNode#setVisibleTotalTime(ba8836b59fb42830).(double time) { m_visibleTotalTimecxx . . $ QTJSC/ProfileNode#m_visibleTotalTime. = time; } |
| 84 | double selfTimecxx . . $ QTJSC/ProfileNode#selfTime(21b6c25e127938e2).() const { return m_visibleSelfTimecxx . . $ QTJSC/ProfileNode#m_visibleSelfTime.; } |
| 85 | double actualSelfTimecxx . . $ QTJSC/ProfileNode#actualSelfTime(21b6c25e127938e2).() const { return m_actualSelfTimecxx . . $ QTJSC/ProfileNode#m_actualSelfTime.; } |
| 86 | void setSelfTimecxx . . $ QTJSC/ProfileNode#setSelfTime(ba8836b59fb42830).(double time) {m_actualSelfTimecxx . . $ QTJSC/ProfileNode#m_actualSelfTime. = time; m_visibleSelfTimecxx . . $ QTJSC/ProfileNode#m_visibleSelfTime. = time; } |
| 87 | void setActualSelfTimecxx . . $ QTJSC/ProfileNode#setActualSelfTime(ba8836b59fb42830).(double time) { m_actualSelfTimecxx . . $ QTJSC/ProfileNode#m_actualSelfTime. = time; } |
| 88 | void setVisibleSelfTimecxx . . $ QTJSC/ProfileNode#setVisibleSelfTime(ba8836b59fb42830).(double time) { m_visibleSelfTimecxx . . $ QTJSC/ProfileNode#m_visibleSelfTime. = time; } |
| 89 | |
| 90 | double totalPercentcxx . . $ QTJSC/ProfileNode#totalPercent(21b6c25e127938e2).() const { return (m_visibleTotalTimecxx . . $ QTJSC/ProfileNode#m_visibleTotalTime. / (m_headcxx . . $ QTJSC/ProfileNode#m_head. ? m_headcxx . . $ QTJSC/ProfileNode#m_head.->totalTimecxx . . $ QTJSC/ProfileNode#totalTime(21b6c25e127938e2).() : totalTimecxx . . $ QTJSC/ProfileNode#totalTime(21b6c25e127938e2).())) * 100.0; } |
| 91 | double selfPercentcxx . . $ QTJSC/ProfileNode#selfPercent(21b6c25e127938e2).() const { return (m_visibleSelfTimecxx . . $ QTJSC/ProfileNode#m_visibleSelfTime. / (m_headcxx . . $ QTJSC/ProfileNode#m_head. ? m_headcxx . . $ QTJSC/ProfileNode#m_head.->totalTimecxx . . $ QTJSC/ProfileNode#totalTime(21b6c25e127938e2).() : totalTimecxx . . $ QTJSC/ProfileNode#totalTime(21b6c25e127938e2).())) * 100.0; } |
| 92 | |
| 93 | unsigned numberOfCallscxx . . $ QTJSC/ProfileNode#numberOfCalls(ddd8539a2fcdd4ce).() const { return m_numberOfCallscxx . . $ QTJSC/ProfileNode#m_numberOfCalls.; } |
| 94 | void setNumberOfCallscxx . . $ QTJSC/ProfileNode#setNumberOfCalls(cb2f890c2fdad230).(unsigned number) { m_numberOfCallscxx . . $ QTJSC/ProfileNode#m_numberOfCalls. = number; } |
| 95 | |
| 96 | // Children members |
| 97 | const Vector<RefPtr<ProfileNode> >& childrencxx . . $ QTJSC/ProfileNode#children(ec45a031f4e09d1e).() const { return m_children; } |
| 98 | ProfileNodecxx . . $ QTJSC/ProfileNode#* firstChildcxx . . $ QTJSC/ProfileNode#firstChild(52aa179bc17c0068).() const { return m_children.size() ? m_children.first().get() : 0; } |
| 99 | ProfileNodecxx . . $ QTJSC/ProfileNode#* lastChildcxx . . $ QTJSC/ProfileNode#lastChild(52aa179bc17c0068).() const { return m_children.size() ? m_children.last().get() : 0; } |
| 100 | ProfileNodecxx . . $ QTJSC/ProfileNode#* findChildcxx . . $ QTJSC/ProfileNode#findChild(b292eb65e9cb3653).(ProfileNodecxx . . $ QTJSC/ProfileNode#*) const; |
| 101 | void removeChildcxx . . $ QTJSC/ProfileNode#removeChild(c2a0125b6ef73b36).(ProfileNodecxx . . $ QTJSC/ProfileNode#*); |
| 102 | void addChildcxx . . $ QTJSC/ProfileNode#addChild(aabf76a710b61cc5).(PassRefPtrcxx . . $ PassRefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#> prpChild); |
| 103 | void insertNodecxx . . $ QTJSC/ProfileNode#insertNode(aabf76a710b61cc5).(PassRefPtrcxx . . $ PassRefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#> prpNode); |
| 104 | |
| 105 | // Visiblity |
| 106 | bool visiblecxx . . $ QTJSC/ProfileNode#visible(50ce9a9e25b4a850).() const { return m_visiblecxx . . $ QTJSC/ProfileNode#m_visible.; } |
| 107 | void setVisiblecxx . . $ QTJSC/ProfileNode#setVisible(b45ddcbc8423892c).(bool visible) { m_visiblecxx . . $ QTJSC/ProfileNode#m_visible. = visible; } |
| 108 | |
| 109 | static void setTreeVisiblecxx . . $ QTJSC/ProfileNode#setTreeVisible(d50a14f335a65df5).(ProfileNodecxx . . $ QTJSC/ProfileNode#*, bool visible); |
| 110 | |
| 111 | // Sorting |
| 112 | ProfileNodecxx . . $ QTJSC/ProfileNode#* traverseNextNodePostOrdercxx . . $ QTJSC/ProfileNode#traverseNextNodePostOrder(52aa179bc17c0068).() const; |
| 113 | ProfileNodecxx . . $ QTJSC/ProfileNode#* traverseNextNodePreOrdercxx . . $ QTJSC/ProfileNode#traverseNextNodePreOrder(1f0cbde4ba45d0b6).(bool processChildren = true) const; |
| 114 | |
| 115 | // Views |
| 116 | void calculateVisibleTotalTimecxx . . $ QTJSC/ProfileNode#calculateVisibleTotalTime(49f6e7a06ebc5aa8).(); |
| 117 | bool focuscxx . . $ QTJSC/ProfileNode#focus(d5ac21b21379c79c).(const CallIdentifiercxx . . $ QTJSC/CallIdentifier#&); |
| 118 | void excludecxx . . $ QTJSC/ProfileNode#exclude(8a1d71aab8ab5a09).(const CallIdentifiercxx . . $ QTJSC/CallIdentifier#&); |
| 119 | void restorecxx . . $ QTJSC/ProfileNode#restore(49f6e7a06ebc5aa8).(); |
| 120 | |
| 121 | void endAndRecordCallcxx . . $ QTJSC/ProfileNode#endAndRecordCall(49f6e7a06ebc5aa8).(); |
| 122 | |
| 123 | #ifndef NDEBUGcxx . . $ `<built-in>:472:9`! |
| 124 | const char* c_str() const { return m_callIdentifier; } |
| 125 | void debugPrintData(int indentLevel) const; |
| 126 | double debugPrintDataSampleStyle(int indentLevel, FunctionCallHashCount&) const; |
| 127 | #endif |
| 128 | |
| 129 | private: |
| 130 | ProfileNodecxx . . $ QTJSC/ProfileNode#ProfileNode(ccbbc6087b523190).(const CallIdentifiercxx . . $ QTJSC/CallIdentifier#&, ProfileNodecxx . . $ QTJSC/ProfileNode#* headNode, ProfileNodecxx . . $ QTJSC/ProfileNode#* parentNode); |
| 131 | ProfileNodecxx . . $ QTJSC/ProfileNode#ProfileNode(f41e2251b97b4da5).(ProfileNodecxx . . $ QTJSC/ProfileNode#* headNode, ProfileNodecxx . . $ QTJSC/ProfileNode#* nodeToCopy); |
| 132 | |
| 133 | void startTimercxx . . $ QTJSC/ProfileNode#startTimer(49f6e7a06ebc5aa8).(); |
| 134 | void resetChildrensSiblingscxx . . $ QTJSC/ProfileNode#resetChildrensSiblings(49f6e7a06ebc5aa8).(); |
| 135 | |
| 136 | RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>* childrenBegincxx . . $ QTJSC/ProfileNode#childrenBegin(d0ba184de8497caa).() { return m_children.begin(); } |
| 137 | RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>* childrenEndcxx . . $ QTJSC/ProfileNode#childrenEnd(d0ba184de8497caa).() { return m_children.end(); } |
| 138 | |
| 139 | // Sorting comparators |
| 140 | static inline bool totalTimeDescendingComparatorcxx . . $ QTJSC/ProfileNode#totalTimeDescendingComparator(d03158c1176b5a52).(const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& a, const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& b) { return a->totalTime() > b->totalTime(); } |
| 141 | static inline bool totalTimeAscendingComparatorcxx . . $ QTJSC/ProfileNode#totalTimeAscendingComparator(d03158c1176b5a52).(const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& a, const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& b) { return a->totalTime() < b->totalTime(); } |
| 142 | static inline bool selfTimeDescendingComparatorcxx . . $ QTJSC/ProfileNode#selfTimeDescendingComparator(d03158c1176b5a52).(const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& a, const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& b) { return a->selfTime() > b->selfTime(); } |
| 143 | static inline bool selfTimeAscendingComparatorcxx . . $ QTJSC/ProfileNode#selfTimeAscendingComparator(d03158c1176b5a52).(const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& a, const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& b) { return a->selfTime() < b->selfTime(); } |
| 144 | static inline bool callsDescendingComparatorcxx . . $ QTJSC/ProfileNode#callsDescendingComparator(d03158c1176b5a52).(const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& a, const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& b) { return a->numberOfCalls() > b->numberOfCalls(); } |
| 145 | static inline bool callsAscendingComparatorcxx . . $ QTJSC/ProfileNode#callsAscendingComparator(d03158c1176b5a52).(const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& a, const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& b) { return a->numberOfCalls() < b->numberOfCalls(); } |
| 146 | static inline bool functionNameDescendingComparatorcxx . . $ QTJSC/ProfileNode#functionNameDescendingComparator(d03158c1176b5a52).(const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& a, const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& b) { return a->functionName() > b->functionName(); } |
| 147 | static inline bool functionNameAscendingComparatorcxx . . $ QTJSC/ProfileNode#functionNameAscendingComparator(d03158c1176b5a52).(const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& a, const RefPtrcxx . . $ RefPtr#<ProfileNodecxx . . $ QTJSC/ProfileNode#>& b) { return a->functionName() < b->functionName(); } |
| 148 | |
| 149 | CallIdentifiercxx . . $ QTJSC/CallIdentifier# m_callIdentifiercxx . . $ QTJSC/ProfileNode#m_callIdentifier.; |
| 150 | ProfileNodecxx . . $ QTJSC/ProfileNode#* m_headcxx . . $ QTJSC/ProfileNode#m_head.; |
| 151 | ProfileNodecxx . . $ QTJSC/ProfileNode#* m_parentcxx . . $ QTJSC/ProfileNode#m_parent.; |
| 152 | ProfileNodecxx . . $ QTJSC/ProfileNode#* m_nextSiblingcxx . . $ QTJSC/ProfileNode#m_nextSibling.; |
| 153 | |
| 154 | double m_startTimecxx . . $ QTJSC/ProfileNode#m_startTime.; |
| 155 | double m_actualTotalTimecxx . . $ QTJSC/ProfileNode#m_actualTotalTime.; |
| 156 | double m_visibleTotalTimecxx . . $ QTJSC/ProfileNode#m_visibleTotalTime.; |
| 157 | double m_actualSelfTimecxx . . $ QTJSC/ProfileNode#m_actualSelfTime.; |
| 158 | double m_visibleSelfTimecxx . . $ QTJSC/ProfileNode#m_visibleSelfTime.; |
| 159 | unsigned m_numberOfCallscxx . . $ QTJSC/ProfileNode#m_numberOfCalls.; |
| 160 | |
| 161 | bool m_visiblecxx . . $ QTJSC/ProfileNode#m_visible.; |
| 162 | |
| 163 | Vector<RefPtr<ProfileNode> > m_childrencxx . . $ QTJSC/ProfileNode#m_children.; |
| 164 | }; |
| 165 | |
| 166 | } // namespace JSC |
| 167 | |
| 168 | #endif // ProfileNode_h |