Chromium Code Reviews| 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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 624 kGetterFunction, // represents getter functions e.g: get foo() { .. }. | 624 kGetterFunction, // represents getter functions e.g: get foo() { .. }. |
| 625 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }. | 625 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }. |
| 626 kConstructor, | 626 kConstructor, |
| 627 kImplicitGetter, // represents an implicit getter for fields. | 627 kImplicitGetter, // represents an implicit getter for fields. |
| 628 kImplicitSetter, // represents an implicit setter for fields. | 628 kImplicitSetter, // represents an implicit setter for fields. |
| 629 kImplicitStaticFinalGetter, // represents an implicit getter for static | 629 kImplicitStaticFinalGetter, // represents an implicit getter for static |
| 630 // final fields (incl. static const fields). | 630 // final fields (incl. static const fields). |
| 631 kMethodExtractor, // converts method into implicit closure on the receiver. | 631 kMethodExtractor, // converts method into implicit closure on the receiver. |
| 632 kNoSuchMethodDispatcher, // invokes noSuchMethod. | 632 kNoSuchMethodDispatcher, // invokes noSuchMethod. |
| 633 kInvokeFieldDispatcher, // invokes a field as a closure. | 633 kInvokeFieldDispatcher, // invokes a field as a closure. |
| 634 kIrregexpFunction, // represents a generated irregexp matcher function. | |
| 634 }; | 635 }; |
| 635 | 636 |
| 636 enum AsyncModifier { | 637 enum AsyncModifier { |
| 637 kNoModifier, | 638 kNoModifier, |
| 638 kAsync, | 639 kAsync, |
| 639 }; | 640 }; |
| 640 | 641 |
| 641 private: | 642 private: |
| 642 // So that the MarkingVisitor::DetachCode can null out the code fields. | 643 // So that the MarkingVisitor::DetachCode can null out the code fields. |
| 643 friend class MarkingVisitor; | 644 friend class MarkingVisitor; |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 666 RawObject** to() { | 667 RawObject** to() { |
| 667 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_); | 668 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_); |
| 668 } | 669 } |
| 669 | 670 |
| 670 int32_t token_pos_; | 671 int32_t token_pos_; |
| 671 int32_t end_token_pos_; | 672 int32_t end_token_pos_; |
| 672 int32_t usage_counter_; // Incremented while function is running. | 673 int32_t usage_counter_; // Incremented while function is running. |
| 673 int16_t num_fixed_parameters_; | 674 int16_t num_fixed_parameters_; |
| 674 int16_t num_optional_parameters_; // > 0: positional; < 0: named. | 675 int16_t num_optional_parameters_; // > 0: positional; < 0: named. |
| 675 int16_t deoptimization_counter_; | 676 int16_t deoptimization_counter_; |
| 677 int16_t regexp_cid_; | |
|
Ivan Posva
2014/10/10 06:35:54
Would an int8_t do? Or a uint8_t?
Generally it is
Vyacheslav Egorov (Google)
2014/10/10 08:08:08
We were indeed concerned about the size of the Fun
jgruber1
2014/10/10 09:29:44
Added snapshotting of regexp_cid_.
| |
| 676 uint32_t kind_tag_; // See Function::KindTagBits. | 678 uint32_t kind_tag_; // See Function::KindTagBits. |
| 677 uint16_t optimized_instruction_count_; | 679 uint16_t optimized_instruction_count_; |
| 678 uint16_t optimized_call_site_count_; | 680 uint16_t optimized_call_site_count_; |
| 679 }; | 681 }; |
| 680 | 682 |
| 681 | 683 |
| 682 class RawClosureData : public RawObject { | 684 class RawClosureData : public RawObject { |
| 683 private: | 685 private: |
| 684 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData); | 686 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData); |
| 685 | 687 |
| (...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1761 // VM type for capturing JS regular expressions. | 1763 // VM type for capturing JS regular expressions. |
| 1762 class RawJSRegExp : public RawInstance { | 1764 class RawJSRegExp : public RawInstance { |
| 1763 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp); | 1765 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp); |
| 1764 | 1766 |
| 1765 RawObject** from() { | 1767 RawObject** from() { |
| 1766 return reinterpret_cast<RawObject**>(&ptr()->data_length_); | 1768 return reinterpret_cast<RawObject**>(&ptr()->data_length_); |
| 1767 } | 1769 } |
| 1768 RawSmi* data_length_; | 1770 RawSmi* data_length_; |
| 1769 RawSmi* num_bracket_expressions_; | 1771 RawSmi* num_bracket_expressions_; |
| 1770 RawString* pattern_; // Pattern to be used for matching. | 1772 RawString* pattern_; // Pattern to be used for matching. |
| 1773 RawFunction* one_byte_function_; | |
| 1774 RawFunction* two_byte_function_; | |
| 1775 RawFunction* external_one_byte_function_; | |
| 1776 RawFunction* external_two_byte_function_; | |
| 1771 RawObject** to() { | 1777 RawObject** to() { |
| 1772 return reinterpret_cast<RawObject**>(&ptr()->pattern_); | 1778 return reinterpret_cast<RawObject**>(&ptr()->external_two_byte_function_); |
| 1773 } | 1779 } |
| 1774 | 1780 |
| 1775 // A bitfield with two fields: | 1781 // A bitfield with two fields: |
| 1776 // type: Uninitialized, simple or complex. | 1782 // type: Uninitialized, simple or complex. |
| 1777 // flags: Represents global/local, case insensitive, multiline. | 1783 // flags: Represents global/local, case insensitive, multiline. |
| 1778 int8_t type_flags_; | 1784 int8_t type_flags_; |
| 1779 | 1785 |
| 1780 // Variable length data follows here. | 1786 // Variable length data follows here. |
| 1781 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); } | 1787 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); } |
| 1782 }; | 1788 }; |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2049 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2055 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 2050 kTypedDataInt8ArrayViewCid + 15); | 2056 kTypedDataInt8ArrayViewCid + 15); |
| 2051 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2057 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
| 2052 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2058 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
| 2053 return (kNullCid - kTypedDataInt8ArrayCid); | 2059 return (kNullCid - kTypedDataInt8ArrayCid); |
| 2054 } | 2060 } |
| 2055 | 2061 |
| 2056 } // namespace dart | 2062 } // namespace dart |
| 2057 | 2063 |
| 2058 #endif // VM_RAW_OBJECT_H_ | 2064 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |