< prev index next >

src/hotspot/cpu/x86/c1_Runtime1_x86.cpp

Print this page
*** 1025,18 ***
--- 1025,21 ---
          __ ret(0);
        }
        break;
  
      case new_instance_id:
+     case new_instance_no_inline_id:
      case fast_new_instance_id:
      case fast_new_instance_init_check_id:
        {
          Register klass = rdx; // Incoming
          Register obj   = rax; // Result
  
          if (id == new_instance_id) {
            __ set_info("new_instance", dont_gc_arguments);
+         } else if (id == new_instance_no_inline_id) {
+           __ set_info("new_instance_no_inline", dont_gc_arguments);
          } else if (id == fast_new_instance_id) {
            __ set_info("fast new_instance", dont_gc_arguments);
          } else {
            assert(id == fast_new_instance_init_check_id, "bad StubID");
            __ set_info("fast new_instance init check", dont_gc_arguments);

*** 1097,11 ***
            __ pop(rdi);
          }
  
          __ enter();
          OopMap* map = save_live_registers(sasm, 2);
!         int call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_instance), klass);
          oop_maps = new OopMapSet();
          oop_maps->add_gc_map(call_offset, map);
          restore_live_registers_except_rax(sasm);
          __ verify_oop(obj);
          __ leave();
--- 1100,16 ---
            __ pop(rdi);
          }
  
          __ enter();
          OopMap* map = save_live_registers(sasm, 2);
!         int call_offset;
+         if (id == new_instance_no_inline_id) {
+           call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_instance_no_inline), klass);
+         } else {
+           call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_instance), klass);
+         }
          oop_maps = new OopMapSet();
          oop_maps->add_gc_map(call_offset, map);
          restore_live_registers_except_rax(sasm);
          __ verify_oop(obj);
          __ leave();

*** 1130,34 ***
        }
        break;
  
      case new_type_array_id:
      case new_object_array_id:
        {
          Register length   = rbx; // Incoming
          Register klass    = rdx; // Incoming
          Register obj      = rax; // Result
  
          if (id == new_type_array_id) {
            __ set_info("new_type_array", dont_gc_arguments);
!         } else {
            __ set_info("new_object_array", dont_gc_arguments);
          }
  
  #ifdef ASSERT
          // assert object type is really an array of the proper kind
          {
            Label ok;
            Register t0 = obj;
            __ movl(t0, Address(klass, Klass::layout_helper_offset()));
            __ sarl(t0, Klass::_lh_array_tag_shift);
!           int tag = ((id == new_type_array_id)
!                      ? Klass::_lh_array_tag_type_value
!                      : Klass::_lh_array_tag_obj_value);
!           __ cmpl(t0, tag);
!           __ jcc(Assembler::equal, ok);
!           __ stop("assert(is an array klass)");
            __ should_not_reach_here();
            __ bind(ok);
          }
  #endif // ASSERT
  
--- 1138,54 ---
        }
        break;
  
      case new_type_array_id:
      case new_object_array_id:
+     case new_flat_array_id:
        {
          Register length   = rbx; // Incoming
          Register klass    = rdx; // Incoming
          Register obj      = rax; // Result
  
          if (id == new_type_array_id) {
            __ set_info("new_type_array", dont_gc_arguments);
!         } else if (id == new_object_array_id) {
            __ set_info("new_object_array", dont_gc_arguments);
+         } else {
+           __ set_info("new_flat_array", dont_gc_arguments);
          }
  
  #ifdef ASSERT
          // assert object type is really an array of the proper kind
          {
            Label ok;
            Register t0 = obj;
            __ movl(t0, Address(klass, Klass::layout_helper_offset()));
            __ sarl(t0, Klass::_lh_array_tag_shift);
!           switch (id) {
!           case new_type_array_id:
!             __ cmpl(t0, Klass::_lh_array_tag_type_value);
!             __ jcc(Assembler::equal, ok);
!             __ stop("assert(is a type array klass)");
!             break;
+           case new_object_array_id:
+             __ cmpl(t0, Klass::_lh_array_tag_obj_value); // new "[Ljava/lang/Object;"
+             __ jcc(Assembler::equal, ok);
+             __ cmpl(t0, Klass::_lh_array_tag_vt_value);  // new "[LVT;"
+             __ jcc(Assembler::equal, ok);
+             __ stop("assert(is an object or inline type array klass)");
+             break;
+           case new_flat_array_id:
+             // new "[QVT;"
+             __ cmpl(t0, Klass::_lh_array_tag_vt_value);  // the array can be flattened.
+             __ jcc(Assembler::equal, ok);
+             __ cmpl(t0, Klass::_lh_array_tag_obj_value); // the array cannot be flattened (due to InlineArrayElementMaxFlatSize, etc)
+             __ jcc(Assembler::equal, ok);
+             __ stop("assert(is an object or inline type array klass)");
+             break;
+           default:  ShouldNotReachHere();
+           }
            __ should_not_reach_here();
            __ bind(ok);
          }
  #endif // ASSERT
  

*** 1205,12 ***
          __ enter();
          OopMap* map = save_live_registers(sasm, 3);
          int call_offset;
          if (id == new_type_array_id) {
            call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_type_array), klass, length);
!         } else {
            call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_object_array), klass, length);
          }
  
          oop_maps = new OopMapSet();
          oop_maps->add_gc_map(call_offset, map);
          restore_live_registers_except_rax(sasm);
--- 1233,15 ---
          __ enter();
          OopMap* map = save_live_registers(sasm, 3);
          int call_offset;
          if (id == new_type_array_id) {
            call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_type_array), klass, length);
!         } else if (id == new_object_array_id) {
            call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_object_array), klass, length);
+         } else {
+           assert(id == new_flat_array_id, "must be");
+           call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_flat_array), klass, length);
          }
  
          oop_maps = new OopMapSet();
          oop_maps->add_gc_map(call_offset, map);
          restore_live_registers_except_rax(sasm);

*** 1238,10 ***
--- 1269,87 ---
          // rax,: new multi array
          __ verify_oop(rax);
        }
        break;
  
+     case load_flattened_array_id:
+       {
+         StubFrame f(sasm, "load_flattened_array", dont_gc_arguments);
+         OopMap* map = save_live_registers(sasm, 3);
+ 
+         // Called with store_parameter and not C abi
+ 
+         f.load_argument(1, rax); // rax,: array
+         f.load_argument(0, rbx); // rbx,: index
+         int call_offset = __ call_RT(rax, noreg, CAST_FROM_FN_PTR(address, load_flattened_array), rax, rbx);
+ 
+         oop_maps = new OopMapSet();
+         oop_maps->add_gc_map(call_offset, map);
+         restore_live_registers_except_rax(sasm);
+ 
+         // rax,: loaded element at array[index]
+         __ verify_oop(rax);
+       }
+       break;
+ 
+     case store_flattened_array_id:
+       {
+         StubFrame f(sasm, "store_flattened_array", dont_gc_arguments);
+         OopMap* map = save_live_registers(sasm, 4);
+ 
+         // Called with store_parameter and not C abi
+ 
+         f.load_argument(2, rax); // rax,: array
+         f.load_argument(1, rbx); // rbx,: index
+         f.load_argument(0, rcx); // rcx,: value
+         int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, store_flattened_array), rax, rbx, rcx);
+ 
+         oop_maps = new OopMapSet();
+         oop_maps->add_gc_map(call_offset, map);
+         restore_live_registers_except_rax(sasm);
+       }
+       break;
+ 
+     case substitutability_check_id:
+       {
+         StubFrame f(sasm, "substitutability_check", dont_gc_arguments);
+         OopMap* map = save_live_registers(sasm, 3);
+ 
+         // Called with store_parameter and not C abi
+ 
+         f.load_argument(1, rax); // rax,: left
+         f.load_argument(0, rbx); // rbx,: right
+         int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, substitutability_check), rax, rbx);
+ 
+         oop_maps = new OopMapSet();
+         oop_maps->add_gc_map(call_offset, map);
+         restore_live_registers_except_rax(sasm);
+ 
+         // rax,: are the two operands substitutable
+       }
+       break;
+ 
+ 
+     case buffer_inline_args_id:
+     case buffer_inline_args_no_receiver_id:
+       {
+         const char* name = (id == buffer_inline_args_id) ?
+           "buffer_inline_args" : "buffer_inline_args_no_receiver";
+         StubFrame f(sasm, name, dont_gc_arguments);
+         OopMap* map = save_live_registers(sasm, 2);
+         Register method = rbx;
+         address entry = (id == buffer_inline_args_id) ?
+           CAST_FROM_FN_PTR(address, buffer_inline_args) :
+           CAST_FROM_FN_PTR(address, buffer_inline_args_no_receiver);
+         int call_offset = __ call_RT(rax, noreg, entry, method);
+         oop_maps = new OopMapSet();
+         oop_maps->add_gc_map(call_offset, map);
+         restore_live_registers_except_rax(sasm);
+         __ verify_oop(rax);  // rax: an array of buffered value objects
+       }
+       break;
+ 
      case register_finalizer_id:
        {
          __ set_info("register_finalizer", dont_gc_arguments);
  
          // This is called via call_runtime so the arguments

*** 1340,15 ***
          oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true);
        }
        break;
  
      case throw_incompatible_class_change_error_id:
!       { StubFrame f(sasm, "throw_incompatible_class_cast_exception", dont_gc_arguments);
          oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false);
        }
        break;
  
      case slow_subtype_check_id:
        {
          // Typical calling sequence:
          // __ push(klass_RInfo);  // object klass or other subclass
          // __ push(sup_k_RInfo);  // array element klass or other superclass
--- 1448,21 ---
          oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true);
        }
        break;
  
      case throw_incompatible_class_change_error_id:
!       { StubFrame f(sasm, "throw_incompatible_class_change_error", dont_gc_arguments);
          oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false);
        }
        break;
  
+     case throw_illegal_monitor_state_exception_id:
+       { StubFrame f(sasm, "throw_illegal_monitor_state_exception", dont_gc_arguments);
+         oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_illegal_monitor_state_exception), false);
+       }
+       break;
+ 
      case slow_subtype_check_id:
        {
          // Typical calling sequence:
          // __ push(klass_RInfo);  // object klass or other subclass
          // __ push(sup_k_RInfo);  // array element klass or other superclass
< prev index next >