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

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

Issue 2852943003: Move the Kernel string offsets into the VM's heap. (Closed)
Patch Set: Incorporate review comments. 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
« no previous file with comments | « runtime/vm/kernel.h ('k') | runtime/vm/kernel_binary.h » ('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 (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 13 matching lines...) Expand all
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() 33 CanonicalName::CanonicalName()
34 : parent_(NULL), name_(NULL), is_referenced_(false) {} 34 : parent_(NULL), name_index_(-1), is_referenced_(false) {}
35 35
36 36
37 CanonicalName::~CanonicalName() { 37 CanonicalName::~CanonicalName() {
38 for (intptr_t i = 0; i < children_.length(); ++i) { 38 for (intptr_t i = 0; i < children_.length(); ++i) {
39 delete children_[i]; 39 delete children_[i];
40 } 40 }
41 } 41 }
42 42
43 43
44 CanonicalName* CanonicalName::NewRoot() { 44 CanonicalName* CanonicalName::NewRoot() {
45 return new CanonicalName(); 45 return new CanonicalName();
46 } 46 }
47 47
48 48
49 CanonicalName* CanonicalName::AddChild(String* name) { 49 CanonicalName* CanonicalName::AddChild(intptr_t name_index) {
50 CanonicalName* child = new CanonicalName(); 50 CanonicalName* child = new CanonicalName();
51 child->parent_ = this; 51 child->parent_ = this;
52 child->name_ = name; 52 child->name_index_ = name_index;
53 children_.Add(child); 53 children_.Add(child);
54 return child; 54 return child;
55 } 55 }
56 56
57 57
58 Node::~Node() {} 58 Node::~Node() {}
59 59
60 60
61 TreeNode::~TreeNode() {} 61 TreeNode::~TreeNode() {}
62 62
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 1224
1225 void FunctionType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) { 1225 void FunctionType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) {
1226 visitor->VisitFunctionType(this); 1226 visitor->VisitFunctionType(this);
1227 } 1227 }
1228 1228
1229 1229
1230 void FunctionType::VisitChildren(Visitor* visitor) { 1230 void FunctionType::VisitChildren(Visitor* visitor) {
1231 VisitList(&type_parameters(), visitor); 1231 VisitList(&type_parameters(), visitor);
1232 VisitList(&positional_parameters(), visitor); 1232 VisitList(&positional_parameters(), visitor);
1233 for (int i = 0; i < named_parameters().length(); ++i) { 1233 for (int i = 0; i < named_parameters().length(); ++i) {
1234 named_parameters()[i]->second()->AcceptDartTypeVisitor(visitor); 1234 named_parameters()[i]->type()->AcceptDartTypeVisitor(visitor);
1235 } 1235 }
1236 return_type()->AcceptDartTypeVisitor(visitor); 1236 return_type()->AcceptDartTypeVisitor(visitor);
1237 } 1237 }
1238 1238
1239 1239
1240 TypeParameterType::~TypeParameterType() {} 1240 TypeParameterType::~TypeParameterType() {}
1241 1241
1242 1242
1243 void TypeParameterType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) { 1243 void TypeParameterType::AcceptDartTypeVisitor(DartTypeVisitor* visitor) {
1244 visitor->VisitTypeParameterType(this); 1244 visitor->VisitTypeParameterType(this);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 1289
1290 void Program::VisitChildren(Visitor* visitor) { 1290 void Program::VisitChildren(Visitor* visitor) {
1291 VisitList(&libraries(), visitor); 1291 VisitList(&libraries(), visitor);
1292 } 1292 }
1293 1293
1294 1294
1295 } // namespace kernel 1295 } // namespace kernel
1296 1296
1297 } // namespace dart 1297 } // namespace dart
1298 #endif // !defined(DART_PRECOMPILED_RUNTIME) 1298 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« no previous file with comments | « runtime/vm/kernel.h ('k') | runtime/vm/kernel_binary.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698