src/share/vm/interpreter/bytecodes.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File bug_7127066.2 Sdiff src/share/vm/interpreter

src/share/vm/interpreter/bytecodes.hpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 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  *


 384   static Code        java_code      (Code code)    { check(code);      return _java_code     [code]; }
 385   static bool        can_rewrite    (Code code)    { check(code);      return has_all_flags(code, _bc_can_rewrite, false); }
 386   static bool        must_rewrite(Bytecodes::Code code) { return can_rewrite(code) && check_must_rewrite(code); }
 387   static bool        native_byte_order(Code code)  { check(code);      return has_all_flags(code, _fmt_has_nbo, false); }
 388   static bool        uses_cp_cache  (Code code)    { check(code);      return has_all_flags(code, _fmt_has_j, false); }
 389   // if 'end' is provided, it indicates the end of the code buffer which
 390   // should not be read past when parsing.
 391   static int         special_length_at(Bytecodes::Code code, address bcp, address end = NULL);
 392   static int         special_length_at(Method* method, address bcp, address end = NULL) { return special_length_at(code_at(method, bcp), bcp, end); }
 393   static int         raw_special_length_at(address bcp, address end = NULL);
 394   static int         length_for_code_at(Bytecodes::Code code, address bcp)  { int l = length_for(code); return l > 0 ? l : special_length_at(code, bcp); }
 395   static int         length_at      (Method* method, address bcp)  { return length_for_code_at(code_at(method, bcp), bcp); }
 396   static int         java_length_at (Method* method, address bcp)  { return length_for_code_at(java_code_at(method, bcp), bcp); }
 397   static bool        is_java_code   (Code code)    { return 0 <= code && code < number_of_java_codes; }
 398 
 399   static bool        is_aload       (Code code)    { return (code == _aload  || code == _aload_0  || code == _aload_1
 400                                                                              || code == _aload_2  || code == _aload_3); }
 401   static bool        is_astore      (Code code)    { return (code == _astore || code == _astore_0 || code == _astore_1
 402                                                                              || code == _astore_2 || code == _astore_3); }
 403 

 404   static bool        is_const       (Code code)    { return (_aconst_null <= code && code <= _ldc2_w); }
 405   static bool        is_zero_const  (Code code)    { return (code == _aconst_null || code == _iconst_0
 406                                                            || code == _fconst_0 || code == _dconst_0); }
 407   static bool        is_return      (Code code)    { return (_ireturn <= code && code <= _return); }
 408   static bool        is_invoke      (Code code)    { return (_invokevirtual <= code && code <= _invokedynamic); }
 409   static bool        has_receiver   (Code code)    { assert(is_invoke(code), "");  return code == _invokevirtual ||
 410                                                                                           code == _invokespecial ||
 411                                                                                           code == _invokeinterface; }
 412   static bool        has_optional_appendix(Code code) { return code == _invokedynamic || code == _invokehandle; }
 413 
 414   static int         compute_flags  (const char* format, int more_flags = 0);  // compute the flags
 415   static int         flags          (int code, bool is_wide) {
 416     assert(code == (u_char)code, "must be a byte");
 417     return _flags[code + (is_wide ? (1<<BitsPerByte) : 0)];
 418   }
 419   static int         format_bits    (Code code, bool is_wide) { return flags(code, is_wide) & _all_fmt_bits; }
 420   static bool        has_all_flags  (Code code, int test_flags, bool is_wide) {
 421     return (flags(code, is_wide) & test_flags) == test_flags;
 422   }
 423 
   1 /*
   2  * Copyright (c) 1997, 2015, 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  *


 384   static Code        java_code      (Code code)    { check(code);      return _java_code     [code]; }
 385   static bool        can_rewrite    (Code code)    { check(code);      return has_all_flags(code, _bc_can_rewrite, false); }
 386   static bool        must_rewrite(Bytecodes::Code code) { return can_rewrite(code) && check_must_rewrite(code); }
 387   static bool        native_byte_order(Code code)  { check(code);      return has_all_flags(code, _fmt_has_nbo, false); }
 388   static bool        uses_cp_cache  (Code code)    { check(code);      return has_all_flags(code, _fmt_has_j, false); }
 389   // if 'end' is provided, it indicates the end of the code buffer which
 390   // should not be read past when parsing.
 391   static int         special_length_at(Bytecodes::Code code, address bcp, address end = NULL);
 392   static int         special_length_at(Method* method, address bcp, address end = NULL) { return special_length_at(code_at(method, bcp), bcp, end); }
 393   static int         raw_special_length_at(address bcp, address end = NULL);
 394   static int         length_for_code_at(Bytecodes::Code code, address bcp)  { int l = length_for(code); return l > 0 ? l : special_length_at(code, bcp); }
 395   static int         length_at      (Method* method, address bcp)  { return length_for_code_at(code_at(method, bcp), bcp); }
 396   static int         java_length_at (Method* method, address bcp)  { return length_for_code_at(java_code_at(method, bcp), bcp); }
 397   static bool        is_java_code   (Code code)    { return 0 <= code && code < number_of_java_codes; }
 398 
 399   static bool        is_aload       (Code code)    { return (code == _aload  || code == _aload_0  || code == _aload_1
 400                                                                              || code == _aload_2  || code == _aload_3); }
 401   static bool        is_astore      (Code code)    { return (code == _astore || code == _astore_0 || code == _astore_1
 402                                                                              || code == _astore_2 || code == _astore_3); }
 403 
 404   static bool        is_store_into_local(Code code){ return (_istore <= code && code <= _astore_3); }
 405   static bool        is_const       (Code code)    { return (_aconst_null <= code && code <= _ldc2_w); }
 406   static bool        is_zero_const  (Code code)    { return (code == _aconst_null || code == _iconst_0
 407                                                            || code == _fconst_0 || code == _dconst_0); }
 408   static bool        is_return      (Code code)    { return (_ireturn <= code && code <= _return); }
 409   static bool        is_invoke      (Code code)    { return (_invokevirtual <= code && code <= _invokedynamic); }
 410   static bool        has_receiver   (Code code)    { assert(is_invoke(code), "");  return code == _invokevirtual ||
 411                                                                                           code == _invokespecial ||
 412                                                                                           code == _invokeinterface; }
 413   static bool        has_optional_appendix(Code code) { return code == _invokedynamic || code == _invokehandle; }
 414 
 415   static int         compute_flags  (const char* format, int more_flags = 0);  // compute the flags
 416   static int         flags          (int code, bool is_wide) {
 417     assert(code == (u_char)code, "must be a byte");
 418     return _flags[code + (is_wide ? (1<<BitsPerByte) : 0)];
 419   }
 420   static int         format_bits    (Code code, bool is_wide) { return flags(code, is_wide) & _all_fmt_bits; }
 421   static bool        has_all_flags  (Code code, int test_flags, bool is_wide) {
 422     return (flags(code, is_wide) & test_flags) == test_flags;
 423   }
 424 
src/share/vm/interpreter/bytecodes.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File