Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalRuntime.cpp @ 12366:0991c12c4186
Defer barriers upon slow-path allocation
author | Christos Kotselidis <christos.kotselidis@oracle.com> |
---|---|
date | Fri, 11 Oct 2013 17:08:22 +0200 |
parents | 97e282186b5b |
children | 2dfccd93510a |
comparison
equal
deleted
inserted
replaced
12365:ee746f35ae17 | 12366:0991c12c4186 |
---|---|
62 h->check_valid_for_instantiation(true, CHECK); | 62 h->check_valid_for_instantiation(true, CHECK); |
63 // make sure klass is initialized | 63 // make sure klass is initialized |
64 h->initialize(CHECK); | 64 h->initialize(CHECK); |
65 // allocate instance and return via TLS | 65 // allocate instance and return via TLS |
66 oop obj = h->allocate_instance(CHECK); | 66 oop obj = h->allocate_instance(CHECK); |
67 if (GraalDeferredInitBarriers) { | |
68 obj = Universe::heap()->new_store_pre_barrier(thread, obj); | |
69 } | |
67 thread->set_vm_result(obj); | 70 thread->set_vm_result(obj); |
68 JRT_END | 71 JRT_END |
69 | 72 |
70 JRT_ENTRY(void, GraalRuntime::new_array(JavaThread* thread, Klass* array_klass, jint length)) | 73 JRT_ENTRY(void, GraalRuntime::new_array(JavaThread* thread, Klass* array_klass, jint length)) |
71 // Note: no handle for klass needed since they are not used | 74 // Note: no handle for klass needed since they are not used |
77 BasicType elt_type = TypeArrayKlass::cast(array_klass)->element_type(); | 80 BasicType elt_type = TypeArrayKlass::cast(array_klass)->element_type(); |
78 obj = oopFactory::new_typeArray(elt_type, length, CHECK); | 81 obj = oopFactory::new_typeArray(elt_type, length, CHECK); |
79 } else { | 82 } else { |
80 Klass* elem_klass = ObjArrayKlass::cast(array_klass)->element_klass(); | 83 Klass* elem_klass = ObjArrayKlass::cast(array_klass)->element_klass(); |
81 obj = oopFactory::new_objArray(elem_klass, length, CHECK); | 84 obj = oopFactory::new_objArray(elem_klass, length, CHECK); |
85 } | |
86 if (GraalDeferredInitBarriers) { | |
87 obj = Universe::heap()->new_store_pre_barrier(thread, obj); | |
82 } | 88 } |
83 thread->set_vm_result(obj); | 89 thread->set_vm_result(obj); |
84 // This is pretty rare but this runtime patch is stressful to deoptimization | 90 // This is pretty rare but this runtime patch is stressful to deoptimization |
85 // if we deoptimize here so force a deopt to stress the path. | 91 // if we deoptimize here so force a deopt to stress the path. |
86 if (DeoptimizeALot) { | 92 if (DeoptimizeALot) { |