1 /* |
1 /* |
2 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
38 private: |
38 private: |
39 int _number_of_instructions; |
39 int _number_of_instructions; |
40 bool _optimistic; // Insert predicates and deoptimize when they fail |
40 bool _optimistic; // Insert predicates and deoptimize when they fail |
41 IR *_ir; |
41 IR *_ir; |
42 |
42 |
43 define_array(BlockBeginArray, BlockBegin*) |
43 typedef GrowableArray<BlockBegin*> BlockBeginList; |
44 define_stack(BlockBeginList, BlockBeginArray) |
44 typedef GrowableArray<int> IntegerStack; |
45 define_stack(IntegerStack, intArray) |
|
46 define_array(IntegerMap, IntegerStack*) |
|
47 |
45 |
48 class Verification : public BlockClosure { |
46 class Verification : public BlockClosure { |
49 // RangeCheckEliminator::Verification should never get instatiated on the heap. |
47 // RangeCheckEliminator::Verification should never get instatiated on the heap. |
50 private: |
48 private: |
51 void* operator new(size_t size) throw(); |
49 void* operator new(size_t size) throw(); |
178 |
176 |
179 #ifdef ASSERT |
177 #ifdef ASSERT |
180 void add_assertions(Bound *bound, Instruction *instruction, Instruction *position); |
178 void add_assertions(Bound *bound, Instruction *instruction, Instruction *position); |
181 #endif |
179 #endif |
182 |
180 |
183 define_array(BoundArray, Bound *) |
181 typedef GrowableArray<Bound*> BoundStack; |
184 define_stack(BoundStack, BoundArray) |
182 typedef GrowableArray<BoundStack*> BoundMap; |
185 define_array(BoundMap, BoundStack *) |
183 typedef GrowableArray<AccessIndexed*> AccessIndexedList; |
186 define_array(AccessIndexedArray, AccessIndexed *) |
184 typedef GrowableArray<Instruction*> InstructionList; |
187 define_stack(AccessIndexedList, AccessIndexedArray) |
|
188 define_array(InstructionArray, Instruction *) |
|
189 define_stack(InstructionList, InstructionArray) |
|
190 |
185 |
191 class AccessIndexedInfo : public CompilationResourceObj { |
186 class AccessIndexedInfo : public CompilationResourceObj { |
192 public: |
187 public: |
193 AccessIndexedList *_list; |
188 AccessIndexedList *_list; |
194 int _min; |
189 int _min; |
195 int _max; |
190 int _max; |
196 }; |
191 }; |
197 |
192 |
198 define_array(AccessIndexedInfoArray, AccessIndexedInfo *) |
193 typedef GrowableArray<AccessIndexedInfo*> AccessIndexedInfoArray; |
199 BoundMap _bounds; // Mapping from Instruction's id to current bound |
194 BoundMap _bounds; // Mapping from Instruction's id to current bound |
200 AccessIndexedInfoArray _access_indexed_info; // Mapping from Instruction's id to AccessIndexedInfo for in block motion |
195 AccessIndexedInfoArray _access_indexed_info; // Mapping from Instruction's id to AccessIndexedInfo for in block motion |
201 Visitor _visitor; |
196 Visitor _visitor; |
202 |
197 |
203 public: |
198 public: |