src/share/vm/classfile/stackMapFrame.hpp

Print this page


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










  25 // A StackMapFrame represents one frame in the stack map attribute.
  26 
  27 enum {
  28   FLAG_THIS_UNINIT = 0x01
  29 };
  30 
  31 class StackMapFrame : public ResourceObj {
  32  private:
  33   int32_t _offset;
  34 
  35   // See comment in StackMapTable about _frame_count about why these
  36   // fields are int32_t instead of u2.
  37   int32_t _locals_size;  // number of valid type elements in _locals
  38   int32_t _stack_size;   // number of valid type elements in _stack
  39 
  40   int32_t _max_locals;
  41   int32_t _max_stack;
  42 
  43   u1 _flags;
  44   VerificationType* _locals; // local variable type array


 207   // it is assignable to type.
 208   VerificationType get_local(int32_t index, VerificationType type, TRAPS);
 209   // For long/double.
 210   void get_local_2(
 211     int32_t index, VerificationType type1, VerificationType type2, TRAPS);
 212 
 213   // Set element at index in local variable array to type.
 214   void set_local(int32_t index, VerificationType type, TRAPS);
 215   // For long/double.
 216   void set_local_2(
 217     int32_t index, VerificationType type1, VerificationType type2, TRAPS);
 218 
 219   // Private auxiliary method used only in is_assignable_to(StackMapFrame).
 220   // Returns true if src is assignable to target.
 221   bool is_assignable_to(
 222     VerificationType* src, VerificationType* target, int32_t len, TRAPS) const;
 223 
 224   // Debugging
 225   void print() const PRODUCT_RETURN;
 226 };


   1 /*
   2  * Copyright (c) 2003, 2010, 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  *
  23  */
  24 
  25 #ifndef SHARE_VM_CLASSFILE_STACKMAPFRAME_HPP
  26 #define SHARE_VM_CLASSFILE_STACKMAPFRAME_HPP
  27 
  28 #include "classfile/verificationType.hpp"
  29 #include "classfile/verifier.hpp"
  30 #include "oops/methodOop.hpp"
  31 #include "runtime/handles.hpp"
  32 #include "runtime/signature.hpp"
  33 #include "utilities/exceptions.hpp"
  34 
  35 // A StackMapFrame represents one frame in the stack map attribute.
  36 
  37 enum {
  38   FLAG_THIS_UNINIT = 0x01
  39 };
  40 
  41 class StackMapFrame : public ResourceObj {
  42  private:
  43   int32_t _offset;
  44 
  45   // See comment in StackMapTable about _frame_count about why these
  46   // fields are int32_t instead of u2.
  47   int32_t _locals_size;  // number of valid type elements in _locals
  48   int32_t _stack_size;   // number of valid type elements in _stack
  49 
  50   int32_t _max_locals;
  51   int32_t _max_stack;
  52 
  53   u1 _flags;
  54   VerificationType* _locals; // local variable type array


 217   // it is assignable to type.
 218   VerificationType get_local(int32_t index, VerificationType type, TRAPS);
 219   // For long/double.
 220   void get_local_2(
 221     int32_t index, VerificationType type1, VerificationType type2, TRAPS);
 222 
 223   // Set element at index in local variable array to type.
 224   void set_local(int32_t index, VerificationType type, TRAPS);
 225   // For long/double.
 226   void set_local_2(
 227     int32_t index, VerificationType type1, VerificationType type2, TRAPS);
 228 
 229   // Private auxiliary method used only in is_assignable_to(StackMapFrame).
 230   // Returns true if src is assignable to target.
 231   bool is_assignable_to(
 232     VerificationType* src, VerificationType* target, int32_t len, TRAPS) const;
 233 
 234   // Debugging
 235   void print() const PRODUCT_RETURN;
 236 };
 237 
 238 #endif // SHARE_VM_CLASSFILE_STACKMAPFRAME_HPP