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

Side by Side Diff: runtime/vm/tags.cc

Issue 973553005: Fix memory leak in CPU Profile page (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | « runtime/vm/tags.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/tags.h" 5 #include "vm/tags.h"
6 6
7 #include "vm/isolate.h" 7 #include "vm/isolate.h"
8 #include "vm/json_stream.h" 8 #include "vm/json_stream.h"
9 #include "vm/native_entry.h" 9 #include "vm/native_entry.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 ASSERT(tag != kInvalidTagId); 27 ASSERT(tag != kInvalidTagId);
28 ASSERT(tag < kNumVMTags); 28 ASSERT(tag < kNumVMTags);
29 const TagEntry& entry = entries_[tag]; 29 const TagEntry& entry = entries_[tag];
30 ASSERT(entry.id == tag); 30 ASSERT(entry.id == tag);
31 return entry.name; 31 return entry.name;
32 } 32 }
33 33
34 34
35 bool VMTag::IsNativeEntryTag(uword tag) { 35 bool VMTag::IsNativeEntryTag(uword tag) {
36 if (tag == 0) { 36 if ((tag == kRootTagId) || (tag == kTruncatedTagId)) {
37 return false; 37 return false;
38 } 38 }
39 ASSERT(tag != kInvalidTagId); 39 ASSERT(tag != kInvalidTagId);
40 ASSERT(tag != kNumVMTags); 40 ASSERT(tag != kNumVMTags);
41 ASSERT(tag != kLastTagId);
41 return (tag > kNumVMTags) && !IsRuntimeEntryTag(tag); 42 return (tag > kNumVMTags) && !IsRuntimeEntryTag(tag);
42 } 43 }
43 44
44 static RuntimeEntry* runtime_entry_list = NULL; 45 static RuntimeEntry* runtime_entry_list = NULL;
45 46
46 bool VMTag::IsRuntimeEntryTag(uword id) { 47 bool VMTag::IsRuntimeEntryTag(uword id) {
47 const RuntimeEntry* current = runtime_entry_list; 48 const RuntimeEntry* current = runtime_entry_list;
48 while (current != NULL) { 49 while (current != NULL) {
49 if (reinterpret_cast<uword>(current->function()) == id) { 50 if (reinterpret_cast<uword>(current->function()) == id) {
50 return true; 51 return true;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 Isolate* isolate = Isolate::Current(); 150 Isolate* isolate = Isolate::Current();
150 const UserTag& tag = 151 const UserTag& tag =
151 UserTag::Handle(isolate, UserTag::FindTagById(tag_id)); 152 UserTag::Handle(isolate, UserTag::FindTagById(tag_id));
152 ASSERT(!tag.IsNull()); 153 ASSERT(!tag.IsNull());
153 const String& label = String::Handle(isolate, tag.label()); 154 const String& label = String::Handle(isolate, tag.label());
154 return label.ToCString(); 155 return label.ToCString();
155 } 156 }
156 157
157 158
158 } // namespace dart 159 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/tags.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698