comparison src/share/vm/ci/ciArray.hpp @ 12190:edb5ab0f3fe5

8001107: @Stable annotation for constant folding of lazily evaluated variables Reviewed-by: rbackman, twisti, kvn Contributed-by: john.r.rose@oracle.com, vladimir.x.ivanov@oracle.com
author vlivanov
date Tue, 10 Sep 2013 14:51:48 -0700
parents f95d63e2154a
children de6a9e811145
comparison
equal deleted inserted replaced
12188:cd16d587b0fa 12190:edb5ab0f3fe5
23 */ 23 */
24 24
25 #ifndef SHARE_VM_CI_CIARRAY_HPP 25 #ifndef SHARE_VM_CI_CIARRAY_HPP
26 #define SHARE_VM_CI_CIARRAY_HPP 26 #define SHARE_VM_CI_CIARRAY_HPP
27 27
28 #include "ci/ciArrayKlass.hpp"
29 #include "ci/ciConstant.hpp"
28 #include "ci/ciObject.hpp" 30 #include "ci/ciObject.hpp"
29 #include "oops/arrayOop.hpp" 31 #include "oops/arrayOop.hpp"
30 #include "oops/objArrayOop.hpp" 32 #include "oops/objArrayOop.hpp"
31 #include "oops/typeArrayOop.hpp" 33 #include "oops/typeArrayOop.hpp"
32 34
43 ciArray( objArrayHandle h_a) : ciObject(h_a), _length(h_a()->length()) {} 45 ciArray( objArrayHandle h_a) : ciObject(h_a), _length(h_a()->length()) {}
44 ciArray(typeArrayHandle h_a) : ciObject(h_a), _length(h_a()->length()) {} 46 ciArray(typeArrayHandle h_a) : ciObject(h_a), _length(h_a()->length()) {}
45 47
46 ciArray(ciKlass* klass, int len) : ciObject(klass), _length(len) {} 48 ciArray(ciKlass* klass, int len) : ciObject(klass), _length(len) {}
47 49
48 arrayOop get_arrayOop() { return (arrayOop)get_oop(); } 50 arrayOop get_arrayOop() const { return (arrayOop)get_oop(); }
49 51
50 const char* type_string() { return "ciArray"; } 52 const char* type_string() { return "ciArray"; }
51 53
52 void print_impl(outputStream* st); 54 void print_impl(outputStream* st);
53 55
56 ciConstant element_value_impl(BasicType elembt, arrayOop ary, int index);
57
54 public: 58 public:
55 int length() { return _length; } 59 int length() { return _length; }
60
61 // Convenience routines.
62 ciArrayKlass* array_type() { return klass()->as_array_klass(); }
63 ciType* element_type() { return array_type()->element_type(); }
64 BasicType element_basic_type() { return element_type()->basic_type(); }
65
66 // Current value of an element.
67 // Returns T_ILLEGAL if there is no element at the given index.
68 ciConstant element_value(int index);
69
70 // Current value of an element at the specified offset.
71 // Returns T_ILLEGAL if there is no element at the given offset.
72 ciConstant element_value_by_offset(intptr_t element_offset);
56 73
57 // What kind of ciObject is this? 74 // What kind of ciObject is this?
58 bool is_array() { return true; } 75 bool is_array() { return true; }
59 bool is_java_object() { return true; } 76 bool is_java_object() { return true; }
60 }; 77 };