src/share/vm/jvmci/compilerRuntime.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/jvmci

src/share/vm/jvmci/compilerRuntime.cpp

Print this page
rev 29186 : Review changes 2


   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  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 "classfile/stringTable.hpp"
  26 #include "classfile/symbolTable.hpp"
  27 #include "jvmci/compilerRuntime.hpp"
  28 #include "runtime/interfaceSupport.hpp"
  29 #include "runtime/compilationPolicy.hpp"
  30 #include "runtime/deoptimization.hpp"

  31 
  32 // Resolve and allocate String
  33 JRT_BLOCK_ENTRY(void, CompilerRuntime::resolve_string_by_symbol(JavaThread *thread, void* string_result, const char* name))
  34   JRT_BLOCK
  35     oop str = *(oop*)string_result; // Is it resolved already?
  36     if (str == NULL) { // Do resolution
  37       // First 2 bytes of name contains length (number of bytes).
  38       int len = build_u2_from((address)name);
  39       name += 2;
  40       TempNewSymbol sym = SymbolTable::new_symbol(name, len, CHECK);
  41       str = StringTable::intern(sym, CHECK);
  42       assert(java_lang_String::is_instance(str), "must be string");
  43       *(oop*)string_result = str; // Store result
  44     }
  45     assert(str != NULL, "Should be allocated!");
  46     thread->set_vm_result(str);
  47   JRT_BLOCK_END
  48 JRT_END
  49 
  50 




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  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 "classfile/stringTable.hpp"
  26 #include "classfile/symbolTable.hpp"
  27 #include "jvmci/compilerRuntime.hpp"

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


src/share/vm/jvmci/compilerRuntime.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File