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

Unified Diff: runtime/vm/code_generator_ia32.cc

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 | « runtime/vm/code_generator_arm.h ('k') | runtime/vm/code_generator_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator_ia32.cc
===================================================================
--- runtime/vm/code_generator_ia32.cc (revision 4579)
+++ runtime/vm/code_generator_ia32.cc (working copy)
@@ -59,75 +59,6 @@
}
-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) {
- struct PcDesc data;
- data.pc_offset = pc_offset;
- data.kind = kind;
- data.node_id = node_id;
- data.token_index = token_index;
- data.try_index = try_index;
- list_.Add(data);
- }
-
- RawPcDescriptors* FinalizePcDescriptors(uword entry_point) {
- intptr_t num_descriptors = Length();
- const PcDescriptors& descriptors =
- PcDescriptors::Handle(PcDescriptors::New(num_descriptors));
- for (intptr_t i = 0; i < num_descriptors; i++) {
- descriptors.AddDescriptor(i,
- (entry_point + PcOffset(i)),
- Kind(i),
- NodeId(i),
- TokenIndex(i),
- TryIndex(i));
- }
- return descriptors.raw();
- }
-
- private:
- GrowableArray<struct PcDesc> list_;
- DISALLOW_COPY_AND_ASSIGN(DescriptorList);
-};
-
-
class CodeGenerator::HandlerList : public ZoneAllocated {
public:
struct HandlerDesc {
« no previous file with comments | « runtime/vm/code_generator_arm.h ('k') | runtime/vm/code_generator_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698