< prev index next >

src/hotspot/share/interpreter/abstractInterpreter.cpp

Print this page

129       case vmIntrinsics::_updateByteBufferCRC32: return java_util_zip_CRC32_updateByteBuffer;
130       // Use optimized stub code for CRC32C methods.
131       case vmIntrinsics::_updateBytesCRC32C: return java_util_zip_CRC32C_updateBytes;
132       case vmIntrinsics::_updateDirectByteBufferCRC32C: return java_util_zip_CRC32C_updateDirectByteBuffer;
133       case vmIntrinsics::_intBitsToFloat:    return java_lang_Float_intBitsToFloat;
134       case vmIntrinsics::_floatToRawIntBits: return java_lang_Float_floatToRawIntBits;
135       case vmIntrinsics::_longBitsToDouble:  return java_lang_Double_longBitsToDouble;
136       case vmIntrinsics::_doubleToRawLongBits: return java_lang_Double_doubleToRawLongBits;
137 #endif // ZERO
138       case vmIntrinsics::_dsin:              return java_lang_math_sin;
139       case vmIntrinsics::_dcos:              return java_lang_math_cos;
140       case vmIntrinsics::_dtan:              return java_lang_math_tan;
141       case vmIntrinsics::_dabs:              return java_lang_math_abs;
142       case vmIntrinsics::_dlog:              return java_lang_math_log;
143       case vmIntrinsics::_dlog10:            return java_lang_math_log10;
144       case vmIntrinsics::_dpow:              return java_lang_math_pow;
145       case vmIntrinsics::_dexp:              return java_lang_math_exp;
146       case vmIntrinsics::_fmaD:              return java_lang_math_fmaD;
147       case vmIntrinsics::_fmaF:              return java_lang_math_fmaF;
148       case vmIntrinsics::_Reference_get:     return java_lang_ref_reference_get;

149       case vmIntrinsics::_dsqrt:
150         // _dsqrt will be selected for both Math::sqrt and StrictMath::sqrt, but the latter
151         // is native. Keep treating it like a native method in the interpreter
152         assert(m->name() == vmSymbols::sqrt_name() &&
153                (m->klass_name() == vmSymbols::java_lang_Math() ||
154                 m->klass_name() == vmSymbols::java_lang_StrictMath()), "must be");
155         return m->is_native() ? native : java_lang_math_sqrt;
156       case vmIntrinsics::_Object_init:
157         if (RegisterFinalizersAtInit && m->code_size() == 1) {
158           // We need to execute the special return bytecode to check for
159           // finalizer registration so create a normal frame.
160           return zerolocals;
161         }
162         break;
163       default: break;
164     }
165   }
166 
167   // Native method?
168   if (m->is_native()) {



169     assert(!m->is_method_handle_intrinsic(), "overlapping bits here, watch out");
170     return m->is_synchronized() ? native_synchronized : native;
171   }
172 
173   // Synchronized?
174   if (m->is_synchronized()) {
175     return zerolocals_synchronized;
176   }
177 
178   // Empty method?
179   if (m->is_empty_method()) {
180     return empty;
181   }
182 
183   // Getter method?
184   if (m->is_getter()) {
185     return getter;
186   }
187 
188   // Setter method?
189   if (m->is_setter()) {
190     return setter;
191   }
192 








193   // Note: for now: zero locals for all non-empty methods
194   return zerolocals;
195 }
196 
197 void AbstractInterpreter::set_entry_for_kind(AbstractInterpreter::MethodKind kind, address entry) {
198   assert(kind >= method_handle_invoke_FIRST &&
199          kind <= method_handle_invoke_LAST, "late initialization only for MH entry points");
200   assert(_entry_table[kind] == _entry_table[abstract], "previous value must be AME entry");
201   _entry_table[kind] = entry;
202 }
203 
204 // Return true if the interpreter can prove that the given bytecode has
205 // not yet been executed (in Java semantics, not in actual operation).
206 bool AbstractInterpreter::is_not_reached(const methodHandle& method, int bci) {
207   BytecodeStream s(method, bci);
208   Bytecodes::Code code = s.next();
209 
210   if (Bytecodes::is_invoke(code)) {
211     assert(!Bytecodes::must_rewrite(code), "invokes aren't rewritten");
212     ConstantPool* cpool = method()->constants();

129       case vmIntrinsics::_updateByteBufferCRC32: return java_util_zip_CRC32_updateByteBuffer;
130       // Use optimized stub code for CRC32C methods.
131       case vmIntrinsics::_updateBytesCRC32C: return java_util_zip_CRC32C_updateBytes;
132       case vmIntrinsics::_updateDirectByteBufferCRC32C: return java_util_zip_CRC32C_updateDirectByteBuffer;
133       case vmIntrinsics::_intBitsToFloat:    return java_lang_Float_intBitsToFloat;
134       case vmIntrinsics::_floatToRawIntBits: return java_lang_Float_floatToRawIntBits;
135       case vmIntrinsics::_longBitsToDouble:  return java_lang_Double_longBitsToDouble;
136       case vmIntrinsics::_doubleToRawLongBits: return java_lang_Double_doubleToRawLongBits;
137 #endif // ZERO
138       case vmIntrinsics::_dsin:              return java_lang_math_sin;
139       case vmIntrinsics::_dcos:              return java_lang_math_cos;
140       case vmIntrinsics::_dtan:              return java_lang_math_tan;
141       case vmIntrinsics::_dabs:              return java_lang_math_abs;
142       case vmIntrinsics::_dlog:              return java_lang_math_log;
143       case vmIntrinsics::_dlog10:            return java_lang_math_log10;
144       case vmIntrinsics::_dpow:              return java_lang_math_pow;
145       case vmIntrinsics::_dexp:              return java_lang_math_exp;
146       case vmIntrinsics::_fmaD:              return java_lang_math_fmaD;
147       case vmIntrinsics::_fmaF:              return java_lang_math_fmaF;
148       case vmIntrinsics::_Reference_get:     return java_lang_ref_reference_get;
149       case vmIntrinsics::_Continuation_doYield: return java_lang_continuation_doYield;
150       case vmIntrinsics::_dsqrt:
151         // _dsqrt will be selected for both Math::sqrt and StrictMath::sqrt, but the latter
152         // is native. Keep treating it like a native method in the interpreter
153         assert(m->name() == vmSymbols::sqrt_name() &&
154                (m->klass_name() == vmSymbols::java_lang_Math() ||
155                 m->klass_name() == vmSymbols::java_lang_StrictMath()), "must be");
156         return m->is_native() ? native : java_lang_math_sqrt;
157       case vmIntrinsics::_Object_init:
158         if (RegisterFinalizersAtInit && m->code_size() == 1) {
159           // We need to execute the special return bytecode to check for
160           // finalizer registration so create a normal frame.
161           return zerolocals;
162         }
163         break;
164       default: break;
165     }
166   }
167 
168   // Native method?
169   if (m->is_native()) {
170     if (m->is_continuation_enter_intrinsic()) {
171       return zerolocals;
172     }
173     assert(!m->is_method_handle_intrinsic(), "overlapping bits here, watch out");
174     return m->is_synchronized() ? native_synchronized : native;
175   }
176 
177   // Synchronized?
178   if (m->is_synchronized()) {
179     return zerolocals_synchronized;
180   }
181 
182   // Empty method?
183   if (m->is_empty_method()) {
184     return empty;
185   }
186 
187   // Getter method?
188   if (m->is_getter()) {
189     return getter;
190   }
191 
192   // Setter method?
193   if (m->is_setter()) {
194     return setter;
195   }
196 
197   // Symbol* kname = m->klass_name();
198   // Symbol* name = m->name();
199   // if (kname == vmSymbols::jdk_internal_vm_Continuation()) {
200   //   if (name == vmSymbols::enter_name()) {
201   //     return java_lang_continuation_enter;
202   //   }
203   // }
204 
205   // Note: for now: zero locals for all non-empty methods
206   return zerolocals;
207 }
208 
209 void AbstractInterpreter::set_entry_for_kind(AbstractInterpreter::MethodKind kind, address entry) {
210   assert(kind >= method_handle_invoke_FIRST &&
211          kind <= method_handle_invoke_LAST, "late initialization only for MH entry points");
212   assert(_entry_table[kind] == _entry_table[abstract], "previous value must be AME entry");
213   _entry_table[kind] = entry;
214 }
215 
216 // Return true if the interpreter can prove that the given bytecode has
217 // not yet been executed (in Java semantics, not in actual operation).
218 bool AbstractInterpreter::is_not_reached(const methodHandle& method, int bci) {
219   BytecodeStream s(method, bci);
220   Bytecodes::Code code = s.next();
221 
222   if (Bytecodes::is_invoke(code)) {
223     assert(!Bytecodes::must_rewrite(code), "invokes aren't rewritten");
224     ConstantPool* cpool = method()->constants();
< prev index next >