Skip to content

Commit

Permalink
Add can skip null value store check
Browse files Browse the repository at this point in the history
Add `CanSkipNonNullableArrayNullStoreCheck` for recognized method.

Signed-off-by: Annabelle Huo <[email protected]>
  • Loading branch information
a7ehuo committed Nov 20, 2023
1 parent 07a175a commit aebf7dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions compiler/il/OMRMethodSymbol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class OMR_EXTENSIBLE MethodSymbol : public TR::Symbol
bool safeToSkipDivChecks() { return false; }
bool safeToSkipCheckCasts() { return false; }
bool safeToSkipArrayStoreChecks() { return false; }
bool safeToSkipNonNullableArrayNullStoreCheck() { return false; }
bool safeToSkipZeroInitializationOnNewarrays() { return false; }
bool safeToSkipChecksOnArrayCopies() { return false; }

Expand Down
15 changes: 8 additions & 7 deletions compiler/il/OMRResolvedMethodSymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,14 @@ OMR::ResolvedMethodSymbol::ResolvedMethodSymbol(TR_ResolvedMethod * method, TR::

self()->setParameterList();

_properties.set(CanSkipNullChecks , self()->safeToSkipNullChecks());
_properties.set(CanSkipBoundChecks , self()->safeToSkipBoundChecks());
_properties.set(CanSkipCheckCasts , self()->safeToSkipCheckCasts());
_properties.set(CanSkipDivChecks , self()->safeToSkipDivChecks());
_properties.set(CanSkipArrayStoreChecks , self()->safeToSkipArrayStoreChecks());
_properties.set(CanSkipChecksOnArrayCopies , self()->safeToSkipChecksOnArrayCopies());
_properties.set(CanSkipZeroInitializationOnNewarrays, self()->safeToSkipZeroInitializationOnNewarrays());
_properties.set(CanSkipNullChecks , self()->safeToSkipNullChecks());
_properties.set(CanSkipBoundChecks , self()->safeToSkipBoundChecks());
_properties.set(CanSkipCheckCasts , self()->safeToSkipCheckCasts());
_properties.set(CanSkipDivChecks , self()->safeToSkipDivChecks());
_properties.set(CanSkipArrayStoreChecks , self()->safeToSkipArrayStoreChecks());
_properties.set(CanSkipNonNullableArrayNullStoreCheck, self()->safeToSkipNonNullableArrayNullStoreCheck());
_properties.set(CanSkipChecksOnArrayCopies , self()->safeToSkipChecksOnArrayCopies());
_properties.set(CanSkipZeroInitializationOnNewarrays , self()->safeToSkipZeroInitializationOnNewarrays());
}


Expand Down
3 changes: 2 additions & 1 deletion compiler/il/OMRResolvedMethodSymbol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ class OMR_EXTENSIBLE ResolvedMethodSymbol : public TR::MethodSymbol
bool skipCheckCasts() { return _properties.testAny(CanSkipCheckCasts); }
bool skipDivChecks() { return _properties.testAny(CanSkipDivChecks); }
bool skipArrayStoreChecks() { return _properties.testAny(CanSkipArrayStoreChecks); }
bool skipNonNullableArrayNullStoreCheck() { return _properties.testAny(CanSkipNonNullableArrayNullStoreCheck); }
bool skipChecksOnArrayCopies() { return _properties.testAny(CanSkipChecksOnArrayCopies); }
bool skipZeroInitializationOnNewarrays() { return _properties.testAny(CanSkipZeroInitializationOnNewarrays); }

Expand Down Expand Up @@ -336,7 +337,7 @@ class OMR_EXTENSIBLE ResolvedMethodSymbol : public TR::MethodSymbol
CanSkipZeroInitializationOnNewarrays = 1 << 5,
CanSkipArrayStoreChecks = 1 << 6,
HasSnapshots = 1 << 7,
// AVAILABLE = 1 << 8,
CanSkipNonNullableArrayNullStoreCheck = 1 << 8,
CanDirectNativeCall = 1 << 9,
CanReplaceWithHWInstr = 1 << 10,
IsSideEffectFree = 1 << 12,
Expand Down

0 comments on commit aebf7dd

Please sign in to comment.