< prev index next >

src/hotspot/share/classfile/stackMapFrame.cpp

Print this page


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


  84        thisKlass.name() != vmSymbols::java_lang_Object()) {
  85       _locals[0] = VerificationType::uninitialized_this_type();
  86       _flags |= FLAG_THIS_UNINIT;
  87     } else {
  88       _locals[0] = thisKlass;
  89     }
  90   }
  91 
  92   // local num may be greater than size of parameters because long/double occupies two slots
  93   while(!ss.at_return_type()) {
  94     init_local_num += _verifier->change_sig_to_verificationType(
  95       &ss, &_locals[init_local_num],
  96       CHECK_VERIFY_(verifier(), VerificationType::bogus_type()));
  97     ss.next();
  98   }
  99   _locals_size = init_local_num;
 100 
 101   switch (ss.type()) {
 102     case T_OBJECT:
 103     case T_ARRAY:

 104     {
 105       Symbol* sig = ss.as_symbol(CHECK_(VerificationType::bogus_type()));
 106       // Create another symbol to save as signature stream unreferences
 107       // this symbol.
 108       Symbol* sig_copy =
 109         verifier()->create_temporary_symbol(sig, 0, sig->utf8_length(),
 110                                  CHECK_(VerificationType::bogus_type()));
 111       assert(sig_copy == sig, "symbols don't match");



 112       return VerificationType::reference_type(sig_copy);
 113     }
 114     case T_INT:     return VerificationType::integer_type();
 115     case T_BYTE:    return VerificationType::byte_type();
 116     case T_CHAR:    return VerificationType::char_type();
 117     case T_SHORT:   return VerificationType::short_type();
 118     case T_BOOLEAN: return VerificationType::boolean_type();
 119     case T_FLOAT:   return VerificationType::float_type();
 120     case T_DOUBLE:  return VerificationType::double_type();
 121     case T_LONG:    return VerificationType::long_type();
 122     case T_VOID:    return VerificationType::bogus_type();
 123     default:
 124       ShouldNotReachHere();
 125   }
 126   return VerificationType::bogus_type();
 127 }
 128 
 129 void StackMapFrame::copy_locals(const StackMapFrame* src) {
 130   int32_t len = src->locals_size() < _locals_size ?
 131     src->locals_size() : _locals_size;


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


  84        thisKlass.name() != vmSymbols::java_lang_Object()) {
  85       _locals[0] = VerificationType::uninitialized_this_type();
  86       _flags |= FLAG_THIS_UNINIT;
  87     } else {
  88       _locals[0] = thisKlass;
  89     }
  90   }
  91 
  92   // local num may be greater than size of parameters because long/double occupies two slots
  93   while(!ss.at_return_type()) {
  94     init_local_num += _verifier->change_sig_to_verificationType(
  95       &ss, &_locals[init_local_num],
  96       CHECK_VERIFY_(verifier(), VerificationType::bogus_type()));
  97     ss.next();
  98   }
  99   _locals_size = init_local_num;
 100 
 101   switch (ss.type()) {
 102     case T_OBJECT:
 103     case T_ARRAY:
 104     case T_VALUETYPE:
 105     {
 106       Symbol* sig = ss.as_symbol(CHECK_(VerificationType::bogus_type()));
 107       // Create another symbol to save as signature stream unreferences
 108       // this symbol.
 109       Symbol* sig_copy =
 110         verifier()->create_temporary_symbol(sig, 0, sig->utf8_length(),
 111                                  CHECK_(VerificationType::bogus_type()));
 112       assert(sig_copy == sig, "symbols don't match");
 113       if (ss.type() == T_VALUETYPE) {
 114         return VerificationType::valuetype_type(sig_copy);
 115       }
 116       return VerificationType::reference_type(sig_copy);
 117     }
 118     case T_INT:     return VerificationType::integer_type();
 119     case T_BYTE:    return VerificationType::byte_type();
 120     case T_CHAR:    return VerificationType::char_type();
 121     case T_SHORT:   return VerificationType::short_type();
 122     case T_BOOLEAN: return VerificationType::boolean_type();
 123     case T_FLOAT:   return VerificationType::float_type();
 124     case T_DOUBLE:  return VerificationType::double_type();
 125     case T_LONG:    return VerificationType::long_type();
 126     case T_VOID:    return VerificationType::bogus_type();
 127     default:
 128       ShouldNotReachHere();
 129   }
 130   return VerificationType::bogus_type();
 131 }
 132 
 133 void StackMapFrame::copy_locals(const StackMapFrame* src) {
 134   int32_t len = src->locals_size() < _locals_size ?
 135     src->locals_size() : _locals_size;


< prev index next >