541
542 IRT_ENTRY(void, InterpreterRuntime::throw_AbstractMethodError(JavaThread* thread))
543 THROW(vmSymbols::java_lang_AbstractMethodError());
544 IRT_END
545
546
547 IRT_ENTRY(void, InterpreterRuntime::throw_IncompatibleClassChangeError(JavaThread* thread))
548 THROW(vmSymbols::java_lang_IncompatibleClassChangeError());
549 IRT_END
550
551
552 //------------------------------------------------------------------------------------------------------------------------
553 // Fields
554 //
555
556 void InterpreterRuntime::resolve_get_put(JavaThread* thread, Bytecodes::Code bytecode) {
557 Thread* THREAD = thread;
558 // resolve field
559 fieldDescriptor info;
560 constantPoolHandle pool(thread, method(thread)->constants());
561 bool is_put = (bytecode == Bytecodes::_putfield || bytecode == Bytecodes::_nofast_putfield ||
562 bytecode == Bytecodes::_putstatic);
563 bool is_static = (bytecode == Bytecodes::_getstatic || bytecode == Bytecodes::_putstatic);
564
565 {
566 JvmtiHideSingleStepping jhss(thread);
567 LinkResolver::resolve_field_access(info, pool, get_index_u2_cpcache(thread, bytecode),
568 bytecode, CHECK);
569 } // end JvmtiHideSingleStepping
570
571 // check if link resolution caused cpCache to be updated
572 ConstantPoolCacheEntry* cp_cache_entry = cache_entry(thread);
573 if (cp_cache_entry->is_resolved(bytecode)) return;
574
575 // compute auxiliary field attributes
576 TosState state = as_TosState(info.field_type());
577
578 // We need to delay resolving put instructions on final fields
579 // until we actually invoke one. This is required so we throw
580 // exceptions at the correct place. If we do not resolve completely
581 // in the current pass, leaving the put_code set to zero will
582 // cause the next put instruction to reresolve.
583 Bytecodes::Code put_code = (Bytecodes::Code)0;
584
585 // We also need to delay resolving getstatic instructions until the
586 // class is intitialized. This is required so that access to the static
587 // field will call the initialization function every time until the class
588 // is completely initialized ala. in 2.17.5 in JVM Specification.
|
541
542 IRT_ENTRY(void, InterpreterRuntime::throw_AbstractMethodError(JavaThread* thread))
543 THROW(vmSymbols::java_lang_AbstractMethodError());
544 IRT_END
545
546
547 IRT_ENTRY(void, InterpreterRuntime::throw_IncompatibleClassChangeError(JavaThread* thread))
548 THROW(vmSymbols::java_lang_IncompatibleClassChangeError());
549 IRT_END
550
551
552 //------------------------------------------------------------------------------------------------------------------------
553 // Fields
554 //
555
556 void InterpreterRuntime::resolve_get_put(JavaThread* thread, Bytecodes::Code bytecode) {
557 Thread* THREAD = thread;
558 // resolve field
559 fieldDescriptor info;
560 constantPoolHandle pool(thread, method(thread)->constants());
561 methodHandle m(thread, method(thread));
562 bool is_put = (bytecode == Bytecodes::_putfield || bytecode == Bytecodes::_nofast_putfield ||
563 bytecode == Bytecodes::_putstatic);
564 bool is_static = (bytecode == Bytecodes::_getstatic || bytecode == Bytecodes::_putstatic);
565
566 {
567 JvmtiHideSingleStepping jhss(thread);
568 LinkResolver::resolve_field_access(info, pool, get_index_u2_cpcache(thread, bytecode),
569 m, bytecode, CHECK);
570 } // end JvmtiHideSingleStepping
571
572 // check if link resolution caused cpCache to be updated
573 ConstantPoolCacheEntry* cp_cache_entry = cache_entry(thread);
574 if (cp_cache_entry->is_resolved(bytecode)) return;
575
576 // compute auxiliary field attributes
577 TosState state = as_TosState(info.field_type());
578
579 // We need to delay resolving put instructions on final fields
580 // until we actually invoke one. This is required so we throw
581 // exceptions at the correct place. If we do not resolve completely
582 // in the current pass, leaving the put_code set to zero will
583 // cause the next put instruction to reresolve.
584 Bytecodes::Code put_code = (Bytecodes::Code)0;
585
586 // We also need to delay resolving getstatic instructions until the
587 // class is intitialized. This is required so that access to the static
588 // field will call the initialization function every time until the class
589 // is completely initialized ala. in 2.17.5 in JVM Specification.
|