hotspot/src/share/vm/code/codeBlob.hpp
changeset 4564 55dfb20908d0
parent 3908 24b55ad4c228
child 4584 e2a449e8cc6f
--- a/hotspot/src/share/vm/code/codeBlob.hpp	Mon Jan 04 07:04:46 2010 -0800
+++ b/hotspot/src/share/vm/code/codeBlob.hpp	Mon Jan 04 18:38:08 2010 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -102,6 +102,9 @@
   virtual bool is_compiled_by_c2() const         { return false; }
   virtual bool is_compiled_by_c1() const         { return false; }
 
+  // Casting
+  nmethod* as_nmethod_or_null()                  { return is_nmethod() ? (nmethod*) this : NULL; }
+
   // Boundaries
   address    header_begin() const                { return (address)    this; }
   address    header_end() const                  { return ((address)   this) + _header_size; };