< prev index next >

src/hotspot/share/jvmci/jvmciCodeInstaller.cpp

Print this page
rev 60137 : 8227745: Enable Escape Analysis for Better Performance in the Presence of JVMTI Agents
Reviewed-by: mdoerr, goetz
   1 /*
   2  * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   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  */


1164         expressions->append(first);
1165       } else {
1166         MonitorValue *monitor = get_monitor_value(value, objects, JVMCI_CHECK);
1167         monitors->append(monitor);
1168       }
1169       if (second != NULL) {
1170         i++;
1171         if (i >= JVMCIENV->get_length(values) || !JVMCIENV->equals(JVMCIENV->get_object_at(values, i), jvmci_env()->get_Value_ILLEGAL())) {
1172           JVMCI_ERROR("double-slot value not followed by Value.ILLEGAL");
1173         }
1174       }
1175     }
1176 
1177     locals_token = _debug_recorder->create_scope_values(locals);
1178     expressions_token = _debug_recorder->create_scope_values(expressions);
1179     monitors_token = _debug_recorder->create_monitor_values(monitors);
1180 
1181     throw_exception = jvmci_env()->get_BytecodeFrame_rethrowException(frame) == JNI_TRUE;
1182   }
1183 



1184   _debug_recorder->describe_scope(pc_offset, method, NULL, bci, reexecute, throw_exception, false, return_oop,

1185                                   locals_token, expressions_token, monitors_token);
1186 }
1187 
1188 void CodeInstaller::site_Safepoint(CodeBuffer& buffer, jint pc_offset, JVMCIObject site, JVMCI_TRAPS) {
1189   JVMCIObject debug_info = jvmci_env()->get_site_Infopoint_debugInfo(site);
1190   if (debug_info.is_null()) {
1191     JVMCI_ERROR("debug info expected at safepoint at %i", pc_offset);
1192   }
1193 
1194   // address instruction = _instructions->start() + pc_offset;
1195   // jint next_pc_offset = Assembler::locate_next_instruction(instruction) - _instructions->start();
1196   OopMap *map = create_oop_map(debug_info, JVMCI_CHECK);
1197   _debug_recorder->add_safepoint(pc_offset, map);
1198   record_scope(pc_offset, debug_info, CodeInstaller::FullFrame, JVMCI_CHECK);
1199   _debug_recorder->end_safepoint(pc_offset);
1200 }
1201 
1202 void CodeInstaller::site_Infopoint(CodeBuffer& buffer, jint pc_offset, JVMCIObject site, JVMCI_TRAPS) {
1203   JVMCIObject debug_info = jvmci_env()->get_site_Infopoint_debugInfo(site);
1204   if (debug_info.is_null()) {


   1 /*
   2  * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   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  */


1164         expressions->append(first);
1165       } else {
1166         MonitorValue *monitor = get_monitor_value(value, objects, JVMCI_CHECK);
1167         monitors->append(monitor);
1168       }
1169       if (second != NULL) {
1170         i++;
1171         if (i >= JVMCIENV->get_length(values) || !JVMCIENV->equals(JVMCIENV->get_object_at(values, i), jvmci_env()->get_Value_ILLEGAL())) {
1172           JVMCI_ERROR("double-slot value not followed by Value.ILLEGAL");
1173         }
1174       }
1175     }
1176 
1177     locals_token = _debug_recorder->create_scope_values(locals);
1178     expressions_token = _debug_recorder->create_scope_values(expressions);
1179     monitors_token = _debug_recorder->create_monitor_values(monitors);
1180 
1181     throw_exception = jvmci_env()->get_BytecodeFrame_rethrowException(frame) == JNI_TRUE;
1182   }
1183 
1184   // not_global_escape_in_scope and arg_escape should be added to JVMCI
1185   const bool not_global_escape_in_scope = false;
1186   const bool arg_escape                 = false;
1187   _debug_recorder->describe_scope(pc_offset, method, NULL, bci, reexecute, throw_exception, false, return_oop,
1188                                   not_global_escape_in_scope, arg_escape,
1189                                   locals_token, expressions_token, monitors_token);
1190 }
1191 
1192 void CodeInstaller::site_Safepoint(CodeBuffer& buffer, jint pc_offset, JVMCIObject site, JVMCI_TRAPS) {
1193   JVMCIObject debug_info = jvmci_env()->get_site_Infopoint_debugInfo(site);
1194   if (debug_info.is_null()) {
1195     JVMCI_ERROR("debug info expected at safepoint at %i", pc_offset);
1196   }
1197 
1198   // address instruction = _instructions->start() + pc_offset;
1199   // jint next_pc_offset = Assembler::locate_next_instruction(instruction) - _instructions->start();
1200   OopMap *map = create_oop_map(debug_info, JVMCI_CHECK);
1201   _debug_recorder->add_safepoint(pc_offset, map);
1202   record_scope(pc_offset, debug_info, CodeInstaller::FullFrame, JVMCI_CHECK);
1203   _debug_recorder->end_safepoint(pc_offset);
1204 }
1205 
1206 void CodeInstaller::site_Infopoint(CodeBuffer& buffer, jint pc_offset, JVMCIObject site, JVMCI_TRAPS) {
1207   JVMCIObject debug_info = jvmci_env()->get_site_Infopoint_debugInfo(site);
1208   if (debug_info.is_null()) {


< prev index next >