2027N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// Standard closure for BytecodeTracer: prints the current bytecode 0N/A// and its attributes using bytecode-specific information. 0N/A // %%% This field is not GC-ed, and so can contain garbage 0N/A // between critical sections. Use only pointer-comparison 0N/A // operations on the pointer, except within a critical section. 0N/A // (Also, ensure that occasional false positives are benign.) 0N/A // This method is called while executing the raw bytecodes, so none of 0N/A // the adjustments that BytecodeStream performs applies. 0N/A // Note 1: This code will not work as expected with true MT/MP. 0N/A // Need an explicit lock or a different solution. 0N/A // It is possible for this block to be skipped, if a garbage 0N/A // _current_method pointer happens to have the same bits as 0N/A // the incoming method. We could lose a line of trace output. 0N/A // This is acceptable in a debug-only feature. 0N/A // bcp wasn't advanced if previous bytecode was _wide. 0N/A // Set is_wide for the next one, since the caller of this doesn't skip 0N/A // the next bytecode. 0N/A // Used for methodOop::print_codes(). The input bcp comes from 0N/A // BytecodeStream, which will skip wide bytecodes. 0N/A // Print bytecode index and name 0N/A// Implementation of BytecodeTracer 0N/A// %%% This set_closure thing seems overly general, given that 0N/A// nobody uses it. Also, if BytecodePrinter weren't hidden 0N/A// then methodOop could use instances of it directly and it 0N/A// would be easier to remove races on _current_method and bcp. 0N/A// Since this is not product functionality, we can defer cleanup. 0N/A // The ttyLocker also prevents races between two threads 0N/A // trying to use the single instance of BytecodePrinter. 0N/A // Using the ttyLocker prevents the system from coming to 0N/A // a safepoint within this code, which is sensitive to methodOop 0N/A // There used to be a leaf mutex here, but the ttyLocker will 0N/A // work just as well, as long as the printing operations never block. 0N/A // We put the locker on the static trace method, not the 0N/A // virtual one, because the clients of this module go through 0N/A // the static method. 726N/A //climit = cache->length(); // %%% private! 0N/A // Show attributes of pre-rewritten codes 0N/A // If the code doesn't have any fields there's nothing to print. 0N/A // note this is ==1 because the tableswitch and lookupswitch are 0N/A // zero size (for some reason) and we want to print stuff out for them. 0N/A // Java specific bytecodes only matter. 0N/A for (
int i = 0; i <
len; i++) {
0N/A for (
int i = 0; i <
len; i++) {
0N/A // length is zero not one, but printed with no more info.