Mercurial > hg > graal-compiler
diff src/share/vm/opto/runtime.cpp @ 6948:e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 12 Nov 2012 23:14:12 +0100 |
parents | c38f13903fdf a3ecd773a7b9 |
children | 2cb439954abf |
line wrap: on
line diff
--- a/src/share/vm/opto/runtime.cpp Mon Nov 12 18:11:17 2012 +0100 +++ b/src/share/vm/opto/runtime.cpp Mon Nov 12 23:14:12 2012 +0100 @@ -228,7 +228,7 @@ } // object allocation -JRT_BLOCK_ENTRY(void, OptoRuntime::new_instance_C(klassOopDesc* klass, JavaThread* thread)) +JRT_BLOCK_ENTRY(void, OptoRuntime::new_instance_C(Klass* klass, JavaThread* thread)) JRT_BLOCK; #ifndef PRODUCT SharedRuntime::_new_instance_ctr++; // new instance requires GC @@ -238,11 +238,11 @@ // These checks are cheap to make and support reflective allocation. int lh = Klass::cast(klass)->layout_helper(); if (Klass::layout_helper_needs_slow_path(lh) - || !instanceKlass::cast(klass)->is_initialized()) { + || !InstanceKlass::cast(klass)->is_initialized()) { KlassHandle kh(THREAD, klass); kh->check_valid_for_instantiation(false, THREAD); if (!HAS_PENDING_EXCEPTION) { - instanceKlass::cast(kh())->initialize(THREAD); + InstanceKlass::cast(kh())->initialize(THREAD); } if (!HAS_PENDING_EXCEPTION) { klass = kh(); @@ -253,7 +253,7 @@ if (klass != NULL) { // Scavenge and allocate an instance. - oop result = instanceKlass::cast(klass)->allocate_instance(THREAD); + oop result = InstanceKlass::cast(klass)->allocate_instance(THREAD); thread->set_vm_result(result); // Pass oops back through thread local storage. Our apparent type to Java @@ -273,7 +273,7 @@ // array allocation -JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(klassOopDesc* array_type, int len, JavaThread *thread)) +JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(Klass* array_type, int len, JavaThread *thread)) JRT_BLOCK; #ifndef PRODUCT SharedRuntime::_new_array_ctr++; // new array requires GC @@ -286,13 +286,13 @@ if (Klass::cast(array_type)->oop_is_typeArray()) { // The oopFactory likes to work with the element type. // (We could bypass the oopFactory, since it doesn't add much value.) - BasicType elem_type = typeArrayKlass::cast(array_type)->element_type(); + BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type(); result = oopFactory::new_typeArray(elem_type, len, THREAD); } else { // Although the oopFactory likes to work with the elem_type, // the compiler prefers the array_type, since it must already have // that latter value in hand for the fast path. - klassOopDesc* elem_type = objArrayKlass::cast(array_type)->element_klass(); + Klass* elem_type = ObjArrayKlass::cast(array_type)->element_klass(); result = oopFactory::new_objArray(elem_type, len, THREAD); } @@ -311,7 +311,7 @@ JRT_END // array allocation without zeroing -JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_nozero_C(klassOopDesc* array_type, int len, JavaThread *thread)) +JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_nozero_C(Klass* array_type, int len, JavaThread *thread)) JRT_BLOCK; #ifndef PRODUCT SharedRuntime::_new_array_ctr++; // new array requires GC @@ -323,7 +323,7 @@ assert(Klass::cast(array_type)->oop_is_typeArray(), "should be called only for type array"); // The oopFactory likes to work with the element type. - BasicType elem_type = typeArrayKlass::cast(array_type)->element_type(); + BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type(); result = oopFactory::new_typeArray_nozero(elem_type, len, THREAD); // Pass oops back through thread local storage. Our apparent type to Java @@ -344,7 +344,7 @@ is_deoptimized_caller_frame(thread)) { // Zero array here if the caller is deoptimized. int size = ((typeArrayOop)result)->object_size(); - BasicType elem_type = typeArrayKlass::cast(array_type)->element_type(); + BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type(); const size_t hs = arrayOopDesc::header_size(elem_type); // Align to next 8 bytes to avoid trashing arrays's length. const size_t aligned_hs = align_object_offset(hs); @@ -361,74 +361,74 @@ // Note: multianewarray for one dimension is handled inline by GraphKit::new_array. // multianewarray for 2 dimensions -JRT_ENTRY(void, OptoRuntime::multianewarray2_C(klassOopDesc* elem_type, int len1, int len2, JavaThread *thread)) +JRT_ENTRY(void, OptoRuntime::multianewarray2_C(Klass* elem_type, int len1, int len2, JavaThread *thread)) #ifndef PRODUCT SharedRuntime::_multi2_ctr++; // multianewarray for 1 dimension #endif assert(check_compiled_frame(thread), "incorrect caller"); - assert(oop(elem_type)->is_klass(), "not a class"); + assert(elem_type->is_klass(), "not a class"); jint dims[2]; dims[0] = len1; dims[1] = len2; - oop obj = arrayKlass::cast(elem_type)->multi_allocate(2, dims, THREAD); + oop obj = ArrayKlass::cast(elem_type)->multi_allocate(2, dims, THREAD); deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION); thread->set_vm_result(obj); JRT_END // multianewarray for 3 dimensions -JRT_ENTRY(void, OptoRuntime::multianewarray3_C(klassOopDesc* elem_type, int len1, int len2, int len3, JavaThread *thread)) +JRT_ENTRY(void, OptoRuntime::multianewarray3_C(Klass* elem_type, int len1, int len2, int len3, JavaThread *thread)) #ifndef PRODUCT SharedRuntime::_multi3_ctr++; // multianewarray for 1 dimension #endif assert(check_compiled_frame(thread), "incorrect caller"); - assert(oop(elem_type)->is_klass(), "not a class"); + assert(elem_type->is_klass(), "not a class"); jint dims[3]; dims[0] = len1; dims[1] = len2; dims[2] = len3; - oop obj = arrayKlass::cast(elem_type)->multi_allocate(3, dims, THREAD); + oop obj = ArrayKlass::cast(elem_type)->multi_allocate(3, dims, THREAD); deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION); thread->set_vm_result(obj); JRT_END // multianewarray for 4 dimensions -JRT_ENTRY(void, OptoRuntime::multianewarray4_C(klassOopDesc* elem_type, int len1, int len2, int len3, int len4, JavaThread *thread)) +JRT_ENTRY(void, OptoRuntime::multianewarray4_C(Klass* elem_type, int len1, int len2, int len3, int len4, JavaThread *thread)) #ifndef PRODUCT SharedRuntime::_multi4_ctr++; // multianewarray for 1 dimension #endif assert(check_compiled_frame(thread), "incorrect caller"); - assert(oop(elem_type)->is_klass(), "not a class"); + assert(elem_type->is_klass(), "not a class"); jint dims[4]; dims[0] = len1; dims[1] = len2; dims[2] = len3; dims[3] = len4; - oop obj = arrayKlass::cast(elem_type)->multi_allocate(4, dims, THREAD); + oop obj = ArrayKlass::cast(elem_type)->multi_allocate(4, dims, THREAD); deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION); thread->set_vm_result(obj); JRT_END // multianewarray for 5 dimensions -JRT_ENTRY(void, OptoRuntime::multianewarray5_C(klassOopDesc* elem_type, int len1, int len2, int len3, int len4, int len5, JavaThread *thread)) +JRT_ENTRY(void, OptoRuntime::multianewarray5_C(Klass* elem_type, int len1, int len2, int len3, int len4, int len5, JavaThread *thread)) #ifndef PRODUCT SharedRuntime::_multi5_ctr++; // multianewarray for 1 dimension #endif assert(check_compiled_frame(thread), "incorrect caller"); - assert(oop(elem_type)->is_klass(), "not a class"); + assert(elem_type->is_klass(), "not a class"); jint dims[5]; dims[0] = len1; dims[1] = len2; dims[2] = len3; dims[3] = len4; dims[4] = len5; - oop obj = arrayKlass::cast(elem_type)->multi_allocate(5, dims, THREAD); + oop obj = ArrayKlass::cast(elem_type)->multi_allocate(5, dims, THREAD); deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION); thread->set_vm_result(obj); JRT_END -JRT_ENTRY(void, OptoRuntime::multianewarrayN_C(klassOopDesc* elem_type, arrayOopDesc* dims, JavaThread *thread)) +JRT_ENTRY(void, OptoRuntime::multianewarrayN_C(Klass* elem_type, arrayOopDesc* dims, JavaThread *thread)) assert(check_compiled_frame(thread), "incorrect caller"); - assert(oop(elem_type)->is_klass(), "not a class"); + assert(elem_type->is_klass(), "not a class"); assert(oop(dims)->is_typeArray(), "not an array"); ResourceMark rm; @@ -438,7 +438,7 @@ jint *c_dims = NEW_RESOURCE_ARRAY(jint, len); Copy::conjoint_jints_atomic(j_dims, c_dims, len); - oop obj = arrayKlass::cast(elem_type)->multi_allocate(len, c_dims, THREAD); + oop obj = ArrayKlass::cast(elem_type)->multi_allocate(len, c_dims, THREAD); deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION); thread->set_vm_result(obj); JRT_END @@ -811,6 +811,48 @@ return TypeFunc::make(domain, range); } +// for aescrypt encrypt/decrypt operations, just three pointers returning void (length is constant) +const TypeFunc* OptoRuntime::aescrypt_block_Type() { + // create input type (domain) + int num_args = 3; + int argcnt = num_args; + const Type** fields = TypeTuple::fields(argcnt); + int argp = TypeFunc::Parms; + fields[argp++] = TypePtr::NOTNULL; // src + fields[argp++] = TypePtr::NOTNULL; // dest + fields[argp++] = TypePtr::NOTNULL; // k array + assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); + const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); + + // no result type needed + fields = TypeTuple::fields(1); + fields[TypeFunc::Parms+0] = NULL; // void + const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); + return TypeFunc::make(domain, range); +} + +// for cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning void +const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() { + // create input type (domain) + int num_args = 5; + int argcnt = num_args; + const Type** fields = TypeTuple::fields(argcnt); + int argp = TypeFunc::Parms; + fields[argp++] = TypePtr::NOTNULL; // src + fields[argp++] = TypePtr::NOTNULL; // dest + fields[argp++] = TypePtr::NOTNULL; // k array + fields[argp++] = TypePtr::NOTNULL; // r array + fields[argp++] = TypeInt::INT; // src len + assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); + const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); + + // no result type needed + fields = TypeTuple::fields(1); + fields[TypeFunc::Parms+0] = NULL; // void + const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); + return TypeFunc::make(domain, range); +} + //------------- Interpreter state access for on stack replacement const TypeFunc* OptoRuntime::osr_end_Type() { // create input type (domain) @@ -844,7 +886,7 @@ JRT_LEAF(void, OptoRuntime::profile_receiver_type_C(DataLayout* data, oopDesc* receiver)) if (receiver == NULL) return; - klassOop receiver_klass = receiver->klass(); + Klass* receiver_klass = receiver->klass(); intptr_t* mdp = ((intptr_t*)(data)) + DataLayout::header_size_in_cells(); int empty_row = -1; // free row, if any is encountered @@ -1148,7 +1190,7 @@ // create input type (domain) const Type **fields = TypeTuple::fields(2); fields[TypeFunc::Parms+0] = TypeRawPtr::BOTTOM; // Thread-local storage - fields[TypeFunc::Parms+1] = TypeInstPtr::NOTNULL; // methodOop; Method we are entering + fields[TypeFunc::Parms+1] = TypeMetadataPtr::BOTTOM; // Method*; Method we are entering const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2,fields); // create result type (range) @@ -1178,8 +1220,8 @@ JRT_ENTRY_NO_ASYNC(void, OptoRuntime::register_finalizer(oopDesc* obj, JavaThread* thread)) assert(obj->is_oop(), "must be a valid oop"); - assert(obj->klass()->klass_part()->has_finalizer(), "shouldn't be here otherwise"); - instanceKlass::register_finalizer(instanceOop(obj), CHECK); + assert(obj->klass()->has_finalizer(), "shouldn't be here otherwise"); + InstanceKlass::register_finalizer(instanceOop(obj), CHECK); JRT_END //-----------------------------------------------------------------------------