Skip to content

Commit

Permalink
Merge pull request #19 from SAP/pr-jdk-10+40
Browse files Browse the repository at this point in the history
Merge to jdk-10+40
  • Loading branch information
axel7born authored Jan 25, 2018
2 parents 6576c39 + 20bb80c commit a185f96
Show file tree
Hide file tree
Showing 360 changed files with 5,763 additions and 2,877 deletions.
1 change: 1 addition & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -463,3 +463,4 @@ d8c634b016c628622c9abbdc6bf50509e5dedbec jdk-10+35
cb54a299aa91419cb7caef3992592e7b22488163 jdk-10+36
4f830b447edf04fb4a52151a5ad44d9bb60723cd jdk-10+37
e569e83139fdfbecfeb3cd9014d560917787f158 jdk-10+38
5b834ec962366e00d4445352a999a3ac14e26f64 jdk-10+39
8 changes: 4 additions & 4 deletions make/data/currency/CurrencyData.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ formatVersion=3
# Version of the currency code information in this class.
# It is a serial number that accompanies with each amendment.

dataVersion=162
dataVersion=164

# List of all valid ISO 4217 currency codes.
# To ensure compatibility, do not remove codes.
Expand All @@ -52,7 +52,7 @@ all=ADP020-AED784-AFA004-AFN971-ALL008-AMD051-ANG532-AOA973-ARS032-ATS040-AUD036
NIO558-NLG528-NOK578-NPR524-NZD554-OMR512-PAB590-PEN604-PGK598-PHP608-\
PKR586-PLN985-PTE620-PYG600-QAR634-ROL946-RON946-RSD941-RUB643-RUR810-RWF646-SAR682-\
SBD090-SCR690-SDD736-SDG938-SEK752-SGD702-SHP654-SIT705-SKK703-SLL694-SOS706-\
SRD968-SRG740-SSP728-STD678-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TMT934-TND788-TOP776-\
SRD968-SRG740-SSP728-STD678-STN930-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TMT934-TND788-TOP776-\
TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-UYI940-\
UYU858-UZS860-VEB862-VEF937-VND704-VUV548-WST882-XAF950-XAG961-XAU959-XBA955-\
XBB956-XBC957-XBD958-XCD951-XDR960-XFO000-XFU000-XOF952-XPD964-XPF953-\
Expand Down Expand Up @@ -196,7 +196,7 @@ CU=CUP
CW=ANG
# CYPRUS
CY=EUR
# CZECH REPUBLIC (THE)
# CZECHIA
CZ=CZK
# DENMARK
DK=DKK
Expand Down Expand Up @@ -470,7 +470,7 @@ SM=EUR
# SOUTH SUDAN
SS=SSP
# SAO TOME AND PRINCIPE
ST=STD
ST=STN
# SAUDI ARABIA
SA=SAR
# SENEGAL
Expand Down
3 changes: 2 additions & 1 deletion make/mapfiles/libjava/mapfile-vers
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -74,6 +74,7 @@ SUNWprivate_1.1 {
JNU_ThrowStringIndexOutOfBoundsException;
JNU_ToString;

Java_java_io_FileDescriptor_cleanupClose0;
Java_java_io_FileDescriptor_close0;
Java_java_io_FileDescriptor_initIDs;
Java_java_io_FileDescriptor_sync;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
__ load_klass(rscratch1, receiver);
__ ldr(tmp, Address(holder, CompiledICHolder::holder_klass_offset()));
__ cmp(rscratch1, tmp);
__ ldr(rmethod, Address(holder, CompiledICHolder::holder_method_offset()));
__ ldr(rmethod, Address(holder, CompiledICHolder::holder_metadata_offset()));
__ br(Assembler::EQ, ok);
__ far_jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub()));

Expand Down
78 changes: 47 additions & 31 deletions src/hotspot/cpu/arm/macroAssembler_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2475,49 +2475,65 @@ void MacroAssembler::store_sized_value(Register src, Address dst, size_t size_in
// On success, the result will be in method_result, and execution falls through.
// On failure, execution transfers to the given label.
void MacroAssembler::lookup_interface_method(Register Rklass,
Register Rinterf,
Register Rindex,
Register Rintf,
RegisterOrConstant itable_index,
Register method_result,
Register temp_reg1,
Register temp_reg2,
Register Rscan,
Register Rtmp,
Label& L_no_such_interface) {

assert_different_registers(Rklass, Rinterf, temp_reg1, temp_reg2, Rindex);
assert_different_registers(Rklass, Rintf, Rscan, Rtmp);

Register Ritable = temp_reg1;
const int entry_size = itableOffsetEntry::size() * HeapWordSize;
assert(itableOffsetEntry::interface_offset_in_bytes() == 0, "not added for convenience");

// Compute start of first itableOffsetEntry (which is at the end of the vtable)
const int base = in_bytes(Klass::vtable_start_offset());
const int scale = exact_log2(vtableEntry::size_in_bytes());
ldr_s32(temp_reg2, Address(Rklass, Klass::vtable_length_offset())); // Get length of vtable
add(Ritable, Rklass, base);
add(Ritable, Ritable, AsmOperand(temp_reg2, lsl, scale));
ldr_s32(Rtmp, Address(Rklass, Klass::vtable_length_offset())); // Get length of vtable
add(Rscan, Rklass, base);
add(Rscan, Rscan, AsmOperand(Rtmp, lsl, scale));

Label entry, search;
// Search through the itable for an interface equal to incoming Rintf
// itable looks like [intface][offset][intface][offset][intface][offset]

b(entry);

bind(search);
add(Ritable, Ritable, itableOffsetEntry::size() * HeapWordSize);

bind(entry);

// Check that the entry is non-null. A null entry means that the receiver
// class doesn't implement the interface, and wasn't the same as the
// receiver class checked when the interface was resolved.

ldr(temp_reg2, Address(Ritable, itableOffsetEntry::interface_offset_in_bytes()));
cbz(temp_reg2, L_no_such_interface);

cmp(Rinterf, temp_reg2);
b(search, ne);
Label loop;
bind(loop);
ldr(Rtmp, Address(Rscan, entry_size, post_indexed));
#ifdef AARCH64
Label found;
cmp(Rtmp, Rintf);
b(found, eq);
cbnz(Rtmp, loop);
#else
cmp(Rtmp, Rintf); // set ZF and CF if interface is found
cmn(Rtmp, 0, ne); // check if tmp == 0 and clear CF if it is
b(loop, ne);
#endif // AARCH64

ldr_s32(temp_reg2, Address(Ritable, itableOffsetEntry::offset_offset_in_bytes()));
add(temp_reg2, temp_reg2, Rklass); // Add offset to Klass*
assert(itableMethodEntry::size() * HeapWordSize == wordSize, "adjust the scaling in the code below");
assert(itableMethodEntry::method_offset_in_bytes() == 0, "adjust the offset in the code below");
#ifdef AARCH64
b(L_no_such_interface);
bind(found);
#else
// CF == 0 means we reached the end of itable without finding icklass
b(L_no_such_interface, cc);
#endif // !AARCH64

ldr(method_result, Address::indexed_ptr(temp_reg2, Rindex));
if (method_result != noreg) {
// Interface found at previous position of Rscan, now load the method
ldr_s32(Rtmp, Address(Rscan, itableOffsetEntry::offset_offset_in_bytes() - entry_size));
if (itable_index.is_register()) {
add(Rtmp, Rtmp, Rklass); // Add offset to Klass*
assert(itableMethodEntry::size() * HeapWordSize == wordSize, "adjust the scaling in the code below");
assert(itableMethodEntry::method_offset_in_bytes() == 0, "adjust the offset in the code below");
ldr(method_result, Address::indexed_ptr(Rtmp, itable_index.as_register()));
} else {
int method_offset = itableMethodEntry::size() * HeapWordSize * itable_index.as_constant() +
itableMethodEntry::method_offset_in_bytes();
add_slow(method_result, Rklass, method_offset);
ldr(method_result, Address(method_result, Rtmp));
}
}
}

#ifdef COMPILER2
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/arm/macroAssembler_arm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ class MacroAssembler: public Assembler {

void lookup_interface_method(Register recv_klass,
Register intf_klass,
Register itable_index,
RegisterOrConstant itable_index,
Register method_result,
Register temp_reg1,
Register temp_reg2,
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/arm/sharedRuntime_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm

__ load_klass(receiver_klass, receiver);
__ ldr(holder_klass, Address(Ricklass, CompiledICHolder::holder_klass_offset()));
__ ldr(Rmethod, Address(Ricklass, CompiledICHolder::holder_method_offset()));
__ ldr(Rmethod, Address(Ricklass, CompiledICHolder::holder_metadata_offset()));
__ cmp(receiver_klass, holder_klass);

#ifdef AARCH64
Expand Down
70 changes: 30 additions & 40 deletions src/hotspot/cpu/arm/templateTable_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4198,7 +4198,7 @@ void TemplateTable::invokeinterface(int byte_no) {
const Register Rflags = R3_tmp;
const Register Rklass = R3_tmp;

prepare_invoke(byte_no, Rinterf, Rindex, Rrecv, Rflags);
prepare_invoke(byte_no, Rinterf, Rmethod, Rrecv, Rflags);

// Special case of invokeinterface called for virtual method of
// java.lang.Object. See cpCacheOop.cpp for details.
Expand All @@ -4207,56 +4207,39 @@ void TemplateTable::invokeinterface(int byte_no) {
Label notMethod;
__ tbz(Rflags, ConstantPoolCacheEntry::is_forced_virtual_shift, notMethod);

__ mov(Rmethod, Rindex);
invokevirtual_helper(Rmethod, Rrecv, Rflags);
__ bind(notMethod);

// Get receiver klass into Rklass - also a null check
__ load_klass(Rklass, Rrecv);

// profile this call
__ profile_virtual_call(R0_tmp, Rklass);

// Compute start of first itableOffsetEntry (which is at the end of the vtable)
const int base = in_bytes(Klass::vtable_start_offset());
assert(vtableEntry::size() == 1, "adjust the scaling in the code below");
__ ldr_s32(Rtemp, Address(Rklass, Klass::vtable_length_offset())); // Get length of vtable
__ add(Ritable, Rklass, base);
__ add(Ritable, Ritable, AsmOperand(Rtemp, lsl, LogBytesPerWord));

Label entry, search, interface_ok;
Label no_such_interface;

__ b(entry);

__ bind(search);
__ add(Ritable, Ritable, itableOffsetEntry::size() * HeapWordSize);

__ bind(entry);
// Receiver subtype check against REFC.
__ lookup_interface_method(// inputs: rec. class, interface
Rklass, Rinterf, noreg,
// outputs: scan temp. reg1, scan temp. reg2
noreg, Ritable, Rtemp,
no_such_interface);

// Check that the entry is non-null. A null entry means that the receiver
// class doesn't implement the interface, and wasn't the same as the
// receiver class checked when the interface was resolved.

__ ldr(Rtemp, Address(Ritable, itableOffsetEntry::interface_offset_in_bytes()));
__ cbnz(Rtemp, interface_ok);

// throw exception
__ call_VM(noreg, CAST_FROM_FN_PTR(address,
InterpreterRuntime::throw_IncompatibleClassChangeError));

// the call_VM checks for exception, so we should never return here.
__ should_not_reach_here();

__ bind(interface_ok);
// profile this call
__ profile_virtual_call(R0_tmp, Rklass);

__ cmp(Rinterf, Rtemp);
__ b(search, ne);
// Get declaring interface class from method
__ ldr(Rtemp, Address(Rmethod, Method::const_offset()));
__ ldr(Rtemp, Address(Rtemp, ConstMethod::constants_offset()));
__ ldr(Rinterf, Address(Rtemp, ConstantPool::pool_holder_offset_in_bytes()));

__ ldr_s32(Rtemp, Address(Ritable, itableOffsetEntry::offset_offset_in_bytes()));
__ add(Rtemp, Rtemp, Rklass); // Add offset to Klass*
assert(itableMethodEntry::size() == 1, "adjust the scaling in the code below");
// Get itable index from method
__ ldr_s32(Rtemp, Address(Rmethod, Method::itable_index_offset()));
__ add(Rtemp, Rtemp, (-Method::itable_index_max)); // small negative constant is too large for an immediate on arm32
__ neg(Rindex, Rtemp);

__ ldr(Rmethod, Address::indexed_ptr(Rtemp, Rindex));
__ lookup_interface_method(// inputs: rec. class, interface
Rklass, Rinterf, Rindex,
// outputs: scan temp. reg1, scan temp. reg2
Rmethod, Ritable, Rtemp,
no_such_interface);

// Rmethod: Method* to call

Expand All @@ -4278,6 +4261,13 @@ void TemplateTable::invokeinterface(int byte_no) {

// do the call
__ jump_from_interpreted(Rmethod);

// throw exception
__ bind(no_such_interface);
__ restore_method();
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_IncompatibleClassChangeError));
// the call_VM checks for exception, so we should never return here.
__ should_not_reach_here();
}

void TemplateTable::invokehandle(int byte_no) {
Expand Down
70 changes: 26 additions & 44 deletions src/hotspot/cpu/arm/vtableStubs_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "code/vtableStubs.hpp"
#include "interp_masm_arm.hpp"
#include "memory/resourceArea.hpp"
#include "oops/compiledICHolder.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/klassVtable.hpp"
#include "runtime/sharedRuntime.hpp"
Expand Down Expand Up @@ -118,67 +119,48 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {

// R0-R3 / R0-R7 registers hold the arguments and cannot be spoiled
const Register Rclass = AARCH64_ONLY(R9) NOT_AARCH64(R4);
const Register Rlength = AARCH64_ONLY(R10) NOT_AARCH64(R5);
const Register Rintf = AARCH64_ONLY(R10) NOT_AARCH64(R5);
const Register Rscan = AARCH64_ONLY(R11) NOT_AARCH64(R6);
const Register tmp = Rtemp;

assert_different_registers(Ricklass, Rclass, Rlength, Rscan, tmp);
assert_different_registers(Ricklass, Rclass, Rintf, Rscan, Rtemp);

// Calculate the start of itable (itable goes after vtable)
const int scale = exact_log2(vtableEntry::size_in_bytes());
address npe_addr = __ pc();
__ load_klass(Rclass, R0);
__ ldr_s32(Rlength, Address(Rclass, Klass::vtable_length_offset()));

__ add(Rscan, Rclass, in_bytes(Klass::vtable_start_offset()));
__ add(Rscan, Rscan, AsmOperand(Rlength, lsl, scale));
Label L_no_such_interface;

// Search through the itable for an interface equal to incoming Ricklass
// itable looks like [intface][offset][intface][offset][intface][offset]
const int entry_size = itableOffsetEntry::size() * HeapWordSize;
assert(itableOffsetEntry::interface_offset_in_bytes() == 0, "not added for convenience");
// Receiver subtype check against REFC.
__ ldr(Rintf, Address(Ricklass, CompiledICHolder::holder_klass_offset()));
__ lookup_interface_method(// inputs: rec. class, interface, itable index
Rclass, Rintf, noreg,
// outputs: temp reg1, temp reg2
noreg, Rscan, Rtemp,
L_no_such_interface);

Label loop;
__ bind(loop);
__ ldr(tmp, Address(Rscan, entry_size, post_indexed));
#ifdef AARCH64
Label found;
__ cmp(tmp, Ricklass);
__ b(found, eq);
__ cbnz(tmp, loop);
#else
__ cmp(tmp, Ricklass); // set ZF and CF if interface is found
__ cmn(tmp, 0, ne); // check if tmp == 0 and clear CF if it is
__ b(loop, ne);
#endif // AARCH64

assert(StubRoutines::throw_IncompatibleClassChangeError_entry() != NULL, "Check initialization order");
#ifdef AARCH64
__ jump(StubRoutines::throw_IncompatibleClassChangeError_entry(), relocInfo::runtime_call_type, tmp);
__ bind(found);
#else
// CF == 0 means we reached the end of itable without finding icklass
__ jump(StubRoutines::throw_IncompatibleClassChangeError_entry(), relocInfo::runtime_call_type, noreg, cc);
#endif // !AARCH64

// Interface found at previous position of Rscan, now load the method oop
__ ldr_s32(tmp, Address(Rscan, itableOffsetEntry::offset_offset_in_bytes() - entry_size));
{
const int method_offset = itableMethodEntry::size() * HeapWordSize * itable_index +
itableMethodEntry::method_offset_in_bytes();
__ add_slow(Rmethod, Rclass, method_offset);
}
__ ldr(Rmethod, Address(Rmethod, tmp));
// Get Method* and entry point for compiler
__ ldr(Rintf, Address(Ricklass, CompiledICHolder::holder_metadata_offset()));
__ lookup_interface_method(// inputs: rec. class, interface, itable index
Rclass, Rintf, itable_index,
// outputs: temp reg1, temp reg2, temp reg3
Rmethod, Rscan, Rtemp,
L_no_such_interface);

address ame_addr = __ pc();

#ifdef AARCH64
__ ldr(tmp, Address(Rmethod, Method::from_compiled_offset()));
__ br(tmp);
__ ldr(Rtemp, Address(Rmethod, Method::from_compiled_offset()));
__ br(Rtemp);
#else
__ ldr(PC, Address(Rmethod, Method::from_compiled_offset()));
#endif // AARCH64

__ bind(L_no_such_interface);

assert(StubRoutines::throw_IncompatibleClassChangeError_entry() != NULL, "check initialization order");
__ jump(StubRoutines::throw_IncompatibleClassChangeError_entry(), relocInfo::runtime_call_type, Rtemp);

masm->flush();

if (PrintMiscellaneous && (WizardMode || Verbose)) {
Expand All @@ -205,7 +187,7 @@ int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
instr_count = NOT_AARCH64(4) AARCH64_ONLY(5);
} else {
// itable stub size
instr_count = NOT_AARCH64(20) AARCH64_ONLY(20);
instr_count = NOT_AARCH64(31) AARCH64_ONLY(31);
}

#ifdef AARCH64
Expand Down
Loading

0 comments on commit a185f96

Please sign in to comment.