8217442: Optimize native accesses to String.value

Reviewed-by: shade, dholmes
This commit is contained in:
Claes Redestad 2019-01-22 11:22:44 +01:00
parent 5f5d4425c2
commit 911c7ff446
5 changed files with 75 additions and 57 deletions

View file

@ -147,13 +147,16 @@ class java_lang_String : AllStatic {
static inline unsigned int hash(oop java_string);
static inline bool is_latin1(oop java_string);
static inline int length(oop java_string);
static inline int length(oop java_string, typeArrayOop string_value);
static int utf8_length(oop java_string);
static int utf8_length(oop java_string, typeArrayOop string_value);
// String converters
static char* as_utf8_string(oop java_string);
static char* as_utf8_string(oop java_string, char* buf, int buflen);
static char* as_utf8_string(oop java_string, int start, int len);
static char* as_utf8_string(oop java_string, int start, int len, char* buf, int buflen);
static char* as_utf8_string(oop java_string, typeArrayOop value, char* buf, int buflen);
static char* as_utf8_string(oop java_string, typeArrayOop value, int start, int len, char* buf, int buflen);
static char* as_platform_dependent_str(Handle java_string, TRAPS);
static jchar* as_unicode_string(oop java_string, int& length, TRAPS);
// produce an ascii string with all other values quoted using \u####