hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp
author coleenp
Tue, 12 Jan 2016 13:14:41 -0500
changeset 35479 62c12ca7a45e
child 37439 e8970711113b
permissions -rw-r--r--
8146410: Interpreter functions are declared and defined in the wrong files Summary: Moved functions to the correct files. Reviewed-by: goetz, aph, twisti, mockner
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
/*
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
     2
 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
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),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    77
                     generate_trace_code(ctos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    78
                     generate_trace_code(stos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    79
                     generate_trace_code(atos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    80
                     generate_trace_code(itos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    81
                     generate_trace_code(ltos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    82
                     generate_trace_code(ftos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    83
                     generate_trace_code(dtos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    84
                     generate_trace_code(vtos)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    85
                     );
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
#endif // !PRODUCT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    88
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    89
      { CodeletMark cm(_masm, "return entry points");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    90
        const int index_size = sizeof(u2);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    91
        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
    92
          Interpreter::_return_entry[i] =
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    93
            EntryPoint(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    94
                       generate_return_entry_for(itos, i, index_size),
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(atos, i, index_size),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    98
                       generate_return_entry_for(itos, i, index_size),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
    99
                       generate_return_entry_for(ltos, i, index_size),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   100
                       generate_return_entry_for(ftos, i, index_size),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   101
                       generate_return_entry_for(dtos, i, index_size),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   102
                       generate_return_entry_for(vtos, i, index_size)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   103
                       );
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   104
        }
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
      { CodeletMark cm(_masm, "invoke return entry points");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   108
        const TosState states[] = {itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos};
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   109
        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
   110
        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
   111
        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
   112
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   113
        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
   114
          TosState state = states[i];
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   115
          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
   116
          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
   117
          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
   118
        }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   119
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   120
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   121
      { CodeletMark cm(_masm, "earlyret entry points");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   122
        Interpreter::_earlyret_entry =
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   123
          EntryPoint(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   124
                     generate_earlyret_entry_for(btos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   125
                     generate_earlyret_entry_for(ctos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   126
                     generate_earlyret_entry_for(stos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   127
                     generate_earlyret_entry_for(atos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   128
                     generate_earlyret_entry_for(itos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   129
                     generate_earlyret_entry_for(ltos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   130
                     generate_earlyret_entry_for(ftos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   131
                     generate_earlyret_entry_for(dtos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   132
                     generate_earlyret_entry_for(vtos)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   133
                     );
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   134
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   135
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   136
      { CodeletMark cm(_masm, "deoptimization entry points");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   137
        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
   138
          Interpreter::_deopt_entry[i] =
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   139
            EntryPoint(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   140
                       generate_deopt_entry_for(itos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   141
                       generate_deopt_entry_for(itos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   142
                       generate_deopt_entry_for(itos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   143
                       generate_deopt_entry_for(atos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   144
                       generate_deopt_entry_for(itos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   145
                       generate_deopt_entry_for(ltos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   146
                       generate_deopt_entry_for(ftos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   147
                       generate_deopt_entry_for(dtos, i),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   148
                       generate_deopt_entry_for(vtos, i)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   149
                       );
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   150
        }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   151
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   152
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   153
      { CodeletMark cm(_masm, "result handlers for native calls");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   154
        // The various result converter stublets.
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   155
        int is_generated[Interpreter::number_of_result_handlers];
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   156
        memset(is_generated, 0, sizeof(is_generated));
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
        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
   159
          BasicType type = types[i];
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   160
          if (!is_generated[Interpreter::BasicType_as_index(type)]++) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   161
            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
   162
          }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   163
        }
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
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   166
      { CodeletMark cm(_masm, "continuation entry points");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   167
        Interpreter::_continuation_entry =
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   168
          EntryPoint(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   169
                     generate_continuation_for(btos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   170
                     generate_continuation_for(ctos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   171
                     generate_continuation_for(stos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   172
                     generate_continuation_for(atos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   173
                     generate_continuation_for(itos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   174
                     generate_continuation_for(ltos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   175
                     generate_continuation_for(ftos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   176
                     generate_continuation_for(dtos),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   177
                     generate_continuation_for(vtos)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   178
                     );
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   179
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   180
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   181
      { CodeletMark cm(_masm, "safepoint entry points");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   182
        Interpreter::_safept_entry =
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   183
          EntryPoint(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   184
                     generate_safept_entry_for(btos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   185
                     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
   186
                     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
   187
                     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
   188
                     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
   189
                     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
   190
                     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
   191
                     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
   192
                     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
   193
                     );
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   194
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   195
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   196
      { CodeletMark cm(_masm, "exception handling");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   197
        // (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
   198
        generate_throw_exception();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   199
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   200
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   201
      { CodeletMark cm(_masm, "throw exception entrypoints");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   202
        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
   203
        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
   204
        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
   205
        Interpreter::_throw_ClassCastException_entry             = generate_ClassCastException_handler();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   206
        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
   207
        Interpreter::_throw_StackOverflowError_entry             = generate_StackOverflowError_handler();
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
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   211
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   212
#define method_entry(kind)                                              \
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   213
      { CodeletMark cm(_masm, "method entry point (kind = " #kind ")"); \
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   214
        Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind); \
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
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   217
      // all non-native method kinds
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   218
      method_entry(zerolocals)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   219
      method_entry(zerolocals_synchronized)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   220
      method_entry(empty)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   221
      method_entry(accessor)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   222
      method_entry(abstract)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   223
      method_entry(java_lang_math_sin  )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   224
      method_entry(java_lang_math_cos  )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   225
      method_entry(java_lang_math_tan  )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   226
      method_entry(java_lang_math_abs  )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   227
      method_entry(java_lang_math_sqrt )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   228
      method_entry(java_lang_math_log  )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   229
      method_entry(java_lang_math_log10)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   230
      method_entry(java_lang_math_exp  )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   231
      method_entry(java_lang_math_pow  )
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   232
      method_entry(java_lang_ref_reference_get)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   233
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   234
      AbstractInterpreter::initialize_method_handle_entries();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   235
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   236
      // 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
   237
      Interpreter::_native_entry_begin = Interpreter::code()->code_end();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   238
      method_entry(native)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   239
      method_entry(native_synchronized)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   240
      Interpreter::_native_entry_end = Interpreter::code()->code_end();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   241
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   242
      if (UseCRC32Intrinsics) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   243
        method_entry(java_util_zip_CRC32_update)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   244
        method_entry(java_util_zip_CRC32_updateBytes)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   245
        method_entry(java_util_zip_CRC32_updateByteBuffer)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   246
      }
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
      if (UseCRC32CIntrinsics) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   249
        method_entry(java_util_zip_CRC32C_updateBytes)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   250
        method_entry(java_util_zip_CRC32C_updateDirectByteBuffer)
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   251
      }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   252
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   253
      method_entry(java_lang_Float_intBitsToFloat);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   254
      method_entry(java_lang_Float_floatToRawIntBits);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   255
      method_entry(java_lang_Double_longBitsToDouble);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   256
      method_entry(java_lang_Double_doubleToRawLongBits);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   257
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   258
#undef method_entry
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
      // Bytecodes
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   261
      set_entry_points_for_all_bytes();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   262
    }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   263
  } while (CodeCacheExtensions::needs_other_interpreter_variant());
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;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   303
  EntryPoint entry(e, e, e, e, e, e, e, e, e);
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
  if (CodeCacheExtensions::skip_template_interpreter_entries(code)) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   311
    return;
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
  CodeletMark cm(_masm, Bytecodes::name(code), code);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   314
  // initialize entry points
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   315
  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
   316
  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
   317
  address bep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   318
  address cep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   319
  address sep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   320
  address aep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   321
  address iep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   322
  address lep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   323
  address fep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   324
  address dep = _illegal_bytecode_sequence;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   325
  address vep = _unimplemented_bytecode;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   326
  address wep = _unimplemented_bytecode;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   327
  // code for short & wide version of bytecode
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   328
  if (Bytecodes::is_defined(code)) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   329
    Template* t = TemplateTable::template_for(code);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   330
    assert(t->is_valid(), "just checking");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   331
    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
   332
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   333
  if (Bytecodes::wide_is_defined(code)) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   334
    Template* t = TemplateTable::template_for_wide(code);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   335
    assert(t->is_valid(), "just checking");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   336
    set_wide_entry_point(t, wep);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   337
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   338
  // set entry points
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   339
  EntryPoint entry(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
   340
  Interpreter::_normal_table.set_entry(code, entry);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   341
  Interpreter::_wentry_point[code] = wep;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   342
  CodeCacheExtensions::completed_template_interpreter_entries(_masm, code);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   343
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   344
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   345
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   346
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
   347
  assert(t->is_valid(), "template must exist");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   348
  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
   349
  wep = __ pc(); generate_and_dispatch(t);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   350
}
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   351
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
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
   354
  assert(t->is_valid(), "template must exist");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   355
  switch (t->tos_in()) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   356
    case btos:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   357
    case ctos:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   358
    case stos:
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   359
      ShouldNotReachHere();  // btos/ctos/stos should use itos.
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   360
      break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   361
    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
   362
    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
   363
    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
   364
    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
   365
    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
   366
    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
   367
    default  : ShouldNotReachHere();                                                 break;
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
//------------------------------------------------------------------------------------------------------------------------
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   373
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   374
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
   375
  if (PrintBytecodeHistogram)                                    histogram_bytecode(t);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   376
#ifndef PRODUCT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   377
  // debugging code
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   378
  if (CountBytecodes || TraceBytecodes || StopInterpreterAt > 0) count_bytecode();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   379
  if (PrintBytecodePairHistogram)                                histogram_bytecode_pair(t);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   380
  if (TraceBytecodes)                                            trace_bytecode(t);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   381
  if (StopInterpreterAt > 0)                                     stop_interpreter_at();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   382
  __ verify_FPU(1, t->tos_in());
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   383
#endif // !PRODUCT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   384
  int step = 0;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   385
  if (!t->does_dispatch()) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   386
    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
   387
    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
   388
    // compute bytecode size
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   389
    assert(step > 0, "just checkin'");
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   390
    // setup stuff for dispatching next bytecode
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   391
    if (ProfileInterpreter && VerifyDataPointer
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   392
        && MethodData::bytecode_has_profile(t->bytecode())) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   393
      __ verify_method_data_pointer();
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
    __ dispatch_prolog(tos_out, step);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   396
  }
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   397
  // generate template
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   398
  t->generate(_masm);
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   399
  // advance
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   400
  if (t->does_dispatch()) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   401
#ifdef ASSERT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   402
    // 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
   403
    __ should_not_reach_here();
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   404
#endif // ASSERT
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   405
  } else {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   406
    // dispatch to next bytecode
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   407
    __ dispatch_epilog(tos_out, step);
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
}
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
// Generate method entries
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   412
address TemplateInterpreterGenerator::generate_method_entry(
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   413
                                        AbstractInterpreter::MethodKind kind) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   414
  // determine code generation flags
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   415
  bool native = false;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   416
  bool synchronized = false;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   417
  address entry_point = NULL;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   418
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   419
  switch (kind) {
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   420
  case Interpreter::zerolocals             :                                          break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   421
  case Interpreter::zerolocals_synchronized:                synchronized = true;      break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   422
  case Interpreter::native                 : native = true;                           break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   423
  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
   424
  case Interpreter::empty                  : break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   425
  case Interpreter::accessor               : break;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   426
  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
   427
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   428
  case Interpreter::java_lang_math_sin     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   429
  case Interpreter::java_lang_math_cos     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   430
  case Interpreter::java_lang_math_tan     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   431
  case Interpreter::java_lang_math_abs     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   432
  case Interpreter::java_lang_math_log     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   433
  case Interpreter::java_lang_math_log10   : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   434
  case Interpreter::java_lang_math_sqrt    : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   435
  case Interpreter::java_lang_math_pow     : // fall thru
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   436
  case Interpreter::java_lang_math_exp     : entry_point = generate_math_entry(kind);      break;
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;
62c12ca7a45e 8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff changeset
   467
#endif // defined(TARGET_ARCH_x86) && !defined(_LP64)
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