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/_bytecode.cpp.incl" 27 28 // Implementation of Bytecode 29 30 bool Bytecode::check_must_rewrite(Bytecodes::Code code) const { 31 assert(Bytecodes::can_rewrite(code), "post-check only"); 32 33 // Some codes are conditionally rewriting. Look closely at them. 34 switch (code) { 35 case Bytecodes::_aload_0: 36 // Even if RewriteFrequentPairs is turned on, 37 // the _aload_0 code might delay its rewrite until 38 // a following _getfield rewrites itself. 39 return false; 40 41 case Bytecodes::_lookupswitch: 42 return false; // the rewrite is not done by the interpreter 43 44 case Bytecodes::_new: 45 // (Could actually look at the class here, but the profit would be small.) 46 return false; // the rewrite is not always done | 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 "interpreter/bytecode.hpp" 27 #include "interpreter/linkResolver.hpp" 28 #include "oops/constantPoolOop.hpp" 29 #include "oops/oop.inline.hpp" 30 #include "runtime/fieldType.hpp" 31 #include "runtime/handles.inline.hpp" 32 #include "runtime/safepoint.hpp" 33 #include "runtime/signature.hpp" 34 35 // Implementation of Bytecode 36 37 bool Bytecode::check_must_rewrite(Bytecodes::Code code) const { 38 assert(Bytecodes::can_rewrite(code), "post-check only"); 39 40 // Some codes are conditionally rewriting. Look closely at them. 41 switch (code) { 42 case Bytecodes::_aload_0: 43 // Even if RewriteFrequentPairs is turned on, 44 // the _aload_0 code might delay its rewrite until 45 // a following _getfield rewrites itself. 46 return false; 47 48 case Bytecodes::_lookupswitch: 49 return false; // the rewrite is not done by the interpreter 50 51 case Bytecodes::_new: 52 // (Could actually look at the class here, but the profit would be small.) 53 return false; // the rewrite is not always done |