comparison src/share/vm/code/nmethod.hpp @ 2211:0cd39a385a72

Merge.
author Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
date Mon, 21 Feb 2011 19:17:33 +0100
parents 06f017f7daa7 bf8517f4e4d0
children 0654ee04b214
comparison
equal deleted inserted replaced
2184:5d801e6b9a80 2211:0cd39a385a72
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2011, 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.
697 697
698 // Locks an nmethod so its code will not get removed, even if it is a zombie/not_entrant method 698 // Locks an nmethod so its code will not get removed, even if it is a zombie/not_entrant method
699 class nmethodLocker : public StackObj { 699 class nmethodLocker : public StackObj {
700 nmethod* _nm; 700 nmethod* _nm;
701 701
702 public:
703
702 static void lock_nmethod(nmethod* nm); // note: nm can be NULL 704 static void lock_nmethod(nmethod* nm); // note: nm can be NULL
703 static void unlock_nmethod(nmethod* nm); // (ditto) 705 static void unlock_nmethod(nmethod* nm); // (ditto)
704 706
705 public:
706 nmethodLocker(address pc); // derive nm from pc 707 nmethodLocker(address pc); // derive nm from pc
707 nmethodLocker(nmethod *nm) { _nm = nm; lock_nmethod(_nm); } 708 nmethodLocker(nmethod *nm) { _nm = nm; lock_nmethod(_nm); }
708 nmethodLocker() { _nm = NULL; } 709 nmethodLocker() { _nm = NULL; }
709 ~nmethodLocker() { unlock_nmethod(_nm); } 710 ~nmethodLocker() { unlock_nmethod(_nm); }
710 711