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

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

Issue 2014913002: Tree-shaker: drop imports/exports in a way that doesn't break the vm-service. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | runtime/vm/raw_object_snapshot.cc » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 10227 matching lines...) Expand 10 before | Expand all | Expand 10 after
10238 if (imported.IsCoreLibrary()) { 10238 if (imported.IsCoreLibrary()) {
10239 return true; 10239 return true;
10240 } 10240 }
10241 } 10241 }
10242 } 10242 }
10243 return false; 10243 return false;
10244 } 10244 }
10245 10245
10246 10246
10247 void Library::DropDependencies() const { 10247 void Library::DropDependencies() const {
10248 StorePointer(&raw_ptr()->imports_, Array::null()); 10248 StorePointer(&raw_ptr()->imports_, Object::empty_array().raw());
10249 StorePointer(&raw_ptr()->exports_, Array::null()); 10249 StorePointer(&raw_ptr()->exports_, Object::empty_array().raw());
10250 } 10250 }
10251 10251
10252 10252
10253 void Library::AddImport(const Namespace& ns) const { 10253 void Library::AddImport(const Namespace& ns) const {
10254 Array& imports = Array::Handle(this->imports()); 10254 Array& imports = Array::Handle(this->imports());
10255 intptr_t capacity = imports.Length(); 10255 intptr_t capacity = imports.Length();
10256 if (num_imports() == capacity) { 10256 if (num_imports() == capacity) {
10257 capacity = capacity + kImportsCapacityIncrement; 10257 capacity = capacity + kImportsCapacityIncrement;
10258 imports = Array::Grow(imports, capacity); 10258 imports = Array::Grow(imports, capacity);
10259 StorePointer(&raw_ptr()->imports_, imports.raw()); 10259 StorePointer(&raw_ptr()->imports_, imports.raw());
(...skipping 12351 matching lines...) Expand 10 before | Expand all | Expand 10 after
22611 return UserTag::null(); 22611 return UserTag::null();
22612 } 22612 }
22613 22613
22614 22614
22615 const char* UserTag::ToCString() const { 22615 const char* UserTag::ToCString() const {
22616 const String& tag_label = String::Handle(label()); 22616 const String& tag_label = String::Handle(label());
22617 return tag_label.ToCString(); 22617 return tag_label.ToCString();
22618 } 22618 }
22619 22619
22620 } // namespace dart 22620 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698