2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2019-01-10 15:13:51 -05:00
|
|
|
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
|
2007-12-01 00:00:00 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 only, as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
* accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License version
|
|
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2010-05-27 19:08:38 -07:00
|
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
|
|
* questions.
|
2007-12-01 00:00:00 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-01-10 15:13:51 -05:00
|
|
|
#ifndef SHARE_COMPILER_COMPILELOG_HPP
|
|
|
|
#define SHARE_COMPILER_COMPILELOG_HPP
|
2010-11-23 13:22:55 -08:00
|
|
|
|
|
|
|
#include "utilities/xmlstream.hpp"
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
class ciBaseObject;
|
2014-04-10 11:38:12 +02:00
|
|
|
class ciKlass;
|
2007-12-01 00:00:00 +00:00
|
|
|
class ciObject;
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
class ciMetadata;
|
2007-12-01 00:00:00 +00:00
|
|
|
class ciSymbol;
|
|
|
|
|
|
|
|
// CompileLog
|
|
|
|
//
|
|
|
|
// An open stream for logging information about activities in a
|
|
|
|
// compiler thread. There is exactly one per CompilerThread,
|
|
|
|
// if the +LogCompilation switch is enabled.
|
|
|
|
class CompileLog : public xmlStream {
|
|
|
|
private:
|
|
|
|
const char* _file; // name of file where XML goes
|
|
|
|
julong _file_end; // last good end of file
|
|
|
|
intx _thread_id; // which compile thread
|
|
|
|
|
|
|
|
stringStream _context; // optional, killable context marker
|
|
|
|
char _context_buffer[100];
|
|
|
|
|
|
|
|
char* _identities; // array of boolean
|
|
|
|
int _identities_limit;
|
|
|
|
int _identities_capacity;
|
|
|
|
|
|
|
|
CompileLog* _next; // static chain of all logs
|
|
|
|
|
|
|
|
static CompileLog* _first; // head of static chain
|
|
|
|
|
2014-05-09 16:50:54 -04:00
|
|
|
void va_tag(bool push, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
public:
|
2013-06-03 08:52:20 +02:00
|
|
|
CompileLog(const char* file_name, FILE* fp, intx thread_id);
|
2007-12-01 00:00:00 +00:00
|
|
|
~CompileLog();
|
|
|
|
|
|
|
|
intx thread_id() { return _thread_id; }
|
|
|
|
const char* file() { return _file; }
|
2012-10-05 18:57:10 -07:00
|
|
|
|
|
|
|
// Optional context marker, to help place actions that occur during
|
|
|
|
// parsing. If there is no log output until the next context string
|
|
|
|
// or reset, context string will be silently ignored
|
2007-12-01 00:00:00 +00:00
|
|
|
stringStream* context() { return &_context; }
|
2012-10-05 18:57:10 -07:00
|
|
|
void clear_context() { context()->reset(); }
|
2014-05-09 16:50:54 -04:00
|
|
|
void set_context(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
void name(ciSymbol* s); // name='s'
|
2011-01-27 16:11:27 -08:00
|
|
|
void name(Symbol* s) { xmlStream::name(s); }
|
2014-04-10 11:38:12 +02:00
|
|
|
void name(ciKlass* k);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// Output an object description, return obj->ident().
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
int identify(ciBaseObject* obj);
|
2007-12-01 00:00:00 +00:00
|
|
|
void clear_identities();
|
|
|
|
|
2012-10-05 18:57:10 -07:00
|
|
|
void inline_fail (const char* reason);
|
|
|
|
void inline_success(const char* reason);
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// virtuals
|
|
|
|
virtual void see_tag(const char* tag, bool push);
|
|
|
|
virtual void pop_tag(const char* tag);
|
|
|
|
|
|
|
|
// make a provisional end of log mark
|
|
|
|
void mark_file_end() { _file_end = out()->count(); }
|
|
|
|
|
2012-10-05 18:57:10 -07:00
|
|
|
// Print code cache statistics
|
|
|
|
void code_cache_state();
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// copy all logs to the given stream
|
|
|
|
static void finish_log(outputStream* out);
|
|
|
|
static void finish_log_on_error(outputStream* out, char *buf, int buflen);
|
|
|
|
};
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2019-01-10 15:13:51 -05:00
|
|
|
#endif // SHARE_COMPILER_COMPILELOG_HPP
|