# HG changeset patch # User coleenp # Date 1531834644 14400 # Node ID d379f06962cf57426f355591cad137f11350109c # Parent 0a018efec082667a6354b791b4cdf7f8c4cc1bd9# Parent f0193a4828ef0fcc9be106082e65bd70365e618c Merge diff -r 0a018efec082 -r d379f06962cf src/hotspot/share/aot/aotCodeHeap.cpp --- a/src/hotspot/share/aot/aotCodeHeap.cpp Tue Jul 10 11:13:33 2018 -0400 +++ b/src/hotspot/share/aot/aotCodeHeap.cpp Tue Jul 17 09:37:24 2018 -0400 @@ -450,6 +450,7 @@ SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_object_notify", address, JVMCIRuntime::object_notify); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_object_notifyAll", address, JVMCIRuntime::object_notifyAll); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_OSR_migration_end", address, SharedRuntime::OSR_migration_end); + SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_enable_stack_reserved_zone", address, SharedRuntime::enable_stack_reserved_zone); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_resolve_dynamic_invoke", address, CompilerRuntime::resolve_dynamic_invoke); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_resolve_string_by_symbol", address, CompilerRuntime::resolve_string_by_symbol); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_resolve_klass_by_symbol", address, CompilerRuntime::resolve_klass_by_symbol); diff -r 0a018efec082 -r d379f06962cf src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java --- a/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java Tue Jul 17 09:37:24 2018 -0400 @@ -25,9 +25,14 @@ package sun.nio.fs; -import java.nio.file.attribute.*; -import java.util.*; import java.io.IOException; +import java.nio.file.attribute.DosFileAttributeView; +import java.nio.file.attribute.FileAttributeView; +import java.nio.file.attribute.PosixFileAttributeView; +import java.nio.file.attribute.UserDefinedFileAttributeView; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Pattern; /** * Linux implementation of FileStore @@ -121,6 +126,18 @@ return false; } + // get kernel version as a three element array {major, minor, micro} + private static int[] getKernelVersion() { + Pattern pattern = Pattern.compile("\\D+"); + String[] matches = pattern.split(System.getProperty("os.version")); + int[] majorMinorMicro = new int[3]; + int length = Math.min(matches.length, majorMinorMicro.length); + for (int i = 0; i < length; i++) { + majorMinorMicro[i] = Integer.valueOf(matches[i]); + } + return majorMinorMicro; + } + @Override public boolean supportsFileAttributeView(Class type) { // support DosFileAttributeView and UserDefinedAttributeView if extended @@ -140,11 +157,31 @@ if ((entry().hasOption("user_xattr"))) return true; - // for ext3 and ext4 user_xattr option is enabled by default so - // check for explicit disabling of this option - if (entry().fstype().equals("ext3") || - entry().fstype().equals("ext4")) { - return !entry().hasOption("nouser_xattr"); + // check for explicit disabling of extended attributes + if (entry().hasOption("nouser_xattr")) { + return false; + } + + // user_{no}xattr options not present but we special-case ext3 as + // we know that extended attributes are not enabled by default. + if (entry().fstype().equals("ext3")) { + return false; + } + + // user_xattr option not present but we special-case ext4 as we + // know that extended attributes are enabled by default for + // kernel version >= 2.6.39 + if (entry().fstype().equals("ext4")) { + if (!xattrChecked) { + // check kernel version + int[] kernelVersion = getKernelVersion(); + xattrEnabled = kernelVersion[0] > 2 || + (kernelVersion[0] == 2 && kernelVersion[1] > 6) || + (kernelVersion[0] == 2 && kernelVersion[1] == 6 && + kernelVersion[2] >= 39); + xattrChecked = true; + } + return xattrEnabled; } // not ext3/4 so probe mount point diff -r 0a018efec082 -r d379f06962cf src/java.net.http/share/classes/java/net/http/HttpResponse.java --- a/src/java.net.http/share/classes/java/net/http/HttpResponse.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/java.net.http/share/classes/java/net/http/HttpResponse.java Tue Jul 17 09:37:24 2018 -0400 @@ -1188,7 +1188,7 @@ /** * Returns a response subscriber which publishes the response body - * through a {@link Publisher Publisher>}. + * through a {@code Publisher>}. * *

The {@link HttpResponse} using this subscriber is available * immediately after the response headers have been read, without diff -r 0a018efec082 -r d379f06962cf src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java --- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java Tue Jul 17 09:37:24 2018 -0400 @@ -146,6 +146,7 @@ {"SharedRuntime::exception_handler_for_return_address", "_aot_exception_handler_for_return_address"}, {"SharedRuntime::register_finalizer", "_aot_register_finalizer"}, {"SharedRuntime::OSR_migration_end", "_aot_OSR_migration_end"}, + {"SharedRuntime::enable_stack_reserved_zone", "_aot_enable_stack_reserved_zone"}, {"CompilerRuntime::resolve_dynamic_invoke", "_aot_resolve_dynamic_invoke"}, {"CompilerRuntime::resolve_string_by_symbol", "_aot_resolve_string_by_symbol"}, {"CompilerRuntime::resolve_klass_by_symbol", "_aot_resolve_klass_by_symbol"}, diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -110,7 +110,7 @@ @Override public LIRGenerationResult newLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, StructuredGraph graph, Object stub) { - return new HotSpotLIRGenerationResult(compilationId, lir, frameMapBuilder, makeCallingConvention(graph, (Stub) stub), stub); + return new HotSpotLIRGenerationResult(compilationId, lir, frameMapBuilder, makeCallingConvention(graph, (Stub) stub), stub, config.requiresReservedStackCheck(graph.getMethods())); } @Override diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -46,7 +46,7 @@ @Override public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) { - leaveFrame(crb, masm, /* emitSafepoint */false); + leaveFrame(crb, masm, /* emitSafepoint */false, false); AArch64Call.directJmp(crb, masm, crb.foreignCalls.lookupForeignCall(UNCOMMON_TRAP_HANDLER)); } } diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,14 +24,29 @@ package org.graalvm.compiler.hotspot.aarch64; +import static jdk.vm.ci.aarch64.AArch64.lr; +import static jdk.vm.ci.aarch64.AArch64.sp; +import static jdk.vm.ci.aarch64.AArch64.zr; +import static jdk.vm.ci.hotspot.aarch64.AArch64HotSpotRegisterConfig.fp; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.ENABLE_STACK_RESERVED_ZONE; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.THROW_DELAYED_STACKOVERFLOW_ERROR; + +import org.graalvm.compiler.asm.Label; +import org.graalvm.compiler.asm.aarch64.AArch64Address; +import org.graalvm.compiler.asm.aarch64.AArch64Assembler; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler.ScratchRegister; +import org.graalvm.compiler.core.common.spi.ForeignCallLinkage; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.graalvm.compiler.hotspot.meta.HotSpotForeignCallsProvider; import org.graalvm.compiler.lir.LIRInstructionClass; import org.graalvm.compiler.lir.aarch64.AArch64BlockEndOp; +import org.graalvm.compiler.lir.aarch64.AArch64Call; import org.graalvm.compiler.lir.asm.CompilationResultBuilder; +import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.RegisterValue; /** * Superclass for operations that leave a method's frame. @@ -53,9 +68,31 @@ this.thread = null; // no safepoint } - protected void leaveFrame(CompilationResultBuilder crb, AArch64MacroAssembler masm, boolean emitSafepoint) { + protected void leaveFrame(CompilationResultBuilder crb, AArch64MacroAssembler masm, boolean emitSafepoint, boolean requiresReservedStackAccessCheck) { assert crb.frameContext != null : "We never elide frames in aarch64"; crb.frameContext.leave(crb); + if (requiresReservedStackAccessCheck) { + HotSpotForeignCallsProvider foreignCalls = (HotSpotForeignCallsProvider) crb.foreignCalls; + Label noReserved = new Label(); + try (ScratchRegister sc = masm.getScratchRegister()) { + Register scratch = sc.getRegister(); + masm.ldr(64, scratch, masm.makeAddress(thread, config.javaThreadReservedStackActivationOffset, 8)); + masm.subs(64, zr, sp, scratch); + } + masm.branchConditionally(AArch64Assembler.ConditionFlag.LO, noReserved); + ForeignCallLinkage enableStackReservedZone = foreignCalls.lookupForeignCall(ENABLE_STACK_RESERVED_ZONE); + CallingConvention cc = enableStackReservedZone.getOutgoingCallingConvention(); + assert cc.getArgumentCount() == 1; + Register arg0 = ((RegisterValue) cc.getArgument(0)).getRegister(); + masm.mov(64, arg0, thread); + try (ScratchRegister sc = masm.getScratchRegister()) { + masm.stp(64, fp, lr, AArch64Address.createPreIndexedImmediateAddress(sp, -2)); + AArch64Call.directCall(crb, masm, enableStackReservedZone, sc.getRegister(), null); + masm.ldp(64, fp, lr, AArch64Address.createPostIndexedImmediateAddress(sp, 2)); + } + AArch64Call.directJmp(crb, masm, foreignCalls.lookupForeignCall(THROW_DELAYED_STACKOVERFLOW_ERROR)); + masm.bind(noReserved); + } if (emitSafepoint) { try (ScratchRegister sc = masm.getScratchRegister()) { Register scratch = sc.getRegister(); diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,10 +24,10 @@ package org.graalvm.compiler.hotspot.aarch64; -import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; import static jdk.vm.ci.aarch64.AArch64.sp; import static jdk.vm.ci.code.ValueUtil.asRegister; import static jdk.vm.ci.hotspot.aarch64.AArch64HotSpotRegisterConfig.fp; +import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; import org.graalvm.compiler.asm.Label; import org.graalvm.compiler.asm.aarch64.AArch64Address; @@ -69,7 +69,7 @@ @Override public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) { - leaveFrame(crb, masm, /* emitSafepoint */false); + leaveFrame(crb, masm, /* emitSafepoint */false, false); if (GraalServices.JAVA_SPECIFICATION_VERSION < 8) { // Restore sp from fp if the exception PC is a method handle call site. diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,19 +28,18 @@ import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; import static org.graalvm.compiler.hotspot.HotSpotBackend.INITIALIZE_KLASS_BY_SYMBOL; +import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_DYNAMIC_INVOKE; import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_KLASS_BY_SYMBOL; import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_METHOD_BY_SYMBOL_AND_LOAD_COUNTERS; import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_STRING_BY_SYMBOL; -import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_DYNAMIC_INVOKE; -import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.RESOLVE; import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.INITIALIZE; import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.LOAD_COUNTERS; +import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.RESOLVE; import static org.graalvm.compiler.lir.LIRValueUtil.asConstant; import static org.graalvm.compiler.lir.LIRValueUtil.isConstantValue; import java.util.function.Function; -import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant; import org.graalvm.compiler.asm.Label; import org.graalvm.compiler.asm.aarch64.AArch64Address.AddressingMode; import org.graalvm.compiler.asm.aarch64.AArch64Assembler.ConditionFlag; @@ -81,10 +80,10 @@ import org.graalvm.compiler.lir.aarch64.AArch64Move; import org.graalvm.compiler.lir.aarch64.AArch64Move.StoreOp; import org.graalvm.compiler.lir.aarch64.AArch64PrefetchOp; +import org.graalvm.compiler.lir.aarch64.AArch64RestoreRegistersOp; import org.graalvm.compiler.lir.aarch64.AArch64SaveRegistersOp; -import org.graalvm.compiler.lir.aarch64.AArch64RestoreRegistersOp; - import org.graalvm.compiler.lir.gen.LIRGenerationResult; +import org.graalvm.compiler.options.OptionValues; import jdk.vm.ci.aarch64.AArch64; import jdk.vm.ci.aarch64.AArch64Kind; @@ -93,6 +92,7 @@ import jdk.vm.ci.code.RegisterValue; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.hotspot.HotSpotCompressedNullConstant; +import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant; import jdk.vm.ci.hotspot.HotSpotObjectConstant; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Constant; @@ -103,7 +103,6 @@ import jdk.vm.ci.meta.PlatformKind; import jdk.vm.ci.meta.SpeculationLog; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.options.OptionValues; /** * LIR generator specialized for AArch64 HotSpot. @@ -502,7 +501,7 @@ emitMove(operand, input); } Register thread = getProviders().getRegisters().getThreadRegister(); - append(new AArch64HotSpotReturnOp(operand, getStub() != null, config, thread)); + append(new AArch64HotSpotReturnOp(operand, getStub() != null, config, thread, getResult().requiresReservedStackAccessCheck())); } @Override diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,10 +24,10 @@ package org.graalvm.compiler.hotspot.aarch64; +import static jdk.vm.ci.aarch64.AArch64.lr; +import static jdk.vm.ci.code.ValueUtil.asRegister; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; -import static jdk.vm.ci.aarch64.AArch64.lr; -import static jdk.vm.ci.code.ValueUtil.asRegister; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; @@ -48,9 +48,11 @@ @Use({REG, ILLEGAL}) private Value result; private final boolean isStub; + private final boolean requiresReservedStackAccessCheck; - public AArch64HotSpotReturnOp(Value result, boolean isStub, GraalHotSpotVMConfig config, Register thread) { + public AArch64HotSpotReturnOp(Value result, boolean isStub, GraalHotSpotVMConfig config, Register thread, boolean requiresReservedStackAccessCheck) { super(TYPE, config, thread); + this.requiresReservedStackAccessCheck = requiresReservedStackAccessCheck; assert validReturnValue(result); this.result = result; this.isStub = isStub; @@ -66,7 +68,7 @@ @Override public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) { final boolean emitSafepoint = !isStub; - leaveFrame(crb, masm, emitSafepoint); + leaveFrame(crb, masm, emitSafepoint, requiresReservedStackAccessCheck); masm.ret(lr); } } diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,9 +24,9 @@ package org.graalvm.compiler.hotspot.aarch64; -import static org.graalvm.compiler.hotspot.HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER; import static jdk.vm.ci.aarch64.AArch64.lr; import static jdk.vm.ci.code.ValueUtil.asRegister; +import static org.graalvm.compiler.hotspot.HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; import org.graalvm.compiler.core.common.spi.ForeignCallLinkage; @@ -57,7 +57,7 @@ @Override public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) { - leaveFrame(crb, masm, /* emitSafepoint */false); + leaveFrame(crb, masm, /* emitSafepoint */false, false); ForeignCallLinkage linkage = crb.foreignCalls.lookupForeignCall(UNWIND_EXCEPTION_TO_CALLER); CallingConvention cc = linkage.getOutgoingCallingConvention(); diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -111,7 +111,7 @@ @Override public LIRGenerationResult newLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, StructuredGraph graph, Object stub) { - return new HotSpotLIRGenerationResult(compilationId, lir, frameMapBuilder, makeCallingConvention(graph, (Stub) stub), stub); + return new HotSpotLIRGenerationResult(compilationId, lir, frameMapBuilder, makeCallingConvention(graph, (Stub) stub), stub, config.requiresReservedStackCheck(graph.getMethods())); } @Override diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -268,7 +268,7 @@ pollOnReturnScratchRegister = findPollOnReturnScratchRegister(); } Register thread = getProviders().getRegisters().getThreadRegister(); - append(new AMD64HotSpotReturnOp(operand, getStub() != null, thread, pollOnReturnScratchRegister, config)); + append(new AMD64HotSpotReturnOp(operand, getStub() != null, thread, pollOnReturnScratchRegister, config, getResult().requiresReservedStackAccessCheck())); } @Override diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -24,18 +24,30 @@ package org.graalvm.compiler.hotspot.amd64; +import static jdk.vm.ci.amd64.AMD64.r15; +import static jdk.vm.ci.amd64.AMD64.rsp; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.ENABLE_STACK_RESERVED_ZONE; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.THROW_DELAYED_STACKOVERFLOW_ERROR; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; +import org.graalvm.compiler.asm.Label; +import org.graalvm.compiler.asm.amd64.AMD64Address; +import org.graalvm.compiler.asm.amd64.AMD64Assembler; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; +import org.graalvm.compiler.core.common.spi.ForeignCallLinkage; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.graalvm.compiler.hotspot.meta.HotSpotForeignCallsProvider; import org.graalvm.compiler.lir.LIRInstructionClass; import org.graalvm.compiler.lir.Opcode; +import org.graalvm.compiler.lir.amd64.AMD64Call; import org.graalvm.compiler.lir.asm.CompilationResultBuilder; import org.graalvm.compiler.lir.gen.DiagnosticLIRGeneratorTool.ZapStackArgumentSpaceBeforeInstruction; import jdk.vm.ci.amd64.AMD64.CPUFeature; +import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.RegisterValue; import jdk.vm.ci.meta.Value; /** @@ -50,20 +62,46 @@ private final Register thread; private final Register scratchForSafepointOnReturn; private final GraalHotSpotVMConfig config; + private final boolean requiresReservedStackAccessCheck; - AMD64HotSpotReturnOp(Value value, boolean isStub, Register thread, Register scratchForSafepointOnReturn, GraalHotSpotVMConfig config) { + AMD64HotSpotReturnOp(Value value, boolean isStub, Register thread, Register scratchForSafepointOnReturn, GraalHotSpotVMConfig config, boolean requiresReservedStackAccessCheck) { super(TYPE); this.value = value; this.isStub = isStub; this.thread = thread; this.scratchForSafepointOnReturn = scratchForSafepointOnReturn; this.config = config; + this.requiresReservedStackAccessCheck = requiresReservedStackAccessCheck; } @Override public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { leaveFrameAndRestoreRbp(crb, masm); if (!isStub) { + if (requiresReservedStackAccessCheck) { + HotSpotForeignCallsProvider foreignCalls = (HotSpotForeignCallsProvider) crb.foreignCalls; + + Label noReserved = new Label(); + masm.cmpptr(rsp, new AMD64Address(r15, config.javaThreadReservedStackActivationOffset)); + masm.jccb(AMD64Assembler.ConditionFlag.Below, noReserved); + // direct call to runtime without stub needs aligned stack + int stackAdjust = crb.target.stackAlignment - crb.target.wordSize; + if (stackAdjust > 0) { + masm.subq(rsp, stackAdjust); + } + ForeignCallLinkage enableStackReservedZone = foreignCalls.lookupForeignCall(ENABLE_STACK_RESERVED_ZONE); + CallingConvention cc = enableStackReservedZone.getOutgoingCallingConvention(); + assert cc.getArgumentCount() == 1; + Register arg0 = ((RegisterValue) cc.getArgument(0)).getRegister(); + masm.movq(arg0, thread); + AMD64Call.directCall(crb, masm, enableStackReservedZone, null, false, null); + if (stackAdjust > 0) { + masm.addq(rsp, stackAdjust); + } + AMD64Call.directJmp(crb, masm, foreignCalls.lookupForeignCall(THROW_DELAYED_STACKOVERFLOW_ERROR)); + masm.bind(noReserved); + } + // Every non-stub compile method must have a poll before the return. AMD64HotSpotSafepointOp.emitCode(crb, masm, config, true, null, thread, scratchForSafepointOnReturn); diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -152,7 +152,7 @@ @Override public LIRGenerationResult newLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, StructuredGraph graph, Object stub) { - return new HotSpotLIRGenerationResult(compilationId, lir, frameMapBuilder, makeCallingConvention(graph, (Stub) stub), stub); + return new HotSpotLIRGenerationResult(compilationId, lir, frameMapBuilder, makeCallingConvention(graph, (Stub) stub), stub, config.requiresReservedStackCheck(graph.getMethods())); } @Override @@ -195,7 +195,9 @@ final int frameSize = crb.frameMap.totalFrameSize(); final int stackpoinerChange = -frameSize; SPARCMacroAssembler masm = (SPARCMacroAssembler) crb.asm; - emitStackOverflowCheck(crb); + if (!isStub) { + emitStackOverflowCheck(crb); + } if (SPARCAssembler.isSimm13(stackpoinerChange)) { masm.save(sp, stackpoinerChange, sp); diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -194,7 +194,7 @@ emitMove(operand, input); } Register thread = getProviders().getRegisters().getThreadRegister(); - append(new SPARCHotSpotReturnOp(operand, getStub() != null, config, thread, getSafepointAddressValue())); + append(new SPARCHotSpotReturnOp(operand, getStub() != null, config, thread, getSafepointAddressValue(), getResult().requiresReservedStackAccessCheck())); } @Override diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -24,17 +24,29 @@ package org.graalvm.compiler.hotspot.sparc; +import static jdk.vm.ci.sparc.SPARC.sp; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.ENABLE_STACK_RESERVED_ZONE; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.THROW_DELAYED_STACKOVERFLOW_ERROR; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; +import org.graalvm.compiler.asm.Label; +import org.graalvm.compiler.asm.sparc.SPARCAddress; +import org.graalvm.compiler.asm.sparc.SPARCAssembler; import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler; +import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler.ScratchRegister; +import org.graalvm.compiler.core.common.spi.ForeignCallLinkage; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.graalvm.compiler.hotspot.meta.HotSpotForeignCallsProvider; import org.graalvm.compiler.lir.LIRInstructionClass; import org.graalvm.compiler.lir.Opcode; import org.graalvm.compiler.lir.asm.CompilationResultBuilder; +import org.graalvm.compiler.lir.sparc.SPARCCall; import org.graalvm.compiler.lir.sparc.SPARCControlFlow.ReturnOp; +import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.RegisterValue; import jdk.vm.ci.meta.Value; /** @@ -47,22 +59,42 @@ @Use({REG, ILLEGAL}) protected Value value; @Use({REG, ILLEGAL}) protected Value safepointPollAddress; + private final boolean requiresReservedStackAccessCheck; private final boolean isStub; private final GraalHotSpotVMConfig config; private final Register thread; - SPARCHotSpotReturnOp(Value value, boolean isStub, GraalHotSpotVMConfig config, Register thread, Value safepointPoll) { + SPARCHotSpotReturnOp(Value value, boolean isStub, GraalHotSpotVMConfig config, Register thread, Value safepointPoll, boolean requiresReservedStackAccessCheck) { super(TYPE, SIZE); this.value = value; this.isStub = isStub; this.config = config; this.thread = thread; this.safepointPollAddress = safepointPoll; + this.requiresReservedStackAccessCheck = requiresReservedStackAccessCheck; } @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { if (!isStub) { + if (requiresReservedStackAccessCheck) { + try (ScratchRegister sc = masm.getScratchRegister()) { + HotSpotForeignCallsProvider foreignCalls = (HotSpotForeignCallsProvider) crb.foreignCalls; + Label noReserved = new Label(); + Register scratch = sc.getRegister(); + masm.ldx(new SPARCAddress(thread, config.javaThreadReservedStackActivationOffset), scratch); + masm.compareBranch(sp, scratch, SPARCAssembler.ConditionFlag.LessUnsigned, SPARCAssembler.CC.Xcc, noReserved, SPARCAssembler.BranchPredict.PREDICT_TAKEN, null); + ForeignCallLinkage enableStackReservedZone = foreignCalls.lookupForeignCall(ENABLE_STACK_RESERVED_ZONE); + CallingConvention cc = enableStackReservedZone.getOutgoingCallingConvention(); + assert cc.getArgumentCount() == 1; + Register arg0 = ((RegisterValue) cc.getArgument(0)).getRegister(); + masm.mov(thread, arg0); + SPARCCall.directCall(crb, masm, enableStackReservedZone, scratch, null); + masm.restoreWindow(); + SPARCCall.indirectJmp(crb, masm, scratch, foreignCalls.lookupForeignCall(THROW_DELAYED_STACKOVERFLOW_ERROR)); + masm.bind(noReserved); + } + } // Every non-stub compile method must have a poll before the return. SPARCHotSpotSafepointOp.emitCode(crb, masm, config, true, null, thread, safepointPollAddress); } diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReservedStackAccessTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReservedStackAccessTest.java Tue Jul 17 09:37:24 2018 -0400 @@ -0,0 +1,226 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +package org.graalvm.compiler.hotspot.test; + +import java.io.IOException; +import java.util.concurrent.locks.ReentrantLock; +import java.util.List; + +import org.graalvm.compiler.test.SubprocessUtil; +import org.graalvm.compiler.test.SubprocessUtil.Subprocess; + +import org.junit.Assume; +import org.junit.Before; +import org.junit.Test; + +public class ReservedStackAccessTest extends HotSpotGraalCompilerTest { + @Before + public void check() { + Assume.assumeTrue(runtime().getVMConfig().enableStackReservedZoneAddress != 0); + } + + public void stackAccessTest() { + Assume.assumeTrue(runtime().getVMConfig().enableStackReservedZoneAddress != 0); + + int passed = 0; + for (int i = 0; i < 1000; i++) { + // Each iteration has to be executed by a new thread. The test + // relies on the random size area pushed by the VM at the beginning + // of the stack of each Java thread it creates. + RunWithSOEContext r = new RunWithSOEContext(new ReentrantLockTest(), 256); + Thread thread = new Thread(r); + thread.start(); + try { + thread.join(); + assertTrue(r.result.equals("PASSED"), r.result); + ++passed; + } catch (InterruptedException ex) { + } + } + System.out.println("RESULT: " + (passed == 1000 ? "PASSED" : "FAILED")); + } + + public static void main(String[] args) { + new ReservedStackAccessTest().stackAccessTest(); + } + + @Test + public void run() throws IOException, InterruptedException { + Assume.assumeTrue(runtime().getVMConfig().enableStackReservedZoneAddress != 0); + List vmArgs = SubprocessUtil.withoutDebuggerArguments(SubprocessUtil.getVMCommandLine()); + vmArgs.add("-XX:+UseJVMCICompiler"); + vmArgs.add("-Dgraal.Inline=false"); + vmArgs.add("-XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread"); + Subprocess proc = SubprocessUtil.java(vmArgs, ReservedStackAccessTest.class.getName()); + boolean passed = false; + for (String line : proc.output) { + if (line.equals("RESULT: PASSED")) { + passed = true; + } + } + if (!passed) { + for (String line : proc.output) { + System.err.println("" + line); + } + } + assertTrue(passed); + } + + static class ReentrantLockTest { + + private ReentrantLock[] lockArray; + // Frame sizes vary a lot between interpreted code and compiled code + // so the lock array has to be big enough to cover all cases. + // If test fails with message "Not conclusive test", try to increase + // LOCK_ARRAY_SIZE value + private static final int LOCK_ARRAY_SIZE = 8192; + private boolean stackOverflowErrorReceived; + StackOverflowError soe = null; + int index = -1; + + public void initialize() { + lockArray = new ReentrantLock[LOCK_ARRAY_SIZE]; + for (int i = 0; i < LOCK_ARRAY_SIZE; i++) { + lockArray[i] = new ReentrantLock(); + } + stackOverflowErrorReceived = false; + } + + public String getResult() { + if (!stackOverflowErrorReceived) { + return "ERROR: Not conclusive test: no StackOverflowError received"; + } + for (int i = 0; i < LOCK_ARRAY_SIZE; i++) { + if (lockArray[i].isLocked()) { + if (!lockArray[i].isHeldByCurrentThread()) { + StringBuilder s = new StringBuilder(); + s.append("FAILED: ReentrantLock "); + s.append(i); + s.append(" looks corrupted"); + return s.toString(); + } + } + } + return "PASSED"; + } + + public void run() { + try { + lockAndCall(0); + } catch (StackOverflowError e) { + soe = e; + stackOverflowErrorReceived = true; + } + } + + private void lockAndCall(int i) { + index = i; + if (i < LOCK_ARRAY_SIZE) { + lockArray[i].lock(); + lockAndCall(i + 1); + } + } + } + + static class RunWithSOEContext implements Runnable { + + int counter; + int deframe; + int decounter; + int setupSOEFrame; + int testStartFrame; + ReentrantLockTest test; + String result = "FAILED: no result"; + + RunWithSOEContext(ReentrantLockTest test, int deframe) { + this.test = test; + this.deframe = deframe; + } + + @Override + public void run() { + counter = 0; + decounter = deframe; + test.initialize(); + recursiveCall(); + System.out.println("Framework got StackOverflowError at frame = " + counter); + System.out.println("Test started execution at frame = " + (counter - deframe)); + result = test.getResult(); + } + + @SuppressWarnings("unused") + void recursiveCall() { + // Unused local variables to increase the frame size + long l1; + long l2; + long l3; + long l4; + long l5; + long l6; + long l7; + long l8; + long l9; + long l10; + long l11; + long l12; + long l13; + long l14; + long l15; + long l16; + long l17; + long l18; + long l19; + long l20; + long l21; + long l22; + long l23; + long l24; + long l25; + long l26; + long l27; + long l28; + long l30; + long l31; + long l32; + long l33; + long l34; + long l35; + long l36; + long l37; + counter++; + try { + recursiveCall(); + } catch (StackOverflowError e) { + } + decounter--; + if (decounter == 0) { + setupSOEFrame = counter; + testStartFrame = counter - deframe; + test.run(); + } + } + } + +} diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java Tue Jul 17 09:37:24 2018 -0400 @@ -26,12 +26,15 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.List; import org.graalvm.compiler.core.common.CompressEncoding; import org.graalvm.compiler.hotspot.nodes.GraalHotSpotVMConfigNode; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotVMConfigStore; +import jdk.vm.ci.meta.ResolvedJavaMethod; /** * Used to access native configuration details. @@ -315,6 +318,17 @@ public final int jvmciCountersThreadOffset = getFieldOffset("JavaThread::_jvmci_counters", Integer.class, "jlong*"); public final int javaThreadReservedStackActivationOffset = versioned.javaThreadReservedStackActivationOffset; + public boolean requiresReservedStackCheck(List methods) { + if (enableStackReservedZoneAddress != 0 && methods != null) { + for (ResolvedJavaMethod method : methods) { + if (((HotSpotResolvedJavaMethod) method).hasReservedStackAccess()) { + return true; + } + } + } + return false; + } + /** * An invalid value for {@link #rtldDefault}. */ diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -50,6 +50,7 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.runtime.JVMCICompiler; +import org.graalvm.compiler.word.Word; /** * Common functionality of HotSpot host backends. @@ -66,6 +67,10 @@ */ public static final ForeignCallDescriptor UNCOMMON_TRAP_HANDLER = new ForeignCallDescriptor("uncommonTrapHandler", void.class); + public static final ForeignCallDescriptor ENABLE_STACK_RESERVED_ZONE = new ForeignCallDescriptor("enableStackReservedZoneEntry", void.class, Word.class); + + public static final ForeignCallDescriptor THROW_DELAYED_STACKOVERFLOW_ERROR = new ForeignCallDescriptor("throwDelayedStackoverflowError", void.class); + protected final GraalHotSpotVMConfig config; public HotSpotHostBackend(GraalHotSpotVMConfig config, HotSpotGraalRuntimeProvider runtime, HotSpotProviders providers) { diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -46,6 +46,7 @@ */ private StackSlot deoptimizationRescueSlot; protected final Object stub; + private final boolean requiresReservedStackAccessCheck; private int maxInterpreterFrameSize; @@ -55,9 +56,11 @@ */ private EconomicMap calleeSaveInfo = EconomicMap.create(Equivalence.IDENTITY_WITH_SYSTEM_HASHCODE); - public HotSpotLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, CallingConvention callingConvention, Object stub) { + public HotSpotLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, CallingConvention callingConvention, Object stub, + boolean requiresReservedStackAccessCheck) { super(compilationId, lir, frameMapBuilder, callingConvention); this.stub = stub; + this.requiresReservedStackAccessCheck = requiresReservedStackAccessCheck; } public EconomicMap getCalleeSaveInfo() { @@ -83,4 +86,8 @@ public int getMaxInterpreterFrameSize() { return maxInterpreterFrameSize; } + + public boolean requiresReservedStackAccessCheck() { + return requiresReservedStackAccessCheck; + } } diff -r 0a018efec082 -r d379f06962cf src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java Tue Jul 17 09:37:24 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -66,6 +66,8 @@ import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.SAFEPOINT; import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.STACK_INSPECTABLE_LEAF; import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPTIMIZATION_HANDLER; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.ENABLE_STACK_RESERVED_ZONE; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.THROW_DELAYED_STACKOVERFLOW_ERROR; import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; import static org.graalvm.compiler.hotspot.replacements.AssertionSnippets.ASSERTION_VM_MESSAGE_C; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.MARK_WORD_LOCATION; @@ -251,6 +253,12 @@ registerForeignCall(UNCOMMON_TRAP_HANDLER, c.uncommonTrapStub, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); registerForeignCall(IC_MISS_HANDLER, c.inlineCacheMissStub, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); + if (c.enableStackReservedZoneAddress != 0) { + assert c.throwDelayedStackOverflowErrorEntry != 0 : "both must exist"; + registerForeignCall(ENABLE_STACK_RESERVED_ZONE, c.enableStackReservedZoneAddress, NativeCall, DESTROYS_REGISTERS, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); + registerForeignCall(THROW_DELAYED_STACKOVERFLOW_ERROR, c.throwDelayedStackOverflowErrorEntry, NativeCall, DESTROYS_REGISTERS, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); + } + registerForeignCall(JAVA_TIME_MILLIS, c.javaTimeMillisAddress, NativeCall, DESTROYS_REGISTERS, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); registerForeignCall(JAVA_TIME_NANOS, c.javaTimeNanosAddress, NativeCall, DESTROYS_REGISTERS, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); registerForeignCall(SIN.foreignCallDescriptor, c.arithmeticSinAddress, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS); diff -r 0a018efec082 -r d379f06962cf src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java Tue Jul 17 09:37:24 2018 -0400 @@ -140,7 +140,8 @@ */ @Override public Content getSignature(ExecutableElement method) { - Content pre = new HtmlTree(HtmlTag.PRE); + HtmlTree pre = new HtmlTree(HtmlTag.PRE); + pre.setStyle(HtmlStyle.methodSignature); writer.addAnnotationInfo(method, pre); int annotationLength = pre.charCount(); addModifiers(method, pre); diff -r 0a018efec082 -r d379f06962cf src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java Tue Jul 17 09:37:24 2018 -0400 @@ -83,6 +83,7 @@ memberNameLabel, memberNameLink, memberSummary, + methodSignature, moduleLabelInPackage, moduleLabelInType, nameValue, diff -r 0a018efec082 -r d379f06962cf src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css Tue Jul 10 11:13:33 2018 -0400 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css Tue Jul 17 09:37:24 2018 -0400 @@ -822,7 +822,7 @@ margin: -100px 0 0 100px; z-index: 1; } -.details pre { +.methodSignature { white-space:normal; } diff -r 0a018efec082 -r d379f06962cf test/hotspot/jtreg/ProblemList-graal.txt --- a/test/hotspot/jtreg/ProblemList-graal.txt Tue Jul 10 11:13:33 2018 -0400 +++ b/test/hotspot/jtreg/ProblemList-graal.txt Tue Jul 17 09:37:24 2018 -0400 @@ -67,8 +67,6 @@ gc/TestNUMAPageSize.java 8194949 generic-all -runtime/ReservedStack/ReservedStackTestCompiler.java 8181855 generic-all - serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java 8195156 generic-all compiler/compilercontrol/directives/LogTest.java 8181753 generic-all @@ -179,6 +177,7 @@ org.graalvm.compiler.hotspot.test.CompilationWrapperTest 8205081 org.graalvm.compiler.hotspot.test.HsErrLogTest 8205081 org.graalvm.compiler.hotspot.test.OptionsInFileTest 8205081 +org.graalvm.compiler.hotspot.test.ReservedStackAccessTest 8205081 org.graalvm.compiler.replacements.test.classfile.ClassfileBytecodeProviderTest 8205081 org.graalvm.compiler.replacements.test.classfile.RedefineIntrinsicTest 8205081 diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java --- a/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java Tue Jul 10 11:13:33 2018 -0400 +++ b/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java Tue Jul 17 09:37:24 2018 -0400 @@ -86,7 +86,7 @@ "

@Deprecated(forRemoval=true)\n"
                 + "public DeprecatedClassByAnnotation()
\n" + "
Deprecated, for removal: This API element is subject to removal in a future version.
", - "
@Deprecated\n"
+                "
@Deprecated\n"
                 + "public void method()
\n" + "
Deprecated.
"); diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java --- a/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Tue Jul 10 11:13:33 2018 -0400 +++ b/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Tue Jul 17 09:37:24 2018 -0400 @@ -567,7 +567,7 @@ // Test with -nocomment and -nodeprecated options. The ClassDocs whould // not display definition lists for any member details. checkOutput("pkg1/C1.html", expectFound, - "
public void readObject()\n" +
+                "
public void readObject()\n" +
                 "                throws java.io.IOException
\n" + ""); diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testIndentation/TestIndentation.java --- a/test/langtools/jdk/javadoc/doclet/testIndentation/TestIndentation.java Tue Jul 10 11:13:33 2018 -0400 +++ b/test/langtools/jdk/javadoc/doclet/testIndentation/TestIndentation.java Tue Jul 17 09:37:24 2018 -0400 @@ -46,7 +46,7 @@ checkExit(Exit.OK); checkOutput("p/Indent.html", true, - "
public <T> void m​(T t1,",
+                "
public <T> void m​(T t1,",
                 "\n"
                 + "                  T t2)",
                 "\n"
diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java
--- a/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Tue Jul 10 11:13:33 2018 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Tue Jul 17 09:37:24 2018 -0400
@@ -65,7 +65,7 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg/Interface.html", true,
-                "
int method()
", + "
int method()
", "
static final int field
", // Make sure known implementing class list is correct and omits type parameters. "
\n" @@ -141,7 +141,7 @@ + "\n", "

staticMethod

\n" - + "
public static void staticMethod()
\n" + + "
public static void staticMethod()
\n" + "
" + "Description copied from interface: " + "" @@ -187,7 +187,7 @@ + "\n", "

staticMethod

\n" - + "
public static void staticMethod()
\n" + + "
public static void staticMethod()
\n" + "
" + "Description copied from interface: " + "" diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java --- a/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java Tue Jul 10 11:13:33 2018 -0400 +++ b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java Tue Jul 17 09:37:24 2018 -0400 @@ -54,11 +54,11 @@ "
See Also:
\n" + "
getRate(), \n" + "setRate(double)
", - "
public final void setRate​(double value)
\n" + "
public final void setRate​(double value)
\n" + "
Sets the value of the property rate.
\n" + "
\n" + "
Property description:
", - "
public final double getRate()
\n" + "
public final double getRate()
\n" + "
Gets the value of the property rate.
\n" + "
\n" + "
Property description:
", @@ -88,10 +88,10 @@ + "title=\"class in pkg1\">C.BooleanProperty pausedProperty
\n" + "
Defines if paused. The second line.
", "

isPaused

\n" - + "
public final double isPaused()
\n" + + "
public final double isPaused()
\n" + "
Gets the value of the property paused.
", "

setPaused

\n" - + "
public final void setPaused​(boolean value)
\n" + + "
public final void setPaused​(boolean value)
\n" + "
Sets the value of the property paused.
\n" + "
\n" + "
Property description:
\n" @@ -99,7 +99,7 @@ + "
Default value:
\n" + "
false
", "

isPaused

\n" - + "
public final double isPaused()
\n" + + "
public final double isPaused()
\n" + "
Gets the value of the property paused.
\n" + "
\n" + "
Property description:
\n" @@ -113,7 +113,7 @@ + "Timeline is expected to\n" + " be played. This is the second line.", "

setRate

\n" - + "
public final void setRate​(double value)
\n" + + "
public final void setRate​(double value)
\n" + "
Sets the value of the property rate.
\n" + "
\n" + "
Property description:
\n" @@ -124,7 +124,7 @@ + "
Since:
\n" + "
JavaFX 8.0
", "

getRate

\n" - + "
public final double getRate()
\n" + + "
public final double getRate()
\n" + "
Gets the value of the property rate.
\n" + "
\n" + "
Property description:
\n" diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java --- a/test/langtools/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java Tue Jul 10 11:13:33 2018 -0400 +++ b/test/langtools/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java Tue Jul 17 09:37:24 2018 -0400 @@ -55,7 +55,7 @@ checkOutput("pkg/A.html", true, "default void", - "
default void defaultMethod()
", + "
default void defaultMethod()
", "" + "All Methods " + "" diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testLiteralCodeInPre/TestLiteralCodeInPre.java --- a/test/langtools/jdk/javadoc/doclet/testLiteralCodeInPre/TestLiteralCodeInPre.java Tue Jul 10 11:13:33 2018 -0400 +++ b/test/langtools/jdk/javadoc/doclet/testLiteralCodeInPre/TestLiteralCodeInPre.java Tue Jul 17 09:37:24 2018 -0400 @@ -89,7 +89,7 @@ + "
\n"
                 + " id           \n"
                 + " 
", - "
public void htmlAttrInPre1()
\n" + "
public void htmlAttrInPre1()
\n" + "
More html tag outliers.\n" + "
\n"
                 + " @Override\n"
diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java
--- a/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java	Tue Jul 10 11:13:33 2018 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java	Tue Jul 17 09:37:24 2018 -0400
@@ -55,7 +55,7 @@
                 + ""
                 + "returnTypeTest()",
                 // Check return type in member detail.
-                "
public "
+                "
public "
                 + "PublicChild returnTypeTest()
", "" + "PublicChild()"); diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java --- a/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java Tue Jul 10 11:13:33 2018 -0400 +++ b/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java Tue Jul 17 09:37:24 2018 -0400 @@ -96,7 +96,7 @@ "for (Coin c : Coin.values())", "Overloaded valueOf() method has correct documentation.", "Overloaded values method has correct documentation.", - "
public static Coin" +
+                "
public static Coin" +
                 " valueOf​(java.lang.String name)
\n" + "
Returns the enum constant of this type with the specified name.\n" + "The string must match exactly an identifier used to declare an\n" + @@ -155,7 +155,7 @@ + "" + "methodThatReturnsTypeParameterA​(E[] e)", - "
public public E[] "
                 + "methodThatReturnsTypeParameterA​(E[] e)
\n", @@ -695,7 +695,7 @@ + "required=1994)\n" + "public AnnotationTypeUsage()
", // METHOD - "
@AnnotationType("
                 + "optional"
                 + "=\"Method Annotation\",\n"
@@ -703,7 +703,7 @@
                 + "required=1994)\n"
                 + "public void method()
", // METHOD PARAMS - "
public void methodWithParams​("
+                "
public void methodWithParams​("
                 + ""
                 + "@AnnotationType("
                 + "optional=\"Parameter Annotation\",=1994)\n"
                 + "public AnnotationTypeUsage()
", // METHOD - "
@AnnotationType("
                 + "optional"
                 + "=\"Method Annotation\",\n"
@@ -866,7 +866,7 @@
                 + "required=1994)\n"
                 + "public void method()
", // METHOD PARAMS - "
public void methodWithParams​("
+                "
public void methodWithParams​("
                 + ""
                 + "@AnnotationType("
                 + "optional=\"Parameter Annotation\",",
                 "
public java.lang.Object someProperty
", - "
public java.lang.Object public java.lang.Object someProperty()
"); checkOutput("src-html/linksource/Properties.html", true, @@ -222,7 +222,7 @@ + "field
", "
public "
                 + "SomeClass()
", - "
public int "
+                "
public int "
                 + "method()
"); checkOutput("src-html/linksource/SomeClass.html", true, diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestBadOverride.java --- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestBadOverride.java Tue Jul 10 11:13:33 2018 -0400 +++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestBadOverride.java Tue Jul 17 09:37:24 2018 -0400 @@ -52,7 +52,7 @@ checkOutput("pkg4/Foo.html", true, "
  • \n" + "

    toString

    \n" - + "
    public void toString()
    \n" + + "
    public void toString()
    \n" + "
    Why can't I do this ?
    \n" + "
  • "); } diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java --- a/test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java Tue Jul 10 11:13:33 2018 -0400 +++ b/test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java Tue Jul 17 09:37:24 2018 -0400 @@ -73,7 +73,7 @@ + "\n" + "", // Method is documented as though it is declared in the inheriting method. - "
    public void methodInheritedFromParent​(int p1)",
    +                "
    public void methodInheritedFromParent​(int p1)",
                     "
    \n" + "
    All Implemented Interfaces:
    \n" + "
    " diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testSerializedFormWithClassFile/TestSerializedFormWithClassFile.java --- a/test/langtools/jdk/javadoc/doclet/testSerializedFormWithClassFile/TestSerializedFormWithClassFile.java Tue Jul 10 11:13:33 2018 -0400 +++ b/test/langtools/jdk/javadoc/doclet/testSerializedFormWithClassFile/TestSerializedFormWithClassFile.java Tue Jul 17 09:37:24 2018 -0400 @@ -71,7 +71,7 @@ checkExit(Exit.OK); checkOutput("serialized-form.html", true, - "
    public void readObject​"
    +                "
    public void readObject​"
                     + "(java.io.ObjectInputStream arg0)\n"
                     + "                throws java.lang.ClassNotFoundException,\n"
                     + "                       java.io.IOException
    \n"); diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java --- a/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java Tue Jul 10 11:13:33 2018 -0400 +++ b/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java Tue Jul 17 09:37:24 2018 -0400 @@ -87,7 +87,7 @@ checkOutput("p1/A.html", true, "
  • \n" + "

    m3

    \n" - + "
    public void m3()
    \n" + + "
    public void m3()
    \n" + "
    First sentence some text maybe second sentence.
    \n" + "
  • \n" ); diff -r 0a018efec082 -r d379f06962cf test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java --- a/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java Tue Jul 10 11:13:33 2018 -0400 +++ b/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java Tue Jul 17 09:37:24 2018 -0400 @@ -154,22 +154,22 @@ // Test for type annotations on method return types (MethodReturnType.java). checkOutput("typeannos/MtdDefaultScope.html", true, - "
    public <T> public <T> @MRtnA java.lang.String"
                     + " method()
    ", // When JDK-8068737 is fixed, we should change the order - "
    "
    +                "
    "
                     + "@MRtnA java.lang.String "
                     + "@MRtnB [] "
                     + "@MRtnA []"
                     + " array2Deep()
    ", - "
    @MRtnA java.lang.String[][] array2()
    "); checkOutput("typeannos/MtdModifiedScoped.html", true, - "
    public final public final MtdParameterized<@MRtnA "
                     + "<K extends <K extends @MTyParamA java.lang.String>"
                     + " void methodExtends()
    ", - "
    <K extends <K extends @MTyParamA "
                     + "MtdTyParameterized<");
     
             checkOutput("typeannos/PublicModifiedMethods.html", true,
    -                "
    public final <K extends public final <K extends @MTyParamA "
                     + "java.lang.String> void methodExtends()
    ", - "
    public final <K extends public final <K extends @MTyParamA "
                     + "java.lang.String,​V extends @MTyParamA void unannotated​(void unannotated​("
                     + "ParaParameterized<java.lang.String,​java.lang.String>"
                     + " a)
    ", - "
    void nestedParaParameterized​(void nestedParaParameterized​("
                     + "ParaParameterized<@ParamA  java.lang.String> a)
    ", // When JDK-8068737 is fixed, we should change the order - "
    void array2Deep​(void array2Deep​(@ParamA java.lang.String "
                     + ""
                     + "@ParamB [] "
    @@ -237,34 +237,34 @@
     
             // Test for type annotations on throws (Throws.java).
             checkOutput("typeannos/ThrDefaultUnmodified.html", true,
    -                "
    void oneException()\n"
    +                "
    void oneException()\n"
                     + "           throws @ThrA java.lang.Exception
    ", - "
    void twoExceptions()\n"
    +                "
    void twoExceptions()\n"
                     + "            throws @ThrA java.lang.RuntimeException,\n"
                     + "                   @ThrA java.lang.Exception
    "); checkOutput("typeannos/ThrPublicModified.html", true, - "
    public final void oneException​(java.lang.String a)\n"
    -                + "                        throws public final void oneException​"
    +                + "(java.lang.String a)\n                        throws @ThrA java.lang.Exception
    ", - "
    public final void twoExceptions​(java.lang.String a)\n"
    -                + "                         throws public final void twoExceptions​"
    +                + "(java.lang.String a)\n                         throws @ThrA java.lang.RuntimeException,\n"
                     + "                                @ThrA java.lang.Exception
    "); checkOutput("typeannos/ThrWithValue.html", true, - "
    void oneException()\n"
    +                "
    void oneException()\n"
                     + "           throws @ThrB("
                     + "\"m\") java.lang.Exception
    ", - "
    void twoExceptions()\n"
    +                "
    void twoExceptions()\n"
                     + "            throws @ThrB("
                     + "\"m\") java.lang.RuntimeException,\n"
    @@ -273,32 +273,32 @@
     
             // Test for type annotations on type parameters (TypeParameters.java).
             checkOutput("typeannos/TestMethods.html", true,
    -                "
    <K,​"
    -                + "@TyParaA V extends <K,​@TyParaA V extends @TyParaA "
                     + "java.lang.String> void secondAnnotated()
    " ); // Test for type annotations on wildcard type (Wildcards.java). checkOutput("typeannos/BoundTest.html", true, - "
    void wcExtends​(void wcExtends​(MyList<? extends @WldA"
                     + " java.lang.String> l)
    ", - "
    MyList<? super @WldA java.lang.String>"
                     + " returnWcSuper()
    "); checkOutput("typeannos/BoundWithValue.html", true, - "
    void wcSuper​(MyList<? super void wcSuper​(MyList<? super @WldB("
                     + "\"m\") java.lang."
                     + "String> l)
    ", - "
    MyList<? extends @WldB("
                     + "\"m\") java.lang.String"
    @@ -306,37 +306,37 @@
     
             // Test for receiver annotations (Receivers.java).
             checkOutput("typeannos/DefaultUnmodified.html", true,
    -                "
    void withException​(void withException​(@RcvrA "
                     + "DefaultUnmodified this)\n"
                     + "            throws java."
                     + "lang.Exception
    ", - "
    java.lang.String nonVoid​(java.lang.String nonVoid​(@RcvrA @RcvrB"
                     + "(\"m\")"
                     + " DefaultUnmodified this)
    ", - "
    <T extends java.lang.Runnable> void accept​("
    +                "
    <T extends java.lang.Runnable> void accept​("
                     + "@RcvrA DefaultUnmodified this,\n"
                     + "                                           T r)\n"
                     + "                                    throws java.lang.Exception
    "); checkOutput("typeannos/PublicModified.html", true, - "
    public final java.lang.String nonVoid​("
    +                "
    public final java.lang.String nonVoid​"
    +                + "("
                     + "@RcvrA PublicModified this)
    ", - "
    public final <T extends java.lang.Runnable> "
    +                "
    public final <T extends java.lang.Runnable> "
                     + "void accept​(@RcvrA PublicModified this,\n"
                     + "                                                        T r)\n"
                     + "                                                 throws java.lang.Exception
    "); checkOutput("typeannos/WithValue.html", true, - "
    <T extends java.lang.Runnable> void accept​("
    +                "
    <T extends java.lang.Runnable> void accept​("
                     + "@RcvrB("
                     + "\"m\") WithValue this,\n"
    @@ -344,17 +344,17 @@
                     + "                                    throws java.lang.Exception
    "); checkOutput("typeannos/WithFinal.html", true, - "
    java.lang.String nonVoid​(java.lang.String nonVoid​(@RcvrB(\"m\") "
                     + ""
                     + "WithFinal afield)
    "); checkOutput("typeannos/WithBody.html", true, - "
    void field​(void field​(@RcvrA WithBody this)
    "); checkOutput("typeannos/Generic2.html", true, - "
    void test2​(void test2​(@RcvrA Generic2<X> this)
    ");