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

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

Issue 2632253002: VM: [Kernel] Partial support for metadata annotations (Closed)
Patch Set: Created 3 years, 11 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 #ifndef RUNTIME_VM_OBJECT_H_ 5 #ifndef RUNTIME_VM_OBJECT_H_
6 #define RUNTIME_VM_OBJECT_H_ 6 #define RUNTIME_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 13 matching lines...) Expand all
24 #include "vm/scanner.h" 24 #include "vm/scanner.h"
25 #include "vm/tags.h" 25 #include "vm/tags.h"
26 #include "vm/thread.h" 26 #include "vm/thread.h"
27 #include "vm/token_position.h" 27 #include "vm/token_position.h"
28 28
29 namespace dart { 29 namespace dart {
30 30
31 // Forward declarations. 31 // Forward declarations.
32 namespace kernel { 32 namespace kernel {
33 class Program; 33 class Program;
34 class TreeNode;
34 } 35 }
35 36
36 #define DEFINE_FORWARD_DECLARATION(clazz) class clazz; 37 #define DEFINE_FORWARD_DECLARATION(clazz) class clazz;
37 CLASS_LIST(DEFINE_FORWARD_DECLARATION) 38 CLASS_LIST(DEFINE_FORWARD_DECLARATION)
38 #undef DEFINE_FORWARD_DECLARATION 39 #undef DEFINE_FORWARD_DECLARATION
39 class Api; 40 class Api;
40 class ArgumentsDescriptor; 41 class ArgumentsDescriptor;
41 class Assembler; 42 class Assembler;
42 class Closure; 43 class Closure;
43 class Code; 44 class Code;
(...skipping 3708 matching lines...) Expand 10 before | Expand all | Expand 10 after
3752 // look in the scopes of all libraries that are imported 3753 // look in the scopes of all libraries that are imported
3753 // without a library prefix. 3754 // without a library prefix.
3754 RawObject* ResolveName(const String& name) const; 3755 RawObject* ResolveName(const String& name) const;
3755 3756
3756 void AddAnonymousClass(const Class& cls) const; 3757 void AddAnonymousClass(const Class& cls) const;
3757 3758
3758 void AddExport(const Namespace& ns) const; 3759 void AddExport(const Namespace& ns) const;
3759 3760
3760 void AddClassMetadata(const Class& cls, 3761 void AddClassMetadata(const Class& cls,
3761 const Object& tl_owner, 3762 const Object& tl_owner,
3762 TokenPosition token_pos) const; 3763 TokenPosition token_pos,
3763 void AddFieldMetadata(const Field& field, TokenPosition token_pos) const; 3764 kernel::TreeNode* kernel_node = NULL) const;
3764 void AddFunctionMetadata(const Function& func, TokenPosition token_pos) const; 3765 void AddFieldMetadata(const Field& field,
3766 TokenPosition token_pos,
3767 kernel::TreeNode* kernel_node = NULL) const;
3768 void AddFunctionMetadata(const Function& func,
3769 TokenPosition token_pos,
3770 kernel::TreeNode* kernel_node = NULL) const;
3765 void AddLibraryMetadata(const Object& tl_owner, 3771 void AddLibraryMetadata(const Object& tl_owner,
3766 TokenPosition token_pos) const; 3772 TokenPosition token_pos) const;
3767 void AddTypeParameterMetadata(const TypeParameter& param, 3773 void AddTypeParameterMetadata(const TypeParameter& param,
3768 TokenPosition token_pos) const; 3774 TokenPosition token_pos) const;
3769 RawObject* GetMetadata(const Object& obj) const; 3775 RawObject* GetMetadata(const Object& obj) const;
3770 3776
3771 RawClass* toplevel_class() const { return raw_ptr()->toplevel_class_; } 3777 RawClass* toplevel_class() const { return raw_ptr()->toplevel_class_; }
3772 void set_toplevel_class(const Class& value) const; 3778 void set_toplevel_class(const Class& value) const;
3773 3779
3774 RawGrowableObjectArray* patch_classes() const { 3780 RawGrowableObjectArray* patch_classes() const {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
3921 void GrowDictionary(const Array& dict, intptr_t dict_size) const; 3927 void GrowDictionary(const Array& dict, intptr_t dict_size) const;
3922 static RawLibrary* NewLibraryHelper(const String& url, bool import_core_lib); 3928 static RawLibrary* NewLibraryHelper(const String& url, bool import_core_lib);
3923 RawObject* LookupEntry(const String& name, intptr_t* index) const; 3929 RawObject* LookupEntry(const String& name, intptr_t* index) const;
3924 3930
3925 void AllocatePrivateKey() const; 3931 void AllocatePrivateKey() const;
3926 3932
3927 RawString* MakeMetadataName(const Object& obj) const; 3933 RawString* MakeMetadataName(const Object& obj) const;
3928 RawField* GetMetadataField(const String& metaname) const; 3934 RawField* GetMetadataField(const String& metaname) const;
3929 void AddMetadata(const Object& owner, 3935 void AddMetadata(const Object& owner,
3930 const String& name, 3936 const String& name,
3931 TokenPosition token_pos) const; 3937 TokenPosition token_pos,
3938 kernel::TreeNode* kernel_node = NULL) const;
3932 3939
3933 FINAL_HEAP_OBJECT_IMPLEMENTATION(Library, Object); 3940 FINAL_HEAP_OBJECT_IMPLEMENTATION(Library, Object);
3934 3941
3935 friend class Bootstrap; 3942 friend class Bootstrap;
3936 friend class Class; 3943 friend class Class;
3937 friend class Debugger; 3944 friend class Debugger;
3938 friend class Isolate; 3945 friend class Isolate;
3939 friend class DictionaryIterator; 3946 friend class DictionaryIterator;
3940 friend class Namespace; 3947 friend class Namespace;
3941 friend class Object; 3948 friend class Object;
(...skipping 4993 matching lines...) Expand 10 before | Expand all | Expand 10 after
8935 8942
8936 inline void TypeArguments::SetHash(intptr_t value) const { 8943 inline void TypeArguments::SetHash(intptr_t value) const {
8937 // This is only safe because we create a new Smi, which does not cause 8944 // This is only safe because we create a new Smi, which does not cause
8938 // heap allocation. 8945 // heap allocation.
8939 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8946 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8940 } 8947 }
8941 8948
8942 } // namespace dart 8949 } // namespace dart
8943 8950
8944 #endif // RUNTIME_VM_OBJECT_H_ 8951 #endif // RUNTIME_VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698