< prev index next >

src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp

Print this page
@@ -118,10 +118,76 @@
  #ifdef ASSERT
    __ should_not_reach_here();
  #endif
  }
  
+ // Implementation of LoadFlattenedArrayStub
+ 
+ LoadFlattenedArrayStub::LoadFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr result, CodeEmitInfo* info) {
+   _array = array;
+   _index = index;
+   _result = result;
+   _scratch_reg = FrameMap::r0_oop_opr;
+   _info = new CodeEmitInfo(info);
+ }
+ 
+ void LoadFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
+   assert(__ rsp_offset() == 0, "frame size should be fixed");
+   __ bind(_entry);
+   ce->store_parameter(_array->as_register(), 1);
+   ce->store_parameter(_index->as_register(), 0);
+   __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::load_flat_array_id)));
+   ce->add_call_info_here(_info);
+   ce->verify_oop_map(_info);
+   if (_result->as_register() != r0) {
+     __ mov(_result->as_register(), r0);
+   }
+   __ b(_continuation);
+ }
+ 
+ 
+ // Implementation of StoreFlattenedArrayStub
+ 
+ StoreFlattenedArrayStub::StoreFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr value, CodeEmitInfo* info) {
+   _array = array;
+   _index = index;
+   _value = value;
+   _scratch_reg = FrameMap::r0_oop_opr;
+   _info = new CodeEmitInfo(info);
+ }
+ 
+ 
+ void StoreFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
+   assert(__ rsp_offset() == 0, "frame size should be fixed");
+   __ bind(_entry);
+   ce->store_parameter(_array->as_register(), 2);
+   ce->store_parameter(_index->as_register(), 1);
+   ce->store_parameter(_value->as_register(), 0);
+   __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::store_flat_array_id)));
+   ce->add_call_info_here(_info);
+   ce->verify_oop_map(_info);
+   __ b(_continuation);
+ }
+ 
+ // Implementation of SubstitutabilityCheckStub
+ SubstitutabilityCheckStub::SubstitutabilityCheckStub(LIR_Opr left, LIR_Opr right, CodeEmitInfo* info) {
+   _left = left;
+   _right = right;
+   _scratch_reg = FrameMap::r0_oop_opr;
+   _info = new CodeEmitInfo(info);
+ }
+ 
+ void SubstitutabilityCheckStub::emit_code(LIR_Assembler* ce) {
+   assert(__ rsp_offset() == 0, "frame size should be fixed");
+   __ bind(_entry);
+   ce->store_parameter(_left->as_register(), 1);
+   ce->store_parameter(_right->as_register(), 0);
+   __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::substitutability_check_id)));
+   ce->add_call_info_here(_info);
+   ce->verify_oop_map(_info);
+   __ b(_continuation);
+ }
  
  
  // Implementation of NewInstanceStub
  
  NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id) {

@@ -134,12 +200,10 @@
           stub_id == C1StubId::fast_new_instance_init_check_id,
           "need new_instance id");
    _stub_id   = stub_id;
  }
  
- 
- 
  void NewInstanceStub::emit_code(LIR_Assembler* ce) {
    assert(__ rsp_offset() == 0, "frame size should be fixed");
    __ bind(_entry);
    __ mov(r3, _klass_reg->as_register());
    __ far_call(RuntimeAddress(Runtime1::entry_for(_stub_id)));

@@ -175,33 +239,51 @@
  }
  
  
  // Implementation of NewObjectArrayStub
  
- NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
+ NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result,
+                                        CodeEmitInfo* info, bool is_null_free) {
    _klass_reg = klass_reg;
    _result = result;
    _length = length;
    _info = new CodeEmitInfo(info);
+   _is_null_free = is_null_free;
  }
  
  
  void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
    assert(__ rsp_offset() == 0, "frame size should be fixed");
    __ bind(_entry);
    assert(_length->as_register() == r19, "length must in r19,");
    assert(_klass_reg->as_register() == r3, "klass_reg must in r3");
-   __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_object_array_id)));
+ 
+   if (_is_null_free) {
+     __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_null_free_array_id)));
+   } else {
+     __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_object_array_id)));
+   }
+ 
    ce->add_call_info_here(_info);
    ce->verify_oop_map(_info);
    assert(_result->as_register() == r0, "result must in r0");
    __ b(_continuation);
  }
  
  void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
    assert(__ rsp_offset() == 0, "frame size should be fixed");
    __ bind(_entry);
+   if (_throw_ie_stub != nullptr) {
+     // When we come here, _obj_reg has already been checked to be non-null.
+     __ ldr(rscratch1, Address(_obj_reg->as_register(), oopDesc::mark_offset_in_bytes()));
+     __ mov(rscratch2, markWord::inline_type_pattern);
+     __ andr(rscratch1, rscratch1, rscratch2);
+ 
+     __ cmp(rscratch1, rscratch2);
+     __ br(Assembler::EQ, *_throw_ie_stub->entry());
+   }
+ 
    ce->store_parameter(_obj_reg->as_register(),  1);
    ce->store_parameter(_lock_reg->as_register(), 0);
    C1StubId enter_id;
    if (ce->compilation()->has_fpu_code()) {
      enter_id = C1StubId::monitorenter_id;
< prev index next >