src/hotspot/share/classfile/stackMapTableFormat.hpp
author simonis
Tue, 19 Jun 2018 09:43:53 +0200
changeset 50625 d9753e3db0c6
parent 47216 71c04702a3d5
child 50790 5dfedce8ce62
permissions -rw-r--r--
8204965: Fix '--disable-cds' and disable CDS on AIX by default Reviewed-by: erikj, jiangli, stuefe, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
     1
/*
46630
75aa3e39d02c 8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents: 41542
diff changeset
     2
 * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
     4
 *
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
     8
 *
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    13
 * accompanied this code).
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    14
 *
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    18
 *
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    21
 * questions.
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    22
 *
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    23
 */
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6974
diff changeset
    25
#ifndef SHARE_VM_CLASSFILE_STACKMAPTABLEFORMAT_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6974
diff changeset
    26
#define SHARE_VM_CLASSFILE_STACKMAPTABLEFORMAT_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6974
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6974
diff changeset
    28
#include "classfile/verificationType.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6974
diff changeset
    29
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    30
// These classes represent the stack-map substructures described in the JVMS
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    31
// (hence the non-conforming naming scheme).
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    32
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    33
// These classes work with the types in their compressed form in-place (as they
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    34
// would appear in the classfile).  No virtual methods or fields allowed.
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    35
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    36
class verification_type_info {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    37
 private:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    38
  // u1 tag
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    39
  // u2 cpool_index || u2 bci (for ITEM_Object & ITEM_Uninitailized only)
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    40
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    41
  address tag_addr() const { return (address)this; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    42
  address cpool_index_addr() const { return tag_addr() + sizeof(u1); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    43
  address bci_addr() const { return cpool_index_addr(); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    44
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    45
 protected:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    46
  // No constructors  - should be 'private', but GCC issues a warning if it is
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    47
  verification_type_info() {}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    48
  verification_type_info(const verification_type_info&) {}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    49
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    50
 public:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    51
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    52
  static verification_type_info* at(address addr) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    53
    return (verification_type_info*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    54
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    55
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    56
  static verification_type_info* create_at(address addr, u1 tag) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    57
    verification_type_info* vti = (verification_type_info*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    58
    vti->set_tag(tag);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    59
    return vti;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    60
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    61
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    62
  static verification_type_info* create_object_at(address addr, u2 cp_idx) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    63
    verification_type_info* vti = (verification_type_info*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    64
    vti->set_tag(ITEM_Object);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    65
    vti->set_cpool_index(cp_idx);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    66
    return vti;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    67
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    68
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    69
  static verification_type_info* create_uninit_at(address addr, u2 bci) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    70
    verification_type_info* vti = (verification_type_info*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    71
    vti->set_tag(ITEM_Uninitialized);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    72
    vti->set_bci(bci);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    73
    return vti;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    74
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    75
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    76
  static size_t calculate_size(u1 tag) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    77
    if (tag == ITEM_Object || tag == ITEM_Uninitialized) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    78
      return sizeof(u1) + sizeof(u2);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    79
    } else {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    80
      return sizeof(u1);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    81
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    82
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    83
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    84
  static size_t max_size() { return sizeof(u1) + sizeof(u2); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    85
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    86
  u1 tag() const { return *(u1*)tag_addr(); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    87
  void set_tag(u1 tag) { *((u1*)tag_addr()) = tag; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    88
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    89
  bool is_object() const { return tag() == ITEM_Object; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    90
  bool is_uninitialized() const { return tag() == ITEM_Uninitialized; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    91
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    92
  u2 cpool_index() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    93
    assert(is_object(), "This type has no cp_index");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    94
    return Bytes::get_Java_u2(cpool_index_addr());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    95
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    96
  void set_cpool_index(u2 idx) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    97
    assert(is_object(), "This type has no cp_index");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    98
    Bytes::put_Java_u2(cpool_index_addr(), idx);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
    99
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   100
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   101
  u2 bci() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   102
    assert(is_uninitialized(), "This type has no bci");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   103
    return Bytes::get_Java_u2(bci_addr());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   104
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   105
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   106
  void set_bci(u2 bci) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   107
    assert(is_uninitialized(), "This type has no bci");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   108
    Bytes::put_Java_u2(bci_addr(), bci);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   109
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   110
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   111
  void copy_from(verification_type_info* from) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   112
    set_tag(from->tag());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   113
    if (from->is_object()) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   114
      set_cpool_index(from->cpool_index());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   115
    } else if (from->is_uninitialized()) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   116
      set_bci(from->bci());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   117
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   118
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   119
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   120
  size_t size() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   121
    return calculate_size(tag());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   122
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   123
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   124
  verification_type_info* next() {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   125
    return (verification_type_info*)((address)this + size());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   126
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   127
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   128
  // This method is used when reading unverified data in order to ensure
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   129
  // that we don't read past a particular memory limit.  It returns false
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   130
  // if any part of the data structure is outside the specified memory bounds.
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   131
  bool verify(address start, address end) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   132
    return ((address)this >= start &&
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   133
            (address)this < end &&
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   134
            (bci_addr() + sizeof(u2) <= end ||
46630
75aa3e39d02c 8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents: 41542
diff changeset
   135
             (!is_object() && !is_uninitialized())));
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   136
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   137
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   138
  void print_on(outputStream* st) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   139
    switch (tag()) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   140
      case ITEM_Top: st->print("Top"); break;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   141
      case ITEM_Integer: st->print("Integer"); break;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   142
      case ITEM_Float: st->print("Float"); break;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   143
      case ITEM_Double: st->print("Double"); break;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   144
      case ITEM_Long: st->print("Long"); break;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   145
      case ITEM_Null: st->print("Null"); break;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   146
      case ITEM_UninitializedThis:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   147
        st->print("UninitializedThis"); break;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   148
      case ITEM_Uninitialized:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   149
        st->print("Uninitialized[#%d]", bci()); break;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   150
      case ITEM_Object:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   151
        st->print("Object[#%d]", cpool_index()); break;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   152
      default:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   153
        assert(false, "Bad verification_type_info");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   154
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   155
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   156
};
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   157
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   158
#define FOR_EACH_STACKMAP_FRAME_TYPE(macro, arg1, arg2) \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   159
  macro(same_frame, arg1, arg2) \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   160
  macro(same_frame_extended, arg1, arg2) \
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   161
  macro(same_locals_1_stack_item_frame, arg1, arg2) \
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   162
  macro(same_locals_1_stack_item_extended, arg1, arg2) \
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   163
  macro(chop_frame, arg1, arg2) \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   164
  macro(append_frame, arg1, arg2) \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   165
  macro(full_frame, arg1, arg2)
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   166
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   167
#define SM_FORWARD_DECL(type, arg1, arg2) class type;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   168
FOR_EACH_STACKMAP_FRAME_TYPE(SM_FORWARD_DECL, x, x)
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   169
#undef SM_FORWARD_DECL
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   170
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   171
class stack_map_frame {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   172
 protected:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   173
  address frame_type_addr() const { return (address)this; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   174
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   175
  // No constructors  - should be 'private', but GCC issues a warning if it is
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   176
  stack_map_frame() {}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   177
  stack_map_frame(const stack_map_frame&) {}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   178
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   179
 public:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   180
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   181
  static stack_map_frame* at(address addr) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   182
    return (stack_map_frame*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   183
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   184
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   185
  stack_map_frame* next() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   186
    return at((address)this + size());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   187
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   188
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   189
  u1 frame_type() const { return *(u1*)frame_type_addr(); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   190
  void set_frame_type(u1 type) { *((u1*)frame_type_addr()) = type; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   191
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   192
  // pseudo-virtual methods
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   193
  inline size_t size() const;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   194
  inline int offset_delta() const;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   195
  inline void set_offset_delta(int offset_delta);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   196
  inline int number_of_types() const; // number of types contained in the frame
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   197
  inline verification_type_info* types() const; // pointer to first type
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   198
  inline bool is_valid_offset(int offset_delta) const;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   199
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   200
  // This method must be used when reading unverified data in order to ensure
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   201
  // that we don't read past a particular memory limit.  It returns false
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   202
  // if any part of the data structure is outside the specified memory bounds.
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   203
  inline bool verify(address start, address end) const;
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   204
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   205
  inline void print_on(outputStream* st, int current_offset) const;
41542
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   206
  inline void print_truncated(outputStream* st, int current_offset) const;
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   207
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   208
  // Create as_xxx and is_xxx methods for the subtypes
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   209
#define FRAME_TYPE_DECL(stackmap_frame_type, arg1, arg2) \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   210
  inline stackmap_frame_type* as_##stackmap_frame_type() const; \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   211
  bool is_##stackmap_frame_type() { \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   212
    return as_##stackmap_frame_type() != NULL; \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   213
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   214
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   215
  FOR_EACH_STACKMAP_FRAME_TYPE(FRAME_TYPE_DECL, x, x)
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   216
#undef FRAME_TYPE_DECL
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   217
};
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   218
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   219
class same_frame : public stack_map_frame {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   220
 private:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   221
  static int frame_type_to_offset_delta(u1 frame_type) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   222
      return frame_type + 1; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   223
  static u1 offset_delta_to_frame_type(int offset_delta) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   224
      return (u1)(offset_delta - 1); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   225
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   226
 public:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   227
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   228
  static bool is_frame_type(u1 tag) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   229
    return tag < 64;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   230
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   231
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   232
  static same_frame* at(address addr) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   233
    assert(is_frame_type(*addr), "Wrong frame id");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   234
    return (same_frame*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   235
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   236
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   237
  static same_frame* create_at(address addr, int offset_delta) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   238
    same_frame* sm = (same_frame*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   239
    sm->set_offset_delta(offset_delta);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   240
    return sm;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   241
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   242
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   243
  static size_t calculate_size() { return sizeof(u1); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   244
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   245
  size_t size() const { return calculate_size(); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   246
  int offset_delta() const { return frame_type_to_offset_delta(frame_type()); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   247
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   248
  void set_offset_delta(int offset_delta) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   249
    assert(offset_delta <= 64, "Offset too large for same_frame");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   250
    set_frame_type(offset_delta_to_frame_type(offset_delta));
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   251
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   252
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   253
  int number_of_types() const { return 0; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   254
  verification_type_info* types() const { return NULL; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   255
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   256
  bool is_valid_offset(int offset_delta) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   257
    return is_frame_type(offset_delta_to_frame_type(offset_delta));
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   258
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   259
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   260
  bool verify_subtype(address start, address end) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   261
    return true;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   262
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   263
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   264
  void print_on(outputStream* st, int current_offset = -1) const {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   265
    st->print("same_frame(@%d)", offset_delta() + current_offset);
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   266
  }
41542
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   267
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   268
  void print_truncated(outputStream* st, int current_offset = -1) const {
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   269
    print_on(st, current_offset);
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   270
  }
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   271
};
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   272
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   273
class same_frame_extended : public stack_map_frame {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   274
 private:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   275
  enum { _frame_id = 251 };
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   276
  address offset_delta_addr() const { return frame_type_addr() + sizeof(u1); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   277
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   278
 public:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   279
  static bool is_frame_type(u1 tag) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   280
    return tag == _frame_id;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   281
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   282
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   283
  static same_frame_extended* at(address addr) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   284
    assert(is_frame_type(*addr), "Wrong frame type");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   285
    return (same_frame_extended*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   286
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   287
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   288
  static same_frame_extended* create_at(address addr, u2 offset_delta) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   289
    same_frame_extended* sm = (same_frame_extended*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   290
    sm->set_frame_type(_frame_id);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   291
    sm->set_offset_delta(offset_delta);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   292
    return sm;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   293
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   294
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   295
  static size_t calculate_size() { return sizeof(u1) + sizeof(u2); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   296
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   297
  size_t size() const { return calculate_size(); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   298
  int offset_delta() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   299
    return Bytes::get_Java_u2(offset_delta_addr()) + 1;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   300
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   301
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   302
  void set_offset_delta(int offset_delta) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   303
    Bytes::put_Java_u2(offset_delta_addr(), offset_delta - 1);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   304
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   305
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   306
  int number_of_types() const { return 0; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   307
  verification_type_info* types() const { return NULL; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   308
  bool is_valid_offset(int offset) const { return true; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   309
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   310
  bool verify_subtype(address start, address end) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   311
    return frame_type_addr() + size() <= end;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   312
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   313
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   314
  void print_on(outputStream* st, int current_offset = -1) const {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   315
    st->print("same_frame_extended(@%d)", offset_delta() + current_offset);
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   316
  }
41542
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   317
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   318
  void print_truncated(outputStream* st, int current_offset = -1) const {
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   319
    print_on(st, current_offset);
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   320
  }
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   321
};
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   322
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   323
class same_locals_1_stack_item_frame : public stack_map_frame {
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   324
 private:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   325
  address type_addr() const { return frame_type_addr() + sizeof(u1); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   326
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   327
  static int frame_type_to_offset_delta(u1 frame_type) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   328
      return frame_type - 63; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   329
  static u1 offset_delta_to_frame_type(int offset_delta) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   330
      return (u1)(offset_delta + 63); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   331
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   332
 public:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   333
  static bool is_frame_type(u1 tag) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   334
    return tag >= 64 && tag < 128;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   335
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   336
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   337
  static same_locals_1_stack_item_frame* at(address addr) {
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   338
    assert(is_frame_type(*addr), "Wrong frame id");
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   339
    return (same_locals_1_stack_item_frame*)addr;
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   340
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   341
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   342
  static same_locals_1_stack_item_frame* create_at(
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   343
      address addr, int offset_delta, verification_type_info* vti) {
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   344
    same_locals_1_stack_item_frame* sm = (same_locals_1_stack_item_frame*)addr;
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   345
    sm->set_offset_delta(offset_delta);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   346
    if (vti != NULL) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   347
      sm->set_type(vti);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   348
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   349
    return sm;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   350
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   351
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   352
  static size_t calculate_size(verification_type_info* vti) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   353
    return sizeof(u1) + vti->size();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   354
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   355
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   356
  static size_t max_size() {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   357
    return sizeof(u1) + verification_type_info::max_size();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   358
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   359
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   360
  size_t size() const { return calculate_size(types()); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   361
  int offset_delta() const { return frame_type_to_offset_delta(frame_type()); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   362
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   363
  void set_offset_delta(int offset_delta) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   364
    assert(offset_delta > 0 && offset_delta <= 64,
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   365
           "Offset too large for this frame type");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   366
    set_frame_type(offset_delta_to_frame_type(offset_delta));
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   367
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   368
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   369
  void set_type(verification_type_info* vti) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   370
    verification_type_info* cur = types();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   371
    cur->copy_from(vti);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   372
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   373
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   374
  int number_of_types() const { return 1; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   375
  verification_type_info* types() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   376
    return verification_type_info::at(type_addr());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   377
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   378
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   379
  bool is_valid_offset(int offset_delta) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   380
    return is_frame_type(offset_delta_to_frame_type(offset_delta));
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   381
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   382
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   383
  bool verify_subtype(address start, address end) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   384
    return types()->verify(start, end);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   385
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   386
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   387
  void print_on(outputStream* st, int current_offset = -1) const {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   388
    st->print("same_locals_1_stack_item_frame(@%d,",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   389
        offset_delta() + current_offset);
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   390
    types()->print_on(st);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   391
    st->print(")");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   392
  }
41542
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   393
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   394
  void print_truncated(outputStream* st, int current_offset = -1) const {
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   395
    st->print("same_locals_1_stack_item_frame(@%d), output truncated, Stackmap exceeds table size.",
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   396
              offset_delta() + current_offset);
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   397
  }
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   398
};
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   399
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   400
class same_locals_1_stack_item_extended : public stack_map_frame {
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   401
 private:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   402
  address offset_delta_addr() const { return frame_type_addr() + sizeof(u1); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   403
  address type_addr() const { return offset_delta_addr() + sizeof(u2); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   404
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   405
  enum { _frame_id = 247 };
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   406
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   407
 public:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   408
  static bool is_frame_type(u1 tag) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   409
    return tag == _frame_id;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   410
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   411
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   412
  static same_locals_1_stack_item_extended* at(address addr) {
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   413
    assert(is_frame_type(*addr), "Wrong frame id");
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   414
    return (same_locals_1_stack_item_extended*)addr;
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   415
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   416
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   417
  static same_locals_1_stack_item_extended* create_at(
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   418
      address addr, int offset_delta, verification_type_info* vti) {
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   419
    same_locals_1_stack_item_extended* sm =
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   420
       (same_locals_1_stack_item_extended*)addr;
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   421
    sm->set_frame_type(_frame_id);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   422
    sm->set_offset_delta(offset_delta);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   423
    if (vti != NULL) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   424
      sm->set_type(vti);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   425
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   426
    return sm;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   427
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   428
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   429
  static size_t calculate_size(verification_type_info* vti) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   430
    return sizeof(u1) + sizeof(u2) + vti->size();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   431
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   432
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   433
  size_t size() const { return calculate_size(types()); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   434
  int offset_delta() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   435
    return Bytes::get_Java_u2(offset_delta_addr()) + 1;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   436
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   437
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   438
  void set_offset_delta(int offset_delta) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   439
    Bytes::put_Java_u2(offset_delta_addr(), offset_delta - 1);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   440
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   441
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   442
  void set_type(verification_type_info* vti) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   443
    verification_type_info* cur = types();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   444
    cur->copy_from(vti);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   445
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   446
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   447
  int number_of_types() const { return 1; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   448
  verification_type_info* types() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   449
    return verification_type_info::at(type_addr());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   450
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   451
  bool is_valid_offset(int offset) { return true; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   452
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   453
  bool verify_subtype(address start, address end) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   454
    return type_addr() < end && types()->verify(start, end);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   455
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   456
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   457
  void print_on(outputStream* st, int current_offset = -1) const {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   458
    st->print("same_locals_1_stack_item_extended(@%d,",
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   459
        offset_delta() + current_offset);
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   460
    types()->print_on(st);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   461
    st->print(")");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   462
  }
41542
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   463
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   464
  void print_truncated(outputStream* st, int current_offset = -1) const {
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   465
    st->print("same_locals_1_stack_item_extended(@%d), output truncated, Stackmap exceeds table size.",
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   466
              offset_delta() + current_offset);
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   467
  }
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   468
};
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   469
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   470
class chop_frame : public stack_map_frame {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   471
 private:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   472
  address offset_delta_addr() const { return frame_type_addr() + sizeof(u1); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   473
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   474
  static int frame_type_to_chops(u1 frame_type) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   475
    int chop = 251 - frame_type;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   476
    return chop;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   477
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   478
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   479
  static u1 chops_to_frame_type(int chop) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   480
    return 251 - chop;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   481
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   482
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   483
 public:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   484
  static bool is_frame_type(u1 tag) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   485
    return frame_type_to_chops(tag) > 0 && frame_type_to_chops(tag) < 4;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   486
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   487
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   488
  static chop_frame* at(address addr) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   489
    assert(is_frame_type(*addr), "Wrong frame id");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   490
    return (chop_frame*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   491
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   492
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   493
  static chop_frame* create_at(address addr, int offset_delta, int chops) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   494
    chop_frame* sm = (chop_frame*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   495
    sm->set_chops(chops);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   496
    sm->set_offset_delta(offset_delta);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   497
    return sm;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   498
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   499
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   500
  static size_t calculate_size() {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   501
    return sizeof(u1) + sizeof(u2);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   502
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   503
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   504
  size_t size() const { return calculate_size(); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   505
  int offset_delta() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   506
    return Bytes::get_Java_u2(offset_delta_addr()) + 1;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   507
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   508
  void set_offset_delta(int offset_delta) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   509
    Bytes::put_Java_u2(offset_delta_addr(), offset_delta - 1);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   510
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   511
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   512
  int chops() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   513
    int chops = frame_type_to_chops(frame_type());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   514
    assert(chops > 0 && chops < 4, "Invalid number of chops in frame");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   515
    return chops;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   516
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   517
  void set_chops(int chops) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   518
    assert(chops > 0 && chops <= 3, "Bad number of chops");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   519
    set_frame_type(chops_to_frame_type(chops));
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   520
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   521
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   522
  int number_of_types() const { return 0; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   523
  verification_type_info* types() const { return NULL; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   524
  bool is_valid_offset(int offset) { return true; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   525
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   526
  bool verify_subtype(address start, address end) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   527
    return frame_type_addr() + size() <= end;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   528
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   529
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   530
  void print_on(outputStream* st, int current_offset = -1) const {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   531
    st->print("chop_frame(@%d,%d)", offset_delta() + current_offset, chops());
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   532
  }
41542
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   533
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   534
  void print_truncated(outputStream* st, int current_offset = -1) const {
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   535
    print_on(st, current_offset);
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   536
  }
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   537
};
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   538
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   539
class append_frame : public stack_map_frame {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   540
 private:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   541
  address offset_delta_addr() const { return frame_type_addr() + sizeof(u1); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   542
  address types_addr() const { return offset_delta_addr() + sizeof(u2); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   543
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   544
  static int frame_type_to_appends(u1 frame_type) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   545
    int append = frame_type - 251;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   546
    return append;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   547
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   548
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   549
  static u1 appends_to_frame_type(int appends) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   550
    assert(appends > 0 && appends < 4, "Invalid append amount");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   551
    return 251 + appends;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   552
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   553
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   554
 public:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   555
  static bool is_frame_type(u1 tag) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   556
    return frame_type_to_appends(tag) > 0 && frame_type_to_appends(tag) < 4;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   557
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   558
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   559
  static append_frame* at(address addr) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   560
    assert(is_frame_type(*addr), "Wrong frame id");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   561
    return (append_frame*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   562
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   563
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   564
  static append_frame* create_at(
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   565
      address addr, int offset_delta, int appends,
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   566
      verification_type_info* types) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   567
    append_frame* sm = (append_frame*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   568
    sm->set_appends(appends);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   569
    sm->set_offset_delta(offset_delta);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   570
    if (types != NULL) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   571
      verification_type_info* cur = sm->types();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   572
      for (int i = 0; i < appends; ++i) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   573
        cur->copy_from(types);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   574
        cur = cur->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   575
        types = types->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   576
      }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   577
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   578
    return sm;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   579
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   580
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   581
  static size_t calculate_size(int appends, verification_type_info* types) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   582
    size_t sz = sizeof(u1) + sizeof(u2);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   583
    for (int i = 0; i < appends; ++i) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   584
      sz += types->size();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   585
      types = types->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   586
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   587
    return sz;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   588
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   589
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   590
  static size_t max_size() {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   591
    return sizeof(u1) + sizeof(u2) + 3 * verification_type_info::max_size();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   592
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   593
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   594
  size_t size() const { return calculate_size(number_of_types(), types()); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   595
  int offset_delta() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   596
    return Bytes::get_Java_u2(offset_delta_addr()) + 1;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   597
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   598
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   599
  void set_offset_delta(int offset_delta) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   600
    Bytes::put_Java_u2(offset_delta_addr(), offset_delta - 1);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   601
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   602
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   603
  void set_appends(int appends) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   604
    assert(appends > 0 && appends < 4, "Bad number of appends");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   605
    set_frame_type(appends_to_frame_type(appends));
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   606
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   607
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   608
  int number_of_types() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   609
    int appends = frame_type_to_appends(frame_type());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   610
    assert(appends > 0 && appends < 4, "Invalid number of appends in frame");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   611
    return appends;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   612
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   613
  verification_type_info* types() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   614
    return verification_type_info::at(types_addr());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   615
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   616
  bool is_valid_offset(int offset) const { return true; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   617
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   618
  bool verify_subtype(address start, address end) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   619
    verification_type_info* vti = types();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   620
    if ((address)vti < end && vti->verify(start, end)) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   621
      int nof = number_of_types();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   622
      vti = vti->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   623
      if (nof < 2 || vti->verify(start, end)) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   624
        vti = vti->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   625
        if (nof < 3 || vti->verify(start, end)) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   626
          return true;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   627
        }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   628
      }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   629
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   630
    return false;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   631
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   632
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   633
  void print_on(outputStream* st, int current_offset = -1) const {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   634
    st->print("append_frame(@%d,", offset_delta() + current_offset);
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   635
    verification_type_info* vti = types();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   636
    for (int i = 0; i < number_of_types(); ++i) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   637
      vti->print_on(st);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   638
      if (i != number_of_types() - 1) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   639
        st->print(",");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   640
      }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   641
      vti = vti->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   642
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   643
    st->print(")");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   644
  }
41542
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   645
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   646
  void print_truncated(outputStream* st, int current_offset = -1) const {
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   647
    st->print("append_frame(@%d), output truncated, Stackmap exceeds table size.",
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   648
              offset_delta() + current_offset);
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   649
  }
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   650
};
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   651
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   652
class full_frame : public stack_map_frame {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   653
 private:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   654
  address offset_delta_addr() const { return frame_type_addr() + sizeof(u1); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   655
  address num_locals_addr() const { return offset_delta_addr() + sizeof(u2); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   656
  address locals_addr() const { return num_locals_addr() + sizeof(u2); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   657
  address stack_slots_addr(address end_of_locals) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   658
      return end_of_locals; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   659
  address stack_addr(address end_of_locals) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   660
      return stack_slots_addr(end_of_locals) + sizeof(u2); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   661
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   662
  enum { _frame_id = 255 };
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   663
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   664
 public:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   665
  static bool is_frame_type(u1 tag) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   666
    return tag == _frame_id;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   667
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   668
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   669
  static full_frame* at(address addr) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   670
    assert(is_frame_type(*addr), "Wrong frame id");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   671
    return (full_frame*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   672
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   673
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   674
  static full_frame* create_at(
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   675
      address addr, int offset_delta, int num_locals,
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   676
      verification_type_info* locals,
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   677
      int stack_slots, verification_type_info* stack) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   678
    full_frame* sm = (full_frame*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   679
    sm->set_frame_type(_frame_id);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   680
    sm->set_offset_delta(offset_delta);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   681
    sm->set_num_locals(num_locals);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   682
    if (locals != NULL) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   683
      verification_type_info* cur = sm->locals();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   684
      for (int i = 0; i < num_locals; ++i) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   685
        cur->copy_from(locals);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   686
        cur = cur->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   687
        locals = locals->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   688
      }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   689
      address end_of_locals = (address)cur;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   690
      sm->set_stack_slots(end_of_locals, stack_slots);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   691
      cur = sm->stack(end_of_locals);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   692
      for (int i = 0; i < stack_slots; ++i) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   693
        cur->copy_from(stack);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   694
        cur = cur->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   695
        stack = stack->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   696
      }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   697
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   698
    return sm;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   699
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   700
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   701
  static size_t calculate_size(
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   702
      int num_locals, verification_type_info* locals,
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   703
      int stack_slots, verification_type_info* stack) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   704
    size_t sz = sizeof(u1) + sizeof(u2) + sizeof(u2) + sizeof(u2);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   705
    verification_type_info* vti = locals;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   706
    for (int i = 0; i < num_locals; ++i) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   707
      sz += vti->size();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   708
      vti = vti->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   709
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   710
    vti = stack;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   711
    for (int i = 0; i < stack_slots; ++i) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   712
      sz += vti->size();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   713
      vti = vti->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   714
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   715
    return sz;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   716
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   717
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   718
  static size_t max_size(int locals, int stack) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   719
    return sizeof(u1) + 3 * sizeof(u2) +
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   720
        (locals + stack) * verification_type_info::max_size();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   721
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   722
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   723
  size_t size() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   724
    address eol = end_of_locals();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   725
    return calculate_size(num_locals(), locals(), stack_slots(eol), stack(eol));
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   726
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   727
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   728
  int offset_delta() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   729
    return Bytes::get_Java_u2(offset_delta_addr()) + 1;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   730
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   731
  int num_locals() const { return Bytes::get_Java_u2(num_locals_addr()); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   732
  verification_type_info* locals() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   733
    return verification_type_info::at(locals_addr());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   734
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   735
  address end_of_locals() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   736
    verification_type_info* vti = locals();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   737
    for (int i = 0; i < num_locals(); ++i) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   738
      vti = vti->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   739
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   740
    return (address)vti;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   741
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   742
  int stack_slots(address end_of_locals) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   743
    return Bytes::get_Java_u2(stack_slots_addr(end_of_locals));
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   744
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   745
  verification_type_info* stack(address end_of_locals) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   746
    return verification_type_info::at(stack_addr(end_of_locals));
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   747
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   748
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   749
  void set_offset_delta(int offset_delta) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   750
    Bytes::put_Java_u2(offset_delta_addr(), offset_delta - 1);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   751
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   752
  void set_num_locals(int num_locals) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   753
    Bytes::put_Java_u2(num_locals_addr(), num_locals);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   754
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   755
  void set_stack_slots(address end_of_locals, int stack_slots) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   756
    Bytes::put_Java_u2(stack_slots_addr(end_of_locals), stack_slots);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   757
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   758
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   759
  // These return only the locals.  Extra processing is required for stack
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   760
  // types of full frames.
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   761
  int number_of_types() const { return num_locals(); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   762
  verification_type_info* types() const { return locals(); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   763
  bool is_valid_offset(int offset) { return true; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   764
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   765
  bool verify_subtype(address start, address end) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   766
    verification_type_info* vti = types();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   767
    if ((address)vti >= end) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   768
      return false;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   769
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   770
    int count = number_of_types();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   771
    for (int i = 0; i < count; ++i) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   772
      if (!vti->verify(start, end)) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   773
        return false;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   774
      }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   775
      vti = vti->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   776
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   777
    address eol = (address)vti;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   778
    if (eol + sizeof(u2) > end) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   779
      return false;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   780
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   781
    count = stack_slots(eol);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   782
    vti = stack(eol);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   783
    for (int i = 0; i < stack_slots(eol); ++i) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   784
      if (!vti->verify(start, end)) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   785
        return false;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   786
      }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   787
      vti = vti->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   788
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   789
    return true;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   790
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   791
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   792
  void print_on(outputStream* st, int current_offset = -1) const {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   793
    st->print("full_frame(@%d,{", offset_delta() + current_offset);
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   794
    verification_type_info* vti = locals();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   795
    for (int i = 0; i < num_locals(); ++i) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   796
      vti->print_on(st);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   797
      if (i != num_locals() - 1) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   798
        st->print(",");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   799
      }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   800
      vti = vti->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   801
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   802
    st->print("},{");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   803
    address end_of_locals = (address)vti;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   804
    vti = stack(end_of_locals);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   805
    int ss = stack_slots(end_of_locals);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   806
    for (int i = 0; i < ss; ++i) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   807
      vti->print_on(st);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   808
      if (i != ss - 1) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   809
        st->print(",");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   810
      }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   811
      vti = vti->next();
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   812
    }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   813
    st->print("})");
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   814
  }
41542
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   815
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   816
  void print_truncated(outputStream* st, int current_offset = -1) const {
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   817
    st->print("full_frame(@%d), output truncated, Stackmap exceeds table size.",
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   818
              offset_delta() + current_offset);
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   819
  }
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   820
};
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   821
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   822
#define VIRTUAL_DISPATCH(stack_frame_type, func_name, args) \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   823
  stack_frame_type* item_##stack_frame_type = as_##stack_frame_type(); \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   824
  if (item_##stack_frame_type != NULL) { \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   825
    return item_##stack_frame_type->func_name args;  \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   826
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   827
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   828
#define VOID_VIRTUAL_DISPATCH(stack_frame_type, func_name, args) \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   829
  stack_frame_type* item_##stack_frame_type = as_##stack_frame_type(); \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   830
  if (item_##stack_frame_type != NULL) { \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   831
    item_##stack_frame_type->func_name args;  \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   832
    return; \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   833
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   834
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   835
size_t stack_map_frame::size() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   836
  FOR_EACH_STACKMAP_FRAME_TYPE(VIRTUAL_DISPATCH, size, ());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   837
  return 0;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   838
}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   839
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   840
int stack_map_frame::offset_delta() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   841
  FOR_EACH_STACKMAP_FRAME_TYPE(VIRTUAL_DISPATCH, offset_delta, ());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   842
  return 0;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   843
}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   844
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   845
void stack_map_frame::set_offset_delta(int offset_delta) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   846
  FOR_EACH_STACKMAP_FRAME_TYPE(
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   847
      VOID_VIRTUAL_DISPATCH, set_offset_delta, (offset_delta));
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   848
}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   849
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   850
int stack_map_frame::number_of_types() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   851
  FOR_EACH_STACKMAP_FRAME_TYPE(VIRTUAL_DISPATCH, number_of_types, ());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   852
  return 0;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   853
}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   854
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   855
verification_type_info* stack_map_frame::types() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   856
  FOR_EACH_STACKMAP_FRAME_TYPE(VIRTUAL_DISPATCH, types, ());
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   857
  return NULL;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   858
}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   859
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   860
bool stack_map_frame::is_valid_offset(int offset) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   861
  FOR_EACH_STACKMAP_FRAME_TYPE(VIRTUAL_DISPATCH, is_valid_offset, (offset));
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   862
  return true;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   863
}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   864
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   865
bool stack_map_frame::verify(address start, address end) const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   866
  if (frame_type_addr() >= start && frame_type_addr() < end) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   867
    FOR_EACH_STACKMAP_FRAME_TYPE(
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   868
       VIRTUAL_DISPATCH, verify_subtype, (start, end));
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   869
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   870
  return false;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   871
}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   872
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   873
void stack_map_frame::print_on(outputStream* st, int offs = -1) const {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   874
  FOR_EACH_STACKMAP_FRAME_TYPE(VOID_VIRTUAL_DISPATCH, print_on, (st, offs));
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   875
}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   876
41542
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   877
void stack_map_frame::print_truncated(outputStream* st, int offs = -1) const {
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   878
  FOR_EACH_STACKMAP_FRAME_TYPE(VOID_VIRTUAL_DISPATCH, print_truncated, (st, offs));
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   879
}
c705c10c4914 8159511: Stack map validation
hseigel
parents: 13476
diff changeset
   880
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   881
#undef VIRTUAL_DISPATCH
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   882
#undef VOID_VIRTUAL_DISPATCH
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   883
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   884
#define AS_SUBTYPE_DEF(stack_frame_type, arg1, arg2) \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   885
stack_frame_type* stack_map_frame::as_##stack_frame_type() const { \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   886
  if (stack_frame_type::is_frame_type(frame_type())) { \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   887
    return (stack_frame_type*)this; \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   888
  } else { \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   889
    return NULL; \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   890
  } \
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   891
}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   892
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   893
FOR_EACH_STACKMAP_FRAME_TYPE(AS_SUBTYPE_DEF, x, x)
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   894
#undef AS_SUBTYPE_DEF
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   895
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   896
class stack_map_table {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   897
 private:
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   898
  address number_of_entries_addr() const {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   899
    return (address)this;
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   900
  }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   901
  address entries_addr() const {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   902
    return number_of_entries_addr() + sizeof(u2);
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   903
  }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   904
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   905
 protected:
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   906
  // No constructors  - should be 'private', but GCC issues a warning if it is
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   907
  stack_map_table() {}
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   908
  stack_map_table(const stack_map_table&) {}
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   909
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   910
 public:
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   911
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   912
  static stack_map_table* at(address addr) {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   913
    return (stack_map_table*)addr;
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   914
  }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   915
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   916
  u2 number_of_entries() const {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   917
    return Bytes::get_Java_u2(number_of_entries_addr());
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   918
  }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   919
  stack_map_frame* entries() const {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   920
    return stack_map_frame::at(entries_addr());
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   921
  }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   922
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   923
  void set_number_of_entries(u2 num) {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   924
    Bytes::put_Java_u2(number_of_entries_addr(), num);
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   925
  }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   926
};
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   927
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   928
class stack_map_table_attribute {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   929
 private:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   930
  address name_index_addr() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   931
      return (address)this; }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   932
  address attribute_length_addr() const {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   933
      return name_index_addr() + sizeof(u2); }
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   934
  address stack_map_table_addr() const {
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   935
      return attribute_length_addr() + sizeof(u4); }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   936
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   937
 protected:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   938
  // No constructors  - should be 'private', but GCC issues a warning if it is
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   939
  stack_map_table_attribute() {}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   940
  stack_map_table_attribute(const stack_map_table_attribute&) {}
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   941
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   942
 public:
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   943
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   944
  static stack_map_table_attribute* at(address addr) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   945
    return (stack_map_table_attribute*)addr;
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   946
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   947
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   948
  u2 name_index() const {
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   949
    return Bytes::get_Java_u2(name_index_addr()); }
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   950
  u4 attribute_length() const {
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   951
    return Bytes::get_Java_u4(attribute_length_addr()); }
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   952
  stack_map_table* table() const {
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   953
    return stack_map_table::at(stack_map_table_addr());
6974
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   954
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   955
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   956
  void set_name_index(u2 idx) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   957
    Bytes::put_Java_u2(name_index_addr(), idx);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   958
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   959
  void set_attribute_length(u4 len) {
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   960
    Bytes::put_Java_u4(attribute_length_addr(), len);
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   961
  }
a013f1c533a5 6991315: RedefineClasses fails with java.lang.VerifyError
kamg
parents:
diff changeset
   962
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6974
diff changeset
   963
13476
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   964
#undef FOR_EACH_STACKMAP_FRAME_TYPE
471200fb94fd 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 7397
diff changeset
   965
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6974
diff changeset
   966
#endif // SHARE_VM_CLASSFILE_STACKMAPTABLEFORMAT_HPP