@@ -340,7 +340,6 @@ bool LibraryCallKit::try_to_inline(int predicate) {
340340 case vmIntrinsics::_getLong: return inline_unsafe_access (!is_store, T_LONG, Relaxed, false );
341341 case vmIntrinsics::_getFloat: return inline_unsafe_access (!is_store, T_FLOAT, Relaxed, false );
342342 case vmIntrinsics::_getDouble: return inline_unsafe_access (!is_store, T_DOUBLE, Relaxed, false );
343- case vmIntrinsics::_getValue: return inline_unsafe_access (!is_store, T_OBJECT, Relaxed, false , true );
344343
345344 case vmIntrinsics::_putReference: return inline_unsafe_access ( is_store, T_OBJECT, Relaxed, false );
346345 case vmIntrinsics::_putBoolean: return inline_unsafe_access ( is_store, T_BOOLEAN, Relaxed, false );
@@ -351,7 +350,6 @@ bool LibraryCallKit::try_to_inline(int predicate) {
351350 case vmIntrinsics::_putLong: return inline_unsafe_access ( is_store, T_LONG, Relaxed, false );
352351 case vmIntrinsics::_putFloat: return inline_unsafe_access ( is_store, T_FLOAT, Relaxed, false );
353352 case vmIntrinsics::_putDouble: return inline_unsafe_access ( is_store, T_DOUBLE, Relaxed, false );
354- case vmIntrinsics::_putValue: return inline_unsafe_access ( is_store, T_OBJECT, Relaxed, false , true );
355353
356354 case vmIntrinsics::_getReferenceVolatile: return inline_unsafe_access (!is_store, T_OBJECT, Volatile, false );
357355 case vmIntrinsics::_getBooleanVolatile: return inline_unsafe_access (!is_store, T_BOOLEAN, Volatile, false );
@@ -2462,7 +2460,7 @@ void LibraryCallKit::SavedState::discard() {
24622460 _discarded = true ;
24632461}
24642462
2465- bool LibraryCallKit::inline_unsafe_access (bool is_store, const BasicType type, const AccessKind kind, const bool unaligned, const bool is_flat ) {
2463+ bool LibraryCallKit::inline_unsafe_access (bool is_store, const BasicType type, const AccessKind kind, const bool unaligned) {
24662464 if (callee ()->is_static ()) return false ; // caller must have the capability!
24672465 DecoratorSet decorators = C2_UNSAFE_ACCESS;
24682466 guarantee (!is_store || kind != Acquire, " Acquire accesses can be produced only for loads" );
@@ -2487,13 +2485,13 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
24872485 // Object getReference(Object base, int/long offset), etc.
24882486 BasicType rtype = sig->return_type ()->basic_type ();
24892487 assert (rtype == type, " getter must return the expected value" );
2490- assert (sig->count () == 2 || (is_flat && sig-> count () == 3 ) , " oop getter has 2 or 3 arguments" );
2488+ assert (sig->count () == 2 , " oop getter has 2 arguments" );
24912489 assert (sig->type_at (0 )->basic_type () == T_OBJECT, " getter base is object" );
24922490 assert (sig->type_at (1 )->basic_type () == T_LONG, " getter offset is correct" );
24932491 } else {
24942492 // void putReference(Object base, int/long offset, Object x), etc.
24952493 assert (sig->return_type ()->basic_type () == T_VOID, " putter must not return a value" );
2496- assert (sig->count () == 3 || (is_flat && sig-> count () == 4 ) , " oop putter has 3 arguments" );
2494+ assert (sig->count () == 3 , " oop putter has 3 arguments" );
24972495 assert (sig->type_at (0 )->basic_type () == T_OBJECT, " putter base is object" );
24982496 assert (sig->type_at (1 )->basic_type () == T_LONG, " putter offset is correct" );
24992497 BasicType vtype = sig->type_at (sig->count ()-1 )->basic_type ();
@@ -2520,19 +2518,6 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
25202518 assert (Unsafe_field_offset_to_byte_offset (11 ) == 11 ,
25212519 " fieldOffset must be byte-scaled" );
25222520
2523- ciInlineKlass* inline_klass = nullptr ;
2524- if (is_flat) {
2525- const TypeInstPtr* cls = _gvn.type (argument (4 ))->isa_instptr ();
2526- if (cls == nullptr || cls->const_oop () == nullptr ) {
2527- return false ;
2528- }
2529- ciType* mirror_type = cls->const_oop ()->as_instance ()->java_mirror_type ();
2530- if (!mirror_type->is_inlinetype ()) {
2531- return false ;
2532- }
2533- inline_klass = mirror_type->as_inline_klass ();
2534- }
2535-
25362521 if (base->is_InlineType ()) {
25372522 assert (!is_store, " InlineTypeNodes are non-larval value objects" );
25382523 InlineTypeNode* vt = base->as_InlineType ();
@@ -2549,7 +2534,7 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
25492534 if (bt == T_ARRAY || bt == T_NARROWOOP) {
25502535 bt = T_OBJECT;
25512536 }
2552- if (bt == type && ( !field->is_flat () || field-> type () == inline_klass )) {
2537+ if (bt == type && !field->is_flat ()) {
25532538 Node* value = vt->field_value_by_offset (off, false );
25542539 if (value->is_InlineType ()) {
25552540 value = value->as_InlineType ()->adjust_scalarization_depth (this );
@@ -2578,7 +2563,7 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
25782563 assert (!stopped (), " Inlining of unsafe access failed: address construction stopped unexpectedly" );
25792564
25802565 if (_gvn.type (base->uncast ())->isa_ptr () == TypePtr::NULL_PTR) {
2581- if (type != T_OBJECT && (inline_klass == nullptr || !inline_klass-> has_object_fields ()) ) {
2566+ if (type != T_OBJECT) {
25822567 decorators |= IN_NATIVE; // off-heap primitive access
25832568 } else {
25842569 return false ; // off-heap oop accesses are not supported
@@ -2594,7 +2579,7 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
25942579 decorators |= IN_HEAP;
25952580 }
25962581
2597- Node* val = is_store ? argument (4 + (is_flat ? 1 : 0 ) ) : nullptr ;
2582+ Node* val = is_store ? argument (4 ) : nullptr ;
25982583
25992584 const TypePtr* adr_type = _gvn.type (adr)->isa_ptr ();
26002585 if (adr_type == TypePtr::NULL_PTR) {
@@ -2635,7 +2620,7 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
26352620 bt = type2field[field->type ()->basic_type ()];
26362621 }
26372622 }
2638- assert (bt == alias_type->basic_type () || is_flat , " should match" );
2623+ assert (bt == alias_type->basic_type (), " should match" );
26392624 } else {
26402625 bt = alias_type->basic_type ();
26412626 }
@@ -2660,27 +2645,6 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
26602645 mismatched = true ; // conservatively mark all "wide" on-heap accesses as mismatched
26612646 }
26622647
2663- if (is_flat) {
2664- if (adr_type->isa_instptr ()) {
2665- if (field == nullptr || field->type () != inline_klass) {
2666- mismatched = true ;
2667- }
2668- } else if (adr_type->isa_aryptr ()) {
2669- const Type* elem = adr_type->is_aryptr ()->elem ();
2670- if (!adr_type->is_flat () || elem->inline_klass () != inline_klass) {
2671- mismatched = true ;
2672- }
2673- } else {
2674- mismatched = true ;
2675- }
2676- if (is_store) {
2677- const Type* val_t = _gvn.type (val);
2678- if (!val_t ->is_inlinetypeptr () || val_t ->inline_klass () != inline_klass) {
2679- return false ;
2680- }
2681- }
2682- }
2683-
26842648 old_state.discard ();
26852649 assert (!mismatched || alias_type->adr_type ()->is_oopptr (), " off-heap access can't be mismatched" );
26862650
@@ -2695,7 +2659,7 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
26952659 decorators |= mo_decorator_for_access_kind (kind);
26962660
26972661 if (!is_store) {
2698- if (type == T_OBJECT && !is_flat ) {
2662+ if (type == T_OBJECT) {
26992663 const TypeOopPtr* tjp = sharpen_unsafe_type (alias_type, adr_type);
27002664 if (tjp != nullptr ) {
27012665 value_type = tjp;
@@ -2722,15 +2686,11 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
27222686 }
27232687
27242688 if (p == nullptr ) { // Could not constant fold the load
2725- if (is_flat) {
2726- p = InlineTypeNode::make_from_flat (this , inline_klass, base, adr, adr_type, false , false , true );
2727- } else {
2728- p = access_load_at (heap_base_oop, adr, adr_type, value_type, type, decorators);
2729- const TypeOopPtr* ptr = value_type->make_oopptr ();
2730- if (ptr != nullptr && ptr->is_inlinetypeptr ()) {
2731- // Load a non-flattened inline type from memory
2732- p = InlineTypeNode::make_from_oop (this , p, ptr->inline_klass ());
2733- }
2689+ p = access_load_at (heap_base_oop, adr, adr_type, value_type, type, decorators);
2690+ const TypeOopPtr* ptr = value_type->make_oopptr ();
2691+ if (ptr != nullptr && ptr->is_inlinetypeptr ()) {
2692+ // Load a non-flattened inline type from memory
2693+ p = InlineTypeNode::make_from_oop (this , p, ptr->inline_klass ());
27342694 }
27352695 // Normalize the value returned by getBoolean in the following cases
27362696 if (type == T_BOOLEAN &&
@@ -2769,11 +2729,7 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
27692729 val = ConvL2X (val);
27702730 val = gvn ().transform (new CastX2PNode (val));
27712731 }
2772- if (is_flat) {
2773- val->as_InlineType ()->store_flat (this , base, adr, false , false , true , decorators);
2774- } else {
2775- access_store_at (heap_base_oop, adr, adr_type, val, value_type, type, decorators);
2776- }
2732+ access_store_at (heap_base_oop, adr, adr_type, val, value_type, type, decorators);
27772733 }
27782734
27792735 return true ;
0 commit comments