Skip to content
Permalink
Browse files
Automatic merge of master into foreign-memaccess+abi
  • Loading branch information
duke committed May 21, 2021
2 parents 18f0e47 + 3241dde commit 0e1678d5d0bbb3f0010b07f46eb8d6e5841ddb79
Showing 667 changed files with 11,857 additions and 8,806 deletions.
@@ -258,8 +258,6 @@ langtools_JTREG_PROBLEM_LIST += $(TOPDIR)/test/langtools/ProblemList.txt
hotspot_JTREG_PROBLEM_LIST += $(TOPDIR)/test/hotspot/jtreg/ProblemList.txt
lib-test_JTREG_PROBLEM_LIST += $(TOPDIR)/test/lib-test/ProblemList.txt

langtools_JTREG_MAX_MEM := 768m

################################################################################
# Parse test selection
#
@@ -722,7 +720,7 @@ define SetupRunJtregTestBody
# Convert JTREG_foo into $1_JTREG_foo with a suitable value.
$$(eval $$(call SetJtregValue,$1,JTREG_TEST_MODE,agentvm))
$$(eval $$(call SetJtregValue,$1,JTREG_ASSERT,true))
$$(eval $$(call SetJtregValue,$1,JTREG_MAX_MEM,512m))
$$(eval $$(call SetJtregValue,$1,JTREG_MAX_MEM,768m))
$$(eval $$(call SetJtregValue,$1,JTREG_NATIVEPATH))
$$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
$$(eval $$(call SetJtregValue,$1,JTREG_PROBLEM_LIST))
@@ -738,7 +736,7 @@ define SetupRunJtregTestBody

# Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since
# we may end up with a lot of JVM's
$1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $$(EXPR) 25 / $$($1_JTREG_JOBS))
$1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $(AWK) 'BEGIN { print 25 / $$($1_JTREG_JOBS); }')

JTREG_TIMEOUT_FACTOR ?= 4

@@ -62,12 +62,10 @@ endif
# Filter out jvmci specific modules if jvmci is disabled
ifeq ($(INCLUDE_JVMCI), false)
MODULES_FILTER += jdk.internal.vm.ci
MODULES_FILTER += jdk.internal.vm.compiler
MODULES_FILTER += jdk.internal.vm.compiler.management
endif

# Filter out Graal specific modules
MODULES_FILTER += jdk.internal.vm.compiler
MODULES_FILTER += jdk.internal.vm.compiler.management

# jpackage is only on windows, macosx, and linux
ifeq ($(call isTargetOs, windows macosx linux), false)
MODULES_FILTER += jdk.jpackage
@@ -61,6 +61,8 @@ BOOT_MODULES= \
# should carefully be considered if it should be upgradeable or not.
UPGRADEABLE_PLATFORM_MODULES= \
java.compiler \
jdk.internal.vm.compiler \
jdk.internal.vm.compiler.management \
#

PLATFORM_MODULES= \
@@ -132,6 +132,7 @@
import com.sun.tools.classfile.Module_attribute.RequiresEntry;
import com.sun.tools.classfile.NestHost_attribute;
import com.sun.tools.classfile.NestMembers_attribute;
import com.sun.tools.classfile.PermittedSubclasses_attribute;
import com.sun.tools.classfile.Record_attribute;
import com.sun.tools.classfile.Record_attribute.ComponentInfo;
import com.sun.tools.classfile.RuntimeAnnotations_attribute;
@@ -978,6 +979,16 @@ private void addAttributes(ClassHeaderDescription header,
attributes.put(Attribute.Record,
new Record_attribute(attributeString, recordComponents));
}
if (header.isSealed) {
int attributeString = addString(constantPool, Attribute.PermittedSubclasses);
int[] subclasses = new int[header.permittedSubclasses.size()];
int i = 0;
for (String intf : header.permittedSubclasses) {
subclasses[i++] = addClass(constantPool, intf);
}
attributes.put(Attribute.PermittedSubclasses,
new PermittedSubclasses_attribute(attributeString, subclasses));
}
addInnerClassesAttribute(header, constantPool, attributes);
}

@@ -2229,6 +2240,16 @@ private boolean readAttribute(ClassFile cf, FeatureDescription feature, Attribut
}
break;
}
case Attribute.PermittedSubclasses: {
assert feature instanceof ClassHeaderDescription;
PermittedSubclasses_attribute permittedSubclasses = (PermittedSubclasses_attribute) attr;
ClassHeaderDescription chd = (ClassHeaderDescription) feature;
chd.permittedSubclasses = Arrays.stream(permittedSubclasses.subtypes)
.mapToObj(i -> getClassName(cf, i))
.collect(Collectors.toList());
chd.isSealed = true;
break;
}
default:
throw new IllegalStateException("Unhandled attribute: " +
attrName);
@@ -3077,6 +3098,8 @@ public String packge() {
List<String> nestMembers;
boolean isRecord;
List<RecordComponentDescription> recordComponents;
boolean isSealed;
List<String> permittedSubclasses;

@Override
public int hashCode() {
@@ -3087,6 +3110,8 @@ public int hashCode() {
hash = 17 * hash + Objects.hashCode(this.nestMembers);
hash = 17 * hash + Objects.hashCode(this.isRecord);
hash = 17 * hash + Objects.hashCode(this.recordComponents);
hash = 17 * hash + Objects.hashCode(this.isSealed);
hash = 17 * hash + Objects.hashCode(this.permittedSubclasses);
return hash;
}

@@ -3117,6 +3142,12 @@ public boolean equals(Object obj) {
if (!listEquals(this.recordComponents, other.recordComponents)) {
return false;
}
if (this.isSealed != other.isSealed) {
return false;
}
if (!listEquals(this.permittedSubclasses, other.permittedSubclasses)) {
return false;
}
return true;
}

@@ -3137,6 +3168,9 @@ public void write(Appendable output, String baselineVersion, String version) thr
if (isRecord) {
output.append(" record true");
}
if (isSealed) {
output.append(" sealed true");
}
writeAttributes(output);
output.append("\n");
writeRecordComponents(output, baselineVersion, version);
@@ -3163,6 +3197,11 @@ public boolean read(LineBasedReader reader) throws IOException {
readRecordComponents(reader);
}
readInnerClasses(reader);
isSealed = reader.attributes.containsKey("permittedSubclasses");
if (isSealed) {
String subclassesList = reader.attributes.get("permittedSubclasses");
permittedSubclasses = deserializeList(subclassesList);
}

return true;
}
@@ -447,19 +447,13 @@ else
ifeq ($(call isTargetOs, linux macosx), true)
HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES
endif
ifeq ($(call isTargetOs, macosx), true)
HARFBUZZ_CFLAGS += -DHAVE_CORETEXT
endif

# Early re-canonizing has to be disabled to workaround an internal XlC compiler error
# when building libharfbuzz
ifeq ($(call isTargetOs, aix), true)
HARFBUZZ_CFLAGS += -qdebug=necan
endif

ifeq ($(call isTargetOs, macosx), false)
LIBFONTMANAGER_EXCLUDE_FILES += libharfbuzz/hb-coretext.cc
endif
# hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
LIBFONTMANAGER_EXCLUDE_FILES += libharfbuzz/hb-ft.cc

@@ -160,14 +160,20 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre
return call_RT(oop_result1, metadata_result, entry, 3);
}

enum return_state_t {
does_not_return, requires_return
};


// Implementation of StubFrame

class StubFrame: public StackObj {
private:
StubAssembler* _sasm;
bool _return_state;

public:
StubFrame(StubAssembler* sasm, const char* name, bool must_gc_arguments);
StubFrame(StubAssembler* sasm, const char* name, bool must_gc_arguments, return_state_t return_state=requires_return);
void load_argument(int offset_in_words, Register reg);

~StubFrame();
@@ -185,8 +191,9 @@ void StubAssembler::epilogue() {

#define __ _sasm->

StubFrame::StubFrame(StubAssembler* sasm, const char* name, bool must_gc_arguments) {
StubFrame::StubFrame(StubAssembler* sasm, const char* name, bool must_gc_arguments, return_state_t return_state) {
_sasm = sasm;
_return_state = return_state;
__ prologue(name, must_gc_arguments);
}

@@ -196,9 +203,12 @@ void StubFrame::load_argument(int offset_in_words, Register reg) {
__ load_parameter(offset_in_words, reg);
}


StubFrame::~StubFrame() {
__ epilogue();
if (_return_state == requires_return) {
__ epilogue();
} else {
__ should_not_reach_here();
}
}

#undef __
@@ -345,8 +355,6 @@ OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address targe
}
OopMapSet* oop_maps = new OopMapSet();
oop_maps->add_gc_map(call_offset, oop_map);

__ should_not_reach_here();
return oop_maps;
}

@@ -395,9 +403,7 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) {
sasm->set_frame_size(frame_size);
break;
}
default:
__ should_not_reach_here();
break;
default: ShouldNotReachHere();
}

// verify that only r0 and r3 are valid at this time
@@ -452,9 +458,6 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) {
restore_live_registers(sasm, id != handle_exception_nofpu_id);
break;
case handle_exception_from_callee_id:
// Pop the return address.
__ leave();
__ ret(lr); // jump to exception handler
break;
default: ShouldNotReachHere();
}
@@ -620,13 +623,13 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
break;

case throw_div0_exception_id:
{ StubFrame f(sasm, "throw_div0_exception", dont_gc_arguments);
{ StubFrame f(sasm, "throw_div0_exception", dont_gc_arguments, does_not_return);
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false);
}
break;

case throw_null_pointer_exception_id:
{ StubFrame f(sasm, "throw_null_pointer_exception", dont_gc_arguments);
{ StubFrame f(sasm, "throw_null_pointer_exception", dont_gc_arguments, does_not_return);
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false);
}
break;
@@ -881,13 +884,13 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
break;

case throw_class_cast_exception_id:
{ StubFrame f(sasm, "throw_class_cast_exception", dont_gc_arguments);
{ StubFrame f(sasm, "throw_class_cast_exception", dont_gc_arguments, does_not_return);
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true);
}
break;

case throw_incompatible_class_change_error_id:
{ StubFrame f(sasm, "throw_incompatible_class_cast_exception", dont_gc_arguments);
{ StubFrame f(sasm, "throw_incompatible_class_cast_exception", dont_gc_arguments, does_not_return);
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false);
}
break;
@@ -981,7 +984,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {

case deoptimize_id:
{
StubFrame f(sasm, "deoptimize", dont_gc_arguments);
StubFrame f(sasm, "deoptimize", dont_gc_arguments, does_not_return);
OopMap* oop_map = save_live_registers(sasm);
f.load_argument(0, c_rarg1);
int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize), c_rarg1);
@@ -997,7 +1000,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
break;

case throw_range_check_failed_id:
{ StubFrame f(sasm, "range_check_failed", dont_gc_arguments);
{ StubFrame f(sasm, "range_check_failed", dont_gc_arguments, does_not_return);
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), true);
}
break;
@@ -1011,28 +1014,28 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
break;

case access_field_patching_id:
{ StubFrame f(sasm, "access_field_patching", dont_gc_arguments);
{ StubFrame f(sasm, "access_field_patching", dont_gc_arguments, does_not_return);
// we should set up register map
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, access_field_patching));
}
break;

case load_klass_patching_id:
{ StubFrame f(sasm, "load_klass_patching", dont_gc_arguments);
{ StubFrame f(sasm, "load_klass_patching", dont_gc_arguments, does_not_return);
// we should set up register map
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching));
}
break;

case load_mirror_patching_id:
{ StubFrame f(sasm, "load_mirror_patching", dont_gc_arguments);
{ StubFrame f(sasm, "load_mirror_patching", dont_gc_arguments, does_not_return);
// we should set up register map
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching));
}
break;

case load_appendix_patching_id:
{ StubFrame f(sasm, "load_appendix_patching", dont_gc_arguments);
{ StubFrame f(sasm, "load_appendix_patching", dont_gc_arguments, does_not_return);
// we should set up register map
oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_appendix_patching));
}
@@ -1052,13 +1055,13 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
break;

case throw_index_exception_id:
{ StubFrame f(sasm, "index_range_check_failed", dont_gc_arguments);
{ StubFrame f(sasm, "index_range_check_failed", dont_gc_arguments, does_not_return);
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true);
}
break;

case throw_array_store_exception_id:
{ StubFrame f(sasm, "throw_array_store_exception", dont_gc_arguments);
{ StubFrame f(sasm, "throw_array_store_exception", dont_gc_arguments, does_not_return);
// tos + 0: link
// + 1: return address
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_array_store_exception), true);
@@ -1067,7 +1070,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {

case predicate_failed_trap_id:
{
StubFrame f(sasm, "predicate_failed_trap", dont_gc_arguments);
StubFrame f(sasm, "predicate_failed_trap", dont_gc_arguments, does_not_return);

OopMap* map = save_live_registers(sasm);

@@ -1095,10 +1098,9 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
break;

default:
{ StubFrame f(sasm, "unimplemented entry", dont_gc_arguments);
{ StubFrame f(sasm, "unimplemented entry", dont_gc_arguments, does_not_return);
__ mov(r0, (int)id);
__ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), r0);
__ should_not_reach_here();
}
break;
}
@@ -254,7 +254,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,

__ bind(runtime);
// save the live input values
RegSet saved = RegSet::of(store_addr, new_val);
RegSet saved = RegSet::of(store_addr);
__ push(saved, sp);
__ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), card_addr, thread);
__ pop(saved, sp);
@@ -678,6 +678,11 @@ void MacroAssembler::call_VM_base(Register oop_result,
// do the call, remove parameters
MacroAssembler::call_VM_leaf_base(entry_point, number_of_arguments, &l);

// lr could be poisoned with PAC signature during throw_pending_exception
// if it was tail-call optimized by compiler, since lr is not callee-saved
// reload it with proper value
adr(lr, l);

// reset last Java frame
// Only interpreter should have to clear fp
reset_last_Java_frame(true);
@@ -139,7 +139,7 @@
// true means we have fast l2f convers
// false means that conversion is done by runtime call
static constexpr bool convL2FSupported(void) {
return true;
return false;
}

#endif // CPU_ARM_MATCHER_ARM_HPP

0 comments on commit 0e1678d

Please sign in to comment.