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;
|
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 void* operator new(size_t size) throw();
51 void* operator new[](size_t size) throw();
52 #ifdef __IBMCPP__
53 public:
54 #endif
55 void operator delete(void* p) { ShouldNotReachHere(); }
56 void operator delete[](void* p) { ShouldNotReachHere(); }
57
58 private:
59 IR *_ir;
60 boolArray _used;
61 BlockBeginList _current;
62 BlockBeginList _successors;
63
64 public:
65 Verification(IR *ir);
66 virtual void block_do(BlockBegin *block);
67 bool can_reach(BlockBegin *start, BlockBegin *end, BlockBegin *dont_use = NULL);
68 bool dominates(BlockBegin *dominator, BlockBegin *block);
69 };
70
71 public:
72 // Bounds for an instruction in the form x + c which c integer
73 // constant and x another instruction
74 class Bound : public CompilationResourceObj {
75 private:
76 int _upper;
77 Value _upper_instr;
78 int _lower;
|