hotspot/src/share/vm/classfile/bytecodeAssembler.hpp
author mchung
Tue, 24 Nov 2015 14:59:17 -0800
changeset 34280 72bfaaffee36
parent 33602 16053580a684
permissions -rw-r--r--
8143911: Reintegrate JEP 259: Stack-Walking API Reviewed-by: coleenp, dfuchs, bchristi, psandoz, sspitsyn Contributed-by: Mandy Chung <mandy.chung@oracle.com>, Brent Christian <brent.christian@oracle.com>, Daniel Fuchs <daniel.fuchs@oracle.com>, Hamlin Li <huaming.li@oracle.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14385
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     1
/*
33602
16053580a684 8139163: InstanceKlass::cast passes through NULL
coleenp
parents: 14385
diff changeset
     2
 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
14385
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     4
 *
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     8
 *
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    13
 * accompanied this code).
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    14
 *
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    18
 *
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    21
 * questions.
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    22
 *
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    23
 */
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    24
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    25
#ifndef SHARE_VM_CLASSFILE_BYTECODEASSEMBLER_HPP
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    26
#define SHARE_VM_CLASSFILE_BYTECODEASSEMBLER_HPP
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    27
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    28
#include "memory/allocation.hpp"
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    29
#include "oops/method.hpp"
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    30
#include "oops/symbol.hpp"
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    31
#include "utilities/globalDefinitions.hpp"
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    32
#include "utilities/growableArray.hpp"
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    33
#include "utilities/resourceHash.hpp"
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    34
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    35
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    36
/**
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    37
 * Bytecode Assembler
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    38
 *
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    39
 * These classes are used to synthesize code for creating new methods from
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    40
 * within the VM.  This is only a partial implementation of an assembler;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    41
 * only the bytecodes that are needed by clients are implemented at this time.
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    42
 * This is used during default method analysis to create overpass methods
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    43
 * and add them to a call during parsing.  Other uses (such as creating
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    44
 * bridges) may come later.  Any missing bytecodes can be implemented on an
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    45
 * as-need basis.
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    46
 */
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    47
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    48
class BytecodeBuffer : public GrowableArray<u1> {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    49
 public:
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    50
  BytecodeBuffer() : GrowableArray<u1>(20) {}
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    51
};
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    52
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    53
// Entries in a yet-to-be-created constant pool.  Limited types for now.
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    54
class BytecodeCPEntry VALUE_OBJ_CLASS_SPEC {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    55
 public:
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    56
  enum tag {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    57
    ERROR_TAG,
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    58
    UTF8,
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    59
    KLASS,
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    60
    STRING,
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    61
    NAME_AND_TYPE,
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    62
    METHODREF
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    63
  };
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    64
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    65
  u1 _tag;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    66
  union {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    67
    Symbol* utf8;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    68
    u2 klass;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    69
    u2 string;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    70
    struct {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    71
      u2 name_index;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    72
      u2 type_index;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    73
    } name_and_type;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    74
    struct {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    75
      u2 class_index;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    76
      u2 name_and_type_index;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    77
    } methodref;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    78
    uintptr_t hash;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    79
  } _u;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    80
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    81
  BytecodeCPEntry() : _tag(ERROR_TAG) { _u.hash = 0; }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    82
  BytecodeCPEntry(u1 tag) : _tag(tag) { _u.hash = 0; }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    83
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    84
  static BytecodeCPEntry utf8(Symbol* symbol) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    85
    BytecodeCPEntry bcpe(UTF8);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    86
    bcpe._u.utf8 = symbol;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    87
    return bcpe;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    88
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    89
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    90
  static BytecodeCPEntry klass(u2 index) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    91
    BytecodeCPEntry bcpe(KLASS);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    92
    bcpe._u.klass = index;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    93
    return bcpe;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    94
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    95
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    96
  static BytecodeCPEntry string(u2 index) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    97
    BytecodeCPEntry bcpe(STRING);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    98
    bcpe._u.string = index;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    99
    return bcpe;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   100
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   101
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   102
  static BytecodeCPEntry name_and_type(u2 name, u2 type) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   103
    BytecodeCPEntry bcpe(NAME_AND_TYPE);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   104
    bcpe._u.name_and_type.name_index = name;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   105
    bcpe._u.name_and_type.type_index = type;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   106
    return bcpe;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   107
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   108
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   109
  static BytecodeCPEntry methodref(u2 class_index, u2 nat) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   110
    BytecodeCPEntry bcpe(METHODREF);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   111
    bcpe._u.methodref.class_index = class_index;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   112
    bcpe._u.methodref.name_and_type_index = nat;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   113
    return bcpe;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   114
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   115
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   116
  static bool equals(BytecodeCPEntry const& e0, BytecodeCPEntry const& e1) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   117
    return e0._tag == e1._tag && e0._u.hash == e1._u.hash;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   118
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   119
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   120
  static unsigned hash(BytecodeCPEntry const& e0) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   121
    return (unsigned)(e0._tag ^ e0._u.hash);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   122
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   123
};
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   124
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   125
class BytecodeConstantPool : ResourceObj {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   126
 private:
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   127
  typedef ResourceHashtable<BytecodeCPEntry, u2,
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   128
      &BytecodeCPEntry::hash, &BytecodeCPEntry::equals> IndexHash;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   129
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   130
  ConstantPool* _orig;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   131
  GrowableArray<BytecodeCPEntry> _entries;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   132
  IndexHash _indices;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   133
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   134
  u2 find_or_add(BytecodeCPEntry const& bcpe);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   135
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   136
 public:
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   137
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   138
  BytecodeConstantPool(ConstantPool* orig) : _orig(orig) {}
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   139
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   140
  BytecodeCPEntry const& at(u2 index) const { return _entries.at(index); }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   141
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   142
  InstanceKlass* pool_holder() const {
33602
16053580a684 8139163: InstanceKlass::cast passes through NULL
coleenp
parents: 14385
diff changeset
   143
    return _orig->pool_holder();
14385
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   144
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   145
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   146
  u2 utf8(Symbol* sym) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   147
    return find_or_add(BytecodeCPEntry::utf8(sym));
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   148
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   149
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   150
  u2 klass(Symbol* class_name) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   151
    return find_or_add(BytecodeCPEntry::klass(utf8(class_name)));
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   152
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   153
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   154
  u2 string(Symbol* str) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   155
    return find_or_add(BytecodeCPEntry::string(utf8(str)));
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   156
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   157
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   158
  u2 name_and_type(Symbol* name, Symbol* sig) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   159
    return find_or_add(BytecodeCPEntry::name_and_type(utf8(name), utf8(sig)));
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   160
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   161
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   162
  u2 methodref(Symbol* class_name, Symbol* name, Symbol* sig) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   163
    return find_or_add(BytecodeCPEntry::methodref(
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   164
        klass(class_name), name_and_type(name, sig)));
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   165
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   166
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   167
  ConstantPool* create_constant_pool(TRAPS) const;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   168
};
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   169
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   170
// Partial bytecode assembler - only what we need for creating
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   171
// overpass methods for default methods is implemented
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   172
class BytecodeAssembler : StackObj {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   173
 private:
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   174
  BytecodeBuffer* _code;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   175
  BytecodeConstantPool* _cp;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   176
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   177
  void append(u1 imm_u1);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   178
  void append(u2 imm_u2);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   179
  void append(u4 imm_u4);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   180
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   181
  void xload(u4 index, u1 quick, u1 twobyte);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   182
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   183
 public:
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   184
  BytecodeAssembler(BytecodeBuffer* buffer, BytecodeConstantPool* cp)
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   185
    : _code(buffer), _cp(cp) {}
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   186
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   187
  void aload(u4 index);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   188
  void areturn();
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   189
  void athrow();
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   190
  void checkcast(Symbol* sym);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   191
  void dload(u4 index);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   192
  void dreturn();
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   193
  void dup();
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   194
  void fload(u4 index);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   195
  void freturn();
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   196
  void iload(u4 index);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   197
  void invokespecial(Method* method);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   198
  void invokespecial(Symbol* cls, Symbol* name, Symbol* sig);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   199
  void invokevirtual(Method* method);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   200
  void invokevirtual(Symbol* cls, Symbol* name, Symbol* sig);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   201
  void ireturn();
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   202
  void ldc(u1 index);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   203
  void ldc_w(u2 index);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   204
  void lload(u4 index);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   205
  void lreturn();
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   206
  void _new(Symbol* sym);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   207
  void _return();
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   208
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   209
  void load_string(Symbol* sym);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   210
  void load(BasicType bt, u4 index);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   211
  void _return(BasicType bt);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   212
};
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   213
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   214
#endif // SHARE_VM_CLASSFILE_BYTECODEASSEMBLER_HPP