Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/compiler/compileLog.hpp
32285 views
/*1* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_VM_COMPILER_COMPILELOG_HPP25#define SHARE_VM_COMPILER_COMPILELOG_HPP2627#include "utilities/xmlstream.hpp"2829class ciBaseObject;30class ciObject;31class ciMetadata;32class ciSymbol;3334// CompileLog35//36// An open stream for logging information about activities in a37// compiler thread. There is exactly one per CompilerThread,38// if the +LogCompilation switch is enabled.39class CompileLog : public xmlStream {40private:41const char* _file; // name of file where XML goes42julong _file_end; // last good end of file43intx _thread_id; // which compile thread4445stringStream _context; // optional, killable context marker46char _context_buffer[100];4748char* _identities; // array of boolean49int _identities_limit;50int _identities_capacity;5152CompileLog* _next; // static chain of all logs5354static CompileLog* _first; // head of static chain5556void va_tag(bool push, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0);5758public:59CompileLog(const char* file_name, FILE* fp, intx thread_id);60~CompileLog();6162intx thread_id() { return _thread_id; }63const char* file() { return _file; }6465// Optional context marker, to help place actions that occur during66// parsing. If there is no log output until the next context string67// or reset, context string will be silently ignored68stringStream* context() { return &_context; }69void clear_context() { context()->reset(); }70void set_context(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);7172void name(ciSymbol* s); // name='s'73void name(Symbol* s) { xmlStream::name(s); }7475// Output an object description, return obj->ident().76int identify(ciBaseObject* obj);77void clear_identities();7879void inline_fail (const char* reason);80void inline_success(const char* reason);8182// virtuals83virtual void see_tag(const char* tag, bool push);84virtual void pop_tag(const char* tag);8586// make a provisional end of log mark87void mark_file_end() { _file_end = out()->count(); }8889// Print code cache statistics90void code_cache_state();9192// copy all logs to the given stream93static void finish_log(outputStream* out);94static void finish_log_on_error(outputStream* out, char *buf, int buflen);95};9697#endif // SHARE_VM_COMPILER_COMPILELOG_HPP9899100