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 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1865 // False for pre-allocated stack trace (used in OOM and Stack overflow). | 1865 // False for pre-allocated stack trace (used in OOM and Stack overflow). |
1866 bool expand_inlined_; | 1866 bool expand_inlined_; |
1867 }; | 1867 }; |
1868 | 1868 |
1869 | 1869 |
1870 // VM type for capturing JS regular expressions. | 1870 // VM type for capturing JS regular expressions. |
1871 class RawJSRegExp : public RawInstance { | 1871 class RawJSRegExp : public RawInstance { |
1872 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp); | 1872 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp); |
1873 | 1873 |
1874 RawObject** from() { | 1874 RawObject** from() { |
1875 return reinterpret_cast<RawObject**>(&ptr()->data_length_); | 1875 return reinterpret_cast<RawObject**>(&ptr()->num_bracket_expressions_); |
1876 } | 1876 } |
1877 RawSmi* data_length_; | |
1878 RawSmi* num_bracket_expressions_; | 1877 RawSmi* num_bracket_expressions_; |
1879 RawString* pattern_; // Pattern to be used for matching. | 1878 RawString* pattern_; // Pattern to be used for matching. |
1880 RawFunction* one_byte_function_; | 1879 RawFunction* one_byte_function_; |
1881 RawFunction* two_byte_function_; | 1880 RawFunction* two_byte_function_; |
1882 RawFunction* external_one_byte_function_; | 1881 RawFunction* external_one_byte_function_; |
1883 RawFunction* external_two_byte_function_; | 1882 RawFunction* external_two_byte_function_; |
1884 RawObject** to() { | 1883 RawObject** to() { |
1885 return reinterpret_cast<RawObject**>(&ptr()->external_two_byte_function_); | 1884 return reinterpret_cast<RawObject**>(&ptr()->external_two_byte_function_); |
1886 } | 1885 } |
1887 | 1886 |
1888 // A bitfield with two fields: | 1887 // A bitfield with two fields: |
1889 // type: Uninitialized, simple or complex. | 1888 // type: Uninitialized, simple or complex. |
1890 // flags: Represents global/local, case insensitive, multiline. | 1889 // flags: Represents global/local, case insensitive, multiline. |
1891 int8_t type_flags_; | 1890 int8_t type_flags_; |
1892 | |
1893 // Variable length data follows here. | |
1894 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); } | |
1895 }; | 1891 }; |
1896 | 1892 |
1897 | 1893 |
1898 class RawWeakProperty : public RawInstance { | 1894 class RawWeakProperty : public RawInstance { |
1899 RAW_HEAP_OBJECT_IMPLEMENTATION(WeakProperty); | 1895 RAW_HEAP_OBJECT_IMPLEMENTATION(WeakProperty); |
1900 | 1896 |
1901 RawObject** from() { | 1897 RawObject** from() { |
1902 return reinterpret_cast<RawObject**>(&ptr()->key_); | 1898 return reinterpret_cast<RawObject**>(&ptr()->key_); |
1903 } | 1899 } |
1904 RawObject* key_; | 1900 RawObject* key_; |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2161 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2157 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2162 kTypedDataInt8ArrayViewCid + 15); | 2158 kTypedDataInt8ArrayViewCid + 15); |
2163 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2159 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2164 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2160 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2165 return (kNullCid - kTypedDataInt8ArrayCid); | 2161 return (kNullCid - kTypedDataInt8ArrayCid); |
2166 } | 2162 } |
2167 | 2163 |
2168 } // namespace dart | 2164 } // namespace dart |
2169 | 2165 |
2170 #endif // VM_RAW_OBJECT_H_ | 2166 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |