hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp
author chegar
Wed, 16 Dec 2015 12:17:03 +0000
changeset 34705 228508cfabc4
parent 27471 6e56277909f1
child 46727 6e4a84748e2c
permissions -rw-r--r--
8144479: Remove character coders from sun.misc Reviewed-by: psandoz, rriggs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
     2
 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5419
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5419
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5419
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#include "interpreter/interpreter.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
#include "interpreter/interpreterRuntime.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "memory/allocation.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "memory/universe.inline.hpp"
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    30
#include "oops/method.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
#include "oops/oop.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    32
#include "runtime/handles.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    33
#include "runtime/icache.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    34
#include "runtime/interfaceSupport.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    35
#include "runtime/signature.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
#define __ _masm->
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
// Implementation of SignatureHandlerGenerator
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
Register InterpreterRuntime::SignatureHandlerGenerator::from() { return r14; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
Register InterpreterRuntime::SignatureHandlerGenerator::to()   { return rsp; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
Register InterpreterRuntime::SignatureHandlerGenerator::temp() { return rscratch1; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
void InterpreterRuntime::SignatureHandlerGenerator::pass_int() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  const Address src(from(), Interpreter::local_offset_in_bytes(offset()));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
#ifdef _WIN64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  switch (_num_args) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  case 0:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
    __ movl(c_rarg1, src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
    _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  case 1:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
    __ movl(c_rarg2, src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
    _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  case 2:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    __ movl(c_rarg3, src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  default:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
    __ movl(rax, src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
    __ movl(Address(to(), _stack_offset), rax);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
    _stack_offset += wordSize;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  switch (_num_int_args) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  case 0:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
    __ movl(c_rarg1, src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  case 1:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
    __ movl(c_rarg2, src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  case 2:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
    __ movl(c_rarg3, src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  case 3:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
    __ movl(c_rarg4, src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  case 4:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
    __ movl(c_rarg5, src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  default:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
    __ movl(rax, src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
    __ movl(Address(to(), _stack_offset), rax);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
    _stack_offset += wordSize;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
void InterpreterRuntime::SignatureHandlerGenerator::pass_long() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  const Address src(from(), Interpreter::local_offset_in_bytes(offset() + 1));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
#ifdef _WIN64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  switch (_num_args) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  case 0:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   105
    __ movptr(c_rarg1, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
    _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  case 1:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   109
    __ movptr(c_rarg2, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
    _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  case 2:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   113
    __ movptr(c_rarg3, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
    _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  case 3:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  default:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   118
    __ movptr(rax, src);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   119
    __ movptr(Address(to(), _stack_offset), rax);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
    _stack_offset += wordSize;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  switch (_num_int_args) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  case 0:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   126
    __ movptr(c_rarg1, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  case 1:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   130
    __ movptr(c_rarg2, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  case 2:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   134
    __ movptr(c_rarg3, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  case 3:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   138
    __ movptr(c_rarg4, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  case 4:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   142
    __ movptr(c_rarg5, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  default:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   146
    __ movptr(rax, src);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   147
    __ movptr(Address(to(), _stack_offset), rax);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
    _stack_offset += wordSize;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
void InterpreterRuntime::SignatureHandlerGenerator::pass_float() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  const Address src(from(), Interpreter::local_offset_in_bytes(offset()));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
#ifdef _WIN64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  if (_num_args < Argument::n_float_register_parameters_c-1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
    __ movflt(as_XMMRegister(++_num_args), src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
    __ movl(rax, src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
    __ movl(Address(to(), _stack_offset), rax);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
    _stack_offset += wordSize;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  if (_num_fp_args < Argument::n_float_register_parameters_c) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
    __ movflt(as_XMMRegister(_num_fp_args++), src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
    __ movl(rax, src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
    __ movl(Address(to(), _stack_offset), rax);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
    _stack_offset += wordSize;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
void InterpreterRuntime::SignatureHandlerGenerator::pass_double() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  const Address src(from(), Interpreter::local_offset_in_bytes(offset() + 1));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
#ifdef _WIN64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  if (_num_args < Argument::n_float_register_parameters_c-1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
    __ movdbl(as_XMMRegister(++_num_args), src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  } else {
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   183
    __ movptr(rax, src);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   184
    __ movptr(Address(to(), _stack_offset), rax);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
    _stack_offset += wordSize;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  if (_num_fp_args < Argument::n_float_register_parameters_c) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
    __ movdbl(as_XMMRegister(_num_fp_args++), src);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  } else {
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   191
    __ movptr(rax, src);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   192
    __ movptr(Address(to(), _stack_offset), rax);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
    _stack_offset += wordSize;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
void InterpreterRuntime::SignatureHandlerGenerator::pass_object() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
  const Address src(from(), Interpreter::local_offset_in_bytes(offset()));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
#ifdef _WIN64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  switch (_num_args) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
  case 0:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
    assert(offset() == 0, "argument register 1 can only be (non-null) receiver");
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   205
    __ lea(c_rarg1, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
    _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
  case 1:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   209
    __ lea(rax, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
    __ xorl(c_rarg2, c_rarg2);
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   211
    __ cmpptr(src, 0);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   212
    __ cmov(Assembler::notEqual, c_rarg2, rax);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
    _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  case 2:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   216
    __ lea(rax, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
    __ xorl(c_rarg3, c_rarg3);
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   218
    __ cmpptr(src, 0);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   219
    __ cmov(Assembler::notEqual, c_rarg3, rax);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
    _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  default:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   223
    __ lea(rax, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
    __ xorl(temp(), temp());
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   225
    __ cmpptr(src, 0);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   226
    __ cmov(Assembler::notEqual, temp(), rax);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   227
    __ movptr(Address(to(), _stack_offset), temp());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
    _stack_offset += wordSize;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
  switch (_num_int_args) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  case 0:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
    assert(offset() == 0, "argument register 1 can only be (non-null) receiver");
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   235
    __ lea(c_rarg1, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  case 1:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   239
    __ lea(rax, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
    __ xorl(c_rarg2, c_rarg2);
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   241
    __ cmpptr(src, 0);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   242
    __ cmov(Assembler::notEqual, c_rarg2, rax);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
  case 2:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   246
    __ lea(rax, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
    __ xorl(c_rarg3, c_rarg3);
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   248
    __ cmpptr(src, 0);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   249
    __ cmov(Assembler::notEqual, c_rarg3, rax);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
  case 3:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   253
    __ lea(rax, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
    __ xorl(c_rarg4, c_rarg4);
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   255
    __ cmpptr(src, 0);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   256
    __ cmov(Assembler::notEqual, c_rarg4, rax);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
  case 4:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   260
    __ lea(rax, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
    __ xorl(c_rarg5, c_rarg5);
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   262
    __ cmpptr(src, 0);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   263
    __ cmov(Assembler::notEqual, c_rarg5, rax);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
    _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
  default:
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   267
    __ lea(rax, src);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
    __ xorl(temp(), temp());
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   269
    __ cmpptr(src, 0);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   270
    __ cmov(Assembler::notEqual, temp(), rax);
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   271
    __ movptr(Address(to(), _stack_offset), temp());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
    _stack_offset += wordSize;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
void InterpreterRuntime::SignatureHandlerGenerator::generate(uint64_t fingerprint) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
  // generate code to handle arguments
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
  iterate(fingerprint);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
  // return result handler
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
  __ lea(rax, ExternalAddress(Interpreter::result_handler(method()->result_type())));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
  __ ret(0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
  __ flush();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
// Implementation of SignatureHandlerLibrary
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
void SignatureHandlerLibrary::pd_set_handler(address handler) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
#ifdef _WIN64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
class SlowSignatureHandler
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
  : public NativeSignatureIterator {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
  address   _from;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
  intptr_t* _to;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
  intptr_t* _reg_args;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
  intptr_t* _fp_identifiers;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
  unsigned int _num_args;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  virtual void pass_int()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
    jint from_obj = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 3261
diff changeset
   308
    _from -= Interpreter::stackElementSize;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
    if (_num_args < Argument::n_int_register_parameters_c-1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
      *_reg_args++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
      _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
      *_to++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
  virtual void pass_long()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
    intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 3261
diff changeset
   321
    _from -= 2*Interpreter::stackElementSize;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
    if (_num_args < Argument::n_int_register_parameters_c-1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
      *_reg_args++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
      _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
      *_to++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
  virtual void pass_object()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
    intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0));
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 3261
diff changeset
   334
    _from -= Interpreter::stackElementSize;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
    if (_num_args < Argument::n_int_register_parameters_c-1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
      *_reg_args++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
      _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
      *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
  virtual void pass_float()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
    jint from_obj = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 3261
diff changeset
   346
    _from -= Interpreter::stackElementSize;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
    if (_num_args < Argument::n_float_register_parameters_c-1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
      *_reg_args++ = from_obj;
2257
d8e6e11e7f32 6816308: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
kvn
parents: 1217
diff changeset
   350
      *_fp_identifiers |= (intptr_t)(0x01 << (_num_args*2)); // mark as float
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
      _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
      *_to++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
  virtual void pass_double()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
    intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 3261
diff changeset
   360
    _from -= 2*Interpreter::stackElementSize;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
    if (_num_args < Argument::n_float_register_parameters_c-1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
      *_reg_args++ = from_obj;
2257
d8e6e11e7f32 6816308: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
kvn
parents: 1217
diff changeset
   364
      *_fp_identifiers |= (intptr_t)(0x3 << (_num_args*2)); // mark as double
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
      _num_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
      *_to++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
  SlowSignatureHandler(methodHandle method, address from, intptr_t* to)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
    : NativeSignatureIterator(method)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
    _from = from;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
    _to   = to;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
    _reg_args = to - (method->is_static() ? 4 : 5);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
    _fp_identifiers = to - 2;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
    _to = _to + 4;  // Windows reserves stack space for register arguments
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
    *(int*) _fp_identifiers = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
    _num_args = (method->is_static() ? 1 : 0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
class SlowSignatureHandler
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
  : public NativeSignatureIterator {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
  address   _from;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
  intptr_t* _to;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
  intptr_t* _int_args;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
  intptr_t* _fp_args;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
  intptr_t* _fp_identifiers;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
  unsigned int _num_int_args;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
  unsigned int _num_fp_args;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
  virtual void pass_int()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
    jint from_obj = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 3261
diff changeset
   400
    _from -= Interpreter::stackElementSize;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
    if (_num_int_args < Argument::n_int_register_parameters_c-1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
      *_int_args++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
      _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
      *_to++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
  virtual void pass_long()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
    intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 3261
diff changeset
   413
    _from -= 2*Interpreter::stackElementSize;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
    if (_num_int_args < Argument::n_int_register_parameters_c-1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
      *_int_args++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
      _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
      *_to++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
  virtual void pass_object()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
    intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0));
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 3261
diff changeset
   426
    _from -= Interpreter::stackElementSize;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
    if (_num_int_args < Argument::n_int_register_parameters_c-1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
      *_int_args++ = (*from_addr == 0) ? NULL : (intptr_t)from_addr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
      _num_int_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
      *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
  virtual void pass_float()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
    jint from_obj = *(jint*)(_from+Interpreter::local_offset_in_bytes(0));
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 3261
diff changeset
   439
    _from -= Interpreter::stackElementSize;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
    if (_num_fp_args < Argument::n_float_register_parameters_c) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
      *_fp_args++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
      _num_fp_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
      *_to++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
  virtual void pass_double()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
    intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 3261
diff changeset
   452
    _from -= 2*Interpreter::stackElementSize;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
    if (_num_fp_args < Argument::n_float_register_parameters_c) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
      *_fp_args++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
      *_fp_identifiers |= (1 << _num_fp_args); // mark as double
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
      _num_fp_args++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
      *_to++ = from_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
  SlowSignatureHandler(methodHandle method, address from, intptr_t* to)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
    : NativeSignatureIterator(method)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
    _from = from;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
    _to   = to;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
489c9b5090e2 Initial load
duke
parents:
diff changeset
   470
    _int_args = to - (method->is_static() ? 14 : 15);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   471
    _fp_args =  to - 9;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
    _fp_identifiers = to - 10;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
    *(int*) _fp_identifiers = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
    _num_int_args = (method->is_static() ? 1 : 0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
    _num_fp_args = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   479
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
IRT_ENTRY(address,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   482
          InterpreterRuntime::slow_signature_handler(JavaThread* thread,
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   483
                                                     Method* method,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
                                                     intptr_t* from,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
                                                     intptr_t* to))
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   486
  methodHandle m(thread, (Method*)method);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   487
  assert(m->is_native(), "sanity check");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   488
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
  // handle arguments
27471
6e56277909f1 8062370: Various minor code improvements
goetz
parents: 13728
diff changeset
   490
  SlowSignatureHandler(m, (address)from, to + 1).iterate((uint64_t)CONST64(-1));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
  // return result handler
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
  return Interpreter::result_handler(m->result_type());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
IRT_END