Thu, 27 May 2010 19:08:38 -0700
6941466: Oracle rebranding changes for Hotspot repositories
Summary: Change all the Sun copyrights to Oracle copyright
Reviewed-by: ohair
duke@435 | 1 | /* |
trims@1907 | 2 | * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
duke@435 | 25 | class ciObject; |
duke@435 | 26 | class ciSymbol; |
duke@435 | 27 | |
duke@435 | 28 | // CompileLog |
duke@435 | 29 | // |
duke@435 | 30 | // An open stream for logging information about activities in a |
duke@435 | 31 | // compiler thread. There is exactly one per CompilerThread, |
duke@435 | 32 | // if the +LogCompilation switch is enabled. |
duke@435 | 33 | class CompileLog : public xmlStream { |
duke@435 | 34 | private: |
duke@435 | 35 | const char* _file; // name of file where XML goes |
duke@435 | 36 | julong _file_end; // last good end of file |
duke@435 | 37 | intx _thread_id; // which compile thread |
duke@435 | 38 | |
duke@435 | 39 | stringStream _context; // optional, killable context marker |
duke@435 | 40 | char _context_buffer[100]; |
duke@435 | 41 | |
duke@435 | 42 | char* _identities; // array of boolean |
duke@435 | 43 | int _identities_limit; |
duke@435 | 44 | int _identities_capacity; |
duke@435 | 45 | |
duke@435 | 46 | CompileLog* _next; // static chain of all logs |
duke@435 | 47 | |
duke@435 | 48 | static CompileLog* _first; // head of static chain |
duke@435 | 49 | |
duke@435 | 50 | void va_tag(bool push, const char* format, va_list ap); |
duke@435 | 51 | |
duke@435 | 52 | public: |
duke@435 | 53 | CompileLog(const char* file, FILE* fp, intx thread_id); |
duke@435 | 54 | ~CompileLog(); |
duke@435 | 55 | |
duke@435 | 56 | intx thread_id() { return _thread_id; } |
duke@435 | 57 | const char* file() { return _file; } |
duke@435 | 58 | stringStream* context() { return &_context; } |
duke@435 | 59 | |
duke@435 | 60 | void name(ciSymbol* s); // name='s' |
duke@435 | 61 | void name(symbolHandle s) { xmlStream::name(s); } |
duke@435 | 62 | |
duke@435 | 63 | // Output an object description, return obj->ident(). |
duke@435 | 64 | int identify(ciObject* obj); |
duke@435 | 65 | void clear_identities(); |
duke@435 | 66 | |
duke@435 | 67 | // virtuals |
duke@435 | 68 | virtual void see_tag(const char* tag, bool push); |
duke@435 | 69 | virtual void pop_tag(const char* tag); |
duke@435 | 70 | |
duke@435 | 71 | // make a provisional end of log mark |
duke@435 | 72 | void mark_file_end() { _file_end = out()->count(); } |
duke@435 | 73 | |
duke@435 | 74 | // copy all logs to the given stream |
duke@435 | 75 | static void finish_log(outputStream* out); |
duke@435 | 76 | static void finish_log_on_error(outputStream* out, char *buf, int buflen); |
duke@435 | 77 | }; |