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

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

Issue 1686773002: Precompilation: drop unused types and type arguments and empty classes and libraries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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) 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 3468 matching lines...) Expand 10 before | Expand all | Expand 10 after
3479 #if defined(DEBUG) 3479 #if defined(DEBUG)
3480 // Verify that the same class is not added twice. 3480 // Verify that the same class is not added twice.
3481 for (intptr_t i = 0; i < direct_subclasses.Length(); i++) { 3481 for (intptr_t i = 0; i < direct_subclasses.Length(); i++) {
3482 ASSERT(direct_subclasses.At(i) != subclass.raw()); 3482 ASSERT(direct_subclasses.At(i) != subclass.raw());
3483 } 3483 }
3484 #endif 3484 #endif
3485 direct_subclasses.Add(subclass, Heap::kOld); 3485 direct_subclasses.Add(subclass, Heap::kOld);
3486 } 3486 }
3487 3487
3488 3488
3489 void Class::ClearDirectSubclasses() const {
3490 StorePointer(&raw_ptr()->direct_subclasses_, GrowableObjectArray::null());
3491 }
3492
3493
3489 RawArray* Class::constants() const { 3494 RawArray* Class::constants() const {
3490 return raw_ptr()->constants_; 3495 return raw_ptr()->constants_;
3491 } 3496 }
3492 3497
3493 void Class::set_constants(const Array& value) const { 3498 void Class::set_constants(const Array& value) const {
3494 ASSERT(!value.IsNull()); 3499 ASSERT(!value.IsNull());
3495 StorePointer(&raw_ptr()->constants_, value.raw()); 3500 StorePointer(&raw_ptr()->constants_, value.raw());
3496 } 3501 }
3497 3502
3498 3503
(...skipping 6188 matching lines...) Expand 10 before | Expand all | Expand 10 after
9687 imported = prefix.GetLibrary(i); 9692 imported = prefix.GetLibrary(i);
9688 if (imported.IsCoreLibrary()) { 9693 if (imported.IsCoreLibrary()) {
9689 return true; 9694 return true;
9690 } 9695 }
9691 } 9696 }
9692 } 9697 }
9693 return false; 9698 return false;
9694 } 9699 }
9695 9700
9696 9701
9702 void Library::DropDependencies() const {
9703 StorePointer(&raw_ptr()->imports_, Array::null());
9704 StorePointer(&raw_ptr()->exports_, Array::null());
9705 }
9706
9707
9697 void Library::AddImport(const Namespace& ns) const { 9708 void Library::AddImport(const Namespace& ns) const {
9698 Array& imports = Array::Handle(this->imports()); 9709 Array& imports = Array::Handle(this->imports());
9699 intptr_t capacity = imports.Length(); 9710 intptr_t capacity = imports.Length();
9700 if (num_imports() == capacity) { 9711 if (num_imports() == capacity) {
9701 capacity = capacity + kImportsCapacityIncrement; 9712 capacity = capacity + kImportsCapacityIncrement;
9702 imports = Array::Grow(imports, capacity); 9713 imports = Array::Grow(imports, capacity);
9703 StorePointer(&raw_ptr()->imports_, imports.raw()); 9714 StorePointer(&raw_ptr()->imports_, imports.raw());
9704 } 9715 }
9705 intptr_t index = num_imports(); 9716 intptr_t index = num_imports();
9706 imports.SetAt(index, ns); 9717 imports.SetAt(index, ns);
(...skipping 11725 matching lines...) Expand 10 before | Expand all | Expand 10 after
21432 return UserTag::null(); 21443 return UserTag::null();
21433 } 21444 }
21434 21445
21435 21446
21436 const char* UserTag::ToCString() const { 21447 const char* UserTag::ToCString() const {
21437 const String& tag_label = String::Handle(label()); 21448 const String& tag_label = String::Handle(label());
21438 return tag_label.ToCString(); 21449 return tag_label.ToCString();
21439 } 21450 }
21440 21451
21441 } // namespace dart 21452 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/precompiler.h » ('j') | runtime/vm/precompiler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698