hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp
author twisti
Fri, 30 Nov 2012 15:23:16 -0800
changeset 14626 0cf4eccf130f
parent 7397 5b173b4ca846
child 14631 526804361522
permissions -rw-r--r--
8003240: x86: move MacroAssembler into separate file Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
     2
 * Copyright (c) 2004, 2010, 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: 2571
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2571
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: 2571
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: 6418
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6418
diff changeset
    26
#include "assembler_sparc.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6418
diff changeset
    27
#include "memory/resourceArea.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6418
diff changeset
    28
#include "prims/jniFastGetField.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6418
diff changeset
    29
#include "prims/jvm_misc.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6418
diff changeset
    30
#include "runtime/safepoint.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
// TSO ensures that loads are blocking and ordered with respect to
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// to earlier loads, so we don't need LoadLoad membars.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
#define __ masm->
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
#define BUFFER_SIZE 30*sizeof(jint)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
// Common register usage:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
// O0: env
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
// O1: obj
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
// O2: jfieldID
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
// O4: offset (O2 >> 2)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
// G4: old safepoint counter
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  const char *name;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  switch (type) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
    case T_BOOLEAN: name = "jni_fast_GetBooleanField"; break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
    case T_BYTE:    name = "jni_fast_GetByteField";    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
    case T_CHAR:    name = "jni_fast_GetCharField";    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
    case T_SHORT:   name = "jni_fast_GetShortField";   break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
    case T_INT:     name = "jni_fast_GetIntField";     break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
    default:        ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  ResourceMark rm;
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
    57
  BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE*wordSize);
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
    58
  CodeBuffer cbuf(blob);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  MacroAssembler* masm = new MacroAssembler(&cbuf);
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
    60
  address fast_entry = __ pc();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  Label label1, label2;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
2571
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
    64
  AddressLiteral cnt_addrlit(SafepointSynchronize::safepoint_counter_addr());
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
    65
  __ sethi (cnt_addrlit, O3);
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
    66
  Address cnt_addr(O3, cnt_addrlit.low10());
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
    67
  __ ld (cnt_addr, G4);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  __ andcc (G4, 1, G0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  __ br (Assembler::notZero, false, Assembler::pn, label1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  __ delayed()->srl (O2, 2, O4);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  __ ld_ptr (O1, 0, O5);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  speculative_load_pclist[count] = __ pc();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  switch (type) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
    case T_BOOLEAN: __ ldub (O5, O4, G3);  break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    case T_BYTE:    __ ldsb (O5, O4, G3);  break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
    case T_CHAR:    __ lduh (O5, O4, G3);  break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
    case T_SHORT:   __ ldsh (O5, O4, G3);  break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
    case T_INT:     __ ld (O5, O4, G3);    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
    default:        ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
2571
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
    84
  __ ld (cnt_addr, O5);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  __ cmp (O5, G4);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  __ br (Assembler::notEqual, false, Assembler::pn, label2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  __ delayed()->mov (O7, G1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  __ retl ();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  __ delayed()->mov (G3, O0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  slowcase_entry_pclist[count++] = __ pc();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  __ bind (label1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  __ mov (O7, G1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  address slow_case_addr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  switch (type) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
    case T_BOOLEAN: slow_case_addr = jni_GetBooleanField_addr(); break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
    case T_BYTE:    slow_case_addr = jni_GetByteField_addr();    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
    case T_CHAR:    slow_case_addr = jni_GetCharField_addr();    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    case T_SHORT:   slow_case_addr = jni_GetShortField_addr();   break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
    case T_INT:     slow_case_addr = jni_GetIntField_addr();     break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
    default:        ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  __ bind (label2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  __ call (slow_case_addr, relocInfo::none);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  __ delayed()->mov (G1, O7);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  __ flush ();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  return fast_entry;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
address JNI_FastGetField::generate_fast_get_boolean_field() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  return generate_fast_get_int_field0(T_BOOLEAN);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
address JNI_FastGetField::generate_fast_get_byte_field() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  return generate_fast_get_int_field0(T_BYTE);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
address JNI_FastGetField::generate_fast_get_char_field() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  return generate_fast_get_int_field0(T_CHAR);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
address JNI_FastGetField::generate_fast_get_short_field() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  return generate_fast_get_int_field0(T_SHORT);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
address JNI_FastGetField::generate_fast_get_int_field() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  return generate_fast_get_int_field0(T_INT);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
address JNI_FastGetField::generate_fast_get_long_field() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  const char *name = "jni_fast_GetLongField";
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  ResourceMark rm;
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
   136
  BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE*wordSize);
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
   137
  CodeBuffer cbuf(blob);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  MacroAssembler* masm = new MacroAssembler(&cbuf);
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
   139
  address fast_entry = __ pc();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  Label label1, label2;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
2571
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
   143
  AddressLiteral cnt_addrlit(SafepointSynchronize::safepoint_counter_addr());
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
   144
  __ sethi (cnt_addrlit, G3);
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
   145
  Address cnt_addr(G3, cnt_addrlit.low10());
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
   146
  __ ld (cnt_addr, G4);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  __ andcc (G4, 1, G0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  __ br (Assembler::notZero, false, Assembler::pn, label1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  __ delayed()->srl (O2, 2, O4);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  __ ld_ptr (O1, 0, O5);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  __ add (O5, O4, O5);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
#ifndef _LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  assert(count < LIST_CAPACITY-1, "LIST_CAPACITY too small");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  speculative_load_pclist[count++] = __ pc();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  __ ld (O5, 0, G2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  speculative_load_pclist[count] = __ pc();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  __ ld (O5, 4, O3);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  speculative_load_pclist[count] = __ pc();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  __ ldx (O5, 0, O3);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
2571
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
   166
  __ ld (cnt_addr, G1);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
  __ cmp (G1, G4);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  __ br (Assembler::notEqual, false, Assembler::pn, label2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  __ delayed()->mov (O7, G1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
#ifndef _LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
  __ mov (G2, O0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  __ retl ();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
  __ delayed()->mov (O3, O1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
  __ retl ();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  __ delayed()->mov (O3, O0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
#ifndef _LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  slowcase_entry_pclist[count-1] = __ pc();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  slowcase_entry_pclist[count++] = __ pc() ;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  slowcase_entry_pclist[count++] = __ pc();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  __ bind (label1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  __ mov (O7, G1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  address slow_case_addr = jni_GetLongField_addr();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  __ bind (label2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  __ call (slow_case_addr, relocInfo::none);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  __ delayed()->mov (G1, O7);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  __ flush ();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  return fast_entry;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  const char *name;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  switch (type) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
    case T_FLOAT:  name = "jni_fast_GetFloatField";  break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
    case T_DOUBLE: name = "jni_fast_GetDoubleField"; break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
    default:       ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  ResourceMark rm;
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
   208
  BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE*wordSize);
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
   209
  CodeBuffer cbuf(blob);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  MacroAssembler* masm = new MacroAssembler(&cbuf);
6418
6671edbd230e 6978355: renaming for 6961697
twisti
parents: 5547
diff changeset
   211
  address fast_entry = __ pc();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  Label label1, label2;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
2571
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
   215
  AddressLiteral cnt_addrlit(SafepointSynchronize::safepoint_counter_addr());
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
   216
  __ sethi (cnt_addrlit, O3);
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
   217
  Address cnt_addr(O3, cnt_addrlit.low10());
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
   218
  __ ld (cnt_addr, G4);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  __ andcc (G4, 1, G0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  __ br (Assembler::notZero, false, Assembler::pn, label1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  __ delayed()->srl (O2, 2, O4);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  __ ld_ptr (O1, 0, O5);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
  assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  speculative_load_pclist[count] = __ pc();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
  switch (type) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
    case T_FLOAT:  __ ldf (FloatRegisterImpl::S, O5, O4, F0); break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
    case T_DOUBLE: __ ldf (FloatRegisterImpl::D, O5, O4, F0); break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
    default:       ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
2571
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 1
diff changeset
   232
  __ ld (cnt_addr, O5);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  __ cmp (O5, G4);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  __ br (Assembler::notEqual, false, Assembler::pn, label2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
  __ delayed()->mov (O7, G1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
  __ retl ();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  __ delayed()-> nop ();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
  slowcase_entry_pclist[count++] = __ pc();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
  __ bind (label1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
  __ mov (O7, G1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
  address slow_case_addr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
  switch (type) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
    case T_FLOAT:  slow_case_addr = jni_GetFloatField_addr();  break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
    case T_DOUBLE: slow_case_addr = jni_GetDoubleField_addr(); break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
    default:       ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
  __ bind (label2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
  __ call (slow_case_addr, relocInfo::none);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
  __ delayed()->mov (G1, O7);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
  __ flush ();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
  return fast_entry;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
address JNI_FastGetField::generate_fast_get_float_field() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  return generate_fast_get_float_field0(T_FLOAT);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
address JNI_FastGetField::generate_fast_get_double_field() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
  return generate_fast_get_float_field0(T_DOUBLE);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
}