28 #include "c1/c1_Instruction.hpp"
29
30 // Base class for range check elimination
31 class RangeCheckElimination : AllStatic {
32 public:
33 static void eliminate(IR *ir);
34 };
35
36 // Implementation
37 class RangeCheckEliminator VALUE_OBJ_CLASS_SPEC {
38 private:
39 int _number_of_instructions;
40 bool _optimistic; // Insert predicates and deoptimize when they fail
41 IR *_ir;
42
43 define_array(BlockBeginArray, BlockBegin*)
44 define_stack(BlockBeginList, BlockBeginArray)
45 define_stack(IntegerStack, intArray)
46 define_array(IntegerMap, IntegerStack*)
47
48 class Verification : public _ValueObj /*VALUE_OBJ_CLASS_SPEC*/, public BlockClosure {
49 private:
50 IR *_ir;
51 boolArray _used;
52 BlockBeginList _current;
53 BlockBeginList _successors;
54
55 public:
56 Verification(IR *ir);
57 virtual void block_do(BlockBegin *block);
58 bool can_reach(BlockBegin *start, BlockBegin *end, BlockBegin *dont_use = NULL);
59 bool dominates(BlockBegin *dominator, BlockBegin *block);
60 };
61
62 public:
63 // Bounds for an instruction in the form x + c which c integer
64 // constant and x another instruction
65 class Bound : public CompilationResourceObj {
66 private:
67 int _upper;
68 Value _upper_instr;
69 int _lower;
|
28 #include "c1/c1_Instruction.hpp"
29
30 // Base class for range check elimination
31 class RangeCheckElimination : AllStatic {
32 public:
33 static void eliminate(IR *ir);
34 };
35
36 // Implementation
37 class RangeCheckEliminator VALUE_OBJ_CLASS_SPEC {
38 private:
39 int _number_of_instructions;
40 bool _optimistic; // Insert predicates and deoptimize when they fail
41 IR *_ir;
42
43 define_array(BlockBeginArray, BlockBegin*)
44 define_stack(BlockBeginList, BlockBeginArray)
45 define_stack(IntegerStack, intArray)
46 define_array(IntegerMap, IntegerStack*)
47
48 class Verification : public BlockClosure {
49 // RangeCheckEliminator::Verification should never get instatiated on the heap.
50 private:
51 void* operator new(size_t size) throw();
52 void* operator new[](size_t size) throw();
53 void operator delete(void* p);
54 void operator delete[](void* p);
55
56 IR *_ir;
57 boolArray _used;
58 BlockBeginList _current;
59 BlockBeginList _successors;
60
61 public:
62 Verification(IR *ir);
63 virtual void block_do(BlockBegin *block);
64 bool can_reach(BlockBegin *start, BlockBegin *end, BlockBegin *dont_use = NULL);
65 bool dominates(BlockBegin *dominator, BlockBegin *block);
66 };
67
68 public:
69 // Bounds for an instruction in the form x + c which c integer
70 // constant and x another instruction
71 class Bound : public CompilationResourceObj {
72 private:
73 int _upper;
74 Value _upper_instr;
75 int _lower;
|