src/share/vm/compiler/compileLog.hpp

Fri, 29 Apr 2016 00:06:10 +0800

author
aoqi
date
Fri, 29 Apr 2016 00:06:10 +0800
changeset 1
2d8a650513c2
parent 0
f90c822e73f8
child 6876
710a3c8b516e
permissions
-rw-r--r--

Added MIPS 64-bit port.

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
aoqi@0 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
aoqi@0 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 *
aoqi@0 23 */
aoqi@0 24
aoqi@0 25 #ifndef SHARE_VM_COMPILER_COMPILELOG_HPP
aoqi@0 26 #define SHARE_VM_COMPILER_COMPILELOG_HPP
aoqi@0 27
aoqi@0 28 #include "utilities/xmlstream.hpp"
aoqi@0 29
aoqi@0 30 class ciBaseObject;
aoqi@0 31 class ciObject;
aoqi@0 32 class ciMetadata;
aoqi@0 33 class ciSymbol;
aoqi@0 34
aoqi@0 35 // CompileLog
aoqi@0 36 //
aoqi@0 37 // An open stream for logging information about activities in a
aoqi@0 38 // compiler thread. There is exactly one per CompilerThread,
aoqi@0 39 // if the +LogCompilation switch is enabled.
aoqi@0 40 class CompileLog : public xmlStream {
aoqi@0 41 private:
aoqi@0 42 const char* _file; // name of file where XML goes
aoqi@0 43 julong _file_end; // last good end of file
aoqi@0 44 intx _thread_id; // which compile thread
aoqi@0 45
aoqi@0 46 stringStream _context; // optional, killable context marker
aoqi@0 47 char _context_buffer[100];
aoqi@0 48
aoqi@0 49 char* _identities; // array of boolean
aoqi@0 50 int _identities_limit;
aoqi@0 51 int _identities_capacity;
aoqi@0 52
aoqi@0 53 CompileLog* _next; // static chain of all logs
aoqi@0 54
aoqi@0 55 static CompileLog* _first; // head of static chain
aoqi@0 56
aoqi@0 57 void va_tag(bool push, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0);
aoqi@0 58
aoqi@0 59 public:
aoqi@0 60 CompileLog(const char* file_name, FILE* fp, intx thread_id);
aoqi@0 61 ~CompileLog();
aoqi@0 62
aoqi@0 63 intx thread_id() { return _thread_id; }
aoqi@0 64 const char* file() { return _file; }
aoqi@0 65
aoqi@0 66 // Optional context marker, to help place actions that occur during
aoqi@0 67 // parsing. If there is no log output until the next context string
aoqi@0 68 // or reset, context string will be silently ignored
aoqi@0 69 stringStream* context() { return &_context; }
aoqi@0 70 void clear_context() { context()->reset(); }
aoqi@0 71 void set_context(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
aoqi@0 72
aoqi@0 73 void name(ciSymbol* s); // name='s'
aoqi@0 74 void name(Symbol* s) { xmlStream::name(s); }
aoqi@0 75
aoqi@0 76 // Output an object description, return obj->ident().
aoqi@0 77 int identify(ciBaseObject* obj);
aoqi@0 78 void clear_identities();
aoqi@0 79
aoqi@0 80 void inline_fail (const char* reason);
aoqi@0 81 void inline_success(const char* reason);
aoqi@0 82
aoqi@0 83 // virtuals
aoqi@0 84 virtual void see_tag(const char* tag, bool push);
aoqi@0 85 virtual void pop_tag(const char* tag);
aoqi@0 86
aoqi@0 87 // make a provisional end of log mark
aoqi@0 88 void mark_file_end() { _file_end = out()->count(); }
aoqi@0 89
aoqi@0 90 // Print code cache statistics
aoqi@0 91 void code_cache_state();
aoqi@0 92
aoqi@0 93 // copy all logs to the given stream
aoqi@0 94 static void finish_log(outputStream* out);
aoqi@0 95 static void finish_log_on_error(outputStream* out, char *buf, int buflen);
aoqi@0 96 };
aoqi@0 97
aoqi@0 98 #endif // SHARE_VM_COMPILER_COMPILELOG_HPP

mercurial