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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10806047: Fix crash during parallel moves. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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/il_printer.cc ('k') | runtime/vm/locations.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 9788)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -2379,8 +2379,7 @@
};
-// This class is often passed by value. Add additional fields with caution.
-class MoveOperands : public ValueObject {
+class MoveOperands : public ZoneAllocated {
public:
MoveOperands(Location dest, Location src) : dest_(dest), src_(src) { }
@@ -2390,7 +2389,8 @@
Location* src_slot() { return &src_; }
Location* dest_slot() { return &dest_; }
- void set_src(Location src) { src_ = src; }
+ void set_src(const Location& value) { src_ = value; }
+ void set_dest(const Location& value) { dest_ = value; }
// The parallel move resolver marks moves as "in-progress" by clearing the
// destination (but not the source).
@@ -2432,6 +2432,8 @@
private:
Location dest_;
Location src_;
+
+ DISALLOW_COPY_AND_ASSIGN(MoveOperands);
};
@@ -2443,13 +2445,18 @@
DECLARE_INSTRUCTION(ParallelMove)
void AddMove(Location dest, Location src) {
- moves_.Add(MoveOperands(dest, src));
+ moves_.Add(new MoveOperands(dest, src));
}
- const GrowableArray<MoveOperands>& moves() { return moves_; }
+ MoveOperands* MoveOperandsAt(intptr_t index) const { return moves_[index]; }
+ void SetSrcSlotAt(intptr_t index, const Location& loc);
+ void SetDestSlotAt(intptr_t index, const Location& loc);
+
+ intptr_t NumMoves() const { return moves_.length(); }
+
private:
- GrowableArray<MoveOperands> moves_;
+ GrowableArray<MoveOperands*> moves_; // Elements cannot be null.
DISALLOW_COPY_AND_ASSIGN(ParallelMoveInstr);
};
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/locations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698