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

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

Issue 2853423002: Move the Kernel canonical name table into the VM's heap (Closed)
Patch Set: Merge a bugfix Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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/kernel.h" 5 #include "vm/kernel.h"
6 6
7 #if !defined(DART_PRECOMPILED_RUNTIME) 7 #if !defined(DART_PRECOMPILED_RUNTIME)
8 namespace dart { 8 namespace dart {
9 9
10 namespace kernel { 10 namespace kernel {
(...skipping 12 matching lines...) Expand all
23 delete[] source_code_; 23 delete[] source_code_;
24 delete[] line_starts_; 24 delete[] line_starts_;
25 } 25 }
26 26
27 27
28 SourceTable::~SourceTable() { 28 SourceTable::~SourceTable() {
29 delete[] sources_; 29 delete[] sources_;
30 } 30 }
31 31
32 32
33 CanonicalName::CanonicalName()
34 : parent_(NULL), name_index_(-1), is_referenced_(false) {}
35
36
37 CanonicalName::~CanonicalName() {
38 for (intptr_t i = 0; i < children_.length(); ++i) {
39 delete children_[i];
40 }
41 }
42
43
44 CanonicalName* CanonicalName::NewRoot() {
45 return new CanonicalName();
46 }
47
48
49 CanonicalName* CanonicalName::AddChild(intptr_t name_index) {
50 CanonicalName* child = new CanonicalName();
51 child->parent_ = this;
52 child->name_index_ = name_index;
53 children_.Add(child);
54 return child;
55 }
56
57
58 Node::~Node() {} 33 Node::~Node() {}
59 34
60 35
61 TreeNode::~TreeNode() {} 36 TreeNode::~TreeNode() {}
62 37
63 38
64 void TreeNode::AcceptVisitor(Visitor* visitor) { 39 void TreeNode::AcceptVisitor(Visitor* visitor) {
65 AcceptTreeVisitor(visitor); 40 AcceptTreeVisitor(visitor);
66 } 41 }
67 42
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 1264
1290 void Program::VisitChildren(Visitor* visitor) { 1265 void Program::VisitChildren(Visitor* visitor) {
1291 VisitList(&libraries(), visitor); 1266 VisitList(&libraries(), visitor);
1292 } 1267 }
1293 1268
1294 1269
1295 } // namespace kernel 1270 } // namespace kernel
1296 1271
1297 } // namespace dart 1272 } // namespace dart
1298 #endif // !defined(DART_PRECOMPILED_RUNTIME) 1273 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698