src/hotspot/cpu/sparc/c1_MacroAssembler_sparc.cpp
author stefank
Tue, 06 Aug 2019 10:48:21 +0200
changeset 57777 90ead0febf56
parent 50380 bec342339138
child 57811 947252a54b98
permissions -rw-r--r--
8229258: Rework markOop and markOopDesc into a simpler mark word value carrier Reviewed-by: rkennke, coleenp, kbarrett, dcubed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
49397
d3a8aa01f26f 8071282: remove misc dead code
rraghavan
parents: 47216
diff changeset
     2
 * Copyright (c) 1999, 2018, 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: 5046
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5046
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: 5046
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"
50380
bec342339138 8204195: Clean up macroAssembler.inline.hpp and other inline.hpp files included in .hpp files
coleenp
parents: 49397
diff changeset
    26
#include "asm/macroAssembler.inline.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
#include "c1/c1_MacroAssembler.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "c1/c1_Runtime1.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "classfile/systemDictionary.hpp"
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29081
diff changeset
    30
#include "gc/shared/collectedHeap.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
#include "interpreter/interpreter.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    32
#include "oops/arrayOop.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    33
#include "oops/markOop.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    34
#include "runtime/basicLock.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    35
#include "runtime/biasedLocking.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    36
#include "runtime/os.hpp"
29081
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents: 24018
diff changeset
    37
#include "runtime/sharedRuntime.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    38
#include "runtime/stubRoutines.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  Label L;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  const Register temp_reg = G3_scratch;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  // Note: needs more testing of out-of-line vs. inline slow case
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  verify_oop(receiver);
7427
d7b79a367474 6985015: C1 needs to support compressed oops
iveresov
parents: 7397
diff changeset
    45
  load_klass(receiver, temp_reg);
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 9124
diff changeset
    46
  cmp_and_brx_short(temp_reg, iCache, Assembler::equal, Assembler::pt, L);
2571
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 670
diff changeset
    47
  AddressLiteral ic_miss(SharedRuntime::get_ic_miss_stub());
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 670
diff changeset
    48
  jump_to(ic_miss, temp_reg);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  delayed()->nop();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  align(CodeEntryAlignment);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  bind(L);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
void C1_MacroAssembler::explicit_null_check(Register base) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  Unimplemented();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 22234
diff changeset
    60
void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 22234
diff changeset
    61
  assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 22234
diff changeset
    62
  generate_stack_overflow_check(bang_size_in_bytes);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  // Create the frame.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  save_frame_c1(frame_size_in_bytes);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
void C1_MacroAssembler::verified_entry() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  if (C1Breakpoint) breakpoint_trap();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  // build frame
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  verify_FPU(0, "method_entry");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox, Register Rscratch, Label& slow_case) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  assert_different_registers(Rmark, Roop, Rbox, Rscratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  Label done;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
2571
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 670
diff changeset
    80
  Address mark_addr(Roop, oopDesc::mark_offset_in_bytes());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  // The following move must be the first instruction of emitted since debug
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  // information may be generated for it.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  // Load object header
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  ld_ptr(mark_addr, Rmark);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  verify_oop(Roop);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  // save object being locked into the BasicObjectLock
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  st_ptr(Roop, Rbox, BasicObjectLock::obj_offset_in_bytes());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  if (UseBiasedLocking) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
    biased_locking_enter(Roop, Rmark, Rscratch, done, &slow_case);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  // Save Rbox in Rscratch to be used for the cas operation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  mov(Rbox, Rscratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  // and mark it unlocked
57777
90ead0febf56 8229258: Rework markOop and markOopDesc into a simpler mark word value carrier
stefank
parents: 50380
diff changeset
   100
  or3(Rmark, markWord::unlocked_value, Rmark);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  // save unlocked object header into the displaced header location on the stack
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  st_ptr(Rmark, Rbox, BasicLock::displaced_header_offset_in_bytes());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
57777
90ead0febf56 8229258: Rework markOop and markOopDesc into a simpler mark word value carrier
stefank
parents: 50380
diff changeset
   105
  // compare object markWord with Rmark and if equal exchange Rscratch with object markWord
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  assert(mark_addr.disp() == 0, "cas must take a zero displacement");
18097
acd70736bd60 8008407: remove SPARC V8 support
morris
parents: 13969
diff changeset
   107
  cas_ptr(mark_addr.base(), Rmark, Rscratch);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  // if compare/exchange succeeded we found an unlocked object and we now have locked it
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  // hence we are done
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  cmp(Rmark, Rscratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  brx(Assembler::equal, false, Assembler::pt, done);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  delayed()->sub(Rscratch, SP, Rscratch);  //pull next instruction into delay slot
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  // we did not find an unlocked object so see if this is a recursive case
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  // sub(Rscratch, SP, Rscratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  assert(os::vm_page_size() > 0xfff, "page size too small - change the constant");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  andcc(Rscratch, 0xfffff003, Rscratch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  brx(Assembler::notZero, false, Assembler::pn, slow_case);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  delayed()->st_ptr(Rscratch, Rbox, BasicLock::displaced_header_offset_in_bytes());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  bind(done);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
void C1_MacroAssembler::unlock_object(Register Rmark, Register Roop, Register Rbox, Label& slow_case) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  assert_different_registers(Rmark, Roop, Rbox);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  Label done;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
2571
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 670
diff changeset
   128
  Address mark_addr(Roop, oopDesc::mark_offset_in_bytes());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  assert(mark_addr.disp() == 0, "cas must take a zero displacement");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  if (UseBiasedLocking) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
    // load the object out of the BasicObjectLock
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
    ld_ptr(Rbox, BasicObjectLock::obj_offset_in_bytes(), Roop);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
    verify_oop(Roop);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
    biased_locking_exit(mark_addr, Rmark, done);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  // Test first it it is a fast recursive unlock
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  ld_ptr(Rbox, BasicLock::displaced_header_offset_in_bytes(), Rmark);
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 9124
diff changeset
   139
  br_null_short(Rmark, Assembler::pt, done);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  if (!UseBiasedLocking) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
    // load object
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
    ld_ptr(Rbox, BasicObjectLock::obj_offset_in_bytes(), Roop);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
    verify_oop(Roop);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  // Check if it is still a light weight lock, this is is true if we see
57777
90ead0febf56 8229258: Rework markOop and markOopDesc into a simpler mark word value carrier
stefank
parents: 50380
diff changeset
   147
  // the stack address of the basicLock in the markWord of the object
18097
acd70736bd60 8008407: remove SPARC V8 support
morris
parents: 13969
diff changeset
   148
  cas_ptr(mark_addr.base(), Rbox, Rmark);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  cmp(Rbox, Rmark);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  brx(Assembler::notEqual, false, Assembler::pn, slow_case);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  delayed()->nop();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
  // Done
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  bind(done);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
void C1_MacroAssembler::try_allocate(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  Register obj,                        // result: pointer to object after successful allocation
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  Register var_size_in_bytes,          // object size in bytes if unknown at compile time; invalid otherwise
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  int      con_size_in_bytes,          // object size in bytes if   known at compile time
7724
a92d706dbdd5 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 7427
diff changeset
   162
  Register t1,                         // temp register, must be global register for incr_allocated_bytes
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  Register t2,                         // temp register
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  Label&   slow_case                   // continuation point if fast allocation fails
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
) {
7898
729a02451b8a 7011463: Sparc MacroAssembler::incr_allocated_bytes() needs a RegisterOrConstant argument
phh
parents: 7724
diff changeset
   166
  RegisterOrConstant size_in_bytes = var_size_in_bytes->is_valid()
729a02451b8a 7011463: Sparc MacroAssembler::incr_allocated_bytes() needs a RegisterOrConstant argument
phh
parents: 7724
diff changeset
   167
    ? RegisterOrConstant(var_size_in_bytes) : RegisterOrConstant(con_size_in_bytes);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  if (UseTLAB) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
    tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
    eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case);
7898
729a02451b8a 7011463: Sparc MacroAssembler::incr_allocated_bytes() needs a RegisterOrConstant argument
phh
parents: 7724
diff changeset
   172
    incr_allocated_bytes(size_in_bytes, t1, t2);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register len, Register t1, Register t2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
  assert_different_registers(obj, klass, len, t1, t2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  if (UseBiasedLocking && !len->is_valid()) {
11430
718fc06da49a 7118863: Move sizeof(klassOopDesc) into the *Klass::*_offset_in_bytes() functions
stefank
parents: 10252
diff changeset
   180
    ld_ptr(klass, in_bytes(Klass::prototype_header_offset()), t1);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  } else {
57777
90ead0febf56 8229258: Rework markOop and markOopDesc into a simpler mark word value carrier
stefank
parents: 50380
diff changeset
   182
    set((intx)markWord::prototype().value(), t1);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  }
7427
d7b79a367474 6985015: C1 needs to support compressed oops
iveresov
parents: 7397
diff changeset
   184
  st_ptr(t1, obj, oopDesc::mark_offset_in_bytes());
19979
ebe1dbb6e1aa 8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents: 18097
diff changeset
   185
  if (UseCompressedClassPointers) {
7427
d7b79a367474 6985015: C1 needs to support compressed oops
iveresov
parents: 7397
diff changeset
   186
    // Save klass
d7b79a367474 6985015: C1 needs to support compressed oops
iveresov
parents: 7397
diff changeset
   187
    mov(klass, t1);
13969
d2a189b83b87 7054512: Compress class pointers after perm gen removal
roland
parents: 13728
diff changeset
   188
    encode_klass_not_null(t1);
7427
d7b79a367474 6985015: C1 needs to support compressed oops
iveresov
parents: 7397
diff changeset
   189
    stw(t1, obj, oopDesc::klass_offset_in_bytes());
d7b79a367474 6985015: C1 needs to support compressed oops
iveresov
parents: 7397
diff changeset
   190
  } else {
d7b79a367474 6985015: C1 needs to support compressed oops
iveresov
parents: 7397
diff changeset
   191
    st_ptr(klass, obj, oopDesc::klass_offset_in_bytes());
d7b79a367474 6985015: C1 needs to support compressed oops
iveresov
parents: 7397
diff changeset
   192
  }
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   193
  if (len->is_valid()) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   194
    st(len, obj, arrayOopDesc::length_offset_in_bytes());
19979
ebe1dbb6e1aa 8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents: 18097
diff changeset
   195
  } else if (UseCompressedClassPointers) {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   196
    // otherwise length is in the class gap
7427
d7b79a367474 6985015: C1 needs to support compressed oops
iveresov
parents: 7397
diff changeset
   197
    store_klass_gap(G0, obj);
d7b79a367474 6985015: C1 needs to support compressed oops
iveresov
parents: 7397
diff changeset
   198
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
void C1_MacroAssembler::initialize_body(Register base, Register index) {
35548
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   203
  zero_memory(base, index);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
void C1_MacroAssembler::allocate_object(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
  Register obj,                        // result: pointer to object after successful allocation
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  Register t1,                         // temp register
7724
a92d706dbdd5 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents: 7427
diff changeset
   210
  Register t2,                         // temp register, must be a global register for try_allocate
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  Register t3,                         // temp register
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
  int      hdr_size,                   // object header size in words
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  int      obj_size,                   // object size in words
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  Register klass,                      // object klass
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  Label&   slow_case                   // continuation point if fast allocation fails
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  assert_different_registers(obj, t1, t2, t3, klass);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  assert(klass == G5, "must be G5");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  // allocate space & initialize header
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  if (!is_simm13(obj_size * wordSize)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
    // would need to use extra register to load
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
    // object size => go the slow case for now
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 9124
diff changeset
   224
    ba(slow_case);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
    delayed()->nop();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
    return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
  try_allocate(obj, noreg, obj_size * wordSize, t2, t3, slow_case);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
35548
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   230
  initialize_object(obj, klass, noreg, obj_size * HeapWordSize, t1, t2, /* is_tlab_allocated */ UseTLAB);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
void C1_MacroAssembler::initialize_object(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  Register obj,                        // result: pointer to object after successful allocation
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
  Register klass,                      // object klass
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
  Register var_size_in_bytes,          // object size in bytes if unknown at compile time; invalid otherwise
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
  int      con_size_in_bytes,          // object size in bytes if   known at compile time
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  Register t1,                         // temp register
35548
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   239
  Register t2,                         // temp register
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   240
  bool     is_tlab_allocated           // the object was allocated in a TLAB; relevant for the implementation of ZeroTLAB
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
  ) {
7427
d7b79a367474 6985015: C1 needs to support compressed oops
iveresov
parents: 7397
diff changeset
   242
  const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
  initialize_header(obj, klass, noreg, t1, t2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
    Label ok;
11430
718fc06da49a 7118863: Move sizeof(klassOopDesc) into the *Klass::*_offset_in_bytes() functions
stefank
parents: 10252
diff changeset
   249
    ld(klass, in_bytes(Klass::layout_helper_offset()), t1);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
    if (var_size_in_bytes != noreg) {
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 9124
diff changeset
   251
      cmp_and_brx_short(t1, var_size_in_bytes, Assembler::equal, Assembler::pt, ok);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
    } else {
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 9124
diff changeset
   253
      cmp_and_brx_short(t1, con_size_in_bytes, Assembler::equal, Assembler::pt, ok);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
    stop("bad size in initialize_object");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
    should_not_reach_here();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
    bind(ok);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
35548
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   263
  if (!(UseTLAB && ZeroTLAB && is_tlab_allocated)) {
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   264
    // initialize body
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   265
    const int threshold = 5 * HeapWordSize;              // approximate break even point for code size
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   266
    if (var_size_in_bytes != noreg) {
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   267
      // use a loop
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   268
      add(obj, hdr_size_in_bytes, t1);               // compute address of first element
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   269
      sub(var_size_in_bytes, hdr_size_in_bytes, t2); // compute size of body
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   270
      initialize_body(t1, t2);
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   271
    } else if (con_size_in_bytes <= threshold) {
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   272
      // use explicit NULL stores
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   273
      for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += HeapWordSize)     st_ptr(G0, obj, i);
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   274
    } else if (con_size_in_bytes > hdr_size_in_bytes) {
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   275
      // use a loop
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   276
      const Register base  = t1;
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   277
      const Register index = t2;
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   278
      add(obj, hdr_size_in_bytes, base);               // compute address of first element
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   279
      // compute index = number of words to clear
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   280
      set(con_size_in_bytes - hdr_size_in_bytes, index);
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   281
      initialize_body(base, index);
8d3afe96ffea 8086053: Address inconsistencies regarding ZeroTLAB
zmajo
parents: 30764
diff changeset
   282
    }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
2867
69187054225f 6788527: Server vm intermittently fails with assertion "live value must not be garbage" with fastdebug bits
kvn
parents: 2571
diff changeset
   285
  if (CURRENT_ENV->dtrace_alloc_probes()) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
    assert(obj == O0, "must be");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
    call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::dtrace_object_alloc_id)),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
         relocInfo::runtime_call_type);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
    delayed()->nop();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
  verify_oop(obj);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
void C1_MacroAssembler::allocate_array(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
  Register obj,                        // result: pointer to array after successful allocation
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
  Register len,                        // array length
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
  Register t1,                         // temp register
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
  Register t2,                         // temp register
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
  Register t3,                         // temp register
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
  int      hdr_size,                   // object header size in words
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
  int      elt_size,                   // element size in bytes
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
  Register klass,                      // object klass
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  Label&   slow_case                   // continuation point if fast allocation fails
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
  assert_different_registers(obj, len, t1, t2, t3, klass);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
  assert(klass == G5, "must be G5");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
  assert(t1 == G1, "must be G1");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
  // determine alignment mask
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
  assert(!(BytesPerWord & 1), "must be a multiple of 2 for masking code to work");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
  // check for negative or excessive length
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
  // note: the maximum length allowed is chosen so that arrays of any
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
  //       element size with this length are always smaller or equal
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
  //       to the largest integer (i.e., array size computation will
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
  //       not overflow)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
  set(max_array_allocation_length, t1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
  cmp(len, t1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
  br(Assembler::greaterUnsigned, false, Assembler::pn, slow_case);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
  // compute array size
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
  // note: if 0 <= len <= max_length, len*elt_size + header + alignment is
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
  //       smaller or equal to the largest integer; also, since top is always
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
  //       aligned, we can do the alignment here instead of at the end address
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
  //       computation
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
  const Register arr_size = t1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
  switch (elt_size) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
    case  1: delayed()->mov(len,    arr_size); break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
    case  2: delayed()->sll(len, 1, arr_size); break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
    case  4: delayed()->sll(len, 2, arr_size); break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
    case  8: delayed()->sll(len, 3, arr_size); break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
    default: ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
  add(arr_size, hdr_size * wordSize + MinObjAlignmentInBytesMask, arr_size); // add space for header & alignment
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
  and3(arr_size, ~MinObjAlignmentInBytesMask, arr_size);                     // align array size
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
  // allocate space & initialize header
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
  if (UseTLAB) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
    tlab_allocate(obj, arr_size, 0, t2, slow_case);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
    eden_allocate(obj, arr_size, 0, t2, t3, slow_case);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
  initialize_header(obj, klass, len, t2, t3);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
  // initialize body
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
  const Register base  = t2;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
  const Register index = t3;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
  add(obj, hdr_size * wordSize, base);               // compute address of first element
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
  sub(arr_size, hdr_size * wordSize, index);         // compute index = number of words to clear
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
  initialize_body(base, index);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
2867
69187054225f 6788527: Server vm intermittently fails with assertion "live value must not be garbage" with fastdebug bits
kvn
parents: 2571
diff changeset
   354
  if (CURRENT_ENV->dtrace_alloc_probes()) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
    assert(obj == O0, "must be");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
    call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::dtrace_object_alloc_id)),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
         relocInfo::runtime_call_type);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
    delayed()->nop();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
  verify_oop(obj);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
void C1_MacroAssembler::verify_stack_oop(int stack_offset) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
  if (!VerifyOops) return;
2571
d602ad6538bd 6822110: Add AddressLiteral class on SPARC
twisti
parents: 670
diff changeset
   369
  verify_oop_addr(Address(SP, stack_offset + STACK_BIAS));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
void C1_MacroAssembler::verify_not_null_oop(Register r) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
  Label not_null;
10252
0981ce1c3eef 7063628: Use cbcond on T4
kvn
parents: 9124
diff changeset
   374
  br_notnull_short(r, Assembler::pt, not_null);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
  stop("non-null oop required");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
  bind(not_null);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
  if (!VerifyOops) return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
  verify_oop(r);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
void C1_MacroAssembler::invalidate_registers(bool iregisters, bool lregisters, bool oregisters,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
                                             Register preserve1, Register preserve2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
  if (iregisters) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
    for (int i = 0; i < 6; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
      Register r = as_iRegister(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
      if (r != preserve1 && r != preserve2)  set(0xdead, r);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
  if (oregisters) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
    for (int i = 0; i < 6; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
      Register r = as_oRegister(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
      if (r != preserve1 && r != preserve2)  set(0xdead, r);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
  if (lregisters) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
    for (int i = 0; i < 8; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
      Register r = as_lRegister(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
      if (r != preserve1 && r != preserve2)  set(0xdead, r);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
#endif