Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Unified Diff: runtime/vm/code_generator.h

Issue 9465028: Move CodeGenerator::DescriptorList into shared part. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/code_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.h
===================================================================
--- runtime/vm/code_generator.h (revision 4579)
+++ runtime/vm/code_generator.h (working copy)
@@ -122,6 +122,54 @@
const Class& class_;
};
+
+class CodeGenerator::DescriptorList : public ZoneAllocated {
+ public:
+ struct PcDesc {
+ intptr_t pc_offset; // PC offset value of the descriptor.
+ PcDescriptors::Kind kind; // Descriptor kind (kDeopt, kOther).
+ intptr_t node_id; // AST node id.
+ intptr_t token_index; // Token position in source of PC.
+ intptr_t try_index; // Try block index of PC.
+ };
+
+ DescriptorList() : list_() {
+ }
+ ~DescriptorList() { }
+
+ intptr_t Length() const {
+ return list_.length();
+ }
+
+ intptr_t PcOffset(int index) const {
+ return list_[index].pc_offset;
+ }
+ PcDescriptors::Kind Kind(int index) const {
+ return list_[index].kind;
+ }
+ intptr_t NodeId(int index) const {
+ return list_[index].node_id;
+ }
+ intptr_t TokenIndex(int index) const {
+ return list_[index].token_index;
+ }
+ intptr_t TryIndex(int index) const {
+ return list_[index].try_index;
+ }
+
+ void AddDescriptor(PcDescriptors::Kind kind,
+ intptr_t pc_offset,
+ intptr_t node_id,
+ intptr_t token_index,
+ intptr_t try_index);
+
+ RawPcDescriptors* FinalizePcDescriptors(uword entry_point);
+
+ private:
+ GrowableArray<struct PcDesc> list_;
+ DISALLOW_COPY_AND_ASSIGN(DescriptorList);
+};
+
} // namespace dart
#endif // VM_CODE_GENERATOR_H_
« no previous file with comments | « no previous file | runtime/vm/code_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698