make/hotspot/src/native/dtrace/generateJvmOffsets.cpp
author lkorinth
Wed, 13 Nov 2019 11:37:29 +0100
changeset 59053 ba6c248cae19
parent 54780 f8d182aedc92
permissions -rw-r--r--
8232365: Implementation for JEP 363: Remove the Concurrent Mark Sweep (CMS) Garbage Collector Reviewed-by: kbarrett, tschatzl, erikj, coleenp, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
59053
ba6c248cae19 8232365: Implementation for JEP 363: Remove the Concurrent Mark Sweep (CMS) Garbage Collector
lkorinth
parents: 54780
diff changeset
     2
 * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3261
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3261
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3261
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
 * This is to provide sanity check in jhelper.d which compares SCCS
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
 * versions of generateJvmOffsets.cpp used to create and extract
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
 * contents of __JvmOffsets[] table.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
 * The __JvmOffsets[] table is located in generated JvmOffsets.cpp.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
 * GENOFFS_SCCS_VER 34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
49553
58cffb6ec13c 8201236: Straighten out dtrace build logic
ihse
parents: 49124
diff changeset
    34
#include <stdio.h>
58cffb6ec13c 8201236: Straighten out dtrace build logic
ihse
parents: 49124
diff changeset
    35
#include <strings.h>
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
/* A workaround for private and protected fields */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
#define private   public
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
#define protected public
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
#include <proc_service.h>
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30291
diff changeset
    42
#include "gc/shared/collectedHeap.hpp"
51341
09cc8813ae51 8207965: C2-only debug build fails
kvn
parents: 51179
diff changeset
    43
#include "memory/heap.hpp"
54780
f8d182aedc92 8223136: Move compressed oops functions to CompressedOops class
stefank
parents: 51341
diff changeset
    44
#include "oops/compressedOops.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6418
diff changeset
    45
#include "runtime/vmStructs.hpp"
49553
58cffb6ec13c 8201236: Straighten out dtrace build logic
ihse
parents: 49124
diff changeset
    46
58cffb6ec13c 8201236: Straighten out dtrace build logic
ihse
parents: 49124
diff changeset
    47
typedef enum GEN_variant {
58cffb6ec13c 8201236: Straighten out dtrace build logic
ihse
parents: 49124
diff changeset
    48
        GEN_OFFSET = 0,
58cffb6ec13c 8201236: Straighten out dtrace build logic
ihse
parents: 49124
diff changeset
    49
        GEN_INDEX  = 1,
58cffb6ec13c 8201236: Straighten out dtrace build logic
ihse
parents: 49124
diff changeset
    50
        GEN_TABLE  = 2
58cffb6ec13c 8201236: Straighten out dtrace build logic
ihse
parents: 49124
diff changeset
    51
} GEN_variant;
58cffb6ec13c 8201236: Straighten out dtrace build logic
ihse
parents: 49124
diff changeset
    52
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
#ifdef COMPILER1
17006
b9bfa72b7dda 7104565: trim jprt build targets
drchase
parents: 13969
diff changeset
    54
#ifdef ASSERT
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
 * To avoid the most part of potential link errors
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
 * we link this program with -z nodefs .
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
 * But for 'debug1' and 'fastdebug1' we still have to provide
17006
b9bfa72b7dda 7104565: trim jprt build targets
drchase
parents: 13969
diff changeset
    61
 * a particular workaround for the following symbols below.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
 * It will be good to find out a generic way in the future.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
#pragma weak tty
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
#if defined(i386) || defined(__i386) || defined(__amd64)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
#pragma weak noreg
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
#endif /* i386 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
LIR_Opr LIR_OprFact::illegalOpr = (LIR_Opr) 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
address StubRoutines::_call_stub_return_address = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
StubQueue* AbstractInterpreter::_code = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
17006
b9bfa72b7dda 7104565: trim jprt build targets
drchase
parents: 13969
diff changeset
    77
#endif /* ASSERT */
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
#endif /* COMPILER1 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
26796
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25714
diff changeset
    80
#define GEN_OFFS_NAME(Type,Name,OutputType)             \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  switch(gen_variant) {                                 \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  case GEN_OFFSET:                                      \
32191
9666860cbf22 8033577: [parfait] warnings from b128 for hotspot/src/os/solaris/dtrace: Unportable format string argument mismatch
sspitsyn
parents: 30764
diff changeset
    83
    printf("#define OFFSET_%-33s %ld\n",                \
26796
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25714
diff changeset
    84
            #OutputType #Name, offset_of(Type, Name));  \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
    break;                                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  case GEN_INDEX:                                       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
    printf("#define IDX_OFFSET_%-33s %d\n",             \
26796
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25714
diff changeset
    88
            #OutputType #Name, index++);                \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
    break;                                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  case GEN_TABLE:                                       \
26796
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25714
diff changeset
    91
    printf("\tOFFSET_%s,\n", #OutputType #Name);        \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
    break;                                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
26796
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25714
diff changeset
    95
#define GEN_OFFS(Type,Name)                             \
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25714
diff changeset
    96
  GEN_OFFS_NAME(Type,Name,Type)
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25714
diff changeset
    97
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
#define GEN_SIZE(Type)                                  \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  switch(gen_variant) {                                 \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  case GEN_OFFSET:                                      \
32191
9666860cbf22 8033577: [parfait] warnings from b128 for hotspot/src/os/solaris/dtrace: Unportable format string argument mismatch
sspitsyn
parents: 30764
diff changeset
   101
    printf("#define SIZE_%-35s %ld\n",                  \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
            #Type, sizeof(Type));                       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
    break;                                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  case GEN_INDEX:                                       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
    printf("#define IDX_SIZE_%-35s %d\n",               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
            #Type, index++);                            \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
    break;                                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  case GEN_TABLE:                                       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
    printf("\tSIZE_%s,\n", #Type);                      \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
    break;                                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
#define GEN_VALUE(String,Value)                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  switch(gen_variant) {                                 \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  case GEN_OFFSET:                                      \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
    printf("#define %-40s %d\n", #String, Value);       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
    break;                                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  case GEN_INDEX:                                       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
    printf("#define IDX_%-40s %d\n", #String, index++); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
    break;                                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  case GEN_TABLE:                                       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
    printf("\t" #String ",\n");                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
    break;                                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
void gen_prologue(GEN_variant gen_variant) {
32192
147f23238b67 8080401: Uninitialised variable in hotspot/src/os/solaris/dtrace/
sspitsyn
parents: 32191
diff changeset
   127
    const char *suffix = "Undefined-Suffix";
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
    switch(gen_variant) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
      case GEN_OFFSET: suffix = ".h";        break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
      case GEN_INDEX:  suffix = "Index.h";   break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
      case GEN_TABLE:  suffix = ".cpp";      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
    printf("/*\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
    printf(" * JvmOffsets%s !!!DO NOT EDIT!!! \n", suffix);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
    printf(" * The generateJvmOffsets program generates this file!\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
    printf(" */\n\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
    switch(gen_variant) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
      case GEN_OFFSET:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
      case GEN_INDEX:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
        break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
      case GEN_TABLE:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
        printf("#include \"JvmOffsets.h\"\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
        printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
        printf("int __JvmOffsets[] = {\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
        break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
void gen_epilogue(GEN_variant gen_variant) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
    if (gen_variant != GEN_TABLE) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
        return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
    printf("};\n\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
    return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
int generateJvmOffsets(GEN_variant gen_variant) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  int index = 0;        /* It is used to generate JvmOffsetsIndex.h */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  int pointer_size = sizeof(void *);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  int data_model = (pointer_size == 4) ? PR_MODEL_ILP32 : PR_MODEL_LP64;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  gen_prologue(gen_variant);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  GEN_VALUE(DATA_MODEL, data_model);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  GEN_VALUE(POINTER_SIZE, pointer_size);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
#if defined(TIERED)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
  GEN_VALUE(COMPILER, 3);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
#elif COMPILER1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  GEN_VALUE(COMPILER, 1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
#elif COMPILER2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
  GEN_VALUE(COMPILER, 2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  GEN_VALUE(COMPILER, 0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
#endif // COMPILER1 && COMPILER2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  GEN_OFFS(CollectedHeap, _reserved);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  GEN_OFFS(MemRegion, _start);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  GEN_OFFS(MemRegion, _word_size);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  GEN_SIZE(HeapWord);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  GEN_OFFS(VMStructEntry, typeName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  GEN_OFFS(VMStructEntry, fieldName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  GEN_OFFS(VMStructEntry, address);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  GEN_SIZE(VMStructEntry);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  GEN_VALUE(MAX_METHOD_CODE_SIZE, max_method_code_size);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
#if defined(sparc) || defined(__sparc)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  GEN_VALUE(OFFSET_interpreter_frame_method, 2 * pointer_size);     /* L2 in saved window */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  GEN_VALUE(OFFSET_interpreter_frame_sender_sp, 13 * pointer_size); /* I5 in saved window */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  // Fake value for consistency. It is not going to be used.
25714
87fa6860b5ae 8004128: NPG: remove stackwalking in Threads::gc_prologue and gc_epilogue code
coleenp
parents: 17006
diff changeset
   198
  GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, 0xFFFF);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
#elif defined(i386) || defined(__i386) || defined(__amd64)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
  GEN_VALUE(OFFSET_interpreter_frame_sender_sp, -1 * pointer_size);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  GEN_VALUE(OFFSET_interpreter_frame_method, -3 * pointer_size);
25714
87fa6860b5ae 8004128: NPG: remove stackwalking in Threads::gc_prologue and gc_epilogue code
coleenp
parents: 17006
diff changeset
   202
  GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, -7 * pointer_size);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  GEN_OFFS(Klass, _name);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   206
  GEN_OFFS(ConstantPool, _pool_holder);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
32191
9666860cbf22 8033577: [parfait] warnings from b128 for hotspot/src/os/solaris/dtrace: Unportable format string argument mismatch
sspitsyn
parents: 30764
diff changeset
   209
  GEN_VALUE(OFFSET_HeapBlockHeader_used, (int) offset_of(HeapBlock::Header, _used));
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   210
  GEN_OFFS(oopDesc, _metadata);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  GEN_VALUE(AccessFlags_NATIVE, JVM_ACC_NATIVE);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   214
  GEN_VALUE(ConstMethod_has_linenumber_table, ConstMethod::_has_linenumber_table);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  GEN_OFFS(AccessFlags, _flags);
51179
516acf6956a2 8207359: Make SymbolTable increment_refcount disallow zero
coleenp
parents: 49553
diff changeset
   216
  GEN_OFFS(Symbol, _length_and_refcount);
8076
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   217
  GEN_OFFS(Symbol, _body);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   220
  GEN_OFFS(Method, _constMethod);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   221
  GEN_OFFS(Method, _access_flags);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   224
  GEN_OFFS(ConstMethod, _constants);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   225
  GEN_OFFS(ConstMethod, _flags);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   226
  GEN_OFFS(ConstMethod, _code_size);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   227
  GEN_OFFS(ConstMethod, _name_index);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   228
  GEN_OFFS(ConstMethod, _signature_index);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
  GEN_OFFS(CodeHeap, _memory);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
  GEN_OFFS(CodeHeap, _segmap);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  GEN_OFFS(CodeHeap, _log2_segment_size);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
  GEN_OFFS(VirtualSpace, _low_boundary);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
  GEN_OFFS(VirtualSpace, _high_boundary);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  GEN_OFFS(VirtualSpace, _low);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
  GEN_OFFS(VirtualSpace, _high);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
26796
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25714
diff changeset
   242
  /* We need to use different names here because of the template parameter */
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25714
diff changeset
   243
  GEN_OFFS_NAME(GrowableArray<CodeHeap*>, _data, GrowableArray_CodeHeap);
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25714
diff changeset
   244
  GEN_OFFS_NAME(GrowableArray<CodeHeap*>, _len, GrowableArray_CodeHeap);
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25714
diff changeset
   245
  printf("\n");
666464578742 8015774: Add support for multiple code heaps
thartmann
parents: 25714
diff changeset
   246
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  GEN_OFFS(CodeBlob, _name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
  GEN_OFFS(CodeBlob, _header_size);
38133
78b95467b9f1 8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents: 32192
diff changeset
   249
  GEN_OFFS(CodeBlob, _content_begin);
78b95467b9f1 8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents: 32192
diff changeset
   250
  GEN_OFFS(CodeBlob, _code_begin);
78b95467b9f1 8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents: 32192
diff changeset
   251
  GEN_OFFS(CodeBlob, _code_end);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
  GEN_OFFS(CodeBlob, _data_offset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
  GEN_OFFS(CodeBlob, _frame_size);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
  GEN_OFFS(nmethod, _method);
26686
d7bc560b0ee9 8054174: minor buglet in computation of end of pc descs in libjvm_db.c
dsamersoff
parents: 25714
diff changeset
   257
  GEN_OFFS(nmethod, _dependencies_offset);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   258
  GEN_OFFS(nmethod, _metadata_offset);
38133
78b95467b9f1 8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents: 32192
diff changeset
   259
  GEN_OFFS(nmethod, _scopes_data_begin);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  GEN_OFFS(nmethod, _scopes_pcs_offset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
  GEN_OFFS(nmethod, _handler_table_offset);
38133
78b95467b9f1 8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents: 32192
diff changeset
   262
  GEN_OFFS(nmethod, _deopt_handler_begin);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
  GEN_OFFS(nmethod, _orig_pc_offset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
  GEN_OFFS(PcDesc, _pc_offset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
  GEN_OFFS(PcDesc, _scope_decode_offset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
13969
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13728
diff changeset
   270
  GEN_OFFS(NarrowPtrStruct, _base);
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13728
diff changeset
   271
  GEN_OFFS(NarrowPtrStruct, _shift);
2254
f13dda645a4b 6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents: 670
diff changeset
   272
  printf("\n");
f13dda645a4b 6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents: 670
diff changeset
   273
32191
9666860cbf22 8033577: [parfait] warnings from b128 for hotspot/src/os/solaris/dtrace: Unportable format string argument mismatch
sspitsyn
parents: 30764
diff changeset
   274
  GEN_VALUE(SIZE_HeapBlockHeader, (int) sizeof(HeapBlock::Header));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
  GEN_SIZE(oopDesc);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   276
  GEN_SIZE(ConstantPool);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
  GEN_SIZE(PcDesc);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   280
  GEN_SIZE(Method);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12937
diff changeset
   281
  GEN_SIZE(ConstMethod);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
  GEN_SIZE(nmethod);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
  GEN_SIZE(CodeBlob);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
  GEN_SIZE(BufferBlob);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
  GEN_SIZE(SingletonBlob);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
  GEN_SIZE(RuntimeStub);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
  GEN_SIZE(SafepointBlob);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
  gen_epilogue(gen_variant);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
  printf("\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
  fflush(stdout);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
  return 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
}
49124
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   295
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   296
const char *HELP =
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   297
    "HELP: generateJvmOffsets {-header | -index | -table} \n";
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   298
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   299
int main(int argc, const char *argv[]) {
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   300
    GEN_variant gen_var;
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   301
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   302
    if (argc != 2) {
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   303
        printf("%s", HELP);
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   304
        return 1;
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   305
    }
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   306
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   307
    if (0 == strcmp(argv[1], "-header")) {
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   308
        gen_var = GEN_OFFSET;
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   309
    }
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   310
    else if (0 == strcmp(argv[1], "-index")) {
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   311
        gen_var = GEN_INDEX;
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   312
    }
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   313
    else if (0 == strcmp(argv[1], "-table")) {
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   314
        gen_var = GEN_TABLE;
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   315
    }
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   316
    else {
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   317
        printf("%s", HELP);
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   318
        return 1;
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   319
    }
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   320
    return generateJvmOffsets(gen_var);
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 47216
diff changeset
   321
}