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

Side by Side Diff: vm/intermediate_language.h

Issue 10735002: Add support for fixed parameters in SSA builder and fix a bug in the pre-order graph traversal. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « vm/il_printer.cc ('k') | vm/intermediate_language.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_
6 #define VM_INTERMEDIATE_LANGUAGE_H_ 6 #define VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 M(GraphEntry) \ 1700 M(GraphEntry) \
1701 M(JoinEntry) \ 1701 M(JoinEntry) \
1702 M(TargetEntry) \ 1702 M(TargetEntry) \
1703 M(Do) \ 1703 M(Do) \
1704 M(Bind) \ 1704 M(Bind) \
1705 M(Phi) \ 1705 M(Phi) \
1706 M(Return) \ 1706 M(Return) \
1707 M(Throw) \ 1707 M(Throw) \
1708 M(ReThrow) \ 1708 M(ReThrow) \
1709 M(Branch) \ 1709 M(Branch) \
1710 M(ParallelMove) 1710 M(ParallelMove) \
1711 M(Parameter)
1711 1712
1712 1713
1713 // Forward declarations for Instruction classes. 1714 // Forward declarations for Instruction classes.
1714 class BlockEntryInstr; 1715 class BlockEntryInstr;
1715 class FlowGraphBuilder; 1716 class FlowGraphBuilder;
1716 class Environment; 1717 class Environment;
1717 1718
1718 #define FORWARD_DECLARATION(type) class type##Instr; 1719 #define FORWARD_DECLARATION(type) class type##Instr;
1719 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) 1720 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION)
1720 #undef FORWARD_DECLARATION 1721 #undef FORWARD_DECLARATION
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1980 GrowableArray<BlockEntryInstr*>* preorder, 1981 GrowableArray<BlockEntryInstr*>* preorder,
1981 GrowableArray<BlockEntryInstr*>* postorder, 1982 GrowableArray<BlockEntryInstr*>* postorder,
1982 GrowableArray<intptr_t>* parent, 1983 GrowableArray<intptr_t>* parent,
1983 GrowableArray<BitVector*>* assigned_vars, 1984 GrowableArray<BitVector*>* assigned_vars,
1984 intptr_t variable_count); 1985 intptr_t variable_count);
1985 1986
1986 void AddCatchEntry(TargetEntryInstr* entry) { catch_entries_.Add(entry); } 1987 void AddCatchEntry(TargetEntryInstr* entry) { catch_entries_.Add(entry); }
1987 1988
1988 virtual void PrepareEntry(FlowGraphCompiler* compiler); 1989 virtual void PrepareEntry(FlowGraphCompiler* compiler);
1989 1990
1990 ZoneGrowableArray<Value*>* start_env() const { return start_env_; } 1991 Environment* start_env() const { return start_env_; }
1991 void set_start_env(ZoneGrowableArray<Value*>* env) { start_env_ = env; } 1992 void set_start_env(Environment* env) { start_env_ = env; }
1992 1993
1993 private: 1994 private:
1994 TargetEntryInstr* normal_entry_; 1995 TargetEntryInstr* normal_entry_;
1995 GrowableArray<TargetEntryInstr*> catch_entries_; 1996 GrowableArray<TargetEntryInstr*> catch_entries_;
1996 ZoneGrowableArray<Value*>* start_env_; 1997 Environment* start_env_;
1997 1998
1998 DISALLOW_COPY_AND_ASSIGN(GraphEntryInstr); 1999 DISALLOW_COPY_AND_ASSIGN(GraphEntryInstr);
1999 }; 2000 };
2000 2001
2001 2002
2002 class JoinEntryInstr : public BlockEntryInstr { 2003 class JoinEntryInstr : public BlockEntryInstr {
2003 public: 2004 public:
2004 JoinEntryInstr() 2005 JoinEntryInstr()
2005 : BlockEntryInstr(), 2006 : BlockEntryInstr(),
2006 predecessors_(2), // Two is the assumed to be the common case. 2007 predecessors_(2), // Two is the assumed to be the common case.
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
2182 2183
2183 DECLARE_INSTRUCTION(Phi) 2184 DECLARE_INSTRUCTION(Phi)
2184 2185
2185 private: 2186 private:
2186 GrowableArray<Value*> inputs_; 2187 GrowableArray<Value*> inputs_;
2187 2188
2188 DISALLOW_COPY_AND_ASSIGN(PhiInstr); 2189 DISALLOW_COPY_AND_ASSIGN(PhiInstr);
2189 }; 2190 };
2190 2191
2191 2192
2193 class ParameterInstr: public Definition {
2194 public:
2195 explicit ParameterInstr(intptr_t index) : index_(index) { }
2196
2197 intptr_t index() const { return index_; }
2198
2199 DECLARE_INSTRUCTION(Parameter)
2200
2201 private:
2202 intptr_t index_;
2203
2204 DISALLOW_COPY_AND_ASSIGN(ParameterInstr);
2205 };
2206
2207
2192 class ReturnInstr : public InstructionWithInputs { 2208 class ReturnInstr : public InstructionWithInputs {
2193 public: 2209 public:
2194 ReturnInstr(intptr_t token_pos, Value* value) 2210 ReturnInstr(intptr_t token_pos, Value* value)
2195 : InstructionWithInputs(), token_pos_(token_pos), value_(value) { 2211 : InstructionWithInputs(), token_pos_(token_pos), value_(value) {
2196 ASSERT(value_ != NULL); 2212 ASSERT(value_ != NULL);
2197 } 2213 }
2198 2214
2199 DECLARE_INSTRUCTION(Return) 2215 DECLARE_INSTRUCTION(Return)
2200 2216
2201 Value* value() const { return value_; } 2217 Value* value() const { return value_; }
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
2420 const GrowableArray<BlockEntryInstr*>& block_order_; 2436 const GrowableArray<BlockEntryInstr*>& block_order_;
2421 2437
2422 private: 2438 private:
2423 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 2439 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
2424 }; 2440 };
2425 2441
2426 2442
2427 } // namespace dart 2443 } // namespace dart
2428 2444
2429 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 2445 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « vm/il_printer.cc ('k') | vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698