# HG changeset patch # User Doug Simon # Date 1339759003 -7200 # Node ID 60ca7d300b8f9d2005c154b83535725e47c9be66 # Parent 19ca9e48cd315c00dd4ce7c4d28c6b7dad55bd7c reverted to using fast_new_instance_init_check_id stub to use fast TLAB refilling diff -r 19ca9e48cd31 -r 60ca7d300b8f src/cpu/x86/vm/c1_Runtime1_x86.cpp --- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp Fri Jun 15 12:05:13 2012 +0200 +++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp Fri Jun 15 13:16:43 2012 +0200 @@ -1036,6 +1036,10 @@ __ push(rdi); __ push(rbx); +#ifdef GRAAL + __ push(rcx); + __ push(rsi); +#endif if (id == fast_new_instance_init_check_id) { // make sure the klass is initialized @@ -1074,6 +1078,10 @@ __ initialize_object(obj, klass, obj_size, 0, t1, t2); __ verify_oop(obj); +#ifdef GRAAL + __ pop(rsi); + __ pop(rcx); +#endif __ pop(rbx); __ pop(rdi); __ ret(0); @@ -1087,11 +1095,19 @@ __ initialize_object(obj, klass, obj_size, 0, t1, t2); __ verify_oop(obj); +#ifdef GRAAL + __ pop(rsi); + __ pop(rcx); +#endif __ pop(rbx); __ pop(rdi); __ ret(0); __ bind(slow_path); +#ifdef GRAAL + __ pop(rsi); + __ pop(rcx); +#endif __ pop(rbx); __ pop(rdi); } diff -r 19ca9e48cd31 -r 60ca7d300b8f src/share/vm/graal/graalCompilerToVM.cpp --- a/src/share/vm/graal/graalCompilerToVM.cpp Fri Jun 15 12:05:13 2012 +0200 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Fri Jun 15 13:16:43 2012 +0200 @@ -816,10 +816,15 @@ set_int(env, config, "bciProfileWidth", BciProfileWidth); set_int(env, config, "typeProfileWidth", TypeProfileWidth); + // We use the fast path stub so that we get TLAB refills whenever possible instead of + // unconditionally allocating directly from the heap (which the slow path does). + // The stub must also do initialization when the compiled check fails. + Runtime1::StubID newInstanceStub = Runtime1::fast_new_instance_init_check_id; + set_long(env, config, "debugStub", VmIds::addStub((address)warning)); set_long(env, config, "instanceofStub", VmIds::addStub(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); set_long(env, config, "verifyPointerStub", VmIds::addStub(Runtime1::entry_for(Runtime1::graal_verify_pointer_id))); - set_long(env, config, "newInstanceStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_instance_id))); + set_long(env, config, "newInstanceStub", VmIds::addStub(Runtime1::entry_for(newInstanceStub))); set_long(env, config, "newTypeArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_type_array_id))); set_long(env, config, "newObjectArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_object_array_id))); set_long(env, config, "newMultiArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_multi_array_id)));