50 store_to_memory(control(), adr, val, elem_type, adr_type);
51 }
52
53
54 //------------------------------array_addressing-------------------------------
55 // Pull array and index from the stack. Compute pointer-to-element.
56 Node* Parse::array_addressing(BasicType type, int vals, const Type* *result2) {
57 Node *idx = peek(0+vals); // Get from stack without popping
58 Node *ary = peek(1+vals); // in case of exception
59
60 // Null check the array base, with correct stack contents
61 ary = do_null_check(ary, T_ARRAY);
62 // Compile-time detect of null-exception?
63 if (stopped()) return top();
64
65 const TypeAryPtr* arytype = _gvn.type(ary)->is_aryptr();
66 const TypeInt* sizetype = arytype->size();
67 const Type* elemtype = arytype->elem();
68
69 if (UseUniqueSubclasses && result2 != NULL) {
70 const Type* el = elemtype;
71 if (elemtype->isa_narrowoop()) {
72 el = elemtype->is_narrowoop()->make_oopptr();
73 }
74 const TypeInstPtr* toop = el->isa_instptr();
75 if (toop) {
76 if (toop->klass()->as_instance_klass()->unique_concrete_subklass()) {
77 // If we load from "AbstractClass[]" we must see "ConcreteSubClass".
78 const Type* subklass = Type::get_const_type(toop->klass());
79 elemtype = subklass->join(el);
80 }
81 }
82 }
83
84 // Check for big class initializers with all constant offsets
85 // feeding into a known-size array.
86 const TypeInt* idxtype = _gvn.type(idx)->is_int();
87 // See if the highest idx value is less than the lowest array bound,
88 // and if the idx value cannot be negative:
89 bool need_range_check = true;
90 if (idxtype->_hi < sizetype->_lo && idxtype->_lo >= 0) {
91 need_range_check = false;
92 if (C->log() != NULL) C->log()->elem("observe that='!need_range_check'");
93 }
94
95 if (!arytype->klass()->is_loaded()) {
|
50 store_to_memory(control(), adr, val, elem_type, adr_type);
51 }
52
53
54 //------------------------------array_addressing-------------------------------
55 // Pull array and index from the stack. Compute pointer-to-element.
56 Node* Parse::array_addressing(BasicType type, int vals, const Type* *result2) {
57 Node *idx = peek(0+vals); // Get from stack without popping
58 Node *ary = peek(1+vals); // in case of exception
59
60 // Null check the array base, with correct stack contents
61 ary = do_null_check(ary, T_ARRAY);
62 // Compile-time detect of null-exception?
63 if (stopped()) return top();
64
65 const TypeAryPtr* arytype = _gvn.type(ary)->is_aryptr();
66 const TypeInt* sizetype = arytype->size();
67 const Type* elemtype = arytype->elem();
68
69 if (UseUniqueSubclasses && result2 != NULL) {
70 const Type* el = elemtype->make_ptr();
71 if (el && el->isa_instptr()) {
72 const TypeInstPtr* toop = el->is_instptr();
73 if (toop->klass()->as_instance_klass()->unique_concrete_subklass()) {
74 // If we load from "AbstractClass[]" we must see "ConcreteSubClass".
75 const Type* subklass = Type::get_const_type(toop->klass());
76 elemtype = subklass->join(el);
77 }
78 }
79 }
80
81 // Check for big class initializers with all constant offsets
82 // feeding into a known-size array.
83 const TypeInt* idxtype = _gvn.type(idx)->is_int();
84 // See if the highest idx value is less than the lowest array bound,
85 // and if the idx value cannot be negative:
86 bool need_range_check = true;
87 if (idxtype->_hi < sizetype->_lo && idxtype->_lo >= 0) {
88 need_range_check = false;
89 if (C->log() != NULL) C->log()->elem("observe that='!need_range_check'");
90 }
91
92 if (!arytype->klass()->is_loaded()) {
|