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

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

Issue 2993613002: [kernel] Make snapshotting work. (Closed)
Patch Set: 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/clustered_snapshot.cc ('k') | runtime/vm/raw_object_snapshot.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_RAW_OBJECT_H_ 5 #ifndef RUNTIME_VM_RAW_OBJECT_H_
6 #define RUNTIME_VM_RAW_OBJECT_H_ 6 #define RUNTIME_VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/atomic.h" 9 #include "vm/atomic.h"
10 #include "vm/exceptions.h" 10 #include "vm/exceptions.h"
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 RawString* name_; 873 RawString* name_;
874 RawObject* owner_; // Class or patch class or mixin class 874 RawObject* owner_; // Class or patch class or mixin class
875 // where this function is defined. 875 // where this function is defined.
876 RawAbstractType* result_type_; 876 RawAbstractType* result_type_;
877 RawArray* parameter_types_; 877 RawArray* parameter_types_;
878 RawArray* parameter_names_; 878 RawArray* parameter_names_;
879 RawTypeArguments* type_parameters_; // Array of TypeParameter. 879 RawTypeArguments* type_parameters_; // Array of TypeParameter.
880 RawObject* data_; // Additional data specific to the function kind. 880 RawObject* data_; // Additional data specific to the function kind.
881 RawTypedData* kernel_body_; 881 RawTypedData* kernel_body_;
882 RawObject** to_snapshot() { 882 RawObject** to_snapshot() {
883 return reinterpret_cast<RawObject**>(&ptr()->data_); 883 return reinterpret_cast<RawObject**>(&ptr()->kernel_body_);
884 } 884 }
885 RawArray* ic_data_array_; // ICData of unoptimized code. 885 RawArray* ic_data_array_; // ICData of unoptimized code.
886 RawObject** to_no_code() { 886 RawObject** to_no_code() {
887 return reinterpret_cast<RawObject**>(&ptr()->ic_data_array_); 887 return reinterpret_cast<RawObject**>(&ptr()->ic_data_array_);
888 } 888 }
889 RawCode* code_; // Currently active code. Accessed from generated code. 889 RawCode* code_; // Currently active code. Accessed from generated code.
890 NOT_IN_PRECOMPILED(RawCode* unoptimized_code_); // Unoptimized code, keep it 890 NOT_IN_PRECOMPILED(RawCode* unoptimized_code_); // Unoptimized code, keep it
891 // after optimization. 891 // after optimization.
892 RawObject** to() { 892 RawObject** to() {
893 #if defined(DART_PRECOMPILED_RUNTIME) 893 #if defined(DART_PRECOMPILED_RUNTIME)
894 return reinterpret_cast<RawObject**>(&ptr()->code_); 894 return reinterpret_cast<RawObject**>(&ptr()->code_);
895 #else 895 #else
896 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_); 896 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_);
897 #endif 897 #endif
898 } 898 }
899 899
900 NOT_IN_PRECOMPILED(TokenPosition token_pos_); 900 NOT_IN_PRECOMPILED(TokenPosition token_pos_);
901 NOT_IN_PRECOMPILED(TokenPosition end_token_pos_); 901 NOT_IN_PRECOMPILED(TokenPosition end_token_pos_);
902 NOT_IN_PRECOMPILED(intptr_t kernel_offset_);
902 NOT_IN_PRECOMPILED(int32_t usage_counter_); // Accessed from generated code 903 NOT_IN_PRECOMPILED(int32_t usage_counter_); // Accessed from generated code
903 // (JIT only). 904 // (JIT only).
904 uint32_t kind_tag_; // See Function::KindTagBits. 905 uint32_t kind_tag_; // See Function::KindTagBits.
905 int16_t num_fixed_parameters_; 906 int16_t num_fixed_parameters_;
906 int16_t num_optional_parameters_; // > 0: positional; < 0: named. 907 int16_t num_optional_parameters_; // > 0: positional; < 0: named.
907 NOT_IN_PRECOMPILED(intptr_t kernel_offset_);
908 NOT_IN_PRECOMPILED(uint16_t optimized_instruction_count_); 908 NOT_IN_PRECOMPILED(uint16_t optimized_instruction_count_);
909 NOT_IN_PRECOMPILED(uint16_t optimized_call_site_count_); 909 NOT_IN_PRECOMPILED(uint16_t optimized_call_site_count_);
910 NOT_IN_PRECOMPILED(int8_t deoptimization_counter_); 910 NOT_IN_PRECOMPILED(int8_t deoptimization_counter_);
911 NOT_IN_PRECOMPILED(int8_t was_compiled_); 911 NOT_IN_PRECOMPILED(int8_t was_compiled_);
912 }; 912 };
913 913
914 class RawClosureData : public RawObject { 914 class RawClosureData : public RawObject {
915 private: 915 private:
916 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData); 916 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData);
917 917
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 break; 999 break;
1000 } 1000 }
1001 UNREACHABLE(); 1001 UNREACHABLE();
1002 return NULL; 1002 return NULL;
1003 } 1003 }
1004 1004
1005 TokenPosition token_pos_; 1005 TokenPosition token_pos_;
1006 classid_t guarded_cid_; 1006 classid_t guarded_cid_;
1007 classid_t is_nullable_; // kNullCid if field can contain null value and 1007 classid_t is_nullable_; // kNullCid if field can contain null value and
1008 // any other value otherwise. 1008 // any other value otherwise.
1009 NOT_IN_PRECOMPILED(intptr_t kernel_offset_);
1009 // Offset to the guarded length field inside an instance of class matching 1010 // Offset to the guarded length field inside an instance of class matching
1010 // guarded_cid_. Stored corrected by -kHeapObjectTag to simplify code 1011 // guarded_cid_. Stored corrected by -kHeapObjectTag to simplify code
1011 // generated on platforms with weak addressing modes (ARM). 1012 // generated on platforms with weak addressing modes (ARM).
1012 int8_t guarded_list_length_in_object_offset_; 1013 int8_t guarded_list_length_in_object_offset_;
1013 1014
1014 uint8_t kind_bits_; // static, final, const, has initializer.... 1015 uint8_t kind_bits_; // static, final, const, has initializer....
1015 NOT_IN_PRECOMPILED(intptr_t kernel_offset_);
1016 1016
1017 friend class CidRewriteVisitor; 1017 friend class CidRewriteVisitor;
1018 }; 1018 };
1019 1019
1020 class RawLiteralToken : public RawObject { 1020 class RawLiteralToken : public RawObject {
1021 RAW_HEAP_OBJECT_IMPLEMENTATION(LiteralToken); 1021 RAW_HEAP_OBJECT_IMPLEMENTATION(LiteralToken);
1022 1022
1023 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->literal_); } 1023 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->literal_); }
1024 RawString* literal_; // Literal characters as they appear in source text. 1024 RawString* literal_; // Literal characters as they appear in source text.
1025 RawObject* value_; // The actual object corresponding to the token. 1025 RawObject* value_; // The actual object corresponding to the token.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 case Snapshot::kInvalid: 1083 case Snapshot::kInvalid:
1084 break; 1084 break;
1085 } 1085 }
1086 UNREACHABLE(); 1086 UNREACHABLE();
1087 return NULL; 1087 return NULL;
1088 } 1088 }
1089 1089
1090 int32_t line_offset_; 1090 int32_t line_offset_;
1091 int32_t col_offset_; 1091 int32_t col_offset_;
1092 int8_t kind_; // Of type Kind. 1092 int8_t kind_; // Of type Kind.
1093 intptr_t kernel_script_index_;
1093 int64_t load_timestamp_; 1094 int64_t load_timestamp_;
1094 intptr_t kernel_script_index_;
1095 }; 1095 };
1096 1096
1097 class RawLibrary : public RawObject { 1097 class RawLibrary : public RawObject {
1098 enum LibraryState { 1098 enum LibraryState {
1099 kAllocated, // Initial state. 1099 kAllocated, // Initial state.
1100 kLoadRequested, // Compiler or script requested load of library. 1100 kLoadRequested, // Compiler or script requested load of library.
1101 kLoadInProgress, // Library is in the process of being loaded. 1101 kLoadInProgress, // Library is in the process of being loaded.
1102 kLoaded, // Library is loaded. 1102 kLoaded, // Library is loaded.
1103 kLoadError, // Error occurred during load of the Library. 1103 kLoadError, // Error occurred during load of the Library.
1104 }; 1104 };
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after
2439 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2439 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2440 kTypedDataInt8ArrayViewCid + 15); 2440 kTypedDataInt8ArrayViewCid + 15);
2441 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2441 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2442 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2442 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2443 return (kNullCid - kTypedDataInt8ArrayCid); 2443 return (kNullCid - kTypedDataInt8ArrayCid);
2444 } 2444 }
2445 2445
2446 } // namespace dart 2446 } // namespace dart
2447 2447
2448 #endif // RUNTIME_VM_RAW_OBJECT_H_ 2448 #endif // RUNTIME_VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/clustered_snapshot.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698