CACAO
Instructions.hpp
Go to the documentation of this file.
1 /* src/vm/jit/compiler2/Instructions.hpp - Instructions
2 
3  Copyright (C) 2013
4  CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5 
6  This file is part of CACAO.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2, or (at
11  your option) any later version.
12 
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  02110-1301, USA.
22 
23 */
24 
25 /**
26  * This file contains the Instruction class.
27  * The Instruction class is the base class for all other instruction types.
28  * They are defined in Instructions.hpp.
29  */
30 
31 #ifndef _JIT_COMPILER2_INSTRUCTIONS
32 #define _JIT_COMPILER2_INSTRUCTIONS
33 
38 #include "vm/types.hpp"
39 
40 namespace cacao {
41 namespace jit {
42 namespace compiler2 {
43 
44 
45 // Instruction groups
46 class LoadInst : public Instruction {
47 public:
48  explicit LoadInst(InstID id, Type::TypeID type, BeginInst *begin) : Instruction(id, type, begin) {}
49  virtual bool is_floating() const { return false; }
50 };
51 
52 class UnaryInst : public Instruction {
53 public:
54  explicit UnaryInst(InstID id, Type::TypeID type, Value* S1) : Instruction(id, type) {
55  append_op(S1);
56  }
57  virtual UnaryInst* to_UnaryInst() { return this; }
58 };
59 
60 /**
61  * Binary Instruction. Not a real instruction. For convenience only.
62  *
63  * @note Idea: create a ArithmeticInst superclass which features a method
64  * e.g. simplify() which returns the result of the operands if they are
65  * constants.
66  */
67 class BinaryInst : public Instruction {
68 public:
69  explicit BinaryInst(InstID id, Type::TypeID type, Value* S1, Value* S2) : Instruction(id, type) {
70  append_op(S1);
71  append_op(S2);
72  }
73  virtual BinaryInst* to_BinaryInst() { return this; }
74 };
75 
76 class MultiOpInst : public Instruction {
77 public:
78  explicit MultiOpInst(InstID id, Type::TypeID type) : Instruction(id, type) {}
79 
80  // exporting to the public
83 };
84 
85 /**
86  * TODO not a real Instruction... hmm
87  */
88 class CondInst {
89 protected:
91 public:
92  explicit CondInst(Conditional::CondID cond) : cond(cond){}
94 };
95 
96 
97 /**
98  * This Instruction mark the start of a basic block
99  */
100 class BeginInst : public Instruction {
101 public:
103  typedef PredecessorListTy::const_iterator const_pred_iterator;
104 private:
107 
109  pred_list[index] = BI;
110  }
111  void set_successor(int index, BeginInst *BI);
112 
113 public:
114  explicit BeginInst() : Instruction(BeginInstID, Type::VoidTypeID) {
115  end = NULL;
116  }
117  explicit BeginInst(EndInst *end) : Instruction(BeginInstID, Type::VoidTypeID), end(end) {}
118  virtual BeginInst* to_BeginInst() { return this; }
119  virtual BeginInst *get_BeginInst() const { return const_cast<BeginInst*>(this); }
120  int get_predecessor_index(const BeginInst* BI) const {
121  if (BI) {
122  int index = 0;
123  for (PredecessorListTy::const_iterator i = pred_list.begin(),
124  e = pred_list.end(); i != e; ++i) {
125  if (BI == (*i)) {
126  return index;
127  }
128  index++;
129  }
130  }
131  return -1;
132  }
134  if (index < 0 || (unsigned)index > pred_size()) {
135  return NULL;
136  }
137  PredecessorListTy::const_iterator i = pred_list.begin();
138  while(index--) {
139  ++i;
140  }
141  assert(i != pred_list.end());
142  return *i;
143  }
144  int get_successor_index(const BeginInst* BI) const;
145 
146  EndInst *get_EndInst() const { return end; }
147  void set_EndInst(EndInst* e) { end = e; }
148  virtual bool is_floating() const { return false; }
149 
150  const_pred_iterator pred_begin() const { return pred_list.begin(); }
151  const_pred_iterator pred_end() const { return pred_list.end(); }
152  std::size_t pred_size() const { return pred_list.size(); }
153 
154  friend class EndInst;
155  friend class Method;
156  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
157 };
158 
159 /**
160  * this stores a reference to a begin instruction
161  */
163 private:
165 public:
166  // constructor
167  explicit BeginInstRef(BeginInst* BI) : begin(BI) {}
168  /// copy constructor
169  BeginInstRef(const BeginInstRef &other) : begin(other.begin) {}
170  /// copy assignment operator
172  begin = other.begin;
173  return (*this);
174  }
175  // assign BeginInst
177  begin = BI;
178  return (*this);
179  }
180  // conversion
181  operator BeginInst*() {
182  return begin;
183  }
184  // getter
185  BeginInst* get() const {
186  return begin;
187  }
188 };
189 
190 inline OStream& operator<<(OStream &OS, const BeginInstRef &BIR) {
191  return OS << BIR.get();
192 }
193 
194 /**
195  * This Instruction mark the end of a basic block
196  */
197 class EndInst : public Instruction {
198 public:
200  typedef SuccessorListTy::const_iterator succ_const_iterator;
201  typedef SuccessorListTy::const_reverse_iterator succ_const_reverse_iterator;
202 private:
205  succ_list[index] = BI;
206  }
207 public:
208  explicit EndInst(BeginInst* begin) : Instruction(EndInstID, Type::VoidTypeID, begin) {
209  assert(begin);
210  begin->set_EndInst(this);
211  }
212  explicit EndInst(InstID id, BeginInst* begin) : Instruction(id, Type::VoidTypeID, begin) {
213  assert(begin);
214  begin->set_EndInst(this);
215  }
216  virtual EndInst* to_EndInst() { return this; }
217  virtual bool is_floating() const { return false; }
218 
219  void append_succ(BeginInst* bi) {
220  assert(bi);
221  succ_list.push_back(BeginInstRef(bi));
222  assert(begin);
223  bi->pred_list.push_back(begin);
224  }
225  #if 0
226  void replace_succ(BeginInst* s_old, BeginInst* s_new) {
227  assert(s_new);
228  // replace the successor of this EndInst with the new block s_new
229  std::replace(succ_list.begin(), succ_list.end(), s_old, s_new);
230  // update pred link of the new BeginInst
231  assert(begin);
232  s_new->pred_list.push_back(begin);
233 
234  // remove the predecessor of s_old
235  s_old->pred_list.remove(begin);
236  }
237  #endif
238  int get_successor_index(const BeginInst* BI) const {
239  if (BI) {
240  int index = 0;
241  for (SuccessorListTy::const_iterator i = succ_list.begin(),
242  e = succ_list.end(); i != e; ++i) {
243  if (BI == i->get()) {
244  return index;
245  }
246  index++;
247  }
248  }
249  return -1;
250  }
251  SuccessorListTy::const_iterator succ_begin() const { return succ_list.begin(); }
252  SuccessorListTy::const_iterator succ_end() const { return succ_list.end(); }
253  SuccessorListTy::const_reverse_iterator succ_rbegin() const { return succ_list.rbegin(); }
254  SuccessorListTy::const_reverse_iterator succ_rend() const { return succ_list.rend(); }
255  BeginInstRef &succ_front() { return succ_list.front(); }
256  BeginInstRef &succ_back() { return succ_list.back(); }
257  size_t succ_size() const { return succ_list.size(); }
258 
260  assert(i < succ_size());
261  return succ_list[i];
262  }
263 
264  friend class BeginInst;
265  friend class Method;
266  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
267 };
268 
269 inline int BeginInst::get_successor_index(const BeginInst* BI) const {
270  return get_EndInst()->get_successor_index(BI);
271 }
273  get_EndInst()->set_successor(index,BI);
274 }
275 
276 // Instructions
277 
278 class NOPInst : public Instruction {
279 public:
280  explicit NOPInst() : Instruction(NOPInstID, Type::VoidTypeID) {}
281  virtual NOPInst* to_NOPInst() { return this; }
282  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
283 };
284 
285 class POPInst : public Instruction {
286 public:
288  virtual POPInst* to_POPInst() { return this; }
289  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
290 };
291 
292 class CHECKNULLInst : public Instruction {
293 public:
295  virtual CHECKNULLInst* to_CHECKNULLInst() { return this; }
296  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
297 };
298 
299 class ARRAYLENGTHInst : public UnaryInst {
300 public:
301  explicit ARRAYLENGTHInst(Value *S1) : UnaryInst(ARRAYLENGTHInstID, Type::IntTypeID, S1) {}
302  virtual ARRAYLENGTHInst* to_ARRAYLENGTHInst() { return this; }
303  virtual bool is_homogeneous() const { return false; }
304  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
305 };
306 
307 class NEGInst : public UnaryInst {
308 public:
309  explicit NEGInst(Type::TypeID type,Value *S1) : UnaryInst(NEGInstID, type, S1) {}
310  virtual NEGInst* to_NEGInst() { return this; }
311  virtual bool is_arithmetic() const { return true; }
312  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
313 };
314 
315 class CASTInst : public UnaryInst {
316 public:
318  : UnaryInst(CASTInstID, type, s1) {
319  }
320  virtual CASTInst* to_CASTInst() { return this; }
321  virtual bool is_homogeneous() const { return false; }
322  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
323 };
324 
325 class ADDInst : public BinaryInst {
326 public:
327  explicit ADDInst(Type::TypeID type, Value* S1, Value* S2) : BinaryInst(ADDInstID, type, S1, S2) {}
328  virtual ADDInst* to_ADDInst() { return this; }
329  virtual bool is_arithmetic() const { return true; }
330  virtual bool is_commutable() const { return true; }
331  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
332 };
333 
334 class SUBInst : public BinaryInst{
335 public:
336  explicit SUBInst(Type::TypeID type, Value* S1, Value* S2) : BinaryInst(SUBInstID, type, S1, S2) {}
337  virtual SUBInst* to_SUBInst() { return this; }
338  virtual bool is_arithmetic() const { return true; }
339  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
340 };
341 
342 class MULInst : public BinaryInst {
343 public:
344  explicit MULInst(Type::TypeID type, Value* S1, Value* S2) : BinaryInst(MULInstID, type, S1, S2) {}
345  virtual MULInst* to_MULInst() { return this; }
346  virtual bool is_arithmetic() const { return true; }
347  virtual bool is_commutable() const { return true; }
348  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
349 };
350 
351 class DIVInst : public BinaryInst {
352 public:
353  explicit DIVInst(Type::TypeID type, Value* S1, Value* S2) : BinaryInst(DIVInstID, type, S1, S2) {}
354  virtual DIVInst* to_DIVInst() { return this; }
355  virtual bool is_arithmetic() const { return true; }
356  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
357 };
358 
359 class REMInst : public BinaryInst {
360 public:
361  explicit REMInst(Type::TypeID type, Value* S1, Value* S2) : BinaryInst(REMInstID, type, S1, S2) {}
362  virtual REMInst* to_REMInst() { return this; }
363  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
364 };
365 
366 class SHLInst : public Instruction {
367 public:
369  virtual SHLInst* to_SHLInst() { return this; }
370  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
371 };
372 
373 class USHRInst : public Instruction {
374 public:
376  virtual USHRInst* to_USHRInst() { return this; }
377  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
378 };
379 
380 class ANDInst : public BinaryInst {
381 public:
382  explicit ANDInst(Type::TypeID type, Value* S1, Value* S2) : BinaryInst(ANDInstID, type, S1, S2) {}
383  virtual ANDInst* to_ANDInst() { return this; }
384  virtual bool is_commutable() const { return true; }
385  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
386 };
387 
388 class ORInst : public BinaryInst {
389 public:
390  explicit ORInst(Type::TypeID type, Value* S1, Value* S2) : BinaryInst(ORInstID, type, S1, S2) {}
391  virtual ORInst* to_ORInst() { return this; }
392  virtual bool is_commutable() const { return true; }
393  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
394 };
395 
396 class XORInst : public BinaryInst {
397 public:
398  explicit XORInst(Type::TypeID type, Value* S1, Value* S2) : BinaryInst(XORInstID, type, S1, S2) {}
399  virtual XORInst* to_XORInst() { return this; }
400  virtual bool is_commutable() const { return true; }
401  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
402 };
403 
404 class CMPInst : public BinaryInst {
405 public:
407  G,
408  L,
410  };
411  explicit CMPInst(Value* S1, Value* S2, FloatHandling f) : BinaryInst(CMPInstID, Type::IntTypeID, S1, S2), f(f) {}
412  virtual CMPInst* to_CMPInst() { return this; }
413  virtual bool is_homogeneous() const { return false; }
414  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
415  FloatHandling get_FloatHandling() const { return f; }
416 private:
418 };
419 
420 class CONSTInst : public Instruction {
421 private:
422  typedef union {
423  int32_t i;
424  int64_t l;
425  float f;
426  double d;
427  void *anyptr;
428  java_handle_t *stringconst; /* for ACONST with string */
429  classref_or_classinfo c; /* for ACONST with class */
430  } val_operand_t;
432 public:
433  explicit CONSTInst(int32_t i,Type::IntType) : Instruction(CONSTInstID, Type::IntTypeID) {
434  value.i = i;
435  }
436  explicit CONSTInst(int64_t l,Type::LongType) : Instruction(CONSTInstID, Type::LongTypeID) {
437  value.l = l;
438  }
439  explicit CONSTInst(float f,Type::FloatType) : Instruction(CONSTInstID, Type::FloatTypeID) {
440  value.f = f;
441  }
442  explicit CONSTInst(double d,Type::DoubleType) : Instruction(CONSTInstID, Type::DoubleTypeID) {
443  value.d = d;
444  }
445  virtual CONSTInst* to_CONSTInst() { return this; }
446 
447  /**
448  * @bug this does not what one might expect! Do not use!
449  */
450  s8 get_value() const {
451  switch(get_type()) {
452  case Type::LongTypeID: return (s8)value.l;
453  case Type::IntTypeID: return (s8)value.i;
454  case Type::FloatTypeID: return (s8)value.f;
455  case Type::DoubleTypeID: return (s8)value.d;
456  default: assert(0); return 0;
457  }
458  return 0;
459  }
460  int32_t get_Int() const {
461  assert(get_type() == Type::IntTypeID);
462  return value.i;
463  }
464  int64_t get_Long() const {
465  assert(get_type() == Type::LongTypeID);
466  return value.l;
467  }
468  float get_Float() const {
469  assert(get_type() == Type::FloatTypeID);
470  return value.f;
471  }
472  double get_Double() const {
473  assert(get_type() == Type::DoubleTypeID);
474  return value.d;
475  }
476  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
477  virtual OStream& print(OStream& OS) const {
478  Instruction::print(OS);
479  switch(get_type()){
480  case Type::IntTypeID: return OS << " = " << get_Int();
481  case Type::LongTypeID: return OS << " = " << get_Long();
482  case Type::FloatTypeID: return OS << " = " << get_Float();
483  case Type::DoubleTypeID: return OS << " = " << get_Double();
484  default: break;
485  }
486  return OS;
487  }
488 };
489 
490 class GETFIELDInst : public Instruction {
491 public:
493  virtual GETFIELDInst* to_GETFIELDInst() { return this; }
494  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
495 };
496 
497 class PUTFIELDInst : public Instruction {
498 public:
500  virtual PUTFIELDInst* to_PUTFIELDInst() { return this; }
501  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
502 };
503 
504 class PUTSTATICInst : public Instruction {
505 private:
507  bool resolved;
508 public:
509  /**
510  * @param resolved This _should_ not change during compilation
511  */
513  BeginInst* begin, Instruction *state_change)
514  : Instruction(PUTSTATICInstID, value->get_type()), fmiref(fmiref), resolved(resolved) {
515  append_op(value);
516  append_dep(begin);
517  append_dep(state_change);
518  }
519  virtual BeginInst* get_BeginInst() const {
521  assert(begin);
522  return begin;
523  }
524  virtual bool has_side_effects() const { return true; }
525  virtual bool is_floating() const { return false; }
526  virtual PUTSTATICInst* to_PUTSTATICInst() { return this; }
527  bool is_resolved() const { return resolved; }
528  constant_FMIref* get_fmiref() const { return fmiref; }
529  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
530 };
531 
532 class GETSTATICInst : public Instruction {
533 private:
535  bool resolved;
536 public:
537  /**
538  * @param resolved This _should_ not change during compilation
539  */
541  BeginInst *begin, Instruction *state_change)
542  : Instruction(GETSTATICInstID, type), fmiref(fmiref), resolved(resolved) {
543  append_dep(begin);
544  append_dep(state_change);
545  }
546  virtual BeginInst* get_BeginInst() const {
548  assert(begin);
549  return begin;
550  }
551  virtual bool has_side_effects() const { return true; }
552  virtual bool is_floating() const { return false; }
553  virtual GETSTATICInst* to_GETSTATICInst() { return this; }
554  bool is_resolved() const { return resolved; }
555  constant_FMIref* get_fmiref() const { return fmiref; }
556  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
557 };
558 
559 class INCInst : public Instruction {
560 public:
562  virtual INCInst* to_INCInst() { return this; }
563  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
564 };
565 
566 class AREFInst : public Instruction {
567 public:
569  : Instruction(AREFInstID, type) {
570  assert(ref->get_type() == Type::ReferenceTypeID);
571  assert(index->get_type() == Type::IntTypeID);
572  append_op(ref);
573  append_op(index);
574  }
575  virtual AREFInst* to_AREFInst() { return this; }
576  virtual bool is_homogeneous() const { return false; }
577  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
578 };
579 
580 class ASTOREInst : public Instruction {
581 public:
582  explicit ASTOREInst(Type::TypeID type, Value* ref, Value* value,
583  BeginInst *begin, Instruction *state_change)
584  : Instruction(ASTOREInstID, Type::VoidTypeID) {
585  append_op(ref);
586  append_op(value);
587  append_dep(begin);
588  append_dep(state_change);
589  }
590  virtual ASTOREInst* to_ASTOREInst() { return this; }
591  virtual bool is_homogeneous() const { return false; }
592  virtual bool has_side_effects() const { return true; }
593  virtual BeginInst* get_BeginInst() const {
595  assert(begin);
596  return begin;
597  }
598  virtual bool is_floating() const { return false; }
599  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
601  return this->op_back()->get_type();
602  }
603 };
604 
605 class ALOADInst : public Instruction {
606 public:
607  explicit ALOADInst(Type::TypeID type, Value* ref,
608  BeginInst *begin, Instruction *state_change)
609  : Instruction(ALOADInstID, type) {
610  append_op(ref);
611  append_dep(begin);
612  append_dep(state_change);
613  }
614  virtual ALOADInst* to_ALOADInst() { return this; }
615  virtual bool is_homogeneous() const { return false; }
616  virtual BeginInst* get_BeginInst() const {
617  assert(dep_size() > 0);
618  return dep_front()->to_BeginInst();
619  }
620  virtual bool is_floating() const { return false; }
621  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
622 };
623 
625 public:
627  : BinaryInst(ARRAYBOUNDSCHECKInstID, Type::VoidTypeID, ref, index) {
628  assert(ref->get_type() == Type::ReferenceTypeID);
629  assert(index->get_type() == Type::IntTypeID);
630  }
631  virtual ARRAYBOUNDSCHECKInst* to_ARRAYBOUNDSCHECKInst() { return this; }
632  virtual bool is_homogeneous() const { return false; }
633  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
634 };
635 
636 class RETInst : public Instruction {
637 public:
639  virtual RETInst* to_RETInst() { return this; }
640  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
641 };
642 
643 class LOADInst : public LoadInst {
644 private:
645  unsigned index;
646 public:
647  explicit LOADInst(Type::TypeID type, unsigned index, BeginInst* begin ) : LoadInst(LOADInstID, type, begin), index(index) {}
648  virtual LOADInst* to_LOADInst() { return this; }
649  unsigned get_index() const { return index; }
650  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
651 };
652 
653 class STOREInst : public Instruction {
654 public:
656  virtual STOREInst* to_STOREInst() { return this; }
657  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
658 };
659 
660 class NEWInst : public Instruction {
661 public:
663  virtual NEWInst* to_NEWInst() { return this; }
664  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
665 };
666 
667 class NEWARRAYInst : public Instruction {
668 public:
670  virtual NEWARRAYInst* to_NEWARRAYInst() { return this; }
671  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
672 };
673 
674 class ANEWARRAYInst : public Instruction {
675 public:
677  virtual ANEWARRAYInst* to_ANEWARRAYInst() { return this; }
678  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
679 };
680 
682 public:
684  virtual MULTIANEWARRAYInst* to_MULTIANEWARRAYInst() { return this; }
685  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
686 };
687 
688 class CHECKCASTInst : public Instruction {
689 public:
691  virtual CHECKCASTInst* to_CHECKCASTInst() { return this; }
692  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
693 };
694 
695 class INSTANCEOFInst : public Instruction {
696 public:
698  virtual INSTANCEOFInst* to_INSTANCEOFInst() { return this; }
699  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
700 };
701 
702 class GOTOInst : public EndInst {
703 private:
704  /**
705  * @note this is for expert use only.
706  * You will have to adjust the successor (and the backlink) manually.
707  */
709  : EndInst(GOTOInstID, begin) {}
710 public:
711  explicit GOTOInst(BeginInst *begin, BeginInst* targetBlock)
712  : EndInst(GOTOInstID, begin) {
713  append_succ(targetBlock);
714  }
715  virtual GOTOInst* to_GOTOInst() { return this; }
717  return succ_front();
718  }
719  friend class Method;
720  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
721 };
722 
723 class JSRInst : public Instruction {
724 public:
726  virtual JSRInst* to_JSRInst() { return this; }
727  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
728 };
729 
730 class BUILTINInst : public Instruction {
731 public:
733  virtual BUILTINInst* to_BUILTINInst() { return this; }
734  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
735 };
736 
738 public:
740  virtual INVOKEVIRTUALInst* to_INVOKEVIRTUALInst() { return this; }
741  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
742 };
743 
745 public:
747  virtual INVOKESPECIALInst* to_INVOKESPECIALInst() { return this; }
748  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
749 };
750 
752 private:
755  bool resolved;
756 public:
758  constant_FMIref *fmiref, bool resolved, BeginInst *begin, Instruction *state_change)
759  : MultiOpInst(INVOKESTATICInstID, type), MD(size),
760  fmiref(fmiref), resolved(resolved) {
761  assert(state_change && state_change->get_name());
762  append_dep(begin);
763  append_dep(state_change);
764  }
765  virtual BeginInst* get_BeginInst() const {
767  assert(begin);
768  return begin;
769  }
770  virtual bool has_side_effects() const { return true; }
771  virtual bool is_floating() const { return false; }
773  std::size_t i = op_size();
774  assert(i < MD.size());
775  MD[i] = V->get_type();
776  append_op(V);
777  }
779  assert(MD.size() == op_size());
780  return MD;
781  }
782  bool is_resolved() const { return resolved; }
783  constant_FMIref* get_fmiref() const { return fmiref; }
784  virtual INVOKESTATICInst* to_INVOKESTATICInst() { return this; }
785  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
786 };
787 
789 public:
791  virtual INVOKEINTERFACEInst* to_INVOKEINTERFACEInst() { return this; }
792  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
793 };
794 
795 class IFInst : public EndInst, public CondInst {
796 public:
798  BeginInst* trueBlock, BeginInst* falseBlock)
799  : EndInst(IFInstID, begin), CondInst(cond) {
800  append_op(S1);
801  append_op(S2);
802  append_succ(trueBlock);
803  append_succ(falseBlock);
804  assert(S1->get_type() == S2->get_type());
805  set_type(S1->get_type());
806  }
807  virtual IFInst* to_IFInst() { return this; }
810  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
811 };
812 
813 class IF_CMPInst : public Instruction {
814 public:
816  virtual IF_CMPInst* to_IF_CMPInst() { return this; }
817  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
818 };
819 
820 class TABLESWITCHInst : public EndInst {
821 private:
824 public:
825  /// wrapper for type safety
826  struct LOW {
828  explicit LOW(s4 low) : low(low) {}
829  };
830  /// wrapper for type safety
831  struct HIGH {
833  explicit HIGH(s4 high) : high(high) {}
834  };
835  /// constructor
836  explicit TABLESWITCHInst(BeginInst *begin, Value* S1, LOW low, HIGH high)
837  : EndInst(TABLESWITCHInstID, begin), tablelow(low.low), tablehigh(high.high) {
838  assert(tablehigh >= tablelow);
839  append_op(S1);
841  }
842 
843  s4 get_low() const { return tablelow; }
844  s4 get_high() const { return tablehigh; }
845  virtual TABLESWITCHInst* to_TABLESWITCHInst() { return this; }
846  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
847 
848  virtual bool verify() const {
849  if (tablehigh < tablelow ) {
850  ERROR_MSG("TABLESWITCH verification error","tablehigh ("<<tablehigh
851  << ") is greater then tablelow ("<< tablelow << ")");
852  return false;
853  }
854  if (succ_size() != std::size_t(tablehigh - tablelow + 1 + 1)) {
855  ERROR_MSG("TABLESWITCH verification error","Number of successors (" << succ_size()
856  << ") not equal to targets (" << tablehigh - tablelow +1 << ")");
857  return false;
858  }
859  return Instruction::verify();
860  }
861 };
862 
863 class LOOKUPSWITCHInst : public EndInst {
864 public:
866  typedef MatchTy::iterator match_iterator;
867 private:
870 public:
871  /// wrapper for type safety
872  struct MATCH {
874  explicit MATCH(s4 match) : match(match) {}
875  };
877  : EndInst(LOOKUPSWITCHInstID, begin), lookupcount(lookupcount), matches(lookupcount) {
878  append_op(S1);
880  }
881  virtual LOOKUPSWITCHInst* to_LOOKUPSWITCHInst() { return this; }
882  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
883  void set_match(s4 index, MATCH match) {
884  assert(index >= 0 && index < lookupcount);
885  matches[index] = match.match;
886  }
888  return matches[index];
889  }
891  return matches.begin();
892  }
894  return matches.end();
895  }
896  virtual bool verify() const {
897  if ( lookupcount < 0) {
898  ERROR_MSG("LOOKUPSWITCH verification error","Lookup count is negative ("
899  << lookupcount << ")");
900  return false;
901  }
902  if (succ_size() != std::size_t(lookupcount + 1)) {
903  ERROR_MSG("LOOKUPSWITCH verification error","Number of successors (" << succ_size()
904  << ") not equal to targets (" << lookupcount + 1 << ")");
905  return false;
906  }
907  return Instruction::verify();
908  }
909 };
910 
911 class RETURNInst : public EndInst {
912 public:
913  /// void return
915  /// value return
916  explicit RETURNInst(BeginInst *begin, Value* S1) : EndInst(RETURNInstID, begin) {
917  append_op(S1);
918  set_type(S1->get_type());
919  }
920  virtual RETURNInst* to_RETURNInst() { return this; }
921  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
922 };
923 
924 class THROWInst : public Instruction {
925 public:
927  virtual THROWInst* to_THROWInst() { return this; }
928  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
929 };
930 
931 class COPYInst : public Instruction {
932 public:
934  virtual COPYInst* to_COPYInst() { return this; }
935  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
936 };
937 
938 class MOVEInst : public Instruction {
939 public:
941  virtual MOVEInst* to_MOVEInst() { return this; }
942  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
943 };
944 
946 public:
948  virtual GETEXCEPTIONInst* to_GETEXCEPTIONInst() { return this; }
949  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
950 };
951 
952 class PHIInst : public MultiOpInst {
953 public:
955  append_dep(begin);
956  }
957  virtual PHIInst* to_PHIInst() { return this; }
958 
959  virtual BeginInst* get_BeginInst() const {
961  assert(begin);
962  return begin;
963  }
964  virtual bool is_floating() const { return false; }
965 
966  // exporting to the public
968  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
969 };
970 
971 class ContainerInst : public Instruction {
972 public:
974  append_dep(begin);
975  }
976  virtual ContainerInst* to_ContainerInst() { return this; }
977 
978  virtual BeginInst* get_BeginInst() const {
980  assert(begin);
981  return begin;
982  }
983  virtual bool is_floating() const { return false; }
984  virtual void accept(InstructionVisitor& v, bool copyOperands) { v.visit(this, copyOperands); }
985 };
986 
987 } // end namespace compiler2
988 } // end namespace jit
989 } // end namespace cacao
990 
991 #endif /* _JIT_COMPILER2_INSTRUCTIONS */
992 
993 
994 /*
995  * These are local overrides for various environment variables in Emacs.
996  * Please do not remove this and leave it at the end of the file, where
997  * Emacs will automagically detect them.
998  * ---------------------------------------------------------------------
999  * Local variables:
1000  * mode: c++
1001  * indent-tabs-mode: t
1002  * c-basic-offset: 4
1003  * tab-width: 4
1004  * End:
1005  * vim:noexpandtab:sw=4:ts=4:
1006  */
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
PHIInst(Type::TypeID type, BeginInst *begin)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_arithmetic() const
True if the instruction is an arithmetic instruction.
virtual AREFInst * to_AREFInst()
CONSTInst(double d, Type::DoubleType)
BeginInstRef & get_else_target()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
std::size_t index
virtual bool has_side_effects() const
True the instruction has side effects.
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
virtual CASTInst * to_CASTInst()
virtual OStream & print(OStream &OS) const
print
Definition: Instruction.cpp:43
virtual JSRInst * to_JSRInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_commutable() const
True if the operands of the instruction are commutable.
virtual INVOKEINTERFACEInst * to_INVOKEINTERFACEInst()
virtual INVOKESPECIALInst * to_INVOKESPECIALInst()
virtual IF_CMPInst * to_IF_CMPInst()
virtual INVOKESTATICInst * to_INVOKESTATICInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
BeginInst * get_predecessor(int index) const
XORInst(Type::TypeID type, Value *S1, Value *S2)
CondInst(Conditional::CondID cond)
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
virtual IFInst * to_IFInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual BUILTINInst * to_BUILTINInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
CMPInst(Value *S1, Value *S2, FloatHandling f)
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
virtual INSTANCEOFInst * to_INSTANCEOFInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_arithmetic() const
True if the instruction is an arithmetic instruction.
virtual GETEXCEPTIONInst * to_GETEXCEPTIONInst()
Type::TypeID get_type() const
get the value type of the instruction
Definition: Value.hpp:68
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
NEGInst(Type::TypeID type, Value *S1)
virtual MULInst * to_MULInst()
PredecessorListTy::const_iterator const_pred_iterator
virtual SHLInst * to_SHLInst()
virtual BinaryInst * to_BinaryInst()
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
const char * get_name() const
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
BeginInstRef(const BeginInstRef &other)
copy constructor
int get_successor_index(const BeginInst *BI) const
This Instruction mark the start of a basic block.
virtual GETFIELDInst * to_GETFIELDInst()
This Instruction mark the end of a basic block.
const_dep_iterator dep_begin() const
TABLESWITCHInst(BeginInst *begin, Value *S1, LOW low, HIGH high)
constructor
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
BeginInstRef & operator=(BeginInst *BI)
virtual CMPInst * to_CMPInst()
UnaryInst(InstID id, Type::TypeID type, Value *S1)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
PUTSTATICInst(Value *value, constant_FMIref *fmiref, bool resolved, BeginInst *begin, Instruction *state_change)
virtual XORInst * to_XORInst()
void set_successor(int index, BeginInst *BI)
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
ADDInst(Type::TypeID type, Value *S1, Value *S2)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
IFInst(BeginInst *begin, Value *S1, Value *S2, Conditional::CondID cond, BeginInst *trueBlock, BeginInst *falseBlock)
BeginInstRef & operator=(const BeginInstRef &other)
copy assignment operator
virtual ALOADInst * to_ALOADInst()
LoadInst(InstID id, Type::TypeID type, BeginInst *begin)
virtual UnaryInst * to_UnaryInst()
virtual bool verify() const
check if the instruction is in a correct state
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
alloc::vector< BeginInstRef >::type SuccessorListTy
virtual CHECKNULLInst * to_CHECKNULLInst()
CONSTInst(int64_t l, Type::LongType)
#define ERROR_MSG(EXPR_SHORT, EXPR_LONG)
Definition: logging.hpp:124
int get_successor_index(const BeginInst *BI) const
virtual ARRAYLENGTHInst * to_ARRAYLENGTHInst()
GOTOInst(BeginInst *begin, BeginInst *targetBlock)
virtual MOVEInst * to_MOVEInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
const_pred_iterator pred_begin() const
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
int64_t s8
Definition: types.hpp:48
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual CONSTInst * to_CONSTInst()
virtual PHIInst * to_PHIInst()
virtual INVOKEVIRTUALInst * to_INVOKEVIRTUALInst()
constant_FMIref * get_fmiref() const
ALOADInst(Type::TypeID type, Value *ref, BeginInst *begin, Instruction *state_change)
JNIEnv jthread jobject jclass jlong size
Definition: jvmti.h:387
virtual INCInst * to_INCInst()
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
EndInst(InstID id, BeginInst *begin)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
SuccessorListTy::const_reverse_iterator succ_rbegin() const
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
this stores a reference to a begin instruction
virtual ORInst * to_ORInst()
REMInst(Type::TypeID type, Value *S1, Value *S2)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
SuccessorListTy::const_reverse_iterator succ_rend() const
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
SuccessorListTy::const_iterator succ_end() const
CONSTInst(float f, Type::FloatType)
virtual THROWInst * to_THROWInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool verify() const
check if the instruction is in a correct state
Definition: Instruction.cpp:82
int get_predecessor_index(const BeginInst *BI) const
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual GETSTATICInst * to_GETSTATICInst()
virtual PUTFIELDInst * to_PUTFIELDInst()
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
virtual NEGInst * to_NEGInst()
virtual STOREInst * to_STOREInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual OStream & print(OStream &OS) const
print
Conditional::CondID get_condition() const
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
std::vector< T, Allocator< T > > type
Definition: vector.hpp:38
virtual COPYInst * to_COPYInst()
TODO not a real Instruction...
virtual bool is_commutable() const
True if the operands of the instruction are commutable.
virtual RETInst * to_RETInst()
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void visit(LoadInst *I, bool copyOperands)
virtual LOADInst * to_LOADInst()
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
Simple stream class for formatted output.
Definition: OStream.hpp:141
Instruction * dep_front() const
Instruction super class.
Definition: Instruction.hpp:73
virtual REMInst * to_REMInst()
DIVInst(Type::TypeID type, Value *S1, Value *S2)
virtual ANDInst * to_ANDInst()
OStream & operator<<(OStream &OS, const Conditional::CondID &cond)
Definition: Conditional.cpp:34
void replace_op(Value *v_old, Value *v_new)
Definition: Instruction.cpp:66
MIIterator i
virtual bool is_arithmetic() const
True if the instruction is an arithmetic instruction.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
Fieldref, Methodref and InterfaceMethodref.
Definition: references.hpp:86
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual ASTOREInst * to_ASTOREInst()
int32_t s4
Definition: types.hpp:45
virtual RETURNInst * to_RETURNInst()
SuccessorListTy::const_iterator succ_begin() const
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
BeginInstRef & get_successor(size_t i)
SuccessorListTy::const_reverse_iterator succ_const_reverse_iterator
virtual BeginInst * to_BeginInst()
OStream & OS
ANDInst(Type::TypeID type, Value *S1, Value *S2)
RETURNInst(BeginInst *begin)
void return
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
constant_FMIref * get_fmiref() const
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
ARRAYBOUNDSCHECKInst(Type::TypeID type, Value *ref, Value *index)
SuccessorListTy::const_iterator succ_const_iterator
MIIterator e
virtual CHECKCASTInst * to_CHECKCASTInst()
ASTOREInst(Type::TypeID type, Value *ref, Value *value, BeginInst *begin, Instruction *state_change)
CASTInst(Type::TypeID type, Value *s1)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual SUBInst * to_SUBInst()
virtual GOTOInst * to_GOTOInst()
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
INVOKESTATICInst(Type::TypeID type, unsigned size, constant_FMIref *fmiref, bool resolved, BeginInst *begin, Instruction *state_change)
virtual ARRAYBOUNDSCHECKInst * to_ARRAYBOUNDSCHECKInst()
void set_predecessor(int index, BeginInst *BI)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_commutable() const
True if the operands of the instruction are commutable.
void append_succ(BeginInst *bi)
GETSTATICInst(Type::TypeID type, constant_FMIref *fmiref, bool resolved, BeginInst *begin, Instruction *state_change)
virtual bool has_side_effects() const
True the instruction has side effects.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual ANEWARRAYInst * to_ANEWARRAYInst()
alloc::vector< BeginInst * >::type PredecessorListTy
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_arithmetic() const
True if the instruction is an arithmetic instruction.
virtual NOPInst * to_NOPInst()
virtual NEWARRAYInst * to_NEWARRAYInst()
constant_FMIref * get_fmiref() const
virtual MULTIANEWARRAYInst * to_MULTIANEWARRAYInst()
SUBInst(Type::TypeID type, Value *S1, Value *S2)
virtual bool is_arithmetic() const
True if the instruction is an arithmetic instruction.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
const_pred_iterator pred_end() const
virtual LOOKUPSWITCHInst * to_LOOKUPSWITCHInst()
virtual PUTSTATICInst * to_PUTSTATICInst()
int8_t s1
Definition: types.hpp:39
virtual bool has_side_effects() const
True the instruction has side effects.
AREFInst(Type::TypeID type, Value *ref, Value *index)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual TABLESWITCHInst * to_TABLESWITCHInst()
virtual POPInst * to_POPInst()
RETURNInst(BeginInst *begin, Value *S1)
value return
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_commutable() const
True if the operands of the instruction are commutable.
virtual EndInst * to_EndInst()
virtual bool is_commutable() const
True if the operands of the instruction are commutable.
LOADInst(Type::TypeID type, unsigned index, BeginInst *begin)
virtual BeginInst * to_BeginInst()
Definition: Instruction.hpp:89
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
virtual bool verify() const
check if the instruction is in a correct state
virtual DIVInst * to_DIVInst()
virtual bool has_side_effects() const
True the instruction has side effects.
void set_successor(int index, BeginInst *BI)
void set_match(s4 index, MATCH match)
Type::TypeID get_array_type() const
BeginInstRef & get_then_target()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
BinaryInst(InstID id, Type::TypeID type, Value *S1, Value *S2)
CONSTInst(int32_t i, Type::IntType)
void set_type(Type::TypeID t)
Definition: Value.hpp:63
virtual USHRInst * to_USHRInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual NEWInst * to_NEWInst()
virtual ContainerInst * to_ContainerInst()
ORInst(Type::TypeID type, Value *S1, Value *S2)
std::size_t pred_size() const
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
MultiOpInst(InstID id, Type::TypeID type)
MULInst(Type::TypeID type, Value *S1, Value *S2)
FloatHandling get_FloatHandling() const
LOOKUPSWITCHInst(BeginInst *begin, Value *S1, s4 lookupcount)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
virtual ADDInst * to_ADDInst()
MethodDescriptor TODO: more info.