-
Enhancement
-
Resolution: Fixed
-
P4
-
17
-
b02
During class loading, we create a String object from a Symbol, then swap the '/' for '.' characters, and create another String object. Seems wasteful. I noticed this when looking for where we load java.lang.Throwable to throw OOM, and this also throws OOM.
It still would throw OOM, just not creating two strings in the process.
Handle s = java_lang_String::create_from_symbol(class_name, CHECK_NULL);
// Translate to external class name format, i.e., convert '/' chars to '.'
Handle string = java_lang_String::externalize_classname(s, CHECK_NULL);
There's another place that does the same thing.
It still would throw OOM, just not creating two strings in the process.
Handle s = java_lang_String::create_from_symbol(class_name, CHECK_NULL);
// Translate to external class name format, i.e., convert '/' chars to '.'
Handle string = java_lang_String::externalize_classname(s, CHECK_NULL);
There's another place that does the same thing.