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 RUNTIME_VM_RAW_OBJECT_H_ | 5 #ifndef RUNTIME_VM_RAW_OBJECT_H_ |
6 #define RUNTIME_VM_RAW_OBJECT_H_ | 6 #define RUNTIME_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 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2109 | 2109 |
2110 // VM type for capturing JS regular expressions. | 2110 // VM type for capturing JS regular expressions. |
2111 class RawRegExp : public RawInstance { | 2111 class RawRegExp : public RawInstance { |
2112 RAW_HEAP_OBJECT_IMPLEMENTATION(RegExp); | 2112 RAW_HEAP_OBJECT_IMPLEMENTATION(RegExp); |
2113 | 2113 |
2114 RawObject** from() { | 2114 RawObject** from() { |
2115 return reinterpret_cast<RawObject**>(&ptr()->num_bracket_expressions_); | 2115 return reinterpret_cast<RawObject**>(&ptr()->num_bracket_expressions_); |
2116 } | 2116 } |
2117 RawSmi* num_bracket_expressions_; | 2117 RawSmi* num_bracket_expressions_; |
2118 RawString* pattern_; // Pattern to be used for matching. | 2118 RawString* pattern_; // Pattern to be used for matching. |
2119 RawFunction* one_byte_function_; | 2119 union { |
2120 RawFunction* two_byte_function_; | 2120 RawFunction* function_; |
| 2121 RawTypedData* bytecode_; |
| 2122 } one_byte_; |
| 2123 union { |
| 2124 RawFunction* function_; |
| 2125 RawTypedData* bytecode_; |
| 2126 } two_byte_; |
2121 RawFunction* external_one_byte_function_; | 2127 RawFunction* external_one_byte_function_; |
2122 RawFunction* external_two_byte_function_; | 2128 RawFunction* external_two_byte_function_; |
2123 RawTypedData* one_byte_bytecode_; | 2129 union { |
2124 RawTypedData* two_byte_bytecode_; | 2130 RawFunction* function_; |
| 2131 RawTypedData* bytecode_; |
| 2132 } one_byte_sticky_; |
| 2133 union { |
| 2134 RawFunction* function_; |
| 2135 RawTypedData* bytecode_; |
| 2136 } two_byte_sticky_; |
| 2137 RawFunction* external_one_byte_sticky_function_; |
| 2138 RawFunction* external_two_byte_sticky_function_; |
2125 RawObject** to() { | 2139 RawObject** to() { |
2126 return reinterpret_cast<RawObject**>(&ptr()->two_byte_bytecode_); | 2140 return reinterpret_cast<RawObject**>( |
| 2141 &ptr()->external_two_byte_sticky_function_); |
2127 } | 2142 } |
2128 | 2143 |
2129 intptr_t num_registers_; | 2144 intptr_t num_registers_; |
2130 | 2145 |
2131 // A bitfield with two fields: | 2146 // A bitfield with two fields: |
2132 // type: Uninitialized, simple or complex. | 2147 // type: Uninitialized, simple or complex. |
2133 // flags: Represents global/local, case insensitive, multiline. | 2148 // flags: Represents global/local, case insensitive, multiline. |
2134 int8_t type_flags_; | 2149 int8_t type_flags_; |
2135 }; | 2150 }; |
2136 | 2151 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2377 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2392 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2378 kTypedDataInt8ArrayViewCid + 15); | 2393 kTypedDataInt8ArrayViewCid + 15); |
2379 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2394 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2380 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2395 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2381 return (kNullCid - kTypedDataInt8ArrayCid); | 2396 return (kNullCid - kTypedDataInt8ArrayCid); |
2382 } | 2397 } |
2383 | 2398 |
2384 } // namespace dart | 2399 } // namespace dart |
2385 | 2400 |
2386 #endif // RUNTIME_VM_RAW_OBJECT_H_ | 2401 #endif // RUNTIME_VM_RAW_OBJECT_H_ |
OLD | NEW |