127 return; 128 } 129 130 // Push the bool result back on stack 131 Node* res = gen_instanceof(peek(), makecon(TypeKlassPtr::make(klass)), true); 132 133 // Pop from stack AFTER gen_instanceof because it can uncommon trap. 134 pop(); 135 push(res); 136 } 137 138 //------------------------------array_store_check------------------------------ 139 // pull array from stack and check that the store is valid 140 void Parse::array_store_check() { 141 142 // Shorthand access to array store elements without popping them. 143 Node *obj = peek(0); 144 Node *idx = peek(1); 145 Node *ary = peek(2); 146 147 if (_gvn.type(obj) == TypePtr::NULL_PTR) { 148 // There's never a type check on null values. 149 // This cutout lets us avoid the uncommon_trap(Reason_array_check) 150 // below, which turns into a performance liability if the 151 // gen_checkcast folds up completely. 152 return; 153 } 154 155 // Extract the array klass type 156 int klass_offset = oopDesc::klass_offset_in_bytes(); 157 Node* p = basic_plus_adr( ary, ary, klass_offset ); 158 // p's type is array-of-OOPS plus klass_offset 159 Node* array_klass = _gvn.transform(LoadKlassNode::make(_gvn, NULL, immutable_memory(), p, TypeInstPtr::KLASS)); 160 // Get the array klass 161 const TypeKlassPtr *tak = _gvn.type(array_klass)->is_klassptr(); 162 163 // The type of array_klass is usually INexact array-of-oop. Heroically 164 // cast array_klass to EXACT array and uncommon-trap if the cast fails. 165 // Make constant out of the inexact array klass, but use it only if the cast 166 // succeeds. | 127 return; 128 } 129 130 // Push the bool result back on stack 131 Node* res = gen_instanceof(peek(), makecon(TypeKlassPtr::make(klass)), true); 132 133 // Pop from stack AFTER gen_instanceof because it can uncommon trap. 134 pop(); 135 push(res); 136 } 137 138 //------------------------------array_store_check------------------------------ 139 // pull array from stack and check that the store is valid 140 void Parse::array_store_check() { 141 142 // Shorthand access to array store elements without popping them. 143 Node *obj = peek(0); 144 Node *idx = peek(1); 145 Node *ary = peek(2); 146 147 if (ShenandoahVerifyReadsToFromSpace) { 148 obj = shenandoah_read_barrier(obj); 149 ary = shenandoah_read_barrier(ary); 150 } 151 152 if (_gvn.type(obj) == TypePtr::NULL_PTR) { 153 // There's never a type check on null values. 154 // This cutout lets us avoid the uncommon_trap(Reason_array_check) 155 // below, which turns into a performance liability if the 156 // gen_checkcast folds up completely. 157 return; 158 } 159 160 // Extract the array klass type 161 int klass_offset = oopDesc::klass_offset_in_bytes(); 162 Node* p = basic_plus_adr( ary, ary, klass_offset ); 163 // p's type is array-of-OOPS plus klass_offset 164 Node* array_klass = _gvn.transform(LoadKlassNode::make(_gvn, NULL, immutable_memory(), p, TypeInstPtr::KLASS)); 165 // Get the array klass 166 const TypeKlassPtr *tak = _gvn.type(array_klass)->is_klassptr(); 167 168 // The type of array_klass is usually INexact array-of-oop. Heroically 169 // cast array_klass to EXACT array and uncommon-trap if the cast fails. 170 // Make constant out of the inexact array klass, but use it only if the cast 171 // succeeds. |