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

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

Issue 10964058: Support redirecting factory constructors in the VM (issue 3969). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
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/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
11 #include "vm/snapshot.h" 11 #include "vm/snapshot.h"
12 12
13 namespace dart { 13 namespace dart {
14 14
15 // Macrobatics to define the Object hierarchy of VM implementation classes. 15 // Macrobatics to define the Object hierarchy of VM implementation classes.
16 #define CLASS_LIST_NO_OBJECT(V) \ 16 #define CLASS_LIST_NO_OBJECT(V) \
17 V(Class) \ 17 V(Class) \
18 V(UnresolvedClass) \ 18 V(UnresolvedClass) \
19 V(AbstractType) \ 19 V(AbstractType) \
20 V(Type) \ 20 V(Type) \
21 V(TypeParameter) \ 21 V(TypeParameter) \
22 V(AbstractTypeArguments) \ 22 V(AbstractTypeArguments) \
23 V(TypeArguments) \ 23 V(TypeArguments) \
24 V(InstantiatedTypeArguments) \ 24 V(InstantiatedTypeArguments) \
25 V(PatchClass) \ 25 V(PatchClass) \
26 V(Function) \ 26 V(Function) \
27 V(ClosureData) \ 27 V(ClosureData) \
28 V(RedirectionData) \
28 V(Field) \ 29 V(Field) \
29 V(LiteralToken) \ 30 V(LiteralToken) \
30 V(TokenStream) \ 31 V(TokenStream) \
31 V(Script) \ 32 V(Script) \
32 V(Library) \ 33 V(Library) \
33 V(LibraryPrefix) \ 34 V(LibraryPrefix) \
34 V(Code) \ 35 V(Code) \
35 V(Instructions) \ 36 V(Instructions) \
36 V(PcDescriptors) \ 37 V(PcDescriptors) \
37 V(Stackmap) \ 38 V(Stackmap) \
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 RawContextScope* context_scope_; 628 RawContextScope* context_scope_;
628 RawFunction* parent_function_; // Enclosing function of this local function. 629 RawFunction* parent_function_; // Enclosing function of this local function.
629 RawClass* signature_class_; 630 RawClass* signature_class_;
630 RawCode* closure_allocation_stub_; // Stub code for allocation of closures. 631 RawCode* closure_allocation_stub_; // Stub code for allocation of closures.
631 RawObject** to() { 632 RawObject** to() {
632 return reinterpret_cast<RawObject**>(&ptr()->closure_allocation_stub_); 633 return reinterpret_cast<RawObject**>(&ptr()->closure_allocation_stub_);
633 } 634 }
634 }; 635 };
635 636
636 637
638 class RawRedirectionData : public RawObject {
639 private:
640 RAW_HEAP_OBJECT_IMPLEMENTATION(RedirectionData);
641
642 RawObject** from() {
643 return reinterpret_cast<RawObject**>(&ptr()->type_);
644 }
645 RawType* type_;
646 RawString* identifier_;
647 RawFunction* target_;
648 RawObject** to() {
649 return reinterpret_cast<RawObject**>(&ptr()->target_);
650 }
651 };
652
653
637 class RawField : public RawObject { 654 class RawField : public RawObject {
638 RAW_HEAP_OBJECT_IMPLEMENTATION(Field); 655 RAW_HEAP_OBJECT_IMPLEMENTATION(Field);
639 656
640 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } 657 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
641 RawString* name_; 658 RawString* name_;
642 RawClass* owner_; 659 RawClass* owner_;
643 RawAbstractType* type_; 660 RawAbstractType* type_;
644 RawInstance* value_; // Offset for instance and value for static fields. 661 RawInstance* value_; // Offset for instance and value for static fields.
645 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->value_); } 662 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->value_); }
646 663
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 kExternalUint64ArrayCid == kByteArrayCid + 18 && 1621 kExternalUint64ArrayCid == kByteArrayCid + 18 &&
1605 kExternalFloat32ArrayCid == kByteArrayCid + 19 && 1622 kExternalFloat32ArrayCid == kByteArrayCid + 19 &&
1606 kExternalFloat64ArrayCid == kByteArrayCid + 20 && 1623 kExternalFloat64ArrayCid == kByteArrayCid + 20 &&
1607 kStacktraceCid == kByteArrayCid + 21); 1624 kStacktraceCid == kByteArrayCid + 21);
1608 return (index >= kByteArrayCid && index <= kExternalFloat64ArrayCid); 1625 return (index >= kByteArrayCid && index <= kExternalFloat64ArrayCid);
1609 } 1626 }
1610 1627
1611 } // namespace dart 1628 } // namespace dart
1612 1629
1613 #endif // VM_RAW_OBJECT_H_ 1630 #endif // VM_RAW_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698