src/share/vm/interpreter/invocationCounter.cpp

Print this page




   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  *
  23  */
  24 
  25 # include "incls/_precompiled.incl"
  26 # include "incls/_invocationCounter.cpp.incl"


  27 
  28 
  29 // Implementation of InvocationCounter
  30 
  31 void InvocationCounter::init() {
  32   _counter = 0;  // reset all the bits, including the sticky carry
  33   reset();
  34 }
  35 
  36 void InvocationCounter::reset() {
  37   // Only reset the state and don't make the method look like it's never
  38   // been executed
  39   set_state(wait_for_compile);
  40 }
  41 
  42 void InvocationCounter::set_carry() {
  43   set_carry_flag();
  44   // The carry bit now indicates that this counter had achieved a very
  45   // large value.  Now reduce the value, so that the method can be
  46   // executed many more times before re-entering the VM.




   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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "interpreter/invocationCounter.hpp"
  27 #include "runtime/frame.hpp"
  28 #include "runtime/handles.inline.hpp"
  29 
  30 
  31 // Implementation of InvocationCounter
  32 
  33 void InvocationCounter::init() {
  34   _counter = 0;  // reset all the bits, including the sticky carry
  35   reset();
  36 }
  37 
  38 void InvocationCounter::reset() {
  39   // Only reset the state and don't make the method look like it's never
  40   // been executed
  41   set_state(wait_for_compile);
  42 }
  43 
  44 void InvocationCounter::set_carry() {
  45   set_carry_flag();
  46   // The carry bit now indicates that this counter had achieved a very
  47   // large value.  Now reduce the value, so that the method can be
  48   // executed many more times before re-entering the VM.