| 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 #ifndef VM_DART_API_STATE_H_ | 5 #ifndef VM_DART_API_STATE_H_ |
| 6 #define VM_DART_API_STATE_H_ | 6 #define VM_DART_API_STATE_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 | 9 |
| 10 #include "platform/thread.h" | 10 #include "platform/thread.h" |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 Object& null_object = Object::Handle(); | 603 Object& null_object = Object::Handle(); |
| 604 null_ = persistent_handles().AllocateHandle(); | 604 null_ = persistent_handles().AllocateHandle(); |
| 605 null_->set_raw(null_object); | 605 null_->set_raw(null_object); |
| 606 } | 606 } |
| 607 return null_; | 607 return null_; |
| 608 } | 608 } |
| 609 PersistentHandle* True() { | 609 PersistentHandle* True() { |
| 610 if (true_ == NULL) { | 610 if (true_ == NULL) { |
| 611 DARTSCOPE(Isolate::Current()); | 611 DARTSCOPE(Isolate::Current()); |
| 612 | 612 |
| 613 const Object& true_object = Object::Handle(Bool::True()); | |
| 614 true_ = persistent_handles().AllocateHandle(); | 613 true_ = persistent_handles().AllocateHandle(); |
| 615 true_->set_raw(true_object); | 614 true_->set_raw(Bool::True()); |
| 616 } | 615 } |
| 617 return true_; | 616 return true_; |
| 618 } | 617 } |
| 619 PersistentHandle* False() { | 618 PersistentHandle* False() { |
| 620 if (false_ == NULL) { | 619 if (false_ == NULL) { |
| 621 DARTSCOPE(Isolate::Current()); | 620 DARTSCOPE(Isolate::Current()); |
| 622 | 621 |
| 623 const Object& false_object = Object::Handle(Bool::False()); | |
| 624 false_ = persistent_handles().AllocateHandle(); | 622 false_ = persistent_handles().AllocateHandle(); |
| 625 false_->set_raw(false_object); | 623 false_->set_raw(Bool::False()); |
| 626 } | 624 } |
| 627 return false_; | 625 return false_; |
| 628 } | 626 } |
| 629 | 627 |
| 630 void DelayWeakReferenceSet(WeakReferenceSet* reference_set) { | 628 void DelayWeakReferenceSet(WeakReferenceSet* reference_set) { |
| 631 WeakReferenceSet::Push(reference_set, &delayed_weak_reference_sets_); | 629 WeakReferenceSet::Push(reference_set, &delayed_weak_reference_sets_); |
| 632 } | 630 } |
| 633 | 631 |
| 634 private: | 632 private: |
| 635 PersistentHandles persistent_handles_; | 633 PersistentHandles persistent_handles_; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 ApiNativeScope::Current()->zone()) {} | 684 ApiNativeScope::Current()->zone()) {} |
| 687 ApiGrowableArray() | 685 ApiGrowableArray() |
| 688 : BaseGrowableArray<T, ValueObject>( | 686 : BaseGrowableArray<T, ValueObject>( |
| 689 ApiNativeScope::Current()->zone()) {} | 687 ApiNativeScope::Current()->zone()) {} |
| 690 }; | 688 }; |
| 691 | 689 |
| 692 | 690 |
| 693 } // namespace dart | 691 } // namespace dart |
| 694 | 692 |
| 695 #endif // VM_DART_API_STATE_H_ | 693 #endif // VM_DART_API_STATE_H_ |
| OLD | NEW |