--- old/src/share/vm/opto/runtime.cpp 2017-01-09 14:53:32.450908631 +0100 +++ new/src/share/vm/opto/runtime.cpp 2017-01-09 14:53:32.306908638 +0100 @@ -47,6 +47,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" #include "oops/typeArrayOop.inline.hpp" +#include "oops/valueArrayKlass.hpp" #include "opto/ad.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" @@ -266,7 +267,12 @@ // Scavenge and allocate an instance. oop result; - if (array_type->is_typeArray_klass()) { + if (array_type->is_valueArray_klass()) { + // TODO refactor all these checks, is_typeArray_klass should not be true for a value type array + // TODO use oopFactory::new_array + Klass* elem_type = ValueArrayKlass::cast(array_type)->element_klass(); + result = oopFactory::new_valueArray(elem_type, len, THREAD); + } else if (array_type->is_typeArray_klass()) { // 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();