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

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

Issue 2591823002: Introduce a SignatureData class so that signature functions can store both their (Closed)
Patch Set: address comments Created 4 years 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/parser.cc ('k') | runtime/vm/raw_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_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/globals.h" 10 #include "vm/globals.h"
11 #include "vm/snapshot.h" 11 #include "vm/snapshot.h"
12 #include "vm/token.h" 12 #include "vm/token.h"
13 #include "vm/token_position.h" 13 #include "vm/token_position.h"
14 14
15 namespace dart { 15 namespace dart {
16 16
17 // Macrobatics to define the Object hierarchy of VM implementation classes. 17 // Macrobatics to define the Object hierarchy of VM implementation classes.
18 #define CLASS_LIST_NO_OBJECT_NOR_STRING_NOR_ARRAY(V) \ 18 #define CLASS_LIST_NO_OBJECT_NOR_STRING_NOR_ARRAY(V) \
19 V(Class) \ 19 V(Class) \
20 V(UnresolvedClass) \ 20 V(UnresolvedClass) \
21 V(TypeArguments) \ 21 V(TypeArguments) \
22 V(PatchClass) \ 22 V(PatchClass) \
23 V(Function) \ 23 V(Function) \
24 V(ClosureData) \ 24 V(ClosureData) \
25 V(SignatureData) \
25 V(RedirectionData) \ 26 V(RedirectionData) \
26 V(Field) \ 27 V(Field) \
27 V(LiteralToken) \ 28 V(LiteralToken) \
28 V(TokenStream) \ 29 V(TokenStream) \
29 V(Script) \ 30 V(Script) \
30 V(Library) \ 31 V(Library) \
31 V(Namespace) \ 32 V(Namespace) \
32 V(Code) \ 33 V(Code) \
33 V(Instructions) \ 34 V(Instructions) \
34 V(ObjectPool) \ 35 V(ObjectPool) \
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 RawContextScope* context_scope_; 861 RawContextScope* context_scope_;
861 RawFunction* parent_function_; // Enclosing function of this local function. 862 RawFunction* parent_function_; // Enclosing function of this local function.
862 RawType* signature_type_; 863 RawType* signature_type_;
863 RawInstance* closure_; // Closure object for static implicit closures. 864 RawInstance* closure_; // Closure object for static implicit closures.
864 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->closure_); } 865 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->closure_); }
865 866
866 friend class Function; 867 friend class Function;
867 }; 868 };
868 869
869 870
871 class RawSignatureData : public RawObject {
872 private:
873 RAW_HEAP_OBJECT_IMPLEMENTATION(SignatureData);
874
875 RawObject** from() {
876 return reinterpret_cast<RawObject**>(&ptr()->parent_function_);
877 }
878 RawFunction* parent_function_; // Enclosing function of this sig. function.
879 RawType* signature_type_;
880 RawObject** to() {
881 return reinterpret_cast<RawObject**>(&ptr()->signature_type_);
882 }
883
884 friend class Function;
885 };
886
887
870 class RawRedirectionData : public RawObject { 888 class RawRedirectionData : public RawObject {
871 private: 889 private:
872 RAW_HEAP_OBJECT_IMPLEMENTATION(RedirectionData); 890 RAW_HEAP_OBJECT_IMPLEMENTATION(RedirectionData);
873 891
874 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->type_); } 892 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->type_); }
875 RawType* type_; 893 RawType* type_;
876 RawString* identifier_; 894 RawString* identifier_;
877 RawFunction* target_; 895 RawFunction* target_;
878 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->target_); } 896 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->target_); }
879 }; 897 };
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
2400 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2418 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2401 kTypedDataInt8ArrayViewCid + 15); 2419 kTypedDataInt8ArrayViewCid + 15);
2402 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2420 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2403 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2421 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2404 return (kNullCid - kTypedDataInt8ArrayCid); 2422 return (kNullCid - kTypedDataInt8ArrayCid);
2405 } 2423 }
2406 2424
2407 } // namespace dart 2425 } // namespace dart
2408 2426
2409 #endif // RUNTIME_VM_RAW_OBJECT_H_ 2427 #endif // RUNTIME_VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698