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

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

Issue 2972343002: [kernel] Insert kernel bodies into VM heap (Closed)
Patch Set: Review comments Created 3 years, 4 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
« no previous file with comments | « runtime/vm/kernel_to_il.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 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 2649 matching lines...) Expand 10 before | Expand all | Expand 10 after
2660 return raw_ptr()->kernel_offset_; 2660 return raw_ptr()->kernel_offset_;
2661 #endif 2661 #endif
2662 } 2662 }
2663 2663
2664 void set_kernel_offset(intptr_t kernel_offset) const { 2664 void set_kernel_offset(intptr_t kernel_offset) const {
2665 #if !defined(DART_PRECOMPILED_RUNTIME) 2665 #if !defined(DART_PRECOMPILED_RUNTIME)
2666 StoreNonPointer(&raw_ptr()->kernel_offset_, kernel_offset); 2666 StoreNonPointer(&raw_ptr()->kernel_offset_, kernel_offset);
2667 #endif 2667 #endif
2668 } 2668 }
2669 2669
2670 RawTypedData* kernel_data() const { return raw_ptr()->kernel_data_; }
2671 void set_kernel_data(const TypedData& data) const;
2672
2670 bool IsOptimizable() const; 2673 bool IsOptimizable() const;
2671 void SetIsOptimizable(bool value) const; 2674 void SetIsOptimizable(bool value) const;
2672 2675
2673 bool CanBeInlined() const; 2676 bool CanBeInlined() const;
2674 2677
2675 MethodRecognizer::Kind recognized_kind() const { 2678 MethodRecognizer::Kind recognized_kind() const {
2676 return RecognizedBits::decode(raw_ptr()->kind_tag_); 2679 return RecognizedBits::decode(raw_ptr()->kind_tag_);
2677 } 2680 }
2678 void set_recognized_kind(MethodRecognizer::Kind value) const; 2681 void set_recognized_kind(MethodRecognizer::Kind value) const;
2679 2682
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
3239 return raw_ptr()->kernel_offset_; 3242 return raw_ptr()->kernel_offset_;
3240 #endif 3243 #endif
3241 } 3244 }
3242 3245
3243 void set_kernel_offset(intptr_t kernel_offset) const { 3246 void set_kernel_offset(intptr_t kernel_offset) const {
3244 #if !defined(DART_PRECOMPILED_RUNTIME) 3247 #if !defined(DART_PRECOMPILED_RUNTIME)
3245 StoreNonPointer(&raw_ptr()->kernel_offset_, kernel_offset); 3248 StoreNonPointer(&raw_ptr()->kernel_offset_, kernel_offset);
3246 #endif 3249 #endif
3247 } 3250 }
3248 3251
3252 RawTypedData* kernel_data() const { return raw_ptr()->kernel_data_; }
3253 void set_kernel_data(const TypedData& data) const;
3254
3249 inline intptr_t Offset() const; 3255 inline intptr_t Offset() const;
3250 // Called during class finalization. 3256 // Called during class finalization.
3251 inline void SetOffset(intptr_t offset_in_bytes) const; 3257 inline void SetOffset(intptr_t offset_in_bytes) const;
3252 3258
3253 inline RawInstance* StaticValue() const; 3259 inline RawInstance* StaticValue() const;
3254 inline void SetStaticValue(const Instance& value, 3260 inline void SetStaticValue(const Instance& value,
3255 bool save_initial_value = false) const; 3261 bool save_initial_value = false) const;
3256 3262
3257 RawClass* Owner() const; 3263 RawClass* Owner() const;
3258 RawClass* Origin() const; // Either mixin class, or same as owner(). 3264 RawClass* Origin() const; // Either mixin class, or same as owner().
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
3645 intptr_t col_offset() const { return raw_ptr()->col_offset_; } 3651 intptr_t col_offset() const { return raw_ptr()->col_offset_; }
3646 3652
3647 // The load time in milliseconds since epoch. 3653 // The load time in milliseconds since epoch.
3648 int64_t load_timestamp() const { return raw_ptr()->load_timestamp_; } 3654 int64_t load_timestamp() const { return raw_ptr()->load_timestamp_; }
3649 3655
3650 RawArray* compile_time_constants() const { 3656 RawArray* compile_time_constants() const {
3651 return raw_ptr()->compile_time_constants_; 3657 return raw_ptr()->compile_time_constants_;
3652 } 3658 }
3653 void set_compile_time_constants(const Array& value) const; 3659 void set_compile_time_constants(const Array& value) const;
3654 3660
3655 const uint8_t* kernel_data() const { return raw_ptr()->kernel_data_; } 3661 intptr_t kernel_script_index() const {
3656 void set_kernel_data(const uint8_t* kernel_data) const; 3662 return raw_ptr()->kernel_script_index_;
3657 3663 }
3658 intptr_t kernel_data_size() const { return raw_ptr()->kernel_data_size_; }
3659 void set_kernel_data_size(const intptr_t kernel_data_size) const;
3660
3661 intptr_t kernel_script_index() { return raw_ptr()->kernel_script_index_; }
3662 void set_kernel_script_index(const intptr_t kernel_script_index) const; 3664 void set_kernel_script_index(const intptr_t kernel_script_index) const;
3663 3665
3664 RawTypedData* kernel_string_offsets() const { 3666 RawTypedData* kernel_string_offsets() const {
3665 return raw_ptr()->kernel_string_offsets_; 3667 return raw_ptr()->kernel_string_offsets_;
3666 } 3668 }
3667 void set_kernel_string_offsets(const TypedData& offsets) const; 3669 void set_kernel_string_offsets(const TypedData& offsets) const;
3668 3670
3669 RawTypedData* kernel_string_data() const { 3671 RawTypedData* kernel_string_data() const {
3670 return raw_ptr()->kernel_string_data_; 3672 return raw_ptr()->kernel_string_data_;
3671 } 3673 }
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
3888 // without a library prefix. 3890 // without a library prefix.
3889 RawObject* ResolveName(const String& name) const; 3891 RawObject* ResolveName(const String& name) const;
3890 3892
3891 void AddAnonymousClass(const Class& cls) const; 3893 void AddAnonymousClass(const Class& cls) const;
3892 3894
3893 void AddExport(const Namespace& ns) const; 3895 void AddExport(const Namespace& ns) const;
3894 3896
3895 void AddClassMetadata(const Class& cls, 3897 void AddClassMetadata(const Class& cls,
3896 const Object& tl_owner, 3898 const Object& tl_owner,
3897 TokenPosition token_pos, 3899 TokenPosition token_pos,
3898 intptr_t kernel_offset = 0) const; 3900 intptr_t kernel_offset = 0,
3901 const TypedData* kernel_data = NULL) const;
3899 void AddFieldMetadata(const Field& field, 3902 void AddFieldMetadata(const Field& field,
3900 TokenPosition token_pos, 3903 TokenPosition token_pos,
3901 intptr_t kernel_offset = 0) const; 3904 intptr_t kernel_offset = 0,
3905 const TypedData* kernel_data = NULL) const;
3902 void AddFunctionMetadata(const Function& func, 3906 void AddFunctionMetadata(const Function& func,
3903 TokenPosition token_pos, 3907 TokenPosition token_pos,
3904 intptr_t kernel_offset = 0) const; 3908 intptr_t kernel_offset = 0,
3909 const TypedData* kernel_data = NULL) const;
3905 void AddLibraryMetadata(const Object& tl_owner, 3910 void AddLibraryMetadata(const Object& tl_owner,
3906 TokenPosition token_pos) const; 3911 TokenPosition token_pos) const;
3907 void AddTypeParameterMetadata(const TypeParameter& param, 3912 void AddTypeParameterMetadata(const TypeParameter& param,
3908 TokenPosition token_pos) const; 3913 TokenPosition token_pos) const;
3909 RawObject* GetMetadata(const Object& obj) const; 3914 RawObject* GetMetadata(const Object& obj) const;
3910 3915
3911 RawClass* toplevel_class() const { return raw_ptr()->toplevel_class_; } 3916 RawClass* toplevel_class() const { return raw_ptr()->toplevel_class_; }
3912 void set_toplevel_class(const Class& value) const; 3917 void set_toplevel_class(const Class& value) const;
3913 3918
3914 RawGrowableObjectArray* patch_classes() const { 3919 RawGrowableObjectArray* patch_classes() const {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
4066 static RawLibrary* NewLibraryHelper(const String& url, bool import_core_lib); 4071 static RawLibrary* NewLibraryHelper(const String& url, bool import_core_lib);
4067 RawObject* LookupEntry(const String& name, intptr_t* index) const; 4072 RawObject* LookupEntry(const String& name, intptr_t* index) const;
4068 4073
4069 void AllocatePrivateKey() const; 4074 void AllocatePrivateKey() const;
4070 4075
4071 RawString* MakeMetadataName(const Object& obj) const; 4076 RawString* MakeMetadataName(const Object& obj) const;
4072 RawField* GetMetadataField(const String& metaname) const; 4077 RawField* GetMetadataField(const String& metaname) const;
4073 void AddMetadata(const Object& owner, 4078 void AddMetadata(const Object& owner,
4074 const String& name, 4079 const String& name,
4075 TokenPosition token_pos, 4080 TokenPosition token_pos,
4076 intptr_t kernel_offset = 0) const; 4081 intptr_t kernel_offset = 0,
4082 const TypedData* kernel_data = NULL) const;
4077 4083
4078 FINAL_HEAP_OBJECT_IMPLEMENTATION(Library, Object); 4084 FINAL_HEAP_OBJECT_IMPLEMENTATION(Library, Object);
4079 4085
4080 friend class Bootstrap; 4086 friend class Bootstrap;
4081 friend class Class; 4087 friend class Class;
4082 friend class Debugger; 4088 friend class Debugger;
4083 friend class DictionaryIterator; 4089 friend class DictionaryIterator;
4084 friend class Isolate; 4090 friend class Isolate;
4085 friend class LibraryDeserializationCluster; 4091 friend class LibraryDeserializationCluster;
4086 friend class Namespace; 4092 friend class Namespace;
(...skipping 4911 matching lines...) Expand 10 before | Expand all | Expand 10 after
8998 9004
8999 inline void TypeArguments::SetHash(intptr_t value) const { 9005 inline void TypeArguments::SetHash(intptr_t value) const {
9000 // This is only safe because we create a new Smi, which does not cause 9006 // This is only safe because we create a new Smi, which does not cause
9001 // heap allocation. 9007 // heap allocation.
9002 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 9008 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
9003 } 9009 }
9004 9010
9005 } // namespace dart 9011 } // namespace dart
9006 9012
9007 #endif // RUNTIME_VM_OBJECT_H_ 9013 #endif // RUNTIME_VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/kernel_to_il.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698