< prev index next >

src/hotspot/share/compiler/oopMap.cpp

Print this page
rev 59383 : [mq]: final
   1 /*
   2  * Copyright (c) 1998, 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  *


 298         }
 299 #ifdef ASSERT
 300         if ((((uintptr_t)loc & (sizeof(*loc)-1)) != 0) ||
 301             !Universe::heap()->is_in_or_null(*loc)) {
 302           tty->print_cr("# Found non oop pointer.  Dumping state at failure");
 303           // try to dump out some helpful debugging information
 304           trace_codeblob_maps(fr, reg_map);
 305           omv.print();
 306           tty->print_cr("register r");
 307           omv.reg()->print();
 308           tty->print_cr("loc = %p *loc = %p\n", loc, cast_from_oop<address>(*loc));
 309           // do the real assert.
 310           assert(Universe::heap()->is_in_or_null(*loc), "found non oop pointer");
 311         }
 312 #endif // ASSERT
 313         oop_fn->do_oop(loc);
 314       } else if ( omv.type() == OopMapValue::narrowoop_value ) {
 315         narrowOop *nl = (narrowOop*)loc;
 316 #ifndef VM_LITTLE_ENDIAN
 317         VMReg vmReg = omv.reg();
 318         // Don't do this on SPARC float registers as they can be individually addressed
 319         if (!vmReg->is_stack() SPARC_ONLY(&& !vmReg->is_FloatRegister())) {
 320           // compressed oops in registers only take up 4 bytes of an
 321           // 8 byte register but they are in the wrong part of the
 322           // word so adjust loc to point at the right place.
 323           nl = (narrowOop*)((address)nl + 4);
 324         }
 325 #endif
 326         oop_fn->do_oop(nl);
 327       }
 328     }
 329   }
 330 }
 331 
 332 
 333 // Update callee-saved register info for the following frame
 334 void OopMapSet::update_register_map(const frame *fr, RegisterMap *reg_map) {
 335   ResourceMark rm;
 336   CodeBlob* cb = fr->cb();
 337   assert(cb != NULL, "no codeblob");
 338 
 339   // Any reg might be saved by a safepoint handler (see generate_handler_blob).


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


 298         }
 299 #ifdef ASSERT
 300         if ((((uintptr_t)loc & (sizeof(*loc)-1)) != 0) ||
 301             !Universe::heap()->is_in_or_null(*loc)) {
 302           tty->print_cr("# Found non oop pointer.  Dumping state at failure");
 303           // try to dump out some helpful debugging information
 304           trace_codeblob_maps(fr, reg_map);
 305           omv.print();
 306           tty->print_cr("register r");
 307           omv.reg()->print();
 308           tty->print_cr("loc = %p *loc = %p\n", loc, cast_from_oop<address>(*loc));
 309           // do the real assert.
 310           assert(Universe::heap()->is_in_or_null(*loc), "found non oop pointer");
 311         }
 312 #endif // ASSERT
 313         oop_fn->do_oop(loc);
 314       } else if ( omv.type() == OopMapValue::narrowoop_value ) {
 315         narrowOop *nl = (narrowOop*)loc;
 316 #ifndef VM_LITTLE_ENDIAN
 317         VMReg vmReg = omv.reg();
 318         if (!vmReg->is_stack()) {

 319           // compressed oops in registers only take up 4 bytes of an
 320           // 8 byte register but they are in the wrong part of the
 321           // word so adjust loc to point at the right place.
 322           nl = (narrowOop*)((address)nl + 4);
 323         }
 324 #endif
 325         oop_fn->do_oop(nl);
 326       }
 327     }
 328   }
 329 }
 330 
 331 
 332 // Update callee-saved register info for the following frame
 333 void OopMapSet::update_register_map(const frame *fr, RegisterMap *reg_map) {
 334   ResourceMark rm;
 335   CodeBlob* cb = fr->cb();
 336   assert(cb != NULL, "no codeblob");
 337 
 338   // Any reg might be saved by a safepoint handler (see generate_handler_blob).


< prev index next >