| 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 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 kSourceTag, | 985 kSourceTag, |
| 986 kPatchTag, | 986 kPatchTag, |
| 987 kEvaluateTag, | 987 kEvaluateTag, |
| 988 }; | 988 }; |
| 989 | 989 |
| 990 private: | 990 private: |
| 991 RAW_HEAP_OBJECT_IMPLEMENTATION(Script); | 991 RAW_HEAP_OBJECT_IMPLEMENTATION(Script); |
| 992 | 992 |
| 993 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->url_); } | 993 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->url_); } |
| 994 RawString* url_; | 994 RawString* url_; |
| 995 RawObject** to_precompiled_snapshot() { | |
| 996 return reinterpret_cast<RawObject**>(&ptr()->url_); | |
| 997 } | |
| 998 RawTokenStream* tokens_; | 995 RawTokenStream* tokens_; |
| 999 RawObject** to_snapshot() { | |
| 1000 return reinterpret_cast<RawObject**>(&ptr()->tokens_); | |
| 1001 } | |
| 1002 RawString* source_; | 996 RawString* source_; |
| 1003 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->source_); } | 997 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->source_); } |
| 998 RawObject** to_snapshot(Snapshot::Kind kind) { |
| 999 switch (kind) { |
| 1000 case Snapshot::kAppNoJIT: |
| 1001 return reinterpret_cast<RawObject**>(&ptr()->url_); |
| 1002 case Snapshot::kCore: |
| 1003 case Snapshot::kAppWithJIT: |
| 1004 case Snapshot::kScript: |
| 1005 return reinterpret_cast<RawObject**>(&ptr()->tokens_); |
| 1006 case Snapshot::kMessage: |
| 1007 break; |
| 1008 } |
| 1009 UNREACHABLE(); |
| 1010 return NULL; |
| 1011 } |
| 1004 | 1012 |
| 1005 int32_t line_offset_; | 1013 int32_t line_offset_; |
| 1006 int32_t col_offset_; | 1014 int32_t col_offset_; |
| 1007 int8_t kind_; // Of type Kind. | 1015 int8_t kind_; // Of type Kind. |
| 1008 }; | 1016 }; |
| 1009 | 1017 |
| 1010 | 1018 |
| 1011 class RawLibrary : public RawObject { | 1019 class RawLibrary : public RawObject { |
| 1012 enum LibraryState { | 1020 enum LibraryState { |
| 1013 kAllocated, // Initial state. | 1021 kAllocated, // Initial state. |
| (...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2374 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2382 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 2375 kTypedDataInt8ArrayViewCid + 15); | 2383 kTypedDataInt8ArrayViewCid + 15); |
| 2376 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2384 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
| 2377 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2385 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
| 2378 return (kNullCid - kTypedDataInt8ArrayCid); | 2386 return (kNullCid - kTypedDataInt8ArrayCid); |
| 2379 } | 2387 } |
| 2380 | 2388 |
| 2381 } // namespace dart | 2389 } // namespace dart |
| 2382 | 2390 |
| 2383 #endif // VM_RAW_OBJECT_H_ | 2391 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |