Sat, 01 Sep 2012 13:25:18 -0400
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
1 /*
2 * Copyright (c) 2002, 2012, 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 */
25 #ifndef SHARE_VM_COMPILER_COMPILELOG_HPP
26 #define SHARE_VM_COMPILER_COMPILELOG_HPP
28 #include "utilities/xmlstream.hpp"
30 class ciBaseObject;
31 class ciObject;
32 class ciMetadata;
33 class ciSymbol;
35 // CompileLog
36 //
37 // An open stream for logging information about activities in a
38 // compiler thread. There is exactly one per CompilerThread,
39 // if the +LogCompilation switch is enabled.
40 class CompileLog : public xmlStream {
41 private:
42 const char* _file; // name of file where XML goes
43 julong _file_end; // last good end of file
44 intx _thread_id; // which compile thread
46 stringStream _context; // optional, killable context marker
47 char _context_buffer[100];
49 char* _identities; // array of boolean
50 int _identities_limit;
51 int _identities_capacity;
53 CompileLog* _next; // static chain of all logs
55 static CompileLog* _first; // head of static chain
57 void va_tag(bool push, const char* format, va_list ap);
59 public:
60 CompileLog(const char* file, FILE* fp, intx thread_id);
61 ~CompileLog();
63 intx thread_id() { return _thread_id; }
64 const char* file() { return _file; }
65 stringStream* context() { return &_context; }
67 void name(ciSymbol* s); // name='s'
68 void name(Symbol* s) { xmlStream::name(s); }
70 // Output an object description, return obj->ident().
71 int identify(ciBaseObject* obj);
72 void clear_identities();
74 // virtuals
75 virtual void see_tag(const char* tag, bool push);
76 virtual void pop_tag(const char* tag);
78 // make a provisional end of log mark
79 void mark_file_end() { _file_end = out()->count(); }
81 // copy all logs to the given stream
82 static void finish_log(outputStream* out);
83 static void finish_log_on_error(outputStream* out, char *buf, int buflen);
84 };
86 #endif // SHARE_VM_COMPILER_COMPILELOG_HPP