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

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: self-code-review 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
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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 822
823 823
824 class RawField : public RawObject { 824 class RawField : public RawObject {
825 RAW_HEAP_OBJECT_IMPLEMENTATION(Field); 825 RAW_HEAP_OBJECT_IMPLEMENTATION(Field);
826 826
827 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } 827 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
828 RawString* name_; 828 RawString* name_;
829 RawObject* owner_; // Class or patch class or mixin class 829 RawObject* owner_; // Class or patch class or mixin class
830 // where this field is defined. 830 // where this field is defined.
831 RawAbstractType* type_; 831 RawAbstractType* type_;
832 RawInstance* value_; // Offset in words for instance and value for static. 832 union {
hausner 2015/09/01 16:02:02 Seems a bit over the top to me: field->value_.sta
siva 2015/09/03 23:32:10 My main motivation for doing this was to have a wa
833 RawInstance* static_value_; // Value for static fields.
834 RawSmi* offset_; // Offset in words for instance fields.
835 RawObject* value_; // Used to access the value in a type agnostic way.
836 } value_;
833 RawArray* dependent_code_; 837 RawArray* dependent_code_;
834 RawFunction* initializer_; 838 union {
839 RawFunction* precompiled_initializer_; // Used when precompiling code.
840 RawInstance* saved_initial_value_; // Saved initial value (static fields).
hausner 2015/09/01 16:02:02 The comment just repeats what the identifier alrea
siva 2015/09/03 23:32:09 Done.
841 RawObject* value_; // Used to access the value in a type agnostic way.
842 } initializer_;
835 RawSmi* guarded_list_length_; 843 RawSmi* guarded_list_length_;
836 RawObject** to() { 844 RawObject** to() {
837 return reinterpret_cast<RawObject**>(&ptr()->guarded_list_length_); 845 return reinterpret_cast<RawObject**>(&ptr()->guarded_list_length_);
838 } 846 }
839 847
840 int32_t token_pos_; 848 int32_t token_pos_;
841 classid_t guarded_cid_; 849 classid_t guarded_cid_;
842 classid_t is_nullable_; // kNullCid if field can contain null value and 850 classid_t is_nullable_; // kNullCid if field can contain null value and
843 // any other value otherwise. 851 // any other value otherwise.
844 // Offset to the guarded length field inside an instance of class matching 852 // Offset to the guarded length field inside an instance of class matching
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
2205 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2213 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2206 kTypedDataInt8ArrayViewCid + 15); 2214 kTypedDataInt8ArrayViewCid + 15);
2207 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2215 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2208 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2216 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2209 return (kNullCid - kTypedDataInt8ArrayCid); 2217 return (kNullCid - kTypedDataInt8ArrayCid);
2210 } 2218 }
2211 2219
2212 } // namespace dart 2220 } // namespace dart
2213 2221
2214 #endif // VM_RAW_OBJECT_H_ 2222 #endif // VM_RAW_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698