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

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

Issue 15772005: - Add different types for persistent and weak persistent handles (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/debugger_api_impl.cc ('k') | runtime/vm/object.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 #ifndef VM_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after
2043 Object& obj_; 2043 Object& obj_;
2044 intptr_t cur_token_pos_; 2044 intptr_t cur_token_pos_;
2045 Token::Kind cur_token_kind_; 2045 Token::Kind cur_token_kind_;
2046 intptr_t cur_token_obj_index_; 2046 intptr_t cur_token_obj_index_;
2047 }; 2047 };
2048 2048
2049 private: 2049 private:
2050 void SetPrivateKey(const String& value) const; 2050 void SetPrivateKey(const String& value) const;
2051 2051
2052 static RawTokenStream* New(); 2052 static RawTokenStream* New();
2053 static void DataFinalizer(Dart_Handle handle, void *peer); 2053 static void DataFinalizer(Dart_WeakPersistentHandle handle, void *peer);
2054 2054
2055 FINAL_HEAP_OBJECT_IMPLEMENTATION(TokenStream, Object); 2055 FINAL_HEAP_OBJECT_IMPLEMENTATION(TokenStream, Object);
2056 friend class Class; 2056 friend class Class;
2057 }; 2057 };
2058 2058
2059 2059
2060 class Script : public Object { 2060 class Script : public Object {
2061 public: 2061 public:
2062 RawString* url() const { return raw_ptr()->url_; } 2062 RawString* url() const { return raw_ptr()->url_; }
2063 bool HasSource() const; 2063 bool HasSource() const;
(...skipping 2680 matching lines...) Expand 10 before | Expand all | Expand 10 after
4744 return &(raw_ptr(str)->external_data_->data()[index]); 4744 return &(raw_ptr(str)->external_data_->data()[index]);
4745 } 4745 }
4746 4746
4747 static void SetExternalData(const String& str, 4747 static void SetExternalData(const String& str,
4748 ExternalStringData<uint8_t>* data) { 4748 ExternalStringData<uint8_t>* data) {
4749 ASSERT(str.IsExternalOneByteString()); 4749 ASSERT(str.IsExternalOneByteString());
4750 NoGCScope no_gc; 4750 NoGCScope no_gc;
4751 raw_ptr(str)->external_data_ = data; 4751 raw_ptr(str)->external_data_ = data;
4752 } 4752 }
4753 4753
4754 static void Finalize(Dart_Handle handle, void* peer); 4754 static void Finalize(Dart_WeakPersistentHandle handle, void* peer);
4755 4755
4756 static RawExternalOneByteString* ReadFrom(SnapshotReader* reader, 4756 static RawExternalOneByteString* ReadFrom(SnapshotReader* reader,
4757 intptr_t object_id, 4757 intptr_t object_id,
4758 intptr_t tags, 4758 intptr_t tags,
4759 Snapshot::Kind kind); 4759 Snapshot::Kind kind);
4760 4760
4761 friend class Class; 4761 friend class Class;
4762 friend class String; 4762 friend class String;
4763 friend class SnapshotReader; 4763 friend class SnapshotReader;
4764 }; 4764 };
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
4810 return &(raw_ptr(str)->external_data_->data()[index]); 4810 return &(raw_ptr(str)->external_data_->data()[index]);
4811 } 4811 }
4812 4812
4813 static void SetExternalData(const String& str, 4813 static void SetExternalData(const String& str,
4814 ExternalStringData<uint16_t>* data) { 4814 ExternalStringData<uint16_t>* data) {
4815 ASSERT(str.IsExternalTwoByteString()); 4815 ASSERT(str.IsExternalTwoByteString());
4816 NoGCScope no_gc; 4816 NoGCScope no_gc;
4817 raw_ptr(str)->external_data_ = data; 4817 raw_ptr(str)->external_data_ = data;
4818 } 4818 }
4819 4819
4820 static void Finalize(Dart_Handle handle, void* peer); 4820 static void Finalize(Dart_WeakPersistentHandle handle, void* peer);
4821 4821
4822 static RawExternalTwoByteString* ReadFrom(SnapshotReader* reader, 4822 static RawExternalTwoByteString* ReadFrom(SnapshotReader* reader,
4823 intptr_t object_id, 4823 intptr_t object_id,
4824 intptr_t tags, 4824 intptr_t tags,
4825 Snapshot::Kind kind); 4825 Snapshot::Kind kind);
4826 4826
4827 friend class Class; 4827 friend class Class;
4828 friend class String; 4828 friend class String;
4829 friend class SnapshotReader; 4829 friend class SnapshotReader;
4830 }; 4830 };
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
5820 5820
5821 5821
5822 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 5822 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
5823 intptr_t index) { 5823 intptr_t index) {
5824 return array.At((index * kEntryLength) + kTargetFunctionIndex); 5824 return array.At((index * kEntryLength) + kTargetFunctionIndex);
5825 } 5825 }
5826 5826
5827 } // namespace dart 5827 } // namespace dart
5828 5828
5829 #endif // VM_OBJECT_H_ 5829 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/debugger_api_impl.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698