src/cpu/x86/vm/jniFastGetField_x86_32.cpp

changeset 9669
32bc598624bd
parent 8316
626f594dffa6
child 9703
2fdf635bcf28
equal deleted inserted replaced
9668:acb9351e3a29 9669:32bc598624bd
1 /* 1 /*
2 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2004, 2017, 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.
77 __ jcc (Assembler::notZero, slow); 77 __ jcc (Assembler::notZero, slow);
78 if (os::is_MP()) { 78 if (os::is_MP()) {
79 __ mov(rax, rcx); 79 __ mov(rax, rcx);
80 __ andptr(rax, 1); // rax, must end up 0 80 __ andptr(rax, 1); // rax, must end up 0
81 __ movptr(rdx, Address(rsp, rax, Address::times_1, 2*wordSize)); 81 __ movptr(rdx, Address(rsp, rax, Address::times_1, 2*wordSize));
82 // obj, notice rax, is 0. 82 // obj, notice rax, is 0.
83 // rdx is data dependent on rcx. 83 // rdx is data dependent on rcx.
84 } else { 84 } else {
85 __ movptr (rdx, Address(rsp, 2*wordSize)); // obj 85 __ movptr (rdx, Address(rsp, 2*wordSize)); // obj
86 } 86 }
87 __ movptr(rax, Address(rsp, 3*wordSize)); // jfieldID 87 __ movptr(rax, Address(rsp, 3*wordSize)); // jfieldID
88
89 __ clear_jweak_tag(rdx);
90
88 __ movptr(rdx, Address(rdx, 0)); // *obj 91 __ movptr(rdx, Address(rdx, 0)); // *obj
89 __ shrptr (rax, 2); // offset 92 __ shrptr (rax, 2); // offset
90 93
91 assert(count < LIST_CAPACITY, "LIST_CAPACITY too small"); 94 assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
92 speculative_load_pclist[count] = __ pc(); 95 speculative_load_pclist[count] = __ pc();
93 switch (type) { 96 switch (type) {
94 case T_BOOLEAN: __ movzbl (rax, Address(rdx, rax, Address::times_1)); break; 97 case T_BOOLEAN: __ movzbl (rax, Address(rdx, rax, Address::times_1)); break;
192 __ mov32 (rcx, counter); 195 __ mov32 (rcx, counter);
193 __ testb (rcx, 1); 196 __ testb (rcx, 1);
194 __ jcc (Assembler::notZero, slow); 197 __ jcc (Assembler::notZero, slow);
195 if (os::is_MP()) { 198 if (os::is_MP()) {
196 __ mov(rax, rcx); 199 __ mov(rax, rcx);
197 __ andptr(rax, 1); // rax, must end up 0 200 __ andptr(rax, 1); // rax, must end up 0
198 __ movptr(rdx, Address(rsp, rax, Address::times_1, 3*wordSize)); 201 __ movptr(rdx, Address(rsp, rax, Address::times_1, 3*wordSize));
199 // obj, notice rax, is 0. 202 // obj, notice rax, is 0.
200 // rdx is data dependent on rcx. 203 // rdx is data dependent on rcx.
201 } else { 204 } else {
202 __ movptr(rdx, Address(rsp, 3*wordSize)); // obj 205 __ movptr(rdx, Address(rsp, 3*wordSize)); // obj
203 } 206 }
204 __ movptr(rsi, Address(rsp, 4*wordSize)); // jfieldID 207 __ movptr(rsi, Address(rsp, 4*wordSize)); // jfieldID
208
209 __ clear_jweak_tag(rdx);
210
205 __ movptr(rdx, Address(rdx, 0)); // *obj 211 __ movptr(rdx, Address(rdx, 0)); // *obj
206 __ shrptr(rsi, 2); // offset 212 __ shrptr(rsi, 2); // offset
207 213
208 assert(count < LIST_CAPACITY-1, "LIST_CAPACITY too small"); 214 assert(count < LIST_CAPACITY-1, "LIST_CAPACITY too small");
209 speculative_load_pclist[count++] = __ pc(); 215 speculative_load_pclist[count++] = __ pc();
281 __ mov32 (rcx, counter); 287 __ mov32 (rcx, counter);
282 __ testb (rcx, 1); 288 __ testb (rcx, 1);
283 __ jcc (Assembler::notZero, slow); 289 __ jcc (Assembler::notZero, slow);
284 if (os::is_MP()) { 290 if (os::is_MP()) {
285 __ mov(rax, rcx); 291 __ mov(rax, rcx);
286 __ andptr(rax, 1); // rax, must end up 0 292 __ andptr(rax, 1); // rax, must end up 0
287 __ movptr(rdx, Address(rsp, rax, Address::times_1, 2*wordSize)); 293 __ movptr(rdx, Address(rsp, rax, Address::times_1, 2*wordSize));
288 // obj, notice rax, is 0. 294 // obj, notice rax, is 0.
289 // rdx is data dependent on rcx. 295 // rdx is data dependent on rcx.
290 } else { 296 } else {
291 __ movptr(rdx, Address(rsp, 2*wordSize)); // obj 297 __ movptr(rdx, Address(rsp, 2*wordSize)); // obj
292 } 298 }
293 __ movptr(rax, Address(rsp, 3*wordSize)); // jfieldID 299 __ movptr(rax, Address(rsp, 3*wordSize)); // jfieldID
300
301 __ clear_jweak_tag(rdx);
302
294 __ movptr(rdx, Address(rdx, 0)); // *obj 303 __ movptr(rdx, Address(rdx, 0)); // *obj
295 __ shrptr(rax, 2); // offset 304 __ shrptr(rax, 2); // offset
296 305
297 assert(count < LIST_CAPACITY, "LIST_CAPACITY too small"); 306 assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
298 speculative_load_pclist[count] = __ pc(); 307 speculative_load_pclist[count] = __ pc();

mercurial