OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 ProfileNode::ProfileNode(ProfileTree* tree, CodeEntry* entry) | 72 ProfileNode::ProfileNode(ProfileTree* tree, CodeEntry* entry) |
73 : tree_(tree), | 73 : tree_(tree), |
74 entry_(entry), | 74 entry_(entry), |
75 total_ticks_(0), | 75 total_ticks_(0), |
76 self_ticks_(0), | 76 self_ticks_(0), |
77 children_(CodeEntriesMatch) { | 77 children_(CodeEntriesMatch) { |
78 } | 78 } |
79 | 79 |
80 | 80 |
81 void CodeMap::AddCode(Address addr, CodeEntry* entry, unsigned size) { | |
82 CodeTree::Locator locator; | |
83 tree_.Insert(addr, &locator); | |
84 locator.set_value(CodeEntryInfo(entry, size)); | |
85 } | |
86 | |
87 | |
88 void CodeMap::MoveCode(Address from, Address to) { | |
89 tree_.Move(from, to); | |
90 } | |
91 | |
92 void CodeMap::DeleteCode(Address addr) { | |
93 tree_.Remove(addr); | |
94 } | |
95 | |
96 | |
97 CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) { | 81 CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) { |
98 switch (tag) { | 82 switch (tag) { |
99 case GC: | 83 case GC: |
100 return gc_entry_; | 84 return gc_entry_; |
101 case JS: | 85 case JS: |
102 case COMPILER: | 86 case COMPILER: |
103 // DOM events handlers are reported as OTHER / EXTERNAL entries. | 87 // DOM events handlers are reported as OTHER / EXTERNAL entries. |
104 // To avoid confusing people, let's put all these entries into | 88 // To avoid confusing people, let's put all these entries into |
105 // one bucket. | 89 // one bucket. |
106 case OTHER: | 90 case OTHER: |
107 case EXTERNAL: | 91 case EXTERNAL: |
108 return program_entry_; | 92 return program_entry_; |
109 default: return NULL; | 93 default: return NULL; |
110 } | 94 } |
111 } | 95 } |
112 | 96 |
113 | 97 |
114 uint64_t HeapEntry::id() { | 98 uint64_t HeapEntry::id() { |
115 union { | 99 union { |
116 Id stored_id; | 100 Id stored_id; |
117 uint64_t returned_id; | 101 uint64_t returned_id; |
118 } id_adaptor = {id_}; | 102 } id_adaptor = {id_}; |
119 return id_adaptor.returned_id; | 103 return id_adaptor.returned_id; |
120 } | 104 } |
121 | 105 |
122 } } // namespace v8::internal | 106 } } // namespace v8::internal |
123 | 107 |
124 #endif // V8_PROFILE_GENERATOR_INL_H_ | 108 #endif // V8_PROFILE_GENERATOR_INL_H_ |
OLD | NEW |