OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 #ifdef DEBUG | 194 #ifdef DEBUG |
195 virtual void Print() = 0; | 195 virtual void Print() = 0; |
196 #endif | 196 #endif |
197 }; | 197 }; |
198 | 198 |
199 | 199 |
200 // Effect is a special (singleton) location that indicates the value of a | 200 // Effect is a special (singleton) location that indicates the value of a |
201 // computation is not needed (though its side effects are). | 201 // computation is not needed (though its side effects are). |
202 class Effect : public Location { | 202 class Effect : public Location { |
203 public: | 203 public: |
204 // We should not try to emit code to read or write to Effect. | 204 // We should not try to emit code to read Effect. |
205 void Get(MacroAssembler* masm, Register reg) { UNREACHABLE(); } | 205 void Get(MacroAssembler* masm, Register reg) { UNREACHABLE(); } |
206 void Set(MacroAssembler* masm, Register reg) { UNREACHABLE(); } | |
207 void Push(MacroAssembler* masm) { UNREACHABLE(); } | 206 void Push(MacroAssembler* masm) { UNREACHABLE(); } |
208 | 207 |
| 208 // Setting Effect is ignored. |
| 209 void Set(MacroAssembler* masm, Register reg) {} |
| 210 |
209 #ifdef DEBUG | 211 #ifdef DEBUG |
210 void Print(); | 212 void Print(); |
211 #endif | 213 #endif |
212 | 214 |
213 private: | 215 private: |
214 Effect() {} | 216 Effect() {} |
215 | 217 |
216 friend class CfgGlobals; | 218 friend class CfgGlobals; |
217 }; | 219 }; |
218 | 220 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 class Instruction : public ZoneObject { | 306 class Instruction : public ZoneObject { |
305 public: | 307 public: |
306 // Every instruction has a location where its result is stored (which may | 308 // Every instruction has a location where its result is stored (which may |
307 // be Effect). | 309 // be Effect). |
308 explicit Instruction(Location* loc) : loc_(loc) {} | 310 explicit Instruction(Location* loc) : loc_(loc) {} |
309 | 311 |
310 virtual ~Instruction() {} | 312 virtual ~Instruction() {} |
311 | 313 |
312 // Accessors. | 314 // Accessors. |
313 Location* location() { return loc_; } | 315 Location* location() { return loc_; } |
| 316 void set_location(Location* loc) { loc_ = loc; } |
314 | 317 |
315 // Support for fast-compilation mode: | 318 // Support for fast-compilation mode: |
316 | 319 |
317 // Emit code to perform the instruction. | 320 // Emit code to perform the instruction. |
318 virtual void Compile(MacroAssembler* masm) = 0; | 321 virtual void Compile(MacroAssembler* masm) = 0; |
319 | 322 |
320 // Allocate a temporary which is the result of the immediate predecessor | 323 // Allocate a temporary which is the result of the immediate predecessor |
321 // instruction. It is allocated to the accumulator register if it is used | 324 // instruction. It is allocated to the accumulator register if it is used |
322 // as an operand to this instruction, otherwise to the stack. | 325 // as an operand to this instruction, otherwise to the stack. |
323 virtual void FastAllocate(TempLocation* temp) = 0; | 326 virtual void FastAllocate(TempLocation* temp) = 0; |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 #undef DECLARE_VISIT | 629 #undef DECLARE_VISIT |
627 | 630 |
628 private: | 631 private: |
629 Cfg* cfg_; | 632 Cfg* cfg_; |
630 }; | 633 }; |
631 | 634 |
632 | 635 |
633 } } // namespace v8::internal | 636 } } // namespace v8::internal |
634 | 637 |
635 #endif // V8_CFG_H_ | 638 #endif // V8_CFG_H_ |
OLD | NEW |