src/share/vm/runtime/vm_operations.cpp

Print this page
rev 13113 : 8182651: Add TRACE_ONLY conditional macro to support more fine-grained INCLUDE_TRACE programming
Reviewed-by:
   1 /*
   2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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 "classfile/symbolTable.hpp"
  27 #include "classfile/vmSymbols.hpp"
  28 #include "code/codeCache.hpp"
  29 #include "compiler/compileBroker.hpp"
  30 #include "gc/shared/isGCActiveMark.hpp"
  31 #include "logging/log.hpp"
  32 #include "memory/heapInspection.hpp"
  33 #include "memory/resourceArea.hpp"
  34 #include "oops/symbol.hpp"
  35 #include "runtime/arguments.hpp"
  36 #include "runtime/deoptimization.hpp"
  37 #include "runtime/interfaceSupport.hpp"
  38 #include "runtime/sweeper.hpp"
  39 #include "runtime/thread.inline.hpp"
  40 #include "runtime/vm_operations.hpp"
  41 #include "services/threadService.hpp"
  42 #include "trace/tracing.hpp"
  43 
  44 #define VM_OP_NAME_INITIALIZE(name) #name,
  45 
  46 const char* VM_Operation::_names[VM_Operation::VMOp_Terminating] = \
  47   { VM_OPS_DO(VM_OP_NAME_INITIALIZE) };
  48 
  49 void VM_Operation::set_calling_thread(Thread* thread, ThreadPriority priority) {
  50   _calling_thread = thread;
  51   assert(MinPriority <= priority && priority <= MaxPriority, "sanity check");
  52   _priority = priority;
  53 }
  54 
  55 
  56 void VM_Operation::evaluate() {
  57   ResourceMark rm;
  58   outputStream* debugstream;
  59   bool enabled = log_is_enabled(Debug, vmoperation);
  60   if (enabled) {
  61     debugstream = Log(vmoperation)::debug_stream();
  62     debugstream->print("begin ");


   1 /*
   2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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 "classfile/symbolTable.hpp"
  27 #include "classfile/vmSymbols.hpp"
  28 #include "code/codeCache.hpp"
  29 #include "compiler/compileBroker.hpp"
  30 #include "gc/shared/isGCActiveMark.hpp"
  31 #include "logging/log.hpp"
  32 #include "memory/heapInspection.hpp"
  33 #include "memory/resourceArea.hpp"
  34 #include "oops/symbol.hpp"
  35 #include "runtime/arguments.hpp"
  36 #include "runtime/deoptimization.hpp"
  37 #include "runtime/interfaceSupport.hpp"
  38 #include "runtime/sweeper.hpp"
  39 #include "runtime/thread.inline.hpp"
  40 #include "runtime/vm_operations.hpp"
  41 #include "services/threadService.hpp"

  42 
  43 #define VM_OP_NAME_INITIALIZE(name) #name,
  44 
  45 const char* VM_Operation::_names[VM_Operation::VMOp_Terminating] = \
  46   { VM_OPS_DO(VM_OP_NAME_INITIALIZE) };
  47 
  48 void VM_Operation::set_calling_thread(Thread* thread, ThreadPriority priority) {
  49   _calling_thread = thread;
  50   assert(MinPriority <= priority && priority <= MaxPriority, "sanity check");
  51   _priority = priority;
  52 }
  53 
  54 
  55 void VM_Operation::evaluate() {
  56   ResourceMark rm;
  57   outputStream* debugstream;
  58   bool enabled = log_is_enabled(Debug, vmoperation);
  59   if (enabled) {
  60     debugstream = Log(vmoperation)::debug_stream();
  61     debugstream->print("begin ");