Mercurial > hg > truffle
comparison src/cpu/x86/vm/c1_Runtime1_x86.cpp @ 2106:91fe28b03d6a
Merge.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Wed, 26 Jan 2011 18:17:37 +0100 |
parents | 3c0a889a176b b1a2afa37ec4 |
children | d25d4ca69222 |
comparison
equal
deleted
inserted
replaced
2062:231bf6b9f5ad | 2106:91fe28b03d6a |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
1069 __ movptr(Address(thread, JavaThread::vm_result_2_offset()), NULL_WORD); | 1069 __ movptr(Address(thread, JavaThread::vm_result_2_offset()), NULL_WORD); |
1070 | 1070 |
1071 // verify that that there is really a valid exception in rax, | 1071 // verify that that there is really a valid exception in rax, |
1072 __ verify_not_null_oop(exception_oop); | 1072 __ verify_not_null_oop(exception_oop); |
1073 | 1073 |
1074 | |
1075 oop_maps = new OopMapSet(); | 1074 oop_maps = new OopMapSet(); |
1076 OopMap* oop_map = generate_oop_map(sasm, 1); | 1075 OopMap* oop_map = generate_oop_map(sasm, 1); |
1077 generate_handle_exception(sasm, oop_maps, oop_map); | 1076 generate_handle_exception(sasm, oop_maps, oop_map); |
1078 __ stop("should not reach here"); | 1077 __ stop("should not reach here"); |
1079 } | 1078 } |
1129 #endif // ASSERT | 1128 #endif // ASSERT |
1130 | 1129 |
1131 // if we got here then the TLAB allocation failed, so try | 1130 // if we got here then the TLAB allocation failed, so try |
1132 // refilling the TLAB or allocating directly from eden. | 1131 // refilling the TLAB or allocating directly from eden. |
1133 Label retry_tlab, try_eden; | 1132 Label retry_tlab, try_eden; |
1134 __ tlab_refill(retry_tlab, try_eden, slow_path); // does not destroy rdx (klass) | 1133 const Register thread = |
1134 __ tlab_refill(retry_tlab, try_eden, slow_path); // does not destroy rdx (klass), returns rdi | |
1135 | 1135 |
1136 __ bind(retry_tlab); | 1136 __ bind(retry_tlab); |
1137 | 1137 |
1138 // get the instance size (size is postive so movl is fine for 64bit) | 1138 // get the instance size (size is postive so movl is fine for 64bit) |
1139 __ movl(obj_size, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); | 1139 __ movl(obj_size, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); |
1140 | |
1140 __ tlab_allocate(obj, obj_size, 0, t1, t2, slow_path); | 1141 __ tlab_allocate(obj, obj_size, 0, t1, t2, slow_path); |
1142 | |
1141 __ initialize_object(obj, klass, obj_size, 0, t1, t2); | 1143 __ initialize_object(obj, klass, obj_size, 0, t1, t2); |
1142 __ verify_oop(obj); | 1144 __ verify_oop(obj); |
1143 __ pop(rbx); | 1145 __ pop(rbx); |
1144 __ pop(rdi); | 1146 __ pop(rdi); |
1145 __ ret(0); | 1147 __ ret(0); |
1146 | 1148 |
1147 __ bind(try_eden); | 1149 __ bind(try_eden); |
1148 // get the instance size (size is postive so movl is fine for 64bit) | 1150 // get the instance size (size is postive so movl is fine for 64bit) |
1149 __ movl(obj_size, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); | 1151 __ movl(obj_size, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); |
1152 | |
1150 __ eden_allocate(obj, obj_size, 0, t1, slow_path); | 1153 __ eden_allocate(obj, obj_size, 0, t1, slow_path); |
1154 __ incr_allocated_bytes(thread, obj_size, 0); | |
1155 | |
1151 __ initialize_object(obj, klass, obj_size, 0, t1, t2); | 1156 __ initialize_object(obj, klass, obj_size, 0, t1, t2); |
1152 __ verify_oop(obj); | 1157 __ verify_oop(obj); |
1153 __ pop(rbx); | 1158 __ pop(rbx); |
1154 __ pop(rdi); | 1159 __ pop(rdi); |
1155 __ ret(0); | 1160 __ ret(0); |
1235 __ jcc(Assembler::above, slow_path); | 1240 __ jcc(Assembler::above, slow_path); |
1236 | 1241 |
1237 // if we got here then the TLAB allocation failed, so try | 1242 // if we got here then the TLAB allocation failed, so try |
1238 // refilling the TLAB or allocating directly from eden. | 1243 // refilling the TLAB or allocating directly from eden. |
1239 Label retry_tlab, try_eden; | 1244 Label retry_tlab, try_eden; |
1240 __ tlab_refill(retry_tlab, try_eden, slow_path); // preserves rbx, & rdx | 1245 const Register thread = |
1246 __ tlab_refill(retry_tlab, try_eden, slow_path); // preserves rbx & rdx, returns rdi | |
1241 | 1247 |
1242 __ bind(retry_tlab); | 1248 __ bind(retry_tlab); |
1243 | 1249 |
1244 // get the allocation size: round_up(hdr + length << (layout_helper & 0x1F)) | 1250 // get the allocation size: round_up(hdr + length << (layout_helper & 0x1F)) |
1245 // since size is postive movl does right thing on 64bit | 1251 // since size is positive movl does right thing on 64bit |
1246 __ movl(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); | 1252 __ movl(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); |
1247 // since size is postive movl does right thing on 64bit | 1253 // since size is postive movl does right thing on 64bit |
1248 __ movl(arr_size, length); | 1254 __ movl(arr_size, length); |
1249 assert(t1 == rcx, "fixed register usage"); | 1255 assert(t1 == rcx, "fixed register usage"); |
1250 __ shlptr(arr_size /* by t1=rcx, mod 32 */); | 1256 __ shlptr(arr_size /* by t1=rcx, mod 32 */); |
1267 __ verify_oop(obj); | 1273 __ verify_oop(obj); |
1268 __ ret(0); | 1274 __ ret(0); |
1269 | 1275 |
1270 __ bind(try_eden); | 1276 __ bind(try_eden); |
1271 // get the allocation size: round_up(hdr + length << (layout_helper & 0x1F)) | 1277 // get the allocation size: round_up(hdr + length << (layout_helper & 0x1F)) |
1272 // since size is postive movl does right thing on 64bit | 1278 // since size is positive movl does right thing on 64bit |
1273 __ movl(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); | 1279 __ movl(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); |
1274 // since size is postive movl does right thing on 64bit | 1280 // since size is postive movl does right thing on 64bit |
1275 __ movl(arr_size, length); | 1281 __ movl(arr_size, length); |
1276 assert(t1 == rcx, "fixed register usage"); | 1282 assert(t1 == rcx, "fixed register usage"); |
1277 __ shlptr(arr_size /* by t1=rcx, mod 32 */); | 1283 __ shlptr(arr_size /* by t1=rcx, mod 32 */); |
1280 __ addptr(arr_size, t1); | 1286 __ addptr(arr_size, t1); |
1281 __ addptr(arr_size, MinObjAlignmentInBytesMask); // align up | 1287 __ addptr(arr_size, MinObjAlignmentInBytesMask); // align up |
1282 __ andptr(arr_size, ~MinObjAlignmentInBytesMask); | 1288 __ andptr(arr_size, ~MinObjAlignmentInBytesMask); |
1283 | 1289 |
1284 __ eden_allocate(obj, arr_size, 0, t1, slow_path); // preserves arr_size | 1290 __ eden_allocate(obj, arr_size, 0, t1, slow_path); // preserves arr_size |
1291 __ incr_allocated_bytes(thread, arr_size, 0); | |
1285 | 1292 |
1286 __ initialize_header(obj, klass, length, t1, t2); | 1293 __ initialize_header(obj, klass, length, t1, t2); |
1287 __ movb(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes() + (Klass::_lh_header_size_shift / BitsPerByte))); | 1294 __ movb(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes() + (Klass::_lh_header_size_shift / BitsPerByte))); |
1288 assert(Klass::_lh_header_size_shift % BitsPerByte == 0, "bytewise"); | 1295 assert(Klass::_lh_header_size_shift % BitsPerByte == 0, "bytewise"); |
1289 assert(Klass::_lh_header_size_mask <= 0xFF, "bytewise"); | 1296 assert(Klass::_lh_header_size_mask <= 0xFF, "bytewise"); |