< prev index next >

src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp

Print this page

1938         if (UseTLAB && !constants->tag_at(index).is_unresolved_klass()) {
1939           Klass* entry = constants->resolved_klass_at(index);
1940           InstanceKlass* ik = InstanceKlass::cast(entry);
1941           if (ik->is_initialized() && ik->can_be_fastpath_allocated()) {
1942             size_t obj_size = ik->size_helper();
1943             HeapWord* result = THREAD->tlab().allocate(obj_size);
1944             if (result != NULL) {
1945               // Initialize object field block:
1946               //   - if TLAB is pre-zeroed, we can skip this path
1947               //   - in debug mode, ThreadLocalAllocBuffer::allocate mangles
1948               //     this area, and we still need to initialize it
1949               if (DEBUG_ONLY(true ||) !ZeroTLAB) {
1950                 size_t hdr_size = oopDesc::header_size();
1951                 Copy::fill_to_words(result + hdr_size, obj_size - hdr_size, 0);
1952               }
1953 
1954               oop obj = cast_to_oop(result);
1955 
1956               // Initialize header
1957               assert(!UseBiasedLocking, "Not implemented");



1958               obj->set_mark(markWord::prototype());
1959               obj->set_klass_gap(0);
1960               obj->set_klass(ik);
1961 
1962               // Must prevent reordering of stores for object initialization
1963               // with stores that publish the new object.
1964               OrderAccess::storestore();
1965               SET_STACK_OBJECT(obj, 0);
1966               UPDATE_PC_AND_TOS_AND_CONTINUE(3, 1);
1967             }
1968           }
1969         }
1970         // Slow case allocation
1971         CALL_VM(InterpreterRuntime::_new(THREAD, METHOD->constants(), index),
1972                 handle_exception);
1973         // Must prevent reordering of stores for object initialization
1974         // with stores that publish the new object.
1975         OrderAccess::storestore();
1976         SET_STACK_OBJECT(THREAD->vm_result(), 0);
1977         THREAD->set_vm_result(NULL);
1978         UPDATE_PC_AND_TOS_AND_CONTINUE(3, 1);
1979       }
1980       CASE(_anewarray): {
1981         u2 index = Bytes::get_Java_u2(pc+1);

1938         if (UseTLAB && !constants->tag_at(index).is_unresolved_klass()) {
1939           Klass* entry = constants->resolved_klass_at(index);
1940           InstanceKlass* ik = InstanceKlass::cast(entry);
1941           if (ik->is_initialized() && ik->can_be_fastpath_allocated()) {
1942             size_t obj_size = ik->size_helper();
1943             HeapWord* result = THREAD->tlab().allocate(obj_size);
1944             if (result != NULL) {
1945               // Initialize object field block:
1946               //   - if TLAB is pre-zeroed, we can skip this path
1947               //   - in debug mode, ThreadLocalAllocBuffer::allocate mangles
1948               //     this area, and we still need to initialize it
1949               if (DEBUG_ONLY(true ||) !ZeroTLAB) {
1950                 size_t hdr_size = oopDesc::header_size();
1951                 Copy::fill_to_words(result + hdr_size, obj_size - hdr_size, 0);
1952               }
1953 
1954               oop obj = cast_to_oop(result);
1955 
1956               // Initialize header
1957               assert(!UseBiasedLocking, "Not implemented");
1958 #ifdef _LP64
1959               oopDesc::release_set_mark(result, ik->prototype_header());
1960 #else
1961               obj->set_mark(markWord::prototype());

1962               obj->set_klass(ik);
1963 #endif
1964               // Must prevent reordering of stores for object initialization
1965               // with stores that publish the new object.
1966               OrderAccess::storestore();
1967               SET_STACK_OBJECT(obj, 0);
1968               UPDATE_PC_AND_TOS_AND_CONTINUE(3, 1);
1969             }
1970           }
1971         }
1972         // Slow case allocation
1973         CALL_VM(InterpreterRuntime::_new(THREAD, METHOD->constants(), index),
1974                 handle_exception);
1975         // Must prevent reordering of stores for object initialization
1976         // with stores that publish the new object.
1977         OrderAccess::storestore();
1978         SET_STACK_OBJECT(THREAD->vm_result(), 0);
1979         THREAD->set_vm_result(NULL);
1980         UPDATE_PC_AND_TOS_AND_CONTINUE(3, 1);
1981       }
1982       CASE(_anewarray): {
1983         u2 index = Bytes::get_Java_u2(pc+1);
< prev index next >