| OLD | NEW |
| 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 3489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3500 #if defined(DEBUG) | 3500 #if defined(DEBUG) |
| 3501 // Verify that the same class is not added twice. | 3501 // Verify that the same class is not added twice. |
| 3502 for (intptr_t i = 0; i < direct_subclasses.Length(); i++) { | 3502 for (intptr_t i = 0; i < direct_subclasses.Length(); i++) { |
| 3503 ASSERT(direct_subclasses.At(i) != subclass.raw()); | 3503 ASSERT(direct_subclasses.At(i) != subclass.raw()); |
| 3504 } | 3504 } |
| 3505 #endif | 3505 #endif |
| 3506 direct_subclasses.Add(subclass, Heap::kOld); | 3506 direct_subclasses.Add(subclass, Heap::kOld); |
| 3507 } | 3507 } |
| 3508 | 3508 |
| 3509 | 3509 |
| 3510 void Class::ClearDirectSubclasses() const { |
| 3511 StorePointer(&raw_ptr()->direct_subclasses_, GrowableObjectArray::null()); |
| 3512 } |
| 3513 |
| 3514 |
| 3510 RawArray* Class::constants() const { | 3515 RawArray* Class::constants() const { |
| 3511 return raw_ptr()->constants_; | 3516 return raw_ptr()->constants_; |
| 3512 } | 3517 } |
| 3513 | 3518 |
| 3514 void Class::set_constants(const Array& value) const { | 3519 void Class::set_constants(const Array& value) const { |
| 3515 ASSERT(!value.IsNull()); | 3520 ASSERT(!value.IsNull()); |
| 3516 StorePointer(&raw_ptr()->constants_, value.raw()); | 3521 StorePointer(&raw_ptr()->constants_, value.raw()); |
| 3517 } | 3522 } |
| 3518 | 3523 |
| 3519 | 3524 |
| (...skipping 6193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9713 imported = prefix.GetLibrary(i); | 9718 imported = prefix.GetLibrary(i); |
| 9714 if (imported.IsCoreLibrary()) { | 9719 if (imported.IsCoreLibrary()) { |
| 9715 return true; | 9720 return true; |
| 9716 } | 9721 } |
| 9717 } | 9722 } |
| 9718 } | 9723 } |
| 9719 return false; | 9724 return false; |
| 9720 } | 9725 } |
| 9721 | 9726 |
| 9722 | 9727 |
| 9728 void Library::DropDependencies() const { |
| 9729 StorePointer(&raw_ptr()->imports_, Array::null()); |
| 9730 StorePointer(&raw_ptr()->exports_, Array::null()); |
| 9731 } |
| 9732 |
| 9733 |
| 9723 void Library::AddImport(const Namespace& ns) const { | 9734 void Library::AddImport(const Namespace& ns) const { |
| 9724 Array& imports = Array::Handle(this->imports()); | 9735 Array& imports = Array::Handle(this->imports()); |
| 9725 intptr_t capacity = imports.Length(); | 9736 intptr_t capacity = imports.Length(); |
| 9726 if (num_imports() == capacity) { | 9737 if (num_imports() == capacity) { |
| 9727 capacity = capacity + kImportsCapacityIncrement; | 9738 capacity = capacity + kImportsCapacityIncrement; |
| 9728 imports = Array::Grow(imports, capacity); | 9739 imports = Array::Grow(imports, capacity); |
| 9729 StorePointer(&raw_ptr()->imports_, imports.raw()); | 9740 StorePointer(&raw_ptr()->imports_, imports.raw()); |
| 9730 } | 9741 } |
| 9731 intptr_t index = num_imports(); | 9742 intptr_t index = num_imports(); |
| 9732 imports.SetAt(index, ns); | 9743 imports.SetAt(index, ns); |
| (...skipping 11728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21461 return UserTag::null(); | 21472 return UserTag::null(); |
| 21462 } | 21473 } |
| 21463 | 21474 |
| 21464 | 21475 |
| 21465 const char* UserTag::ToCString() const { | 21476 const char* UserTag::ToCString() const { |
| 21466 const String& tag_label = String::Handle(label()); | 21477 const String& tag_label = String::Handle(label()); |
| 21467 return tag_label.ToCString(); | 21478 return tag_label.ToCString(); |
| 21468 } | 21479 } |
| 21469 | 21480 |
| 21470 } // namespace dart | 21481 } // namespace dart |
| OLD | NEW |