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/globals.h" | 9 #include "vm/globals.h" |
10 #include "vm/token.h" | 10 #include "vm/token.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 V(Function) \ | 28 V(Function) \ |
29 V(Field) \ | 29 V(Field) \ |
30 V(LiteralToken) \ | 30 V(LiteralToken) \ |
31 V(TokenStream) \ | 31 V(TokenStream) \ |
32 V(Script) \ | 32 V(Script) \ |
33 V(Library) \ | 33 V(Library) \ |
34 V(LibraryPrefix) \ | 34 V(LibraryPrefix) \ |
35 V(Code) \ | 35 V(Code) \ |
36 V(Instructions) \ | 36 V(Instructions) \ |
37 V(PcDescriptors) \ | 37 V(PcDescriptors) \ |
| 38 V(Stackmap) \ |
38 V(LocalVarDescriptors) \ | 39 V(LocalVarDescriptors) \ |
39 V(ExceptionHandlers) \ | 40 V(ExceptionHandlers) \ |
40 V(Context) \ | 41 V(Context) \ |
41 V(ContextScope) \ | 42 V(ContextScope) \ |
42 V(ICData) \ | 43 V(ICData) \ |
43 V(Error) \ | 44 V(Error) \ |
44 V(ApiError) \ | 45 V(ApiError) \ |
45 V(LanguageError) \ | 46 V(LanguageError) \ |
46 V(UnhandledException) \ | 47 V(UnhandledException) \ |
47 V(UnwindError) \ | 48 V(UnwindError) \ |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 class RawPcDescriptors : public RawObject { | 682 class RawPcDescriptors : public RawObject { |
682 RAW_HEAP_OBJECT_IMPLEMENTATION(PcDescriptors); | 683 RAW_HEAP_OBJECT_IMPLEMENTATION(PcDescriptors); |
683 | 684 |
684 RawSmi* length_; // Number of descriptors. | 685 RawSmi* length_; // Number of descriptors. |
685 | 686 |
686 // Variable length data follows here. | 687 // Variable length data follows here. |
687 intptr_t data_[0]; | 688 intptr_t data_[0]; |
688 }; | 689 }; |
689 | 690 |
690 | 691 |
| 692 // Stackmap is an immutable representation of the layout of the stack at |
| 693 // a PC. The stack map representation consists of a bit map which marks |
| 694 // each stack slot index starting from the FP (frame pointer) as an object |
| 695 // or regular untagged value. |
| 696 // The Stackmap also consists of a link to code object corresponding to |
| 697 // the frame which the stack map is describing. |
| 698 // The bit map representation is optimized for dense and small bit maps, |
| 699 // without any upper bound. |
| 700 class RawStackmap : public RawObject { |
| 701 RAW_HEAP_OBJECT_IMPLEMENTATION(Stackmap); |
| 702 |
| 703 RawObject** from() { |
| 704 return reinterpret_cast<RawObject**>(&ptr()->code_); |
| 705 } |
| 706 RawCode* code_; // Code object corresponding to the frame described. |
| 707 RawSmi* bitmap_size_in_bytes_; // Size of the bit map in bytes. |
| 708 RawObject** to() { |
| 709 return reinterpret_cast<RawObject**>(&ptr()->bitmap_size_in_bytes_); |
| 710 } |
| 711 uword pc_; // PC corresponding to this stack map representation. |
| 712 |
| 713 // Variable length data follows here (bitmap of the stack layout). |
| 714 uint8_t data_[0]; |
| 715 }; |
| 716 |
| 717 |
691 class RawLocalVarDescriptors : public RawObject { | 718 class RawLocalVarDescriptors : public RawObject { |
692 RAW_HEAP_OBJECT_IMPLEMENTATION(LocalVarDescriptors); | 719 RAW_HEAP_OBJECT_IMPLEMENTATION(LocalVarDescriptors); |
693 | 720 |
694 struct VarInfo { | 721 struct VarInfo { |
695 intptr_t index; // Slot index on stack or in context. | 722 intptr_t index; // Slot index on stack or in context. |
696 intptr_t scope_id; // Scope to which the variable belongs. | 723 intptr_t scope_id; // Scope to which the variable belongs. |
697 intptr_t begin_pos; // Token position of scope start. | 724 intptr_t begin_pos; // Token position of scope start. |
698 intptr_t end_pos; // Token position of scope end. | 725 intptr_t end_pos; // Token position of scope end. |
699 }; | 726 }; |
700 | 727 |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 return reinterpret_cast<RawObject**>(&ptr()->pattern_); | 1159 return reinterpret_cast<RawObject**>(&ptr()->pattern_); |
1133 } | 1160 } |
1134 | 1161 |
1135 intptr_t type_; // Uninitialized, simple or complex. | 1162 intptr_t type_; // Uninitialized, simple or complex. |
1136 intptr_t flags_; // Represents global/local, case insensitive, multiline. | 1163 intptr_t flags_; // Represents global/local, case insensitive, multiline. |
1137 | 1164 |
1138 // Variable length data follows here. | 1165 // Variable length data follows here. |
1139 uint8_t data_[0]; | 1166 uint8_t data_[0]; |
1140 }; | 1167 }; |
1141 | 1168 |
1142 | |
1143 } // namespace dart | 1169 } // namespace dart |
1144 | 1170 |
1145 #endif // VM_RAW_OBJECT_H_ | 1171 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |