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

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

Issue 1289643005: Rename accessors of class Field to make it more apparent as to what is being accessed - static fiel… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add-comment Created 5 years, 3 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/precompiler.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 VM_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define 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/globals.h" 10 #include "vm/globals.h"
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 823
824 824
825 class RawField : public RawObject { 825 class RawField : public RawObject {
826 RAW_HEAP_OBJECT_IMPLEMENTATION(Field); 826 RAW_HEAP_OBJECT_IMPLEMENTATION(Field);
827 827
828 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } 828 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
829 RawString* name_; 829 RawString* name_;
830 RawObject* owner_; // Class or patch class or mixin class 830 RawObject* owner_; // Class or patch class or mixin class
831 // where this field is defined. 831 // where this field is defined.
832 RawAbstractType* type_; 832 RawAbstractType* type_;
833 RawInstance* value_; // Offset in words for instance and value for static. 833 union {
834 RawInstance* static_value_; // Value for static fields.
835 RawSmi* offset_; // Offset in words for instance fields.
836 } value_;
834 RawArray* dependent_code_; 837 RawArray* dependent_code_;
835 RawFunction* initializer_; 838 union {
839 // When precompiling we need to save the static initializer function here
840 // so that code for it can be generated.
841 RawFunction* precompiled_; // Static initializer function - precompiling.
842 // When generating script snapshots after running the application it is
843 // necessary to save the initial value of static fields so that we can
844 // restore the value back to the original initial value.
845 RawInstance* saved_value_; // Saved initial value - static fields.
846 } initializer_;
836 RawSmi* guarded_list_length_; 847 RawSmi* guarded_list_length_;
837 RawObject** to() { 848 RawObject** to() {
838 return reinterpret_cast<RawObject**>(&ptr()->guarded_list_length_); 849 return reinterpret_cast<RawObject**>(&ptr()->guarded_list_length_);
839 } 850 }
840 851
841 int32_t token_pos_; 852 int32_t token_pos_;
842 classid_t guarded_cid_; 853 classid_t guarded_cid_;
843 classid_t is_nullable_; // kNullCid if field can contain null value and 854 classid_t is_nullable_; // kNullCid if field can contain null value and
844 // any other value otherwise. 855 // any other value otherwise.
845 // Offset to the guarded length field inside an instance of class matching 856 // Offset to the guarded length field inside an instance of class matching
(...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2224 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2214 kTypedDataInt8ArrayViewCid + 15); 2225 kTypedDataInt8ArrayViewCid + 15);
2215 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2226 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2216 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2227 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2217 return (kNullCid - kTypedDataInt8ArrayCid); 2228 return (kNullCid - kTypedDataInt8ArrayCid);
2218 } 2229 }
2219 2230
2220 } // namespace dart 2231 } // namespace dart
2221 2232
2222 #endif // VM_RAW_OBJECT_H_ 2233 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698