< prev index next >

src/hotspot/share/code/compiledMethod.cpp

Print this page
rev 60703 : 8227745, 8233915: Enable Escape Analysis for Better Performance in the Presence of JVMTI Agents
Reviewed-by: mdoerr, goetz
   1 /*
   2  * Copyright (c) 2015, 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  *


 269   return false;
 270 }
 271 
 272 void CompiledMethod::verify_oop_relocations() {
 273   // Ensure sure that the code matches the current oop values
 274   RelocIterator iter(this, NULL, NULL);
 275   while (iter.next()) {
 276     if (iter.type() == relocInfo::oop_type) {
 277       oop_Relocation* reloc = iter.oop_reloc();
 278       if (!reloc->oop_is_immediate()) {
 279         reloc->verify_oop_relocation();
 280       }
 281     }
 282   }
 283 }
 284 
 285 
 286 ScopeDesc* CompiledMethod::scope_desc_at(address pc) {
 287   PcDesc* pd = pc_desc_at(pc);
 288   guarantee(pd != NULL, "scope must be present");
 289   return new ScopeDesc(this, pd->scope_decode_offset(),
 290                        pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
 291                        pd->return_oop());
 292 }
 293 
 294 ScopeDesc* CompiledMethod::scope_desc_near(address pc) {
 295   PcDesc* pd = pc_desc_near(pc);
 296   guarantee(pd != NULL, "scope must be present");
 297   return new ScopeDesc(this, pd->scope_decode_offset(),
 298                        pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
 299                        pd->return_oop());
 300 }
 301 
 302 address CompiledMethod::oops_reloc_begin() const {
 303   // If the method is not entrant or zombie then a JMP is plastered over the
 304   // first few bytes.  If an oop in the old code was there, that oop
 305   // should not get GC'd.  Skip the first few bytes of oops on
 306   // not-entrant methods.
 307   if (frame_complete_offset() != CodeOffsets::frame_never_safe &&
 308       code_begin() + frame_complete_offset() >
 309       verified_entry_point() + NativeJump::instruction_size)
 310   {
 311     // If we have a frame_complete_offset after the native jump, then there
 312     // is no point trying to look for oops before that. This is a requirement
 313     // for being allowed to scan oops concurrently.
 314     return code_begin() + frame_complete_offset();
 315   }
 316 
 317   // It is not safe to read oops concurrently using entry barriers, if their
 318   // location depend on whether the nmethod is entrant or not.
 319   assert(BarrierSet::barrier_set()->barrier_set_nmethod() == NULL, "Not safe oop scan");


   1 /*
   2  * Copyright (c) 2015, 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  *


 269   return false;
 270 }
 271 
 272 void CompiledMethod::verify_oop_relocations() {
 273   // Ensure sure that the code matches the current oop values
 274   RelocIterator iter(this, NULL, NULL);
 275   while (iter.next()) {
 276     if (iter.type() == relocInfo::oop_type) {
 277       oop_Relocation* reloc = iter.oop_reloc();
 278       if (!reloc->oop_is_immediate()) {
 279         reloc->verify_oop_relocation();
 280       }
 281     }
 282   }
 283 }
 284 
 285 
 286 ScopeDesc* CompiledMethod::scope_desc_at(address pc) {
 287   PcDesc* pd = pc_desc_at(pc);
 288   guarantee(pd != NULL, "scope must be present");
 289   return new ScopeDesc(this, pd);


 290 }
 291 
 292 ScopeDesc* CompiledMethod::scope_desc_near(address pc) {
 293   PcDesc* pd = pc_desc_near(pc);
 294   guarantee(pd != NULL, "scope must be present");
 295   return new ScopeDesc(this, pd);


 296 }
 297 
 298 address CompiledMethod::oops_reloc_begin() const {
 299   // If the method is not entrant or zombie then a JMP is plastered over the
 300   // first few bytes.  If an oop in the old code was there, that oop
 301   // should not get GC'd.  Skip the first few bytes of oops on
 302   // not-entrant methods.
 303   if (frame_complete_offset() != CodeOffsets::frame_never_safe &&
 304       code_begin() + frame_complete_offset() >
 305       verified_entry_point() + NativeJump::instruction_size)
 306   {
 307     // If we have a frame_complete_offset after the native jump, then there
 308     // is no point trying to look for oops before that. This is a requirement
 309     // for being allowed to scan oops concurrently.
 310     return code_begin() + frame_complete_offset();
 311   }
 312 
 313   // It is not safe to read oops concurrently using entry barriers, if their
 314   // location depend on whether the nmethod is entrant or not.
 315   assert(BarrierSet::barrier_set()->barrier_set_nmethod() == NULL, "Not safe oop scan");


< prev index next >