< prev index next >

src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp

Print this page




  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 "jvmci/jvmciCodeInstaller.hpp"
  25 #include "jvmci/jvmciRuntime.hpp"
  26 #include "jvmci/jvmciCompilerToVM.hpp"
  27 #include "jvmci/jvmciJavaClasses.hpp"
  28 #include "oops/oop.inline.hpp"
  29 #include "runtime/sharedRuntime.hpp"

  30 #include "vmreg_sparc.inline.hpp"
  31 
  32 jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, Handle method, TRAPS) {
  33   if (inst->is_call() || inst->is_jump()) {
  34     return pc_offset + NativeCall::instruction_size;
  35   } else if (inst->is_call_reg()) {
  36     return pc_offset + NativeCallReg::instruction_size;
  37   } else if (inst->is_sethi()) {
  38     return pc_offset + NativeFarCall::instruction_size;
  39   } else {
  40     JVMCI_ERROR_0("unsupported type of instruction for call site");
  41     return 0;
  42   }
  43 }
  44 
  45 void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle constant, TRAPS) {
  46   address pc = _instructions->start() + pc_offset;
  47   Handle obj(THREAD, HotSpotObjectConstantImpl::object(constant));
  48   jobject value = JNIHandles::make_local(obj());
  49   if (HotSpotObjectConstantImpl::compressed(constant)) {




  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 "jvmci/jvmciCodeInstaller.hpp"
  25 #include "jvmci/jvmciRuntime.hpp"
  26 #include "jvmci/jvmciCompilerToVM.hpp"
  27 #include "jvmci/jvmciJavaClasses.hpp"
  28 #include "oops/oop.inline.hpp"
  29 #include "runtime/sharedRuntime.hpp"
  30 #include "utilities/align.hpp"
  31 #include "vmreg_sparc.inline.hpp"
  32 
  33 jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, Handle method, TRAPS) {
  34   if (inst->is_call() || inst->is_jump()) {
  35     return pc_offset + NativeCall::instruction_size;
  36   } else if (inst->is_call_reg()) {
  37     return pc_offset + NativeCallReg::instruction_size;
  38   } else if (inst->is_sethi()) {
  39     return pc_offset + NativeFarCall::instruction_size;
  40   } else {
  41     JVMCI_ERROR_0("unsupported type of instruction for call site");
  42     return 0;
  43   }
  44 }
  45 
  46 void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle constant, TRAPS) {
  47   address pc = _instructions->start() + pc_offset;
  48   Handle obj(THREAD, HotSpotObjectConstantImpl::object(constant));
  49   jobject value = JNIHandles::make_local(obj());
  50   if (HotSpotObjectConstantImpl::compressed(constant)) {


< prev index next >