hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp
author bobv
Mon, 19 Dec 2016 12:39:01 -0500
changeset 42664 29142a56c193
parent 42580 56304dee97f3
child 46263 1d8d6ddcc626
permissions -rw-r--r--
8168503: JEP 297: Unified arm32/arm64 Port Reviewed-by: kvn, enevill, ihse, dholmes, erikj, coleenp, cjplummer
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
     1
/*
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 37480
diff changeset
     2
 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
     4
 *
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
     7
 * published by the Free Software Foundation.
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
     8
 *
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    13
 * accompanied this code).
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    14
 *
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    18
 *
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    21
 * questions.
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    22
 *
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    23
 */
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    24
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    25
#include "precompiled.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    26
#include "interpreter/interpreter.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    27
#include "interpreter/interpreterRuntime.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    28
#include "interpreter/interp_masm.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    29
#include "interpreter/templateInterpreter.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    30
#include "interpreter/templateInterpreterGenerator.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    31
#include "interpreter/templateTable.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    32
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    33
#ifndef CC_INTERP
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    34
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    35
# define __ _masm->
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    36
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    37
TemplateInterpreterGenerator::TemplateInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    38
  _unimplemented_bytecode    = NULL;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    39
  _illegal_bytecode_sequence = NULL;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    40
  generate_all();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    41
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    42
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    43
static const BasicType types[Interpreter::number_of_result_handlers] = {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    44
  T_BOOLEAN,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    45
  T_CHAR   ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    46
  T_BYTE   ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    47
  T_SHORT  ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    48
  T_INT    ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    49
  T_LONG   ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    50
  T_VOID   ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    51
  T_FLOAT  ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    52
  T_DOUBLE ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    53
  T_OBJECT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    54
};
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    55
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    56
void TemplateInterpreterGenerator::generate_all() {
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    57
  { CodeletMark cm(_masm, "slow signature handler");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    58
    AbstractInterpreter::_slow_signature_handler = generate_slow_signature_handler();
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    59
  }
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    60
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    61
  { CodeletMark cm(_masm, "error exits");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    62
    _unimplemented_bytecode    = generate_error_exit("unimplemented bytecode");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    63
    _illegal_bytecode_sequence = generate_error_exit("illegal bytecode sequence - method not verified");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    64
  }
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    65
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    66
#ifndef PRODUCT
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    67
  if (TraceBytecodes) {
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    68
    CodeletMark cm(_masm, "bytecode tracing support");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    69
    Interpreter::_trace_code =
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    70
      EntryPoint(
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    71
                 generate_trace_code(btos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    72
                 generate_trace_code(ztos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    73
                 generate_trace_code(ctos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    74
                 generate_trace_code(stos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    75
                 generate_trace_code(atos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    76
                 generate_trace_code(itos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    77
                 generate_trace_code(ltos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    78
                 generate_trace_code(ftos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    79
                 generate_trace_code(dtos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    80
                 generate_trace_code(vtos)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    81
                 );
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    82
  }
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    83
#endif // !PRODUCT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    84
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    85
  { CodeletMark cm(_masm, "return entry points");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    86
    const int index_size = sizeof(u2);
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    87
    for (int i = 0; i < Interpreter::number_of_return_entries; i++) {
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    88
      Interpreter::_return_entry[i] =
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    89
        EntryPoint(
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    90
                   generate_return_entry_for(itos, i, index_size),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    91
                   generate_return_entry_for(itos, i, index_size),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    92
                   generate_return_entry_for(itos, i, index_size),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    93
                   generate_return_entry_for(itos, i, index_size),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    94
                   generate_return_entry_for(atos, i, index_size),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    95
                   generate_return_entry_for(itos, i, index_size),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    96
                   generate_return_entry_for(ltos, i, index_size),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    97
                   generate_return_entry_for(ftos, i, index_size),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    98
                   generate_return_entry_for(dtos, i, index_size),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
    99
                   generate_return_entry_for(vtos, i, index_size)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   100
                   );
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   101
    }
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   102
  }
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   103
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   104
  { CodeletMark cm(_masm, "invoke return entry points");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   105
    // These states are in order specified in TosState, except btos/ztos/ctos/stos are
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   106
    // really the same as itos since there is no top of stack optimization for these types
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   107
    const TosState states[] = {itos, itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos, ilgl};
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   108
    const int invoke_length = Bytecodes::length_for(Bytecodes::_invokestatic);
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   109
    const int invokeinterface_length = Bytecodes::length_for(Bytecodes::_invokeinterface);
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   110
    const int invokedynamic_length = Bytecodes::length_for(Bytecodes::_invokedynamic);
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   111
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   112
    for (int i = 0; i < Interpreter::number_of_return_addrs; i++) {
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   113
      TosState state = states[i];
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   114
      assert(state != ilgl, "states array is wrong above");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   115
      Interpreter::_invoke_return_entry[i] = generate_return_entry_for(state, invoke_length, sizeof(u2));
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   116
      Interpreter::_invokeinterface_return_entry[i] = generate_return_entry_for(state, invokeinterface_length, sizeof(u2));
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   117
      Interpreter::_invokedynamic_return_entry[i] = generate_return_entry_for(state, invokedynamic_length, sizeof(u4));
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   118
    }
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   119
  }
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   120
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   121
  { CodeletMark cm(_masm, "earlyret entry points");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   122
    Interpreter::_earlyret_entry =
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   123
      EntryPoint(
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   124
                 generate_earlyret_entry_for(btos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   125
                 generate_earlyret_entry_for(ztos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   126
                 generate_earlyret_entry_for(ctos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   127
                 generate_earlyret_entry_for(stos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   128
                 generate_earlyret_entry_for(atos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   129
                 generate_earlyret_entry_for(itos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   130
                 generate_earlyret_entry_for(ltos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   131
                 generate_earlyret_entry_for(ftos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   132
                 generate_earlyret_entry_for(dtos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   133
                 generate_earlyret_entry_for(vtos)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   134
                 );
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   135
  }
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   136
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   137
  { CodeletMark cm(_masm, "deoptimization entry points");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   138
    for (int i = 0; i < Interpreter::number_of_deopt_entries; i++) {
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   139
      Interpreter::_deopt_entry[i] =
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   140
        EntryPoint(
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   141
                   generate_deopt_entry_for(itos, i),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   142
                   generate_deopt_entry_for(itos, i),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   143
                   generate_deopt_entry_for(itos, i),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   144
                   generate_deopt_entry_for(itos, i),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   145
                   generate_deopt_entry_for(atos, i),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   146
                   generate_deopt_entry_for(itos, i),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   147
                   generate_deopt_entry_for(ltos, i),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   148
                   generate_deopt_entry_for(ftos, i),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   149
                   generate_deopt_entry_for(dtos, i),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   150
                   generate_deopt_entry_for(vtos, i)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   151
                   );
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   152
    }
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   153
  }
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   154
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   155
  { CodeletMark cm(_masm, "result handlers for native calls");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   156
    // The various result converter stublets.
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   157
    int is_generated[Interpreter::number_of_result_handlers];
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   158
    memset(is_generated, 0, sizeof(is_generated));
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   159
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   160
    for (int i = 0; i < Interpreter::number_of_result_handlers; i++) {
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   161
      BasicType type = types[i];
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   162
      if (!is_generated[Interpreter::BasicType_as_index(type)]++) {
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   163
        Interpreter::_native_abi_to_tosca[Interpreter::BasicType_as_index(type)] = generate_result_handler_for(type);
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   164
      }
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   165
    }
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   166
  }
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   167
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   168
  { CodeletMark cm(_masm, "continuation entry points");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   169
    Interpreter::_continuation_entry =
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   170
      EntryPoint(
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   171
                 generate_continuation_for(btos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   172
                 generate_continuation_for(ztos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   173
                 generate_continuation_for(ctos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   174
                 generate_continuation_for(stos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   175
                 generate_continuation_for(atos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   176
                 generate_continuation_for(itos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   177
                 generate_continuation_for(ltos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   178
                 generate_continuation_for(ftos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   179
                 generate_continuation_for(dtos),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   180
                 generate_continuation_for(vtos)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   181
                 );
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   182
  }
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   183
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   184
  { CodeletMark cm(_masm, "safepoint entry points");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   185
    Interpreter::_safept_entry =
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   186
      EntryPoint(
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   187
                 generate_safept_entry_for(btos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   188
                 generate_safept_entry_for(ztos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   189
                 generate_safept_entry_for(ctos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   190
                 generate_safept_entry_for(stos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   191
                 generate_safept_entry_for(atos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   192
                 generate_safept_entry_for(itos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   193
                 generate_safept_entry_for(ltos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   194
                 generate_safept_entry_for(ftos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   195
                 generate_safept_entry_for(dtos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   196
                 generate_safept_entry_for(vtos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint))
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   197
                 );
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   198
  }
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   199
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   200
  { CodeletMark cm(_masm, "exception handling");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   201
    // (Note: this is not safepoint safe because thread may return to compiled code)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   202
    generate_throw_exception();
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   203
  }
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   204
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   205
  { CodeletMark cm(_masm, "throw exception entrypoints");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   206
    Interpreter::_throw_ArrayIndexOutOfBoundsException_entry = generate_ArrayIndexOutOfBounds_handler("java/lang/ArrayIndexOutOfBoundsException");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   207
    Interpreter::_throw_ArrayStoreException_entry            = generate_klass_exception_handler("java/lang/ArrayStoreException"                 );
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   208
    Interpreter::_throw_ArithmeticException_entry            = generate_exception_handler("java/lang/ArithmeticException"           , "/ by zero");
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   209
    Interpreter::_throw_ClassCastException_entry             = generate_ClassCastException_handler();
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   210
    Interpreter::_throw_NullPointerException_entry           = generate_exception_handler("java/lang/NullPointerException"          , NULL       );
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   211
    Interpreter::_throw_StackOverflowError_entry             = generate_StackOverflowError_handler();
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   212
  }
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   213
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   214
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   215
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   216
#define method_entry(kind)                                              \
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   217
  { CodeletMark cm(_masm, "method entry point (kind = " #kind ")"); \
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   218
    Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind); \
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   219
    Interpreter::update_cds_entry_table(Interpreter::kind); \
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   220
  }
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   221
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   222
  // all non-native method kinds
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   223
  method_entry(zerolocals)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   224
  method_entry(zerolocals_synchronized)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   225
  method_entry(empty)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   226
  method_entry(accessor)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   227
  method_entry(abstract)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   228
  method_entry(java_lang_math_sin  )
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   229
  method_entry(java_lang_math_cos  )
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   230
  method_entry(java_lang_math_tan  )
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   231
  method_entry(java_lang_math_abs  )
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   232
  method_entry(java_lang_math_sqrt )
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   233
  method_entry(java_lang_math_log  )
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   234
  method_entry(java_lang_math_log10)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   235
  method_entry(java_lang_math_exp  )
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   236
  method_entry(java_lang_math_pow  )
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   237
  method_entry(java_lang_math_fmaF )
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   238
  method_entry(java_lang_math_fmaD )
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   239
  method_entry(java_lang_ref_reference_get)
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   240
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   241
  AbstractInterpreter::initialize_method_handle_entries();
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   242
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   243
  // all native method kinds (must be one contiguous block)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   244
  Interpreter::_native_entry_begin = Interpreter::code()->code_end();
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   245
  method_entry(native)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   246
  method_entry(native_synchronized)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   247
  Interpreter::_native_entry_end = Interpreter::code()->code_end();
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   248
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   249
  method_entry(java_util_zip_CRC32_update)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   250
  method_entry(java_util_zip_CRC32_updateBytes)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   251
  method_entry(java_util_zip_CRC32_updateByteBuffer)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   252
  method_entry(java_util_zip_CRC32C_updateBytes)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   253
  method_entry(java_util_zip_CRC32C_updateDirectByteBuffer)
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   254
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   255
  method_entry(java_lang_Float_intBitsToFloat);
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   256
  method_entry(java_lang_Float_floatToRawIntBits);
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   257
  method_entry(java_lang_Double_longBitsToDouble);
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   258
  method_entry(java_lang_Double_doubleToRawLongBits);
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   259
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   260
#undef method_entry
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   261
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   262
  // Bytecodes
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42580
diff changeset
   263
  set_entry_points_for_all_bytes();
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   264
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   265
  // installation of code in other places in the runtime
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   266
  // (ExcutableCodeManager calls not needed to copy the entries)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   267
  set_safepoints_for_all_bytes();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   268
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   269
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   270
//------------------------------------------------------------------------------------------------------------------------
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   271
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   272
address TemplateInterpreterGenerator::generate_error_exit(const char* msg) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   273
  address entry = __ pc();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   274
  __ stop(msg);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   275
  return entry;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   276
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   277
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   278
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   279
//------------------------------------------------------------------------------------------------------------------------
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   280
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   281
void TemplateInterpreterGenerator::set_entry_points_for_all_bytes() {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   282
  for (int i = 0; i < DispatchTable::length; i++) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   283
    Bytecodes::Code code = (Bytecodes::Code)i;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   284
    if (Bytecodes::is_defined(code)) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   285
      set_entry_points(code);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   286
    } else {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   287
      set_unimplemented(i);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   288
    }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   289
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   290
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   291
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   292
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   293
void TemplateInterpreterGenerator::set_safepoints_for_all_bytes() {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   294
  for (int i = 0; i < DispatchTable::length; i++) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   295
    Bytecodes::Code code = (Bytecodes::Code)i;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   296
    if (Bytecodes::is_defined(code)) Interpreter::_safept_table.set_entry(code, Interpreter::_safept_entry);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   297
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   298
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   299
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   300
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   301
void TemplateInterpreterGenerator::set_unimplemented(int i) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   302
  address e = _unimplemented_bytecode;
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   303
  EntryPoint entry(e, e, e, e, e, e, e, e, e, e);
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   304
  Interpreter::_normal_table.set_entry(i, entry);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   305
  Interpreter::_wentry_point[i] = _unimplemented_bytecode;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   306
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   307
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   308
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   309
void TemplateInterpreterGenerator::set_entry_points(Bytecodes::Code code) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   310
  CodeletMark cm(_masm, Bytecodes::name(code), code);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   311
  // initialize entry points
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   312
  assert(_unimplemented_bytecode    != NULL, "should have been generated before");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   313
  assert(_illegal_bytecode_sequence != NULL, "should have been generated before");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   314
  address bep = _illegal_bytecode_sequence;
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   315
  address zep = _illegal_bytecode_sequence;
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   316
  address cep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   317
  address sep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   318
  address aep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   319
  address iep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   320
  address lep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   321
  address fep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   322
  address dep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   323
  address vep = _unimplemented_bytecode;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   324
  address wep = _unimplemented_bytecode;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   325
  // code for short & wide version of bytecode
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   326
  if (Bytecodes::is_defined(code)) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   327
    Template* t = TemplateTable::template_for(code);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   328
    assert(t->is_valid(), "just checking");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   329
    set_short_entry_points(t, bep, cep, sep, aep, iep, lep, fep, dep, vep);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   330
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   331
  if (Bytecodes::wide_is_defined(code)) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   332
    Template* t = TemplateTable::template_for_wide(code);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   333
    assert(t->is_valid(), "just checking");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   334
    set_wide_entry_point(t, wep);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   335
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   336
  // set entry points
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   337
  EntryPoint entry(bep, zep, cep, sep, aep, iep, lep, fep, dep, vep);
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   338
  Interpreter::_normal_table.set_entry(code, entry);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   339
  Interpreter::_wentry_point[code] = wep;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   340
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   341
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   342
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   343
void TemplateInterpreterGenerator::set_wide_entry_point(Template* t, address& wep) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   344
  assert(t->is_valid(), "template must exist");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   345
  assert(t->tos_in() == vtos, "only vtos tos_in supported for wide instructions");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   346
  wep = __ pc(); generate_and_dispatch(t);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   347
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   348
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   349
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   350
void TemplateInterpreterGenerator::set_short_entry_points(Template* t, address& bep, address& cep, address& sep, address& aep, address& iep, address& lep, address& fep, address& dep, address& vep) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   351
  assert(t->is_valid(), "template must exist");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   352
  switch (t->tos_in()) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   353
    case btos:
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   354
    case ztos:
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   355
    case ctos:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   356
    case stos:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   357
      ShouldNotReachHere();  // btos/ctos/stos should use itos.
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   358
      break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   359
    case atos: vep = __ pc(); __ pop(atos); aep = __ pc(); generate_and_dispatch(t); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   360
    case itos: vep = __ pc(); __ pop(itos); iep = __ pc(); generate_and_dispatch(t); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   361
    case ltos: vep = __ pc(); __ pop(ltos); lep = __ pc(); generate_and_dispatch(t); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   362
    case ftos: vep = __ pc(); __ pop(ftos); fep = __ pc(); generate_and_dispatch(t); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   363
    case dtos: vep = __ pc(); __ pop(dtos); dep = __ pc(); generate_and_dispatch(t); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   364
    case vtos: set_vtos_entry_points(t, bep, cep, sep, aep, iep, lep, fep, dep, vep);     break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   365
    default  : ShouldNotReachHere();                                                 break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   366
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   367
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   368
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   369
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   370
//------------------------------------------------------------------------------------------------------------------------
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   371
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   372
void TemplateInterpreterGenerator::generate_and_dispatch(Template* t, TosState tos_out) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   373
  if (PrintBytecodeHistogram)                                    histogram_bytecode(t);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   374
#ifndef PRODUCT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   375
  // debugging code
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   376
  if (CountBytecodes || TraceBytecodes || StopInterpreterAt > 0) count_bytecode();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   377
  if (PrintBytecodePairHistogram)                                histogram_bytecode_pair(t);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   378
  if (TraceBytecodes)                                            trace_bytecode(t);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   379
  if (StopInterpreterAt > 0)                                     stop_interpreter_at();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   380
  __ verify_FPU(1, t->tos_in());
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   381
#endif // !PRODUCT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   382
  int step = 0;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   383
  if (!t->does_dispatch()) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   384
    step = t->is_wide() ? Bytecodes::wide_length_for(t->bytecode()) : Bytecodes::length_for(t->bytecode());
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   385
    if (tos_out == ilgl) tos_out = t->tos_out();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   386
    // compute bytecode size
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   387
    assert(step > 0, "just checkin'");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   388
    // setup stuff for dispatching next bytecode
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   389
    if (ProfileInterpreter && VerifyDataPointer
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   390
        && MethodData::bytecode_has_profile(t->bytecode())) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   391
      __ verify_method_data_pointer();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   392
    }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   393
    __ dispatch_prolog(tos_out, step);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   394
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   395
  // generate template
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   396
  t->generate(_masm);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   397
  // advance
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   398
  if (t->does_dispatch()) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   399
#ifdef ASSERT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   400
    // make sure execution doesn't go beyond this point if code is broken
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   401
    __ should_not_reach_here();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   402
#endif // ASSERT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   403
  } else {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   404
    // dispatch to next bytecode
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   405
    __ dispatch_epilog(tos_out, step);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   406
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   407
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   408
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   409
// Generate method entries
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   410
address TemplateInterpreterGenerator::generate_method_entry(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   411
                                        AbstractInterpreter::MethodKind kind) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   412
  // determine code generation flags
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   413
  bool native = false;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   414
  bool synchronized = false;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   415
  address entry_point = NULL;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   416
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   417
  switch (kind) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   418
  case Interpreter::zerolocals             :                                          break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   419
  case Interpreter::zerolocals_synchronized:                synchronized = true;      break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   420
  case Interpreter::native                 : native = true;                           break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   421
  case Interpreter::native_synchronized    : native = true; synchronized = true;      break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   422
  case Interpreter::empty                  : break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   423
  case Interpreter::accessor               : break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   424
  case Interpreter::abstract               : entry_point = generate_abstract_entry(); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   425
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   426
  case Interpreter::java_lang_math_sin     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   427
  case Interpreter::java_lang_math_cos     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   428
  case Interpreter::java_lang_math_tan     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   429
  case Interpreter::java_lang_math_abs     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   430
  case Interpreter::java_lang_math_log     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   431
  case Interpreter::java_lang_math_log10   : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   432
  case Interpreter::java_lang_math_sqrt    : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   433
  case Interpreter::java_lang_math_pow     : // fall thru
41323
ddd5600d4762 8154122: Intrinsify fused mac operations
vdeshpande
parents: 40010
diff changeset
   434
  case Interpreter::java_lang_math_exp     : // fall thru
ddd5600d4762 8154122: Intrinsify fused mac operations
vdeshpande
parents: 40010
diff changeset
   435
  case Interpreter::java_lang_math_fmaD    : // fall thru
42580
56304dee97f3 8169711: CDS does not patch entry trampoline if intrinsic method is disabled
thartmann
parents: 41323
diff changeset
   436
  case Interpreter::java_lang_math_fmaF    : entry_point = generate_math_entry(kind);      break;
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   437
  case Interpreter::java_lang_ref_reference_get
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   438
                                           : entry_point = generate_Reference_get_entry(); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   439
  case Interpreter::java_util_zip_CRC32_update
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   440
                                           : native = true; entry_point = generate_CRC32_update_entry();  break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   441
  case Interpreter::java_util_zip_CRC32_updateBytes
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   442
                                           : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   443
  case Interpreter::java_util_zip_CRC32_updateByteBuffer
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   444
                                           : native = true; entry_point = generate_CRC32_updateBytes_entry(kind); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   445
  case Interpreter::java_util_zip_CRC32C_updateBytes
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   446
                                           : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   447
  case Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   448
                                           : entry_point = generate_CRC32C_updateBytes_entry(kind); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   449
#ifdef IA32
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   450
  // On x86_32 platforms, a special entry is generated for the following four methods.
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   451
  // On other platforms the normal entry is used to enter these methods.
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   452
  case Interpreter::java_lang_Float_intBitsToFloat
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   453
                                           : native = true; entry_point = generate_Float_intBitsToFloat_entry(); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   454
  case Interpreter::java_lang_Float_floatToRawIntBits
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   455
                                           : native = true; entry_point = generate_Float_floatToRawIntBits_entry(); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   456
  case Interpreter::java_lang_Double_longBitsToDouble
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   457
                                           : native = true; entry_point = generate_Double_longBitsToDouble_entry(); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   458
  case Interpreter::java_lang_Double_doubleToRawLongBits
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   459
                                           : native = true; entry_point = generate_Double_doubleToRawLongBits_entry(); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   460
#else
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   461
  case Interpreter::java_lang_Float_intBitsToFloat:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   462
  case Interpreter::java_lang_Float_floatToRawIntBits:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   463
  case Interpreter::java_lang_Double_longBitsToDouble:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   464
  case Interpreter::java_lang_Double_doubleToRawLongBits:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   465
    native = true;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   466
    break;
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 37480
diff changeset
   467
#endif // !IA32
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   468
  default:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   469
    fatal("unexpected method kind: %d", kind);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   470
    break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   471
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   472
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   473
  if (entry_point) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   474
    return entry_point;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   475
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   476
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   477
  // We expect the normal and native entry points to be generated first so we can reuse them.
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   478
  if (native) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   479
    entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   480
    if (entry_point == NULL) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   481
      entry_point = generate_native_entry(synchronized);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   482
    }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   483
  } else {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   484
    entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   485
    if (entry_point == NULL) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   486
      entry_point = generate_normal_entry(synchronized);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   487
    }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   488
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   489
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   490
  return entry_point;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   491
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   492
#endif // !CC_INTERP