@@ -733,7 +733,13 @@ void LIRGenerator::do_ArrayCopy(Intrinsic* x) {
733733 assert (x->number_of_arguments () == 5 , " wrong type" );
734734
735735 // Make all state_for calls early since they can emit code
736- CodeEmitInfo* info = state_for (x, x->state ());
736+ CodeEmitInfo* info = nullptr ;
737+ if (x->state_before () != nullptr && x->state_before ()->force_reexecute ()) {
738+ info = state_for (x, x->state_before ());
739+ info->set_force_reexecute ();
740+ } else {
741+ info = state_for (x, x->state ());
742+ }
737743
738744 LIRItem src (x->argument_at (0 ), this );
739745 LIRItem src_pos (x->argument_at (1 ), this );
@@ -766,6 +772,9 @@ void LIRGenerator::do_ArrayCopy(Intrinsic* x) {
766772 int flags;
767773 ciArrayKlass* expected_type = nullptr ;
768774 arraycopy_helper (x, &flags, &expected_type);
775+ if (x->check_flag (Instruction::OmitChecksFlag)) {
776+ flags = 0 ;
777+ }
769778
770779 __ arraycopy (src.result (), src_pos.result (), dst.result (), dst_pos.result (), length.result (), tmp,
771780 expected_type, flags, info); // does add_safepoint
@@ -844,7 +853,13 @@ void LIRGenerator::do_NewInstance(NewInstance* x) {
844853}
845854
846855void LIRGenerator::do_NewTypeArray (NewTypeArray* x) {
847- CodeEmitInfo* info = state_for (x, x->state ());
856+ CodeEmitInfo* info = nullptr ;
857+ if (x->state_before () != nullptr && x->state_before ()->force_reexecute ()) {
858+ info = state_for (x, x->state_before ());
859+ info->set_force_reexecute ();
860+ } else {
861+ info = state_for (x, x->state ());
862+ }
848863
849864 LIRItem length (x->length (), this );
850865 length.load_item_force (FrameMap::r9_opr);
@@ -861,7 +876,7 @@ void LIRGenerator::do_NewTypeArray(NewTypeArray* x) {
861876 __ metadata2reg (ciTypeArrayKlass::make (elem_type)->constant_encoding (), klass_reg);
862877
863878 CodeStub* slow_path = new NewTypeArrayStub (klass_reg, len, reg, info);
864- __ allocate_array (reg, len, tmp1, tmp2, tmp3, tmp4, elem_type, klass_reg, slow_path);
879+ __ allocate_array (reg, len, tmp1, tmp2, tmp3, tmp4, elem_type, klass_reg, slow_path, x-> zero_array () );
865880
866881 LIR_Opr result = rlock_result (x);
867882 __ move (reg, result);
0 commit comments