hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp
author vdeshpande
Fri, 26 Aug 2016 12:17:50 -0700
changeset 41323 ddd5600d4762
parent 40010 e32d5e545789
child 42580 56304dee97f3
permissions -rw-r--r--
8154122: Intrinsify fused mac operations Summary: added FMA intrinsics on x86 Reviewed-by: kvn, aph, darcy
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 "code/codeCacheExtensions.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    27
#include "interpreter/interpreter.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    28
#include "interpreter/interpreterRuntime.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    29
#include "interpreter/interp_masm.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    30
#include "interpreter/templateInterpreter.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    31
#include "interpreter/templateInterpreterGenerator.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    32
#include "interpreter/templateTable.hpp"
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    33
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    34
#ifndef CC_INTERP
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    35
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    36
# define __ _masm->
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    37
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    38
TemplateInterpreterGenerator::TemplateInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    39
  _unimplemented_bytecode    = NULL;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    40
  _illegal_bytecode_sequence = NULL;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    41
  generate_all();
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
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    44
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
    45
  T_BOOLEAN,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    46
  T_CHAR   ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    47
  T_BYTE   ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    48
  T_SHORT  ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    49
  T_INT    ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    50
  T_LONG   ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    51
  T_VOID   ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    52
  T_FLOAT  ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    53
  T_DOUBLE ,
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    54
  T_OBJECT
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
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    57
void TemplateInterpreterGenerator::generate_all() {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    58
  // Loop, in case we need several variants of the interpreter entries
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    59
  do {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    60
    if (!CodeCacheExtensions::skip_code_generation()) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    61
      // bypass code generation when useless
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    62
      { CodeletMark cm(_masm, "slow signature handler");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    63
        AbstractInterpreter::_slow_signature_handler = generate_slow_signature_handler();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    64
      }
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
      { CodeletMark cm(_masm, "error exits");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    67
        _unimplemented_bytecode    = generate_error_exit("unimplemented bytecode");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    68
        _illegal_bytecode_sequence = generate_error_exit("illegal bytecode sequence - method not verified");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    69
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    70
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    71
#ifndef PRODUCT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    72
      if (TraceBytecodes) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    73
        CodeletMark cm(_masm, "bytecode tracing support");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    74
        Interpreter::_trace_code =
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    75
          EntryPoint(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    76
                     generate_trace_code(btos),
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
    77
                     generate_trace_code(ztos),
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    78
                     generate_trace_code(ctos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    79
                     generate_trace_code(stos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    80
                     generate_trace_code(atos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    81
                     generate_trace_code(itos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    82
                     generate_trace_code(ltos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    83
                     generate_trace_code(ftos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    84
                     generate_trace_code(dtos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    85
                     generate_trace_code(vtos)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    86
                     );
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    87
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    88
#endif // !PRODUCT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    89
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    90
      { CodeletMark cm(_masm, "return entry points");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    91
        const int index_size = sizeof(u2);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    92
        for (int i = 0; i < Interpreter::number_of_return_entries; i++) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    93
          Interpreter::_return_entry[i] =
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    94
            EntryPoint(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    95
                       generate_return_entry_for(itos, i, index_size),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    96
                       generate_return_entry_for(itos, i, index_size),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    97
                       generate_return_entry_for(itos, i, index_size),
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
    98
                       generate_return_entry_for(itos, i, index_size),
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    99
                       generate_return_entry_for(atos, i, index_size),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   100
                       generate_return_entry_for(itos, i, index_size),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   101
                       generate_return_entry_for(ltos, i, index_size),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   102
                       generate_return_entry_for(ftos, i, index_size),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   103
                       generate_return_entry_for(dtos, i, index_size),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   104
                       generate_return_entry_for(vtos, i, index_size)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   105
                       );
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   106
        }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   107
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   108
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   109
      { CodeletMark cm(_masm, "invoke return entry points");
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   110
        // These states are in order specified in TosState, except btos/ztos/ctos/stos are
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   111
        // really the same as itos since there is no top of stack optimization for these types
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   112
        const TosState states[] = {itos, itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos, ilgl};
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   113
        const int invoke_length = Bytecodes::length_for(Bytecodes::_invokestatic);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   114
        const int invokeinterface_length = Bytecodes::length_for(Bytecodes::_invokeinterface);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   115
        const int invokedynamic_length = Bytecodes::length_for(Bytecodes::_invokedynamic);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   116
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   117
        for (int i = 0; i < Interpreter::number_of_return_addrs; i++) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   118
          TosState state = states[i];
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   119
          assert(state != ilgl, "states array is wrong above");
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   120
          Interpreter::_invoke_return_entry[i] = generate_return_entry_for(state, invoke_length, sizeof(u2));
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   121
          Interpreter::_invokeinterface_return_entry[i] = generate_return_entry_for(state, invokeinterface_length, sizeof(u2));
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   122
          Interpreter::_invokedynamic_return_entry[i] = generate_return_entry_for(state, invokedynamic_length, sizeof(u4));
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   123
        }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   124
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   125
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   126
      { CodeletMark cm(_masm, "earlyret entry points");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   127
        Interpreter::_earlyret_entry =
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   128
          EntryPoint(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   129
                     generate_earlyret_entry_for(btos),
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   130
                     generate_earlyret_entry_for(ztos),
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   131
                     generate_earlyret_entry_for(ctos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   132
                     generate_earlyret_entry_for(stos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   133
                     generate_earlyret_entry_for(atos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   134
                     generate_earlyret_entry_for(itos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   135
                     generate_earlyret_entry_for(ltos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   136
                     generate_earlyret_entry_for(ftos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   137
                     generate_earlyret_entry_for(dtos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   138
                     generate_earlyret_entry_for(vtos)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   139
                     );
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   140
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   141
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   142
      { CodeletMark cm(_masm, "deoptimization entry points");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   143
        for (int i = 0; i < Interpreter::number_of_deopt_entries; i++) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   144
          Interpreter::_deopt_entry[i] =
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   145
            EntryPoint(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   146
                       generate_deopt_entry_for(itos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   147
                       generate_deopt_entry_for(itos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   148
                       generate_deopt_entry_for(itos, i),
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   149
                       generate_deopt_entry_for(itos, i),
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   150
                       generate_deopt_entry_for(atos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   151
                       generate_deopt_entry_for(itos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   152
                       generate_deopt_entry_for(ltos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   153
                       generate_deopt_entry_for(ftos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   154
                       generate_deopt_entry_for(dtos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   155
                       generate_deopt_entry_for(vtos, i)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   156
                       );
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   157
        }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   158
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   159
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   160
      { CodeletMark cm(_masm, "result handlers for native calls");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   161
        // The various result converter stublets.
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   162
        int is_generated[Interpreter::number_of_result_handlers];
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   163
        memset(is_generated, 0, sizeof(is_generated));
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   164
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   165
        for (int i = 0; i < Interpreter::number_of_result_handlers; i++) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   166
          BasicType type = types[i];
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   167
          if (!is_generated[Interpreter::BasicType_as_index(type)]++) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   168
            Interpreter::_native_abi_to_tosca[Interpreter::BasicType_as_index(type)] = generate_result_handler_for(type);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   169
          }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   170
        }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   171
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   172
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   173
      { CodeletMark cm(_masm, "continuation entry points");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   174
        Interpreter::_continuation_entry =
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   175
          EntryPoint(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   176
                     generate_continuation_for(btos),
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   177
                     generate_continuation_for(ztos),
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   178
                     generate_continuation_for(ctos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   179
                     generate_continuation_for(stos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   180
                     generate_continuation_for(atos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   181
                     generate_continuation_for(itos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   182
                     generate_continuation_for(ltos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   183
                     generate_continuation_for(ftos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   184
                     generate_continuation_for(dtos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   185
                     generate_continuation_for(vtos)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   186
                     );
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   187
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   188
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   189
      { CodeletMark cm(_masm, "safepoint entry points");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   190
        Interpreter::_safept_entry =
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   191
          EntryPoint(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   192
                     generate_safept_entry_for(btos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   193
                     generate_safept_entry_for(ztos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   194
                     generate_safept_entry_for(ctos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   195
                     generate_safept_entry_for(stos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   196
                     generate_safept_entry_for(atos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   197
                     generate_safept_entry_for(itos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   198
                     generate_safept_entry_for(ltos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   199
                     generate_safept_entry_for(ftos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   200
                     generate_safept_entry_for(dtos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   201
                     generate_safept_entry_for(vtos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint))
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   202
                     );
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   203
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   204
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   205
      { CodeletMark cm(_masm, "exception handling");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   206
        // (Note: this is not safepoint safe because thread may return to compiled code)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   207
        generate_throw_exception();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   208
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   209
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   210
      { CodeletMark cm(_masm, "throw exception entrypoints");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   211
        Interpreter::_throw_ArrayIndexOutOfBoundsException_entry = generate_ArrayIndexOutOfBounds_handler("java/lang/ArrayIndexOutOfBoundsException");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   212
        Interpreter::_throw_ArrayStoreException_entry            = generate_klass_exception_handler("java/lang/ArrayStoreException"                 );
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   213
        Interpreter::_throw_ArithmeticException_entry            = generate_exception_handler("java/lang/ArithmeticException"           , "/ by zero");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   214
        Interpreter::_throw_ClassCastException_entry             = generate_ClassCastException_handler();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   215
        Interpreter::_throw_NullPointerException_entry           = generate_exception_handler("java/lang/NullPointerException"          , NULL       );
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   216
        Interpreter::_throw_StackOverflowError_entry             = generate_StackOverflowError_handler();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   217
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   218
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   219
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   220
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   221
#define method_entry(kind)                                              \
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   222
      { CodeletMark cm(_masm, "method entry point (kind = " #kind ")"); \
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   223
        Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind); \
37439
e8970711113b 8145221: Use trampolines for i2i and i2c entries in Methods that are stored in CDS archive
ccheung
parents: 35479
diff changeset
   224
        Interpreter::update_cds_entry_table(Interpreter::kind); \
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   225
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   226
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   227
      // all non-native method kinds
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   228
      method_entry(zerolocals)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   229
      method_entry(zerolocals_synchronized)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   230
      method_entry(empty)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   231
      method_entry(accessor)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   232
      method_entry(abstract)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   233
      method_entry(java_lang_math_sin  )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   234
      method_entry(java_lang_math_cos  )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   235
      method_entry(java_lang_math_tan  )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   236
      method_entry(java_lang_math_abs  )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   237
      method_entry(java_lang_math_sqrt )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   238
      method_entry(java_lang_math_log  )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   239
      method_entry(java_lang_math_log10)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   240
      method_entry(java_lang_math_exp  )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   241
      method_entry(java_lang_math_pow  )
41323
ddd5600d4762 8154122: Intrinsify fused mac operations
vdeshpande
parents: 40010
diff changeset
   242
      if (UseFMA) {
ddd5600d4762 8154122: Intrinsify fused mac operations
vdeshpande
parents: 40010
diff changeset
   243
        method_entry(java_lang_math_fmaF)
ddd5600d4762 8154122: Intrinsify fused mac operations
vdeshpande
parents: 40010
diff changeset
   244
        method_entry(java_lang_math_fmaD)
ddd5600d4762 8154122: Intrinsify fused mac operations
vdeshpande
parents: 40010
diff changeset
   245
      }
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   246
      method_entry(java_lang_ref_reference_get)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   247
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   248
      AbstractInterpreter::initialize_method_handle_entries();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   249
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   250
      // all native method kinds (must be one contiguous block)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   251
      Interpreter::_native_entry_begin = Interpreter::code()->code_end();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   252
      method_entry(native)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   253
      method_entry(native_synchronized)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   254
      Interpreter::_native_entry_end = Interpreter::code()->code_end();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   255
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   256
      if (UseCRC32Intrinsics) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   257
        method_entry(java_util_zip_CRC32_update)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   258
        method_entry(java_util_zip_CRC32_updateBytes)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   259
        method_entry(java_util_zip_CRC32_updateByteBuffer)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   260
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   261
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   262
      if (UseCRC32CIntrinsics) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   263
        method_entry(java_util_zip_CRC32C_updateBytes)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   264
        method_entry(java_util_zip_CRC32C_updateDirectByteBuffer)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   265
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   266
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   267
      method_entry(java_lang_Float_intBitsToFloat);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   268
      method_entry(java_lang_Float_floatToRawIntBits);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   269
      method_entry(java_lang_Double_longBitsToDouble);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   270
      method_entry(java_lang_Double_doubleToRawLongBits);
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
#undef method_entry
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   273
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   274
      // Bytecodes
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   275
      set_entry_points_for_all_bytes();
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
  } while (CodeCacheExtensions::needs_other_interpreter_variant());
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
  // 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
   280
  // (ExcutableCodeManager calls not needed to copy the entries)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   281
  set_safepoints_for_all_bytes();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   282
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   283
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   284
//------------------------------------------------------------------------------------------------------------------------
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   285
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   286
address TemplateInterpreterGenerator::generate_error_exit(const char* msg) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   287
  address entry = __ pc();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   288
  __ stop(msg);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   289
  return entry;
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
//------------------------------------------------------------------------------------------------------------------------
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   294
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   295
void TemplateInterpreterGenerator::set_entry_points_for_all_bytes() {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   296
  for (int i = 0; i < DispatchTable::length; i++) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   297
    Bytecodes::Code code = (Bytecodes::Code)i;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   298
    if (Bytecodes::is_defined(code)) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   299
      set_entry_points(code);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   300
    } else {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   301
      set_unimplemented(i);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   302
    }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   303
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   304
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   305
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
void TemplateInterpreterGenerator::set_safepoints_for_all_bytes() {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   308
  for (int i = 0; i < DispatchTable::length; i++) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   309
    Bytecodes::Code code = (Bytecodes::Code)i;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   310
    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
   311
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   312
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   313
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   314
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   315
void TemplateInterpreterGenerator::set_unimplemented(int i) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   316
  address e = _unimplemented_bytecode;
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   317
  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
   318
  Interpreter::_normal_table.set_entry(i, entry);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   319
  Interpreter::_wentry_point[i] = _unimplemented_bytecode;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   320
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   321
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   322
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   323
void TemplateInterpreterGenerator::set_entry_points(Bytecodes::Code code) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   324
  if (CodeCacheExtensions::skip_template_interpreter_entries(code)) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   325
    return;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   326
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   327
  CodeletMark cm(_masm, Bytecodes::name(code), code);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   328
  // initialize entry points
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   329
  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
   330
  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
   331
  address bep = _illegal_bytecode_sequence;
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   332
  address zep = _illegal_bytecode_sequence;
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   333
  address cep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   334
  address sep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   335
  address aep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   336
  address iep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   337
  address lep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   338
  address fep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   339
  address dep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   340
  address vep = _unimplemented_bytecode;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   341
  address wep = _unimplemented_bytecode;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   342
  // code for short & wide version of bytecode
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   343
  if (Bytecodes::is_defined(code)) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   344
    Template* t = TemplateTable::template_for(code);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   345
    assert(t->is_valid(), "just checking");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   346
    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
   347
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   348
  if (Bytecodes::wide_is_defined(code)) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   349
    Template* t = TemplateTable::template_for_wide(code);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   350
    assert(t->is_valid(), "just checking");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   351
    set_wide_entry_point(t, wep);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   352
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   353
  // set entry points
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   354
  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
   355
  Interpreter::_normal_table.set_entry(code, entry);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   356
  Interpreter::_wentry_point[code] = wep;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   357
  CodeCacheExtensions::completed_template_interpreter_entries(_masm, code);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   358
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   359
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   360
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   361
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
   362
  assert(t->is_valid(), "template must exist");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   363
  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
   364
  wep = __ pc(); generate_and_dispatch(t);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   365
}
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
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
   369
  assert(t->is_valid(), "template must exist");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   370
  switch (t->tos_in()) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   371
    case btos:
37480
291ee208fb72 8132051: Better byte behavior
coleenp
parents: 37439
diff changeset
   372
    case ztos:
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   373
    case ctos:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   374
    case stos:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   375
      ShouldNotReachHere();  // btos/ctos/stos should use itos.
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   376
      break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   377
    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
   378
    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
   379
    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
   380
    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
   381
    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
   382
    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
   383
    default  : ShouldNotReachHere();                                                 break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   384
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   385
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   386
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   387
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   388
//------------------------------------------------------------------------------------------------------------------------
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   389
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   390
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
   391
  if (PrintBytecodeHistogram)                                    histogram_bytecode(t);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   392
#ifndef PRODUCT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   393
  // debugging code
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   394
  if (CountBytecodes || TraceBytecodes || StopInterpreterAt > 0) count_bytecode();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   395
  if (PrintBytecodePairHistogram)                                histogram_bytecode_pair(t);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   396
  if (TraceBytecodes)                                            trace_bytecode(t);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   397
  if (StopInterpreterAt > 0)                                     stop_interpreter_at();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   398
  __ verify_FPU(1, t->tos_in());
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   399
#endif // !PRODUCT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   400
  int step = 0;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   401
  if (!t->does_dispatch()) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   402
    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
   403
    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
   404
    // compute bytecode size
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   405
    assert(step > 0, "just checkin'");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   406
    // setup stuff for dispatching next bytecode
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   407
    if (ProfileInterpreter && VerifyDataPointer
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   408
        && MethodData::bytecode_has_profile(t->bytecode())) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   409
      __ verify_method_data_pointer();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   410
    }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   411
    __ dispatch_prolog(tos_out, step);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   412
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   413
  // generate template
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   414
  t->generate(_masm);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   415
  // advance
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   416
  if (t->does_dispatch()) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   417
#ifdef ASSERT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   418
    // 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
   419
    __ should_not_reach_here();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   420
#endif // ASSERT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   421
  } else {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   422
    // dispatch to next bytecode
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   423
    __ dispatch_epilog(tos_out, step);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   424
  }
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
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   427
// Generate method entries
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   428
address TemplateInterpreterGenerator::generate_method_entry(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   429
                                        AbstractInterpreter::MethodKind kind) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   430
  // determine code generation flags
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   431
  bool native = false;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   432
  bool synchronized = false;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   433
  address entry_point = NULL;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   434
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   435
  switch (kind) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   436
  case Interpreter::zerolocals             :                                          break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   437
  case Interpreter::zerolocals_synchronized:                synchronized = true;      break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   438
  case Interpreter::native                 : native = true;                           break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   439
  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
   440
  case Interpreter::empty                  : break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   441
  case Interpreter::accessor               : break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   442
  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
   443
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   444
  case Interpreter::java_lang_math_sin     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   445
  case Interpreter::java_lang_math_cos     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   446
  case Interpreter::java_lang_math_tan     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   447
  case Interpreter::java_lang_math_abs     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   448
  case Interpreter::java_lang_math_log     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   449
  case Interpreter::java_lang_math_log10   : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   450
  case Interpreter::java_lang_math_sqrt    : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   451
  case Interpreter::java_lang_math_pow     : // fall thru
41323
ddd5600d4762 8154122: Intrinsify fused mac operations
vdeshpande
parents: 40010
diff changeset
   452
  case Interpreter::java_lang_math_exp     : // fall thru
ddd5600d4762 8154122: Intrinsify fused mac operations
vdeshpande
parents: 40010
diff changeset
   453
  case Interpreter::java_lang_math_fmaD    : // fall thru
ddd5600d4762 8154122: Intrinsify fused mac operations
vdeshpande
parents: 40010
diff changeset
   454
  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
   455
  case Interpreter::java_lang_ref_reference_get
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   456
                                           : entry_point = generate_Reference_get_entry(); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   457
  case Interpreter::java_util_zip_CRC32_update
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   458
                                           : 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
   459
  case Interpreter::java_util_zip_CRC32_updateBytes
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   460
                                           : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   461
  case Interpreter::java_util_zip_CRC32_updateByteBuffer
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   462
                                           : 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
   463
  case Interpreter::java_util_zip_CRC32C_updateBytes
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   464
                                           : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   465
  case Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   466
                                           : entry_point = generate_CRC32C_updateBytes_entry(kind); break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   467
#ifdef IA32
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   468
  // 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
   469
  // 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
   470
  case Interpreter::java_lang_Float_intBitsToFloat
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   471
                                           : 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
   472
  case Interpreter::java_lang_Float_floatToRawIntBits
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   473
                                           : 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
   474
  case Interpreter::java_lang_Double_longBitsToDouble
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   475
                                           : 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
   476
  case Interpreter::java_lang_Double_doubleToRawLongBits
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   477
                                           : 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
   478
#else
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   479
  case Interpreter::java_lang_Float_intBitsToFloat:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   480
  case Interpreter::java_lang_Float_floatToRawIntBits:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   481
  case Interpreter::java_lang_Double_longBitsToDouble:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   482
  case Interpreter::java_lang_Double_doubleToRawLongBits:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   483
    native = true;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   484
    break;
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 37480
diff changeset
   485
#endif // !IA32
35479
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   486
  default:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   487
    fatal("unexpected method kind: %d", kind);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   488
    break;
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
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   491
  if (entry_point) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   492
    return entry_point;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   493
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   494
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   495
  // 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
   496
  if (native) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   497
    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
   498
    if (entry_point == NULL) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   499
      entry_point = generate_native_entry(synchronized);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   500
    }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   501
  } else {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   502
    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
   503
    if (entry_point == NULL) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   504
      entry_point = generate_normal_entry(synchronized);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   505
    }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   506
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   507
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   508
  return entry_point;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   509
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   510
#endif // !CC_INTERP