OLD | NEW |
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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 kGetterFunction, // represents getter functions e.g: get foo() { .. }. | 629 kGetterFunction, // represents getter functions e.g: get foo() { .. }. |
630 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }. | 630 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }. |
631 kConstructor, | 631 kConstructor, |
632 kImplicitGetter, // represents an implicit getter for fields. | 632 kImplicitGetter, // represents an implicit getter for fields. |
633 kImplicitSetter, // represents an implicit setter for fields. | 633 kImplicitSetter, // represents an implicit setter for fields. |
634 kImplicitStaticFinalGetter, // represents an implicit getter for static | 634 kImplicitStaticFinalGetter, // represents an implicit getter for static |
635 // final fields (incl. static const fields). | 635 // final fields (incl. static const fields). |
636 kMethodExtractor, // converts method into implicit closure on the receiver. | 636 kMethodExtractor, // converts method into implicit closure on the receiver. |
637 kNoSuchMethodDispatcher, // invokes noSuchMethod. | 637 kNoSuchMethodDispatcher, // invokes noSuchMethod. |
638 kInvokeFieldDispatcher, // invokes a field as a closure. | 638 kInvokeFieldDispatcher, // invokes a field as a closure. |
| 639 kIrregexpFunction, // represents a generated irregexp matcher function. |
639 }; | 640 }; |
640 | 641 |
641 enum AsyncModifier { | 642 enum AsyncModifier { |
642 kNoModifier, | 643 kNoModifier, |
643 kAsync, | 644 kAsync, |
644 }; | 645 }; |
645 | 646 |
646 private: | 647 private: |
647 // So that the MarkingVisitor::DetachCode can null out the code fields. | 648 // So that the MarkingVisitor::DetachCode can null out the code fields. |
648 friend class MarkingVisitor; | 649 friend class MarkingVisitor; |
(...skipping 22 matching lines...) Expand all Loading... |
671 RawObject** to() { | 672 RawObject** to() { |
672 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_); | 673 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_); |
673 } | 674 } |
674 | 675 |
675 int32_t token_pos_; | 676 int32_t token_pos_; |
676 int32_t end_token_pos_; | 677 int32_t end_token_pos_; |
677 int32_t usage_counter_; // Incremented while function is running. | 678 int32_t usage_counter_; // Incremented while function is running. |
678 int16_t num_fixed_parameters_; | 679 int16_t num_fixed_parameters_; |
679 int16_t num_optional_parameters_; // > 0: positional; < 0: named. | 680 int16_t num_optional_parameters_; // > 0: positional; < 0: named. |
680 int16_t deoptimization_counter_; | 681 int16_t deoptimization_counter_; |
| 682 int16_t regexp_cid_; |
681 uint32_t kind_tag_; // See Function::KindTagBits. | 683 uint32_t kind_tag_; // See Function::KindTagBits. |
682 uint16_t optimized_instruction_count_; | 684 uint16_t optimized_instruction_count_; |
683 uint16_t optimized_call_site_count_; | 685 uint16_t optimized_call_site_count_; |
684 }; | 686 }; |
685 | 687 |
686 | 688 |
687 class RawClosureData : public RawObject { | 689 class RawClosureData : public RawObject { |
688 private: | 690 private: |
689 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData); | 691 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData); |
690 | 692 |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1779 // VM type for capturing JS regular expressions. | 1781 // VM type for capturing JS regular expressions. |
1780 class RawJSRegExp : public RawInstance { | 1782 class RawJSRegExp : public RawInstance { |
1781 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp); | 1783 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp); |
1782 | 1784 |
1783 RawObject** from() { | 1785 RawObject** from() { |
1784 return reinterpret_cast<RawObject**>(&ptr()->data_length_); | 1786 return reinterpret_cast<RawObject**>(&ptr()->data_length_); |
1785 } | 1787 } |
1786 RawSmi* data_length_; | 1788 RawSmi* data_length_; |
1787 RawSmi* num_bracket_expressions_; | 1789 RawSmi* num_bracket_expressions_; |
1788 RawString* pattern_; // Pattern to be used for matching. | 1790 RawString* pattern_; // Pattern to be used for matching. |
| 1791 RawFunction* one_byte_function_; |
| 1792 RawFunction* two_byte_function_; |
| 1793 RawFunction* external_one_byte_function_; |
| 1794 RawFunction* external_two_byte_function_; |
1789 RawObject** to() { | 1795 RawObject** to() { |
1790 return reinterpret_cast<RawObject**>(&ptr()->pattern_); | 1796 return reinterpret_cast<RawObject**>(&ptr()->external_two_byte_function_); |
1791 } | 1797 } |
1792 | 1798 |
1793 // A bitfield with two fields: | 1799 // A bitfield with two fields: |
1794 // type: Uninitialized, simple or complex. | 1800 // type: Uninitialized, simple or complex. |
1795 // flags: Represents global/local, case insensitive, multiline. | 1801 // flags: Represents global/local, case insensitive, multiline. |
1796 int8_t type_flags_; | 1802 int8_t type_flags_; |
1797 | 1803 |
1798 // Variable length data follows here. | 1804 // Variable length data follows here. |
1799 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); } | 1805 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); } |
1800 }; | 1806 }; |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2067 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2073 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2068 kTypedDataInt8ArrayViewCid + 15); | 2074 kTypedDataInt8ArrayViewCid + 15); |
2069 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2075 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2070 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2076 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2071 return (kNullCid - kTypedDataInt8ArrayCid); | 2077 return (kNullCid - kTypedDataInt8ArrayCid); |
2072 } | 2078 } |
2073 | 2079 |
2074 } // namespace dart | 2080 } // namespace dart |
2075 | 2081 |
2076 #endif // VM_RAW_OBJECT_H_ | 2082 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |