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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/code_generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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_CODE_GENERATOR_H_ 5 #ifndef VM_CODE_GENERATOR_H_
6 #define VM_CODE_GENERATOR_H_ 6 #define VM_CODE_GENERATOR_H_
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #include "vm/runtime_entry.h" 9 #include "vm/runtime_entry.h"
10 10
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 private: 115 private:
116 static void EnterFunctionAt(int i, 116 static void EnterFunctionAt(int i,
117 const Array& cache, 117 const Array& cache,
118 const Function& function, 118 const Function& function,
119 int num_arguments, 119 int num_arguments,
120 int num_named_arguments); 120 int num_named_arguments);
121 121
122 const Class& class_; 122 const Class& class_;
123 }; 123 };
124 124
125
126 class CodeGenerator::DescriptorList : public ZoneAllocated {
127 public:
128 struct PcDesc {
129 intptr_t pc_offset; // PC offset value of the descriptor.
130 PcDescriptors::Kind kind; // Descriptor kind (kDeopt, kOther).
131 intptr_t node_id; // AST node id.
132 intptr_t token_index; // Token position in source of PC.
133 intptr_t try_index; // Try block index of PC.
134 };
135
136 DescriptorList() : list_() {
137 }
138 ~DescriptorList() { }
139
140 intptr_t Length() const {
141 return list_.length();
142 }
143
144 intptr_t PcOffset(int index) const {
145 return list_[index].pc_offset;
146 }
147 PcDescriptors::Kind Kind(int index) const {
148 return list_[index].kind;
149 }
150 intptr_t NodeId(int index) const {
151 return list_[index].node_id;
152 }
153 intptr_t TokenIndex(int index) const {
154 return list_[index].token_index;
155 }
156 intptr_t TryIndex(int index) const {
157 return list_[index].try_index;
158 }
159
160 void AddDescriptor(PcDescriptors::Kind kind,
161 intptr_t pc_offset,
162 intptr_t node_id,
163 intptr_t token_index,
164 intptr_t try_index);
165
166 RawPcDescriptors* FinalizePcDescriptors(uword entry_point);
167
168 private:
169 GrowableArray<struct PcDesc> list_;
170 DISALLOW_COPY_AND_ASSIGN(DescriptorList);
171 };
172
125 } // namespace dart 173 } // namespace dart
126 174
127 #endif // VM_CODE_GENERATOR_H_ 175 #endif // VM_CODE_GENERATOR_H_
OLDNEW
« 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