12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 #include "precompiled.hpp"
25 #include "aot/aotLoader.hpp"
26 #include "classfile/stringTable.hpp"
27 #include "classfile/symbolTable.hpp"
28 #include "interpreter/linkResolver.hpp"
29 #include "jvmci/compilerRuntime.hpp"
30 #include "oops/cpCache.inline.hpp"
31 #include "oops/oop.inline.hpp"
32 #include "runtime/compilationPolicy.hpp"
33 #include "runtime/deoptimization.hpp"
34 #include "runtime/frame.inline.hpp"
35 #include "runtime/handles.inline.hpp"
36 #include "runtime/interfaceSupport.inline.hpp"
37 #include "runtime/vframe.inline.hpp"
38 #include "utilities/sizes.hpp"
39
40 // Resolve and allocate String
41 JRT_BLOCK_ENTRY(void, CompilerRuntime::resolve_string_by_symbol(JavaThread *thread, void* string_result, const char* name))
42 JRT_BLOCK
43 oop str = *(oop*)string_result; // Is it resolved already?
44 if (str == NULL) { // Do resolution
45 // First 2 bytes of name contains length (number of bytes).
46 int len = Bytes::get_Java_u2((address)name);
47 name += 2;
48 TempNewSymbol sym = SymbolTable::new_symbol(name, len);
49 str = StringTable::intern(sym, CHECK);
50 assert(java_lang_String::is_instance(str), "must be string");
51 *(oop*)string_result = str; // Store result
52 }
|
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 #include "precompiled.hpp"
25 #include "aot/aotLoader.hpp"
26 #include "classfile/stringTable.hpp"
27 #include "classfile/symbolTable.hpp"
28 #include "interpreter/linkResolver.hpp"
29 #include "jvmci/compilerRuntime.hpp"
30 #include "oops/cpCache.inline.hpp"
31 #include "oops/oop.inline.hpp"
32 #include "compiler/compilationPolicy.hpp"
33 #include "runtime/deoptimization.hpp"
34 #include "runtime/frame.inline.hpp"
35 #include "runtime/handles.inline.hpp"
36 #include "runtime/interfaceSupport.inline.hpp"
37 #include "runtime/vframe.inline.hpp"
38 #include "utilities/sizes.hpp"
39
40 // Resolve and allocate String
41 JRT_BLOCK_ENTRY(void, CompilerRuntime::resolve_string_by_symbol(JavaThread *thread, void* string_result, const char* name))
42 JRT_BLOCK
43 oop str = *(oop*)string_result; // Is it resolved already?
44 if (str == NULL) { // Do resolution
45 // First 2 bytes of name contains length (number of bytes).
46 int len = Bytes::get_Java_u2((address)name);
47 name += 2;
48 TempNewSymbol sym = SymbolTable::new_symbol(name, len);
49 str = StringTable::intern(sym, CHECK);
50 assert(java_lang_String::is_instance(str), "must be string");
51 *(oop*)string_result = str; // Store result
52 }
|