< prev index next >

src/hotspot/share/jvmci/compilerRuntime.cpp

Print this page




  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 "classfile/stringTable.hpp"
  26 #include "classfile/symbolTable.hpp"
  27 #include "interpreter/linkResolver.hpp"
  28 #include "jvmci/compilerRuntime.hpp"
  29 #include "oops/cpCache.inline.hpp"
  30 #include "oops/oop.inline.hpp"
  31 #include "runtime/compilationPolicy.hpp"
  32 #include "runtime/deoptimization.hpp"
  33 #include "runtime/interfaceSupport.hpp"
  34 #include "runtime/vframe.hpp"
  35 #include "aot/aotLoader.hpp"
  36 
  37 // Resolve and allocate String
  38 JRT_BLOCK_ENTRY(void, CompilerRuntime::resolve_string_by_symbol(JavaThread *thread, void* string_result, const char* name))
  39   JRT_BLOCK
  40     oop str = *(oop*)string_result; // Is it resolved already?
  41     if (str == NULL) { // Do resolution
  42       // First 2 bytes of name contains length (number of bytes).
  43       int len = build_u2_from((address)name);
  44       name += 2;
  45       TempNewSymbol sym = SymbolTable::new_symbol(name, len, CHECK);
  46       str = StringTable::intern(sym, CHECK);
  47       assert(java_lang_String::is_instance(str), "must be string");
  48       *(oop*)string_result = str; // Store result
  49     }
  50     assert(str != NULL, "Should be allocated!");
  51     thread->set_vm_result(str);
  52   JRT_BLOCK_END
  53 JRT_END




  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 "classfile/stringTable.hpp"
  26 #include "classfile/symbolTable.hpp"
  27 #include "interpreter/linkResolver.hpp"
  28 #include "jvmci/compilerRuntime.hpp"
  29 #include "oops/cpCache.inline.hpp"
  30 #include "oops/oop.inline.hpp"
  31 #include "runtime/compilationPolicy.hpp"
  32 #include "runtime/deoptimization.hpp"
  33 #include "runtime/interfaceSupport.inline.hpp"
  34 #include "runtime/vframe.hpp"
  35 #include "aot/aotLoader.hpp"
  36 
  37 // Resolve and allocate String
  38 JRT_BLOCK_ENTRY(void, CompilerRuntime::resolve_string_by_symbol(JavaThread *thread, void* string_result, const char* name))
  39   JRT_BLOCK
  40     oop str = *(oop*)string_result; // Is it resolved already?
  41     if (str == NULL) { // Do resolution
  42       // First 2 bytes of name contains length (number of bytes).
  43       int len = build_u2_from((address)name);
  44       name += 2;
  45       TempNewSymbol sym = SymbolTable::new_symbol(name, len, CHECK);
  46       str = StringTable::intern(sym, CHECK);
  47       assert(java_lang_String::is_instance(str), "must be string");
  48       *(oop*)string_result = str; // Store result
  49     }
  50     assert(str != NULL, "Should be allocated!");
  51     thread->set_vm_result(str);
  52   JRT_BLOCK_END
  53 JRT_END


< prev index next >