src/hotspot/share/code/dependencies.hpp
changeset 48604 37a5a1109b93
parent 48299 e8f5fc8f5f67
child 49373 47b5652f2928
equal deleted inserted replaced
48603:e5da6c246176 48604:37a5a1109b93
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2018, 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.
   239     int  index() const                { assert(is_valid(), "oops"); return _id < 0 ? -(_id + 1) : _id - 1; }
   239     int  index() const                { assert(is_valid(), "oops"); return _id < 0 ? -(_id + 1) : _id - 1; }
   240     bool is_metadata() const          { assert(is_valid(), "oops"); return _id > 0; }
   240     bool is_metadata() const          { assert(is_valid(), "oops"); return _id > 0; }
   241     bool is_object() const            { assert(is_valid(), "oops"); return _id < 0; }
   241     bool is_object() const            { assert(is_valid(), "oops"); return _id < 0; }
   242 
   242 
   243     Metadata*  as_metadata(OopRecorder* rec) const    { assert(is_metadata(), "oops"); return rec->metadata_at(index()); }
   243     Metadata*  as_metadata(OopRecorder* rec) const    { assert(is_metadata(), "oops"); return rec->metadata_at(index()); }
   244     Klass*     as_klass(OopRecorder* rec) const       { assert(as_metadata(rec)->is_klass(), "oops"); return (Klass*) as_metadata(rec); }
   244     Klass*     as_klass(OopRecorder* rec) const {
   245     Method*    as_method(OopRecorder* rec) const      { assert(as_metadata(rec)->is_method(), "oops"); return (Method*) as_metadata(rec); }
   245       Metadata* m = as_metadata(rec);
       
   246       assert(m != NULL, "as_metadata returned NULL");
       
   247       assert(m->is_klass(), "oops");
       
   248       return (Klass*) m;
       
   249     }
       
   250     Method*    as_method(OopRecorder* rec) const {
       
   251       Metadata* m = as_metadata(rec);
       
   252       assert(m != NULL, "as_metadata returned NULL");
       
   253       assert(m->is_method(), "oops");
       
   254       return (Method*) m;
       
   255     }
   246     jobject    as_object(OopRecorder* rec) const      { assert(is_object(), "oops"); return rec->oop_at(index()); }
   256     jobject    as_object(OopRecorder* rec) const      { assert(is_object(), "oops"); return rec->oop_at(index()); }
   247   };
   257   };
   248 #endif // INCLUDE_JVMCI
   258 #endif // INCLUDE_JVMCI
   249 
   259 
   250  private:
   260  private: