comparison src/cpu/x86/vm/templateInterpreter_x86_32.cpp @ 8974:32bc598624bd

8176100: [REDO][REDO] G1 Needs pre barrier on dereference of weak JNI handles Summary: Add tag bit to all JNI weak handles Reviewed-by: kbarrett, coleenp, tschatzl
author phh
date Tue, 07 May 2019 20:38:26 +0000
parents f04097176542
children
comparison
equal deleted inserted replaced
53:b61a93db2305 54:c6a3a178dbe8
1 /* 1 /*
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 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.
1294 // reset handle block 1294 // reset handle block
1295 __ movptr(t, Address(thread, JavaThread::active_handles_offset())); 1295 __ movptr(t, Address(thread, JavaThread::active_handles_offset()));
1296 __ movl(Address(t, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD); 1296 __ movl(Address(t, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD);
1297 1297
1298 // If result was an oop then unbox and save it in the frame 1298 // If result was an oop then unbox and save it in the frame
1299 { Label L; 1299 {
1300 Label no_oop, store_result; 1300 Label no_oop;
1301 ExternalAddress handler(AbstractInterpreter::result_handler(T_OBJECT)); 1301 ExternalAddress handler(AbstractInterpreter::result_handler(T_OBJECT));
1302 __ cmpptr(Address(rbp, frame::interpreter_frame_result_handler_offset*wordSize), 1302 __ cmpptr(Address(rbp, frame::interpreter_frame_result_handler_offset*wordSize),
1303 handler.addr()); 1303 handler.addr());
1304 __ jcc(Assembler::notEqual, no_oop); 1304 __ jcc(Assembler::notEqual, no_oop);
1305 __ cmpptr(Address(rsp, 0), (int32_t)NULL_WORD); 1305 __ cmpptr(Address(rsp, 0), (int32_t)NULL_WORD);
1306 __ pop(ltos); 1306 __ pop(ltos);
1307 __ testptr(rax, rax); 1307 // Unbox oop result, e.g. JNIHandles::resolve value.
1308 __ jcc(Assembler::zero, store_result); 1308 __ resolve_jobject(rax /* value */,
1309 // unbox 1309 thread /* thread */,
1310 __ movptr(rax, Address(rax, 0)); 1310 t /* tmp */);
1311 __ bind(store_result);
1312 __ movptr(Address(rbp, (frame::interpreter_frame_oop_temp_offset)*wordSize), rax); 1311 __ movptr(Address(rbp, (frame::interpreter_frame_oop_temp_offset)*wordSize), rax);
1313 // keep stack depth as expected by pushing oop which will eventually be discarded 1312 // keep stack depth as expected by pushing oop which will eventually be discarded
1314 __ push(ltos); 1313 __ push(ltos);
1315 __ bind(no_oop); 1314 __ bind(no_oop);
1316 } 1315 }