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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10310132: Remove TuckTemp, PickTemp, use temporary locals instead. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language.cc » ('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 7560)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -1119,9 +1119,7 @@
// | Do <Computation> <Instruction>
// | Return <Value>
// | Branch <Value> <Instruction> <Instruction>
-// <Definition> ::= PickTemp <int> <int> <Instruction>
-// | TuckTemp <int> <int> <Instruction>
-// | Bind <int> <Computation> <Instruction>
+// <Definition> ::= Bind <int> <Computation> <Instruction>
// M is a single argument macro. It is applied to each concrete instruction
// type name. The concrete instruction classes are the name with Instr
@@ -1131,8 +1129,6 @@
M(TargetEntry) \
M(Do) \
M(Bind) \
- M(PickTemp) \
- M(TuckTemp) \
M(Return) \
M(Throw) \
M(ReThrow) \
@@ -1417,74 +1413,6 @@
};
-// The non-optimizing compiler assumes that there is exactly one use of
-// every temporary so they can be deallocated at their use. Some AST nodes,
-// e.g., expr0[expr1]++, violate this assumption (there are two uses of each
-// of the values expr0 and expr1).
-//
-// PickTemp is used to name (with 'destination') a copy of a live temporary
-// (named 'source') without counting as the use of the source.
-class PickTempInstr : public Definition {
- public:
- explicit PickTempInstr(intptr_t source)
- : Definition(), source_(source), successor_(NULL) { }
-
- DECLARE_INSTRUCTION(PickTemp)
-
- intptr_t source() const { return source_; }
-
- virtual Instruction* StraightLineSuccessor() const {
- return successor_;
- }
- virtual void SetSuccessor(Instruction* instr) {
- ASSERT(successor_ == NULL && instr != NULL);
- successor_ = instr;
- }
-
- private:
- const intptr_t source_;
- Instruction* successor_;
-
- DISALLOW_COPY_AND_ASSIGN(PickTempInstr);
-};
-
-
-// The non-optimizing compiler assumes that temporary definitions and uses
-// obey a stack discipline, so they can be allocated and deallocated with
-// push and pop. Some Some AST nodes, e.g., expr++, violate this assumption
-// (the value expr+1 is produced after the value of expr, and also consumed
-// after it).
-//
-// We 'preallocate' temporaries (named with 'destination') such as the one
-// for expr+1 and use TuckTemp to mutate them by overwriting them with a
-// copy of a temporary (named with 'source').
-class TuckTempInstr : public Instruction {
- public:
- TuckTempInstr(intptr_t destination, intptr_t source)
- : destination_(destination), source_(source), successor_(NULL) { }
-
- DECLARE_INSTRUCTION(TuckTemp)
-
- intptr_t destination() const { return destination_; }
- intptr_t source() const { return source_; }
-
- virtual Instruction* StraightLineSuccessor() const {
- return successor_;
- }
- virtual void SetSuccessor(Instruction* instr) {
- ASSERT(successor_ == NULL && instr != NULL);
- successor_ = instr;
- }
-
- private:
- const intptr_t destination_;
- const intptr_t source_;
- Instruction* successor_;
-
- DISALLOW_COPY_AND_ASSIGN(TuckTempInstr);
-};
-
-
class ReturnInstr : public Instruction {
public:
ReturnInstr(intptr_t token_index, Value* value)
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698