src/hotspot/share/jvmci/jvmciCodeInstaller.hpp
author kvn
Wed, 01 May 2019 12:31:29 -0700
changeset 54669 ad45b3802d4e
parent 53244 9807daeb47c4
child 55293 d19dc5b10fbb
permissions -rw-r--r--
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library Reviewed-by: dnsimon, never, stefank, rehn, neliasso, dholmes, kbarrett, coleenp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52381
diff changeset
     2
 * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     4
 *
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     7
 * published by the Free Software Foundation.
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     8
 *
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    13
 * accompanied this code).
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    14
 *
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    18
 *
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    21
 * questions.
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    22
 */
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    23
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52381
diff changeset
    24
#ifndef SHARE_JVMCI_JVMCICODEINSTALLER_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52381
diff changeset
    25
#define SHARE_JVMCI_JVMCICODEINSTALLER_HPP
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    26
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
    27
#include "code/debugInfoRec.hpp"
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
    28
#include "code/exceptionHandlerTable.hpp"
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
    29
#include "code/nativeInst.hpp"
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
    30
#include "jvmci/jvmci.hpp"
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    31
#include "jvmci/jvmciEnv.hpp"
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    32
52381
7f90bc64b0fc 8213203: [JVMCI] adopt formatting changes from jvmci 8
never
parents: 50729
diff changeset
    33
#if INCLUDE_AOT
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    34
class RelocBuffer : public StackObj {
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    35
  enum { stack_size = 1024 };
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    36
public:
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    37
  RelocBuffer() : _size(0), _buffer(0) {}
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    38
  ~RelocBuffer();
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    39
  void ensure_size(size_t bytes);
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    40
  void set_size(size_t bytes);
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    41
  address begin() const;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    42
  size_t size() const { return _size; }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    43
private:
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    44
  size_t _size;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    45
  char _static_buffer[stack_size];
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    46
  char *_buffer;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    47
};
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    48
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
    49
class CodeInstaller;
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
    50
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
    51
class AOTOopRecorder : public OopRecorder {
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
    52
public:
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
    53
  AOTOopRecorder(CodeInstaller* code_inst, Arena* arena = NULL, bool deduplicate = false);
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
    54
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
    55
  virtual int find_index(Metadata* h);
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
    56
  virtual int find_index(jobject h);
47668
fc4cfca10556 8132547: [AOT] support invokedynamic instructions
dlong
parents: 47216
diff changeset
    57
  int nr_meta_refs() const;
fc4cfca10556 8132547: [AOT] support invokedynamic instructions
dlong
parents: 47216
diff changeset
    58
  jobject meta_element(int pos) const;
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
    59
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
    60
private:
47668
fc4cfca10556 8132547: [AOT] support invokedynamic instructions
dlong
parents: 47216
diff changeset
    61
  void record_meta_ref(jobject ref, int index);
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
    62
47668
fc4cfca10556 8132547: [AOT] support invokedynamic instructions
dlong
parents: 47216
diff changeset
    63
  GrowableArray<jobject>* _meta_refs;
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
    64
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
    65
  CodeInstaller* _code_inst;
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
    66
};
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
    67
#endif // INCLUDE_AOT
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
    68
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    69
class CodeMetadata {
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    70
public:
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    71
  CodeMetadata() {}
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    72
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    73
  CodeBlob* get_code_blob() const { return _cb; }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    74
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    75
  PcDesc* get_pc_desc() const { return _pc_desc; }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    76
  int get_nr_pc_desc() const { return _nr_pc_desc; }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    77
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    78
  u_char* get_scopes_desc() const { return _scopes_desc; }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    79
  int get_scopes_size() const { return _nr_scopes_desc; }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    80
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
    81
#if INCLUDE_AOT
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    82
  RelocBuffer* get_reloc_buffer() { return &_reloc_buffer; }
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
    83
  AOTOopRecorder* get_oop_recorder() { return _oop_recorder; }
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
    84
#endif
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
    85
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    86
  ExceptionHandlerTable* get_exception_table() { return _exception_table; }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    87
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    88
  void set_pc_desc(PcDesc* desc, int count) {
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    89
    _pc_desc = desc;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    90
    _nr_pc_desc = count;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    91
  }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    92
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    93
  void set_scopes(u_char* scopes, int size) {
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    94
    _scopes_desc = scopes;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    95
    _nr_scopes_desc = size;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    96
  }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    97
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
    98
#if INCLUDE_AOT
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
    99
  void set_oop_recorder(AOTOopRecorder* recorder) {
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   100
    _oop_recorder = recorder;
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   101
  }
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   102
#endif
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   103
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   104
  void set_exception_table(ExceptionHandlerTable* table) {
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   105
    _exception_table = table;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   106
  }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   107
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   108
private:
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   109
  CodeBlob* _cb;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   110
  PcDesc* _pc_desc;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   111
  int _nr_pc_desc;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   112
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   113
  u_char* _scopes_desc;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   114
  int _nr_scopes_desc;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   115
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   116
#if INCLUDE_AOT
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   117
  RelocBuffer _reloc_buffer;
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   118
  AOTOopRecorder* _oop_recorder;
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   119
#endif
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   120
  ExceptionHandlerTable* _exception_table;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   121
};
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   122
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   123
/*
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   124
 * This class handles the conversion from a InstalledCode to a CodeBlob or an nmethod.
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   125
 */
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   126
class CodeInstaller : public StackObj {
35123
b0b89d83bcf5 8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents: 34502
diff changeset
   127
  friend class JVMCIVMStructs;
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   128
private:
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   129
  enum MarkId {
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   130
    VERIFIED_ENTRY                         = 1,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   131
    UNVERIFIED_ENTRY                       = 2,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   132
    OSR_ENTRY                              = 3,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   133
    EXCEPTION_HANDLER_ENTRY                = 4,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   134
    DEOPT_HANDLER_ENTRY                    = 5,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   135
    INVOKEINTERFACE                        = 6,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   136
    INVOKEVIRTUAL                          = 7,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   137
    INVOKESTATIC                           = 8,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   138
    INVOKESPECIAL                          = 9,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   139
    INLINE_INVOKE                          = 10,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   140
    POLL_NEAR                              = 11,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   141
    POLL_RETURN_NEAR                       = 12,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   142
    POLL_FAR                               = 13,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   143
    POLL_RETURN_FAR                        = 14,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   144
    CARD_TABLE_ADDRESS                     = 15,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   145
    CARD_TABLE_SHIFT                       = 16,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   146
    HEAP_TOP_ADDRESS                       = 17,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   147
    HEAP_END_ADDRESS                       = 18,
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   148
    NARROW_KLASS_BASE_ADDRESS              = 19,
43435
01521491ec10 8172310: [AOT] Fix unverified entry point
iveresov
parents: 43416
diff changeset
   149
    NARROW_OOP_BASE_ADDRESS                = 20,
01521491ec10 8172310: [AOT] Fix unverified entry point
iveresov
parents: 43416
diff changeset
   150
    CRC_TABLE_ADDRESS                      = 21,
01521491ec10 8172310: [AOT] Fix unverified entry point
iveresov
parents: 43416
diff changeset
   151
    LOG_OF_HEAP_REGION_GRAIN_BYTES         = 22,
01521491ec10 8172310: [AOT] Fix unverified entry point
iveresov
parents: 43416
diff changeset
   152
    INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED = 23,
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   153
    INVOKE_INVALID                         = -1
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   154
  };
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   155
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   156
  Arena         _arena;
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   157
  JVMCIEnv*     _jvmci_env;
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   158
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   159
  JVMCIPrimitiveArray    _data_section_handle;
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   160
  JVMCIObjectArray       _data_section_patches_handle;
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   161
  JVMCIObjectArray       _sites_handle;
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   162
#ifndef PRODUCT
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   163
  JVMCIObjectArray       _comments_handle;
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   164
#endif
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   165
  JVMCIPrimitiveArray    _code_handle;
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   166
  JVMCIObject            _word_kind_handle;
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   167
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   168
  CodeOffsets   _offsets;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   169
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   170
  jint          _code_size;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   171
  jint          _total_frame_size;
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   172
  jint          _orig_pc_offset;
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   173
  jint          _parameter_count;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   174
  jint          _constants_size;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   175
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   176
  bool          _has_wide_vector;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   177
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   178
  MarkId        _next_call_type;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   179
  address       _invoke_mark_pc;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   180
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   181
  CodeSection*  _instructions;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   182
  CodeSection*  _constants;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   183
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   184
  OopRecorder*              _oop_recorder;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   185
  DebugInformationRecorder* _debug_recorder;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   186
  Dependencies*             _dependencies;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   187
  ExceptionHandlerTable     _exception_handler_table;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   188
42650
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   189
  bool _immutable_pic_compilation;  // Installer is called for Immutable PIC compilation.
1f304d0c888b 8171008: Integrate AOT compiler into JDK
kvn
parents: 41697
diff changeset
   190
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   191
  static ConstantOopWriteValue* _oop_null_scope_value;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   192
  static ConstantIntValue*    _int_m1_scope_value;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   193
  static ConstantIntValue*    _int_0_scope_value;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   194
  static ConstantIntValue*    _int_1_scope_value;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   195
  static ConstantIntValue*    _int_2_scope_value;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   196
  static LocationValue*       _illegal_value;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   197
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   198
  jint pd_next_offset(NativeInstruction* inst, jint pc_offset, JVMCIObject method, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   199
  void pd_patch_OopConstant(int pc_offset, JVMCIObject constant, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   200
  void pd_patch_MetaspaceConstant(int pc_offset, JVMCIObject constant, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   201
  void pd_patch_DataSectionReference(int pc_offset, int data_offset, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   202
  void pd_relocate_ForeignCall(NativeInstruction* inst, jlong foreign_call_destination, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   203
  void pd_relocate_JavaMethod(CodeBuffer &cbuf, JVMCIObject method, jint pc_offset, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   204
  void pd_relocate_poll(address pc, jint mark, JVMCI_TRAPS);
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   205
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   206
  JVMCIObjectArray sites()                { return _sites_handle; }
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   207
  JVMCIPrimitiveArray code()              { return _code_handle; }
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   208
  JVMCIPrimitiveArray  data_section()     { return _data_section_handle; }
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   209
  JVMCIObjectArray data_section_patches() { return _data_section_patches_handle; }
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   210
#ifndef PRODUCT
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   211
  JVMCIObjectArray comments()             { return _comments_handle; }
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   212
#endif
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   213
  JVMCIObject word_kind()                 { return _word_kind_handle; }
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   214
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   215
public:
33632
038347770a9e 8139170: JVMCI refresh
twisti
parents: 33160
diff changeset
   216
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   217
  CodeInstaller(JVMCIEnv* jvmci_env, bool immutable_pic_compilation) : _arena(mtJVMCI), _jvmci_env(jvmci_env), _immutable_pic_compilation(immutable_pic_compilation) {}
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   218
52381
7f90bc64b0fc 8213203: [JVMCI] adopt formatting changes from jvmci 8
never
parents: 50729
diff changeset
   219
#if INCLUDE_AOT
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   220
  JVMCI::CodeInstallResult gather_metadata(JVMCIObject target, JVMCIObject compiled_code, CodeMetadata& metadata, JVMCI_TRAPS);
52381
7f90bc64b0fc 8213203: [JVMCI] adopt formatting changes from jvmci 8
never
parents: 50729
diff changeset
   221
#endif
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   222
  JVMCI::CodeInstallResult install(JVMCICompiler* compiler,
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   223
                                   JVMCIObject target,
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   224
                                   JVMCIObject compiled_code,
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   225
                                   CodeBlob*& cb,
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   226
                                   JVMCIObject installed_code,
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   227
                                   FailedSpeculation** failed_speculations,
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   228
                                   char* speculations,
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   229
                                   int speculations_len,
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   230
                                   JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   231
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   232
  JVMCIEnv* jvmci_env() { return _jvmci_env; }
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   233
  JVMCIRuntime* runtime() { return _jvmci_env->runtime(); }
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   234
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   235
  static address runtime_call_target_address(oop runtime_call);
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   236
  static VMReg get_hotspot_reg(jint jvmciRegisterNumber, JVMCI_TRAPS);
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   237
  static bool is_general_purpose_reg(VMReg hotspotRegister);
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   238
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   239
  const OopMapSet* oopMapSet() const { return _debug_recorder->_oopmaps; }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   240
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   241
protected:
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   242
  Location::Type get_oop_type(JVMCIObject value);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   243
  ScopeValue* get_scope_value(JVMCIObject value, BasicType type, GrowableArray<ScopeValue*>* objects, ScopeValue* &second, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   244
  MonitorValue* get_monitor_value(JVMCIObject value, GrowableArray<ScopeValue*>* objects, JVMCI_TRAPS);
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   245
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   246
  void* record_metadata_reference(CodeSection* section, address dest, JVMCIObject constant, JVMCI_TRAPS);
33632
038347770a9e 8139170: JVMCI refresh
twisti
parents: 33160
diff changeset
   247
#ifdef _LP64
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   248
  narrowKlass record_narrow_metadata_reference(CodeSection* section, address dest, JVMCIObject constant, JVMCI_TRAPS);
33632
038347770a9e 8139170: JVMCI refresh
twisti
parents: 33160
diff changeset
   249
#endif
038347770a9e 8139170: JVMCI refresh
twisti
parents: 33160
diff changeset
   250
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35123
diff changeset
   251
  // extract the fields of the HotSpotCompiledCode
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   252
  void initialize_fields(JVMCIObject target, JVMCIObject compiled_code, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   253
  void initialize_dependencies(JVMCIObject compiled_code, OopRecorder* oop_recorder, JVMCI_TRAPS);
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   254
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   255
  int estimate_stubs_size(JVMCI_TRAPS);
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   256
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   257
  // perform data and call relocation on the CodeBuffer
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   258
  JVMCI::CodeInstallResult initialize_buffer(CodeBuffer& buffer, bool check_size, JVMCI_TRAPS);
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   259
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   260
  void assumption_NoFinalizableSubclass(JVMCIObject assumption);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   261
  void assumption_ConcreteSubtype(JVMCIObject assumption);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   262
  void assumption_LeafType(JVMCIObject assumption);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   263
  void assumption_ConcreteMethod(JVMCIObject assumption);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   264
  void assumption_CallSiteTargetValue(JVMCIObject assumption, JVMCI_TRAPS);
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   265
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   266
  void site_Safepoint(CodeBuffer& buffer, jint pc_offset, JVMCIObject site, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   267
  void site_Infopoint(CodeBuffer& buffer, jint pc_offset, JVMCIObject site, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   268
  void site_Call(CodeBuffer& buffer, jint pc_offset, JVMCIObject site, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   269
  void site_DataPatch(CodeBuffer& buffer, jint pc_offset, JVMCIObject site, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   270
  void site_Mark(CodeBuffer& buffer, jint pc_offset, JVMCIObject site, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   271
  void site_ExceptionHandler(jint pc_offset, JVMCIObject site);
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   272
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   273
  OopMap* create_oop_map(JVMCIObject debug_info, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   274
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   275
  VMReg getVMRegFromLocation(JVMCIObject location, int total_frame_size, JVMCI_TRAPS);
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   276
34502
1cfcb971cb17 8143730: [JVMCI] infopoint recording is too restrictive
dnsimon
parents: 34165
diff changeset
   277
  /**
1cfcb971cb17 8143730: [JVMCI] infopoint recording is too restrictive
dnsimon
parents: 34165
diff changeset
   278
   * Specifies the level of detail to record for a scope.
1cfcb971cb17 8143730: [JVMCI] infopoint recording is too restrictive
dnsimon
parents: 34165
diff changeset
   279
   */
1cfcb971cb17 8143730: [JVMCI] infopoint recording is too restrictive
dnsimon
parents: 34165
diff changeset
   280
  enum ScopeMode {
1cfcb971cb17 8143730: [JVMCI] infopoint recording is too restrictive
dnsimon
parents: 34165
diff changeset
   281
    // Only record a method and BCI
1cfcb971cb17 8143730: [JVMCI] infopoint recording is too restrictive
dnsimon
parents: 34165
diff changeset
   282
    BytecodePosition,
1cfcb971cb17 8143730: [JVMCI] infopoint recording is too restrictive
dnsimon
parents: 34165
diff changeset
   283
    // Record a method, bci and JVM frame state
1cfcb971cb17 8143730: [JVMCI] infopoint recording is too restrictive
dnsimon
parents: 34165
diff changeset
   284
    FullFrame
1cfcb971cb17 8143730: [JVMCI] infopoint recording is too restrictive
dnsimon
parents: 34165
diff changeset
   285
  };
1cfcb971cb17 8143730: [JVMCI] infopoint recording is too restrictive
dnsimon
parents: 34165
diff changeset
   286
50729
7755c93d3923 8204209: [Graal] Compilation fails during nmethod printing with "assert(bci == 0 || 0 <= bci && bci < code_size()) failed: illegal bci"
iveresov
parents: 49192
diff changeset
   287
  int map_jvmci_bci(int bci);
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   288
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   289
  void record_scope(jint pc_offset, JVMCIObject debug_info, ScopeMode scope_mode, bool return_oop, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   290
  void record_scope(jint pc_offset, JVMCIObject debug_info, ScopeMode scope_mode, JVMCI_TRAPS) {
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   291
    record_scope(pc_offset, debug_info, scope_mode, false /* return_oop */, JVMCIENV);
42861
1d4dfdf4390b 8169938: [AOT] SIGSEGV at ~BufferBlob::vtable chunks
dlong
parents: 42650
diff changeset
   292
  }
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   293
  void record_scope(jint pc_offset, JVMCIObject position, ScopeMode scope_mode, GrowableArray<ScopeValue*>* objects, bool return_oop, JVMCI_TRAPS);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   294
  void record_object_value(ObjectValue* sv, JVMCIObject value, GrowableArray<ScopeValue*>* objects, JVMCI_TRAPS);
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   295
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53244
diff changeset
   296
  GrowableArray<ScopeValue*>* record_virtual_objects(JVMCIObject debug_info, JVMCI_TRAPS);
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   297
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   298
  int estimateStubSpace(int static_call_stubs);
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   299
};
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
   300
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52381
diff changeset
   301
#endif // SHARE_JVMCI_JVMCICODEINSTALLER_HPP