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

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

Issue 12210127: First stab at mixins in VM compiler (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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"
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 RawString* name_; 426 RawString* name_;
427 RawArray* functions_; 427 RawArray* functions_;
428 RawArray* fields_; 428 RawArray* fields_;
429 RawGrowableObjectArray* closure_functions_; // Local functions and literals. 429 RawGrowableObjectArray* closure_functions_; // Local functions and literals.
430 RawArray* interfaces_; // Array of AbstractType. 430 RawArray* interfaces_; // Array of AbstractType.
431 RawGrowableObjectArray* direct_subclasses_; // Array of Class. 431 RawGrowableObjectArray* direct_subclasses_; // Array of Class.
432 RawScript* script_; 432 RawScript* script_;
433 RawLibrary* library_; 433 RawLibrary* library_;
434 RawTypeArguments* type_parameters_; // Array of TypeParameter. 434 RawTypeArguments* type_parameters_; // Array of TypeParameter.
435 RawType* super_type_; 435 RawType* super_type_;
436 RawType* mixin_;
436 RawFunction* signature_function_; // Associated function for signature class. 437 RawFunction* signature_function_; // Associated function for signature class.
437 RawArray* constants_; // Canonicalized values of this class. 438 RawArray* constants_; // Canonicalized values of this class.
438 RawArray* canonical_types_; // Canonicalized types of this class. 439 RawArray* canonical_types_; // Canonicalized types of this class.
439 RawCode* allocation_stub_; // Stub code for allocation of instances. 440 RawCode* allocation_stub_; // Stub code for allocation of instances.
440 RawObject** to() { 441 RawObject** to() {
441 return reinterpret_cast<RawObject**>(&ptr()->allocation_stub_); 442 return reinterpret_cast<RawObject**>(&ptr()->allocation_stub_);
442 } 443 }
443 444
444 cpp_vtable handle_vtable_; 445 cpp_vtable handle_vtable_;
445 intptr_t instance_size_in_words_; // Size if fixed len or 0 if variable len. 446 intptr_t instance_size_in_words_; // Size if fixed len or 0 if variable len.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 kConstImplicitGetter, // represents an implicit const getter for fields. 549 kConstImplicitGetter, // represents an implicit const getter for fields.
549 kMethodExtractor, // converts method into implicit closure on the receiver. 550 kMethodExtractor, // converts method into implicit closure on the receiver.
550 }; 551 };
551 552
552 private: 553 private:
553 friend class Class; 554 friend class Class;
554 RAW_HEAP_OBJECT_IMPLEMENTATION(Function); 555 RAW_HEAP_OBJECT_IMPLEMENTATION(Function);
555 556
556 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } 557 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
557 RawString* name_; 558 RawString* name_;
558 RawObject* owner_; // Class or patch class where this function was defined. 559 RawObject* owner_; // Class or patch class or mixin class
560 // where this function is defined.
559 RawAbstractType* result_type_; 561 RawAbstractType* result_type_;
560 RawArray* parameter_types_; 562 RawArray* parameter_types_;
561 RawArray* parameter_names_; 563 RawArray* parameter_names_;
562 RawCode* code_; // Compiled code for the function. 564 RawCode* code_; // Compiled code for the function.
563 RawCode* unoptimized_code_; // Unoptimized code, keep it after optimization. 565 RawCode* unoptimized_code_; // Unoptimized code, keep it after optimization.
564 RawObject* data_; // Additional data specific to the function kind. 566 RawObject* data_; // Additional data specific to the function kind.
565 RawObject** to() { 567 RawObject** to() {
566 return reinterpret_cast<RawObject**>(&ptr()->data_); 568 return reinterpret_cast<RawObject**>(&ptr()->data_);
567 } 569 }
568 570
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 return reinterpret_cast<RawObject**>(&ptr()->target_); 614 return reinterpret_cast<RawObject**>(&ptr()->target_);
613 } 615 }
614 }; 616 };
615 617
616 618
617 class RawField : public RawObject { 619 class RawField : public RawObject {
618 RAW_HEAP_OBJECT_IMPLEMENTATION(Field); 620 RAW_HEAP_OBJECT_IMPLEMENTATION(Field);
619 621
620 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } 622 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
621 RawString* name_; 623 RawString* name_;
622 RawClass* owner_; 624 RawObject* owner_; // Class or patch class or mixin class
625 // where this field is defined.
623 RawAbstractType* type_; 626 RawAbstractType* type_;
624 RawInstance* value_; // Offset in words for instance and value for static. 627 RawInstance* value_; // Offset in words for instance and value for static.
625 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->value_); } 628 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->value_); }
626 629
627 intptr_t token_pos_; 630 intptr_t token_pos_;
628 uint8_t kind_bits_; // static, final, const, has initializer. 631 uint8_t kind_bits_; // static, final, const, has initializer.
629 }; 632 };
630 633
631 634
632 class RawLiteralToken : public RawObject { 635 class RawLiteralToken : public RawObject {
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 8 && 1692 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 8 &&
1690 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 9 && 1693 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 9 &&
1691 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 10 && 1694 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 10 &&
1692 kStacktraceCid == kExternalInt8ArrayCid + 11); 1695 kStacktraceCid == kExternalInt8ArrayCid + 11);
1693 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); 1696 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid);
1694 } 1697 }
1695 1698
1696 } // namespace dart 1699 } // namespace dart
1697 1700
1698 #endif // VM_RAW_OBJECT_H_ 1701 #endif // VM_RAW_OBJECT_H_
OLDNEW
« runtime/vm/parser.cc ('K') | « runtime/vm/parser.cc ('k') | runtime/vm/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698