1 /* 2 * Copyright (c) 2002, 2006, 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 */ 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_compileLog.cpp.incl" 27 28 CompileLog* CompileLog::_first = NULL; 29 30 // ------------------------------------------------------------------ 31 // CompileLog::CompileLog 32 CompileLog::CompileLog(const char* file, FILE* fp, intx thread_id) 33 : _context(_context_buffer, sizeof(_context_buffer)) 34 { 35 initialize(new(ResourceObj::C_HEAP) fileStream(fp)); 36 _file = file; 37 _file_end = 0; 38 _thread_id = thread_id; 39 40 _identities_limit = 0; 41 _identities_capacity = 400; 42 _identities = NEW_C_HEAP_ARRAY(char, _identities_capacity); 43 44 // link into the global list 45 { MutexLocker locker(CompileTaskAlloc_lock); 46 _next = _first; | 1 /* 2 * Copyright (c) 2002, 2010, 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 */ 24 25 #include "precompiled.hpp" 26 #include "ci/ciMethod.hpp" 27 #include "compiler/compileLog.hpp" 28 #include "memory/allocation.inline.hpp" 29 #include "oops/methodOop.hpp" 30 #include "runtime/mutexLocker.hpp" 31 #include "runtime/os.hpp" 32 33 CompileLog* CompileLog::_first = NULL; 34 35 // ------------------------------------------------------------------ 36 // CompileLog::CompileLog 37 CompileLog::CompileLog(const char* file, FILE* fp, intx thread_id) 38 : _context(_context_buffer, sizeof(_context_buffer)) 39 { 40 initialize(new(ResourceObj::C_HEAP) fileStream(fp)); 41 _file = file; 42 _file_end = 0; 43 _thread_id = thread_id; 44 45 _identities_limit = 0; 46 _identities_capacity = 400; 47 _identities = NEW_C_HEAP_ARRAY(char, _identities_capacity); 48 49 // link into the global list 50 { MutexLocker locker(CompileTaskAlloc_lock); 51 _next = _first; |