src/share/vm/classfile/verificationType.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File bug_jdk8038076 Sdiff src/share/vm/classfile

src/share/vm/classfile/verificationType.hpp

Print this page


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


 282         case Byte:
 283         case Char:
 284         case Short:
 285           // An int can be assigned to boolean, byte, char or short values.
 286           return from.is_integer();
 287         default:
 288           if (is_reference() && from.is_reference()) {
 289             return is_reference_assignable_from(from, context, CHECK_false);
 290           } else {
 291             return false;
 292           }
 293       }
 294     }
 295   }
 296 
 297   VerificationType get_component(ClassVerifier* context, TRAPS) const;
 298 
 299   int dimensions() const {
 300     assert(is_array(), "Must be an array");
 301     int index = 0;
 302     while (name()->byte_at(index++) == '[');
 303     return index;
 304   }
 305 
 306   void print_on(outputStream* st) const;
 307 
 308  private:
 309 
 310   bool is_reference_assignable_from(
 311     const VerificationType&, ClassVerifier*, TRAPS) const;
 312 };
 313 
 314 #endif // SHARE_VM_CLASSFILE_VERIFICATIONTYPE_HPP
   1 /*
   2  * Copyright (c) 2003, 2014, 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  *


 282         case Byte:
 283         case Char:
 284         case Short:
 285           // An int can be assigned to boolean, byte, char or short values.
 286           return from.is_integer();
 287         default:
 288           if (is_reference() && from.is_reference()) {
 289             return is_reference_assignable_from(from, context, CHECK_false);
 290           } else {
 291             return false;
 292           }
 293       }
 294     }
 295   }
 296 
 297   VerificationType get_component(ClassVerifier* context, TRAPS) const;
 298 
 299   int dimensions() const {
 300     assert(is_array(), "Must be an array");
 301     int index = 0;
 302     while (name()->byte_at(index) == '[') index++;
 303     return index;
 304   }
 305 
 306   void print_on(outputStream* st) const;
 307 
 308  private:
 309 
 310   bool is_reference_assignable_from(
 311     const VerificationType&, ClassVerifier*, TRAPS) const;
 312 };
 313 
 314 #endif // SHARE_VM_CLASSFILE_VERIFICATIONTYPE_HPP
src/share/vm/classfile/verificationType.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File