src/hotspot/share/oops/constMethod.cpp
changeset 53584 f72661ff0294
parent 49594 898ef81cbc0e
child 59070 22ee476cc664
equal deleted inserted replaced
53583:051b5f7510d5 53584:f72661ff0294
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   424 
   424 
   425 // Printing
   425 // Printing
   426 
   426 
   427 void ConstMethod::print_on(outputStream* st) const {
   427 void ConstMethod::print_on(outputStream* st) const {
   428   ResourceMark rm;
   428   ResourceMark rm;
   429   assert(is_constMethod(), "must be constMethod");
       
   430   st->print_cr("%s", internal_name());
   429   st->print_cr("%s", internal_name());
   431   Method* m = method();
   430   Method* m = method();
   432   st->print(" - method:       " INTPTR_FORMAT " ", p2i((address)m));
   431   st->print(" - method:       " INTPTR_FORMAT " ", p2i((address)m));
   433   if (m != NULL) {
   432   if (m != NULL) {
   434     m->print_value_on(st);
   433     m->print_value_on(st);
   442 }
   441 }
   443 
   442 
   444 // Short version of printing ConstMethod* - just print the name of the
   443 // Short version of printing ConstMethod* - just print the name of the
   445 // method it belongs to.
   444 // method it belongs to.
   446 void ConstMethod::print_value_on(outputStream* st) const {
   445 void ConstMethod::print_value_on(outputStream* st) const {
   447   assert(is_constMethod(), "must be constMethod");
       
   448   st->print(" const part of method " );
   446   st->print(" const part of method " );
   449   Method* m = method();
   447   Method* m = method();
   450   if (m != NULL) {
   448   if (m != NULL) {
   451     m->print_value_on(st);
   449     m->print_value_on(st);
   452   } else {
   450   } else {
   485 #endif // INCLUDE_SERVICES
   483 #endif // INCLUDE_SERVICES
   486 
   484 
   487 // Verification
   485 // Verification
   488 
   486 
   489 void ConstMethod::verify_on(outputStream* st) {
   487 void ConstMethod::verify_on(outputStream* st) {
   490   guarantee(is_constMethod(), "object must be constMethod");
       
   491 
       
   492   // Verification can occur during oop construction before the method or
   488   // Verification can occur during oop construction before the method or
   493   // other fields have been initialized.
   489   // other fields have been initialized.
   494   guarantee(method() != NULL && method()->is_method(), "should be method");
   490   guarantee(method() != NULL && method()->is_method(), "should be method");
   495 
   491 
   496   address m_end = (address)((intptr_t) this + size());
   492   address m_end = (address)((intptr_t) this + size());