Multi-
byte compressed
string representation embodiments define a String class control field identifying compression as enabled / disabled, and another control field, identifying a decompressed string created when compression enabled. On
pattern matching by a
compiler, noping tests based on null setting of stringCompressionFlag and registering a class loading assumption on a
nop location. When arguments to a String class constructor are not compressible, a decompressed String is created and stringCompressionFlag initialized. Endian-aware helper methods for reading / writing
byte and character values and helper methods for widening, narrowing, truncation, conversion and masking are defined. Enhanced String class constructors, when characters are not compressible, create a decompressed String, and initialize stringCompressionFlag triggering class load assumptions, overwriting all nopable patch points. A String object
sign bit is set to one for decompressed strings when compression enabled, and masking / testing this flag bit is noped using stringCompressionFlag and associated class load assumption. Alternative
package protected string constructors and operations are provided. Checking a predetermined location to determine whether supplied arguments to a String class constructor are compressible is performed.