85
86 static int value_offset_in_bytes() {
87 assert(initialized && (value_offset > 0), "Must be initialized");
88 return value_offset;
89 }
90 static int hash_offset_in_bytes() {
91 assert(initialized && (hash_offset > 0), "Must be initialized");
92 return hash_offset;
93 }
94 static int coder_offset_in_bytes() {
95 assert(initialized && (coder_offset > 0), "Must be initialized");
96 return coder_offset;
97 }
98
99 static inline void set_value_raw(oop string, typeArrayOop buffer);
100 static inline void set_value(oop string, typeArrayOop buffer);
101 static inline void set_hash(oop string, unsigned int hash);
102
103 // Accessors
104 static inline typeArrayOop value(oop java_string);
105 static inline unsigned int hash(oop java_string);
106 static inline bool is_latin1(oop java_string);
107 static inline int length(oop java_string);
108 static int utf8_length(oop java_string);
109
110 // String converters
111 static char* as_utf8_string(oop java_string);
112 static char* as_utf8_string(oop java_string, char* buf, int buflen);
113 static char* as_utf8_string(oop java_string, int start, int len);
114 static char* as_utf8_string(oop java_string, int start, int len, char* buf, int buflen);
115 static char* as_platform_dependent_str(Handle java_string, TRAPS);
116 static jchar* as_unicode_string(oop java_string, int& length, TRAPS);
117 // produce an ascii string with all other values quoted using \u####
118 static char* as_quoted_ascii(oop java_string);
119
120 // Compute the hash value for a java.lang.String object which would
121 // contain the characters passed in.
122 //
123 // As the hash value used by the String object itself, in
124 // String.hashCode(). This value is normally calculated in Java code
|
85
86 static int value_offset_in_bytes() {
87 assert(initialized && (value_offset > 0), "Must be initialized");
88 return value_offset;
89 }
90 static int hash_offset_in_bytes() {
91 assert(initialized && (hash_offset > 0), "Must be initialized");
92 return hash_offset;
93 }
94 static int coder_offset_in_bytes() {
95 assert(initialized && (coder_offset > 0), "Must be initialized");
96 return coder_offset;
97 }
98
99 static inline void set_value_raw(oop string, typeArrayOop buffer);
100 static inline void set_value(oop string, typeArrayOop buffer);
101 static inline void set_hash(oop string, unsigned int hash);
102
103 // Accessors
104 static inline typeArrayOop value(oop java_string);
105 static inline typeArrayOop value_no_keepalive(oop java_string);
106 static inline unsigned int hash(oop java_string);
107 static inline bool is_latin1(oop java_string);
108 static inline int length(oop java_string);
109 static int utf8_length(oop java_string);
110
111 // String converters
112 static char* as_utf8_string(oop java_string);
113 static char* as_utf8_string(oop java_string, char* buf, int buflen);
114 static char* as_utf8_string(oop java_string, int start, int len);
115 static char* as_utf8_string(oop java_string, int start, int len, char* buf, int buflen);
116 static char* as_platform_dependent_str(Handle java_string, TRAPS);
117 static jchar* as_unicode_string(oop java_string, int& length, TRAPS);
118 // produce an ascii string with all other values quoted using \u####
119 static char* as_quoted_ascii(oop java_string);
120
121 // Compute the hash value for a java.lang.String object which would
122 // contain the characters passed in.
123 //
124 // As the hash value used by the String object itself, in
125 // String.hashCode(). This value is normally calculated in Java code
|