src/share/vm/runtime/compilationPolicy.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/_compilationPolicy.cpp.incl"




















  27 
  28 CompilationPolicy* CompilationPolicy::_policy;
  29 elapsedTimer       CompilationPolicy::_accumulated_time;
  30 bool               CompilationPolicy::_in_vm_startup;
  31 
  32 // Determine compilation policy based on command line argument
  33 void compilationPolicy_init() {
  34   CompilationPolicy::set_in_vm_startup(DelayCompilationDuringStartup);
  35 
  36   switch(CompilationPolicyChoice) {
  37   case 0:
  38     CompilationPolicy::set_policy(new SimpleCompPolicy());
  39     break;
  40 
  41   case 1:
  42 #ifdef COMPILER2
  43     CompilationPolicy::set_policy(new StackWalkCompPolicy());
  44 #else
  45     Unimplemented();
  46 #endif




   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 "code/compiledIC.hpp"
  27 #include "code/nmethod.hpp"
  28 #include "code/scopeDesc.hpp"
  29 #include "compiler/compilerOracle.hpp"
  30 #include "interpreter/interpreter.hpp"
  31 #include "oops/methodDataOop.hpp"
  32 #include "oops/methodOop.hpp"
  33 #include "oops/oop.inline.hpp"
  34 #include "prims/nativeLookup.hpp"
  35 #include "runtime/compilationPolicy.hpp"
  36 #include "runtime/frame.hpp"
  37 #include "runtime/handles.inline.hpp"
  38 #include "runtime/rframe.hpp"
  39 #include "runtime/simpleThresholdPolicy.hpp"
  40 #include "runtime/stubRoutines.hpp"
  41 #include "runtime/thread.hpp"
  42 #include "runtime/timer.hpp"
  43 #include "runtime/vframe.hpp"
  44 #include "runtime/vm_operations.hpp"
  45 #include "utilities/events.hpp"
  46 #include "utilities/globalDefinitions.hpp"
  47 
  48 CompilationPolicy* CompilationPolicy::_policy;
  49 elapsedTimer       CompilationPolicy::_accumulated_time;
  50 bool               CompilationPolicy::_in_vm_startup;
  51 
  52 // Determine compilation policy based on command line argument
  53 void compilationPolicy_init() {
  54   CompilationPolicy::set_in_vm_startup(DelayCompilationDuringStartup);
  55 
  56   switch(CompilationPolicyChoice) {
  57   case 0:
  58     CompilationPolicy::set_policy(new SimpleCompPolicy());
  59     break;
  60 
  61   case 1:
  62 #ifdef COMPILER2
  63     CompilationPolicy::set_policy(new StackWalkCompPolicy());
  64 #else
  65     Unimplemented();
  66 #endif