Compare commits

...

5 Commits
max/fix ... 956

Author SHA1 Message Date
Anton Tarasov
d9e7c9b550 JBR-2377 Native crash IU-202.3855 macOS
(cherry picked from commit 0917d89523)
2020-06-29 17:59:35 +03:00
Anton Tarasov
a3be710135 JBR-2489 Git branch operations (switch to another branch, rebase) sometimes crash WebStorm 202.5428.27
(cherry picked from commit 78bd1bbeae)
2020-06-26 16:17:06 +03:00
Vitaly Provodin
e525056e82 Clean up the list of ignored Render tests 2020-06-26 14:19:14 +07:00
Vitaly Provodin
548c3ddd76 JBR-2531 add fastdebug level for dcevm builds (follow up for windows) 2020-06-23 18:03:53 +07:00
Vitaly Provodin
fa2e127689 JBR-2531 add fastdebug level for dcevm bilds 2020-06-23 17:34:44 +07:00
9 changed files with 128 additions and 100 deletions

View File

@@ -68,8 +68,9 @@ function create_jbr {
}
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
WITH_DEBUG_LEVEL="--with-debug-level=release"
WITH_IMPORT_MODULES="--with-import-modules=./modular-sdk"
RELEASE_NAME=linux-x86_64-normal-server-release
git checkout -- modules.list src/java.desktop/share/classes/module-info.java
case "$bundle_type" in
"jfx")
@@ -80,6 +81,8 @@ case "$bundle_type" in
;;
"dcevm")
git am jb/project/tools/patches/dcevm/*.patch
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
RELEASE_NAME=linux-x86_64-normal-server-fastdebug
;;
"nomod")
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
@@ -90,7 +93,7 @@ esac
sh configure \
--disable-warnings-as-errors \
--with-debug-level=release \
$WITH_DEBUG_LEVEL \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-version-pre= \
@@ -99,15 +102,15 @@ sh configure \
$WITH_IMPORT_MODULES \
--enable-cds=yes || exit $?
make images CONF=linux-x86_64-normal-server-release || exit $?
make images CONF=$RELEASE_NAME || exit $?
JSDK=build/linux-x86_64-normal-server-release/images/jdk
JSDK=build/$RELEASE_NAME/images/jdk
JBSDK=$JBRSDK_BASE_NAME-linux-x64-b$build_number
echo Fixing permissions
chmod -R a+r $JSDK
BASE_DIR=build/linux-x86_64-normal-server-release/images
BASE_DIR=build/$RELEASE_NAME/images
JBRSDK_BUNDLE=jbrsdk
rm -rf $BASE_DIR/$JBRSDK_BUNDLE

View File

@@ -75,8 +75,9 @@ function create_jbr {
}
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WITH_DEBUG_LEVEL="--with-debug-level=release"
WITH_IMPORT_MODULES="--with-import-modules=./modular-sdk"
RELEASE_NAME=macosx-x86_64-normal-server-release
git checkout -- modules.list src/java.desktop/share/classes/module-info.java
case "$bundle_type" in
"jfx")
@@ -87,6 +88,8 @@ case "$bundle_type" in
;;
"dcevm")
git am jb/project/tools/patches/dcevm/*.patch
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
RELEASE_NAME=macosx-x86_64-normal-server-fastdebug
;;
"nomod")
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
@@ -97,7 +100,7 @@ esac
sh configure \
--disable-warnings-as-errors \
--with-debug-level=release \
$WITH_DEBUG_LEVEL \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-version-pre= \
@@ -107,9 +110,9 @@ sh configure \
--with-boot-jdk=`/usr/libexec/java_home -v 11` \
--enable-cds=yes || exit $?
make clean images CONF=macosx-x86_64-normal-server-release || exit $?
make clean images CONF=$RELEASE_NAME || exit $?
JSDK=build/macosx-x86_64-normal-server-release/images/jdk-bundle
JSDK=build/$RELEASE_NAME/images/jdk-bundle
JBSDK=${JBRSDK_BASE_NAME}-osx-x64-b${build_number}
BASE_DIR=jre

View File

@@ -54,7 +54,9 @@ function create_jbr {
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WORK_DIR=$(pwd)
WITH_DEBUG_LEVEL="--with-debug-level=release"
WITH_IMPORT_MODULES="--with-import-modules=${WORK_DIR}/modular-sdk"
RELEASE_NAME=windows-x86_64-normal-server-release
git checkout -- modules.list src/java.desktop/share/classes/module-info.java
case "$bundle_type" in
"jfx")
@@ -68,6 +70,8 @@ case "$bundle_type" in
"dcevm")
echo "Adding dcevm patches"
git am jb/project/tools/patches/dcevm/*.patch
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
RELEASE_NAME=windows-x86_64-normal-server-fastdebug
;;
"nomod")
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
@@ -79,7 +83,7 @@ esac
PATH="/usr/local/bin:/usr/bin:${PATH}"
./configure \
--disable-warnings-as-errors \
--disable-debug-symbols \
$WITH_DEBUG_LEVEL \
--with-target-bits=64 \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
@@ -93,16 +97,16 @@ PATH="/usr/local/bin:/usr/bin:${PATH}"
--enable-cds=yes || exit 1
if [ "$bundle_type" == "jfx_jcef" ]; then
make LOG=info clean images CONF=windows-x86_64-normal-server-release test-image || exit 1
make LOG=info clean images CONF=$RELEASE_NAME test-image || exit 1
else
make LOG=info clean images CONF=windows-x86_64-normal-server-release || exit 1
make LOG=info clean images CONF=$RELEASE_NAME || exit 1
fi
JSDK=build/windows-x86_64-normal-server-release/images/jdk
JSDK=build/$RELEASE_NAME/images/jdk
if [[ "$bundle_type" == *jcef* ]]; then
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-b${build_number}
fi
BASE_DIR=build/windows-x86_64-normal-server-release/images
BASE_DIR=build/$RELEASE_NAME/images
JBRSDK_BUNDLE=jbrsdk
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE} && rsync -a --exclude demo --exclude sample ${JSDK}/ ${JBRSDK_BUNDLE} || exit 1

View File

@@ -48,10 +48,17 @@ function pack_jbr {
#rm -rf ${BASE_DIR}/${JBR_BUNDLE}
}
RELEASE_NAME=windows-x86_64-normal-server-release
case "$bundle_type" in
"dcevm")
RELEASE_NAME=windows-x86_64-normal-server-fastdebug
;;
esac
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
JBR_BASE_NAME=jbr-$JBSDK_VERSION
IMAGES_DIR=build/windows-x86_64-normal-server-release/images
IMAGES_DIR=build/$RELEASE_NAME/images
JSDK=$IMAGES_DIR/jdk
JBSDK=$JBRSDK_BASE_NAME-windows-x64-b$build_number
BASE_DIR=.

View File

@@ -47,15 +47,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
public class RenderPerfTest {
private static HashSet<String> ignoredTests = new HashSet<>();
static {
ignoredTests.add("testWhiteTextBubblesNoAA");
ignoredTests.add("testWhiteTextBubblesLCD");
ignoredTests.add("testWhiteTextBubblesGray");
ignoredTests.add("testLinGradOvalRotBubblesAA");
ignoredTests.add("testWiredBoxBubblesAA");
ignoredTests.add("testLinesAA");
}
private final static int N = 1000;
private final static float WIDTH = 800;
private final static float HEIGHT = 800;

View File

@@ -131,27 +131,31 @@ public final class CGraphicsEnvironment extends SunGraphicsEnvironment {
*/
@SuppressWarnings("unused")
void _displayReconfiguration(final int displayId, final boolean removed) {
synchronized (this) {
// We don't need to switch to AppKit, we're already there
mainDisplayID = getMainDisplayID();
if (removed && devices.containsKey(displayId)) {
final CGraphicsDevice gd = devices.remove(displayId);
oldDevices.add(new WeakReference<>(gd));
try {
synchronized (this) {
// We don't need to switch to AppKit, we're already there
mainDisplayID = getMainDisplayID();
if (removed && devices.containsKey(displayId)) {
final CGraphicsDevice gd = devices.remove(displayId);
oldDevices.add(new WeakReference<>(gd));
}
}
}
initDevices(mainDisplayID);
initDevices(mainDisplayID);
// Need to notify old devices, in case the user hold the reference to it
for (ListIterator<WeakReference<CGraphicsDevice>> it =
oldDevices.listIterator(); it.hasNext(); ) {
CGraphicsDevice gd = it.next().get();
if (gd != null) {
gd.invalidate(mainDisplayID);
gd.displayChanged();
} else {
// no more references to this device, remove it
it.remove();
// Need to notify old devices, in case the user hold the reference to it
for (ListIterator<WeakReference<CGraphicsDevice>> it =
oldDevices.listIterator(); it.hasNext(); ) {
CGraphicsDevice gd = it.next().get();
if (gd != null) {
gd.invalidate(mainDisplayID);
gd.displayChanged();
} else {
// no more references to this device, remove it
it.remove();
}
}
} catch (Throwable t) {
t.printStackTrace();
}
}

View File

@@ -1151,16 +1151,21 @@ public class LWWindowPeer
@Override
public final void displayChanged() {
if (updateGraphicsDevice()) {
updateMinimumSize();
if (!isMaximizedBoundsSet()) {
setPlatformMaximizedBounds(getDefaultMaximizedBounds());
try {
if (updateGraphicsDevice()) {
updateMinimumSize();
if (!isMaximizedBoundsSet()) {
setPlatformMaximizedBounds(getDefaultMaximizedBounds());
}
}
// Replace surface unconditionally, because internal state of the
// GraphicsDevice could be changed.
replaceSurfaceData();
repaintPeer();
} catch (Throwable t) {
System.err.println(t + " on " + this);
t.printStackTrace();
}
// Replace surface unconditionally, because internal state of the
// GraphicsDevice could be changed.
replaceSurfaceData();
repaintPeer();
}
@Override

View File

@@ -603,47 +603,47 @@ public class CInputMethod extends InputMethodAdapter {
private synchronized String attributedSubstringFromRange(final int locationIn, final int lengthIn) {
final String[] retString = new String[1];
try {
if (fIMContext != null && fAwtFocussedComponent != null)
LWCToolkit.invokeAndWait(new Runnable() {
public void run() { synchronized(retString) {
int location = locationIn;
int length = lengthIn;
if (fIMContext != null && fAwtFocussedComponent != null) {
invokeAndWaitNoThrow(new Runnable() {
public void run() {
synchronized (retString) {
int location = locationIn;
int length = lengthIn;
if ((location + length) > (fIMContext.getCommittedTextLength() + fCurrentTextLength)) {
length = fIMContext.getCommittedTextLength() - location;
}
AttributedCharacterIterator theIterator = null;
if (fCurrentText == null) {
theIterator = fIMContext.getCommittedText(location, location + length, null);
} else {
int insertSpot = fIMContext.getInsertPositionOffset();
if (location < insertSpot) {
theIterator = fIMContext.getCommittedText(location, location + length, null);
} else if (location >= insertSpot && location < insertSpot + fCurrentTextLength) {
theIterator = fCurrentText.getIterator(null, location - insertSpot, location - insertSpot +length);
} else {
theIterator = fIMContext.getCommittedText(location - fCurrentTextLength, location - fCurrentTextLength + length, null);
if ((location + length) > (fIMContext.getCommittedTextLength() + fCurrentTextLength)) {
length = fIMContext.getCommittedTextLength() - location;
}
}
// Get the characters from the iterator
char selectedText[] = new char[theIterator.getEndIndex() - theIterator.getBeginIndex()];
char current = theIterator.first();
int index = 0;
while (current != CharacterIterator.DONE) {
selectedText[index++] = current;
current = theIterator.next();
}
AttributedCharacterIterator theIterator = null;
retString[0] = new String(selectedText);
}}
if (fCurrentText == null) {
theIterator = fIMContext.getCommittedText(location, location + length, null);
} else {
int insertSpot = fIMContext.getInsertPositionOffset();
if (location < insertSpot) {
theIterator = fIMContext.getCommittedText(location, location + length, null);
} else if (location >= insertSpot && location < insertSpot + fCurrentTextLength) {
theIterator = fCurrentText.getIterator(null, location - insertSpot, location - insertSpot + length);
} else {
theIterator = fIMContext.getCommittedText(location - fCurrentTextLength, location - fCurrentTextLength + length, null);
}
}
// Get the characters from the iterator
char selectedText[] = new char[theIterator.getEndIndex() - theIterator.getBeginIndex()];
char current = theIterator.first();
int index = 0;
while (current != CharacterIterator.DONE) {
selectedText[index++] = current;
current = theIterator.next();
}
retString[0] = new String(selectedText);
}
}
}, fAwtFocussedComponent);
} catch (InvocationTargetException ite) { ite.printStackTrace(); }
}
synchronized(retString) { return retString[0]; }
}
@@ -656,9 +656,8 @@ public class CInputMethod extends InputMethodAdapter {
private synchronized int[] selectedRange() {
final int[] returnValue = new int[2];
try {
if (fIMContext != null && fAwtFocussedComponent != null)
LWCToolkit.invokeAndWait(new Runnable() {
if (fIMContext != null && fAwtFocussedComponent != null) {
invokeAndWaitNoThrow(new Runnable() {
public void run() { synchronized(returnValue) {
AttributedCharacterIterator theIterator = fIMContext.getSelectedText(null);
if (theIterator == null) {
@@ -691,7 +690,7 @@ public class CInputMethod extends InputMethodAdapter {
}}
}, fAwtFocussedComponent);
} catch (InvocationTargetException ite) { ite.printStackTrace(); }
}
synchronized(returnValue) { return returnValue; }
}
@@ -707,15 +706,13 @@ public class CInputMethod extends InputMethodAdapter {
final int[] returnValue = new int[2];
try {
LWCToolkit.invokeAndWait(new Runnable() {
public void run() { synchronized(returnValue) {
// The insert position is always after the composed text, so the range start is the
// insert spot less the length of the composed text.
returnValue[0] = fIMContext.getInsertPositionOffset();
}}
}, fAwtFocussedComponent);
} catch (InvocationTargetException ite) { ite.printStackTrace(); }
invokeAndWaitNoThrow(new Runnable() {
public void run() { synchronized(returnValue) {
// The insert position is always after the composed text, so the range start is the
// insert spot less the length of the composed text.
returnValue[0] = fIMContext.getInsertPositionOffset();
}}
}, fAwtFocussedComponent);
returnValue[1] = fCurrentTextLength;
synchronized(returnValue) { return returnValue; }
@@ -882,7 +879,7 @@ public class CInputMethod extends InputMethodAdapter {
// 1) Do not run secondary msg loop in this case.
// 2) Delegate runnable back to FX when applicable.
LWCToolkit.invokeAndWait(() -> {
invokeAndWaitNoThrow(() -> {
runOnAppKit.set(instanceofJFXPanel(getClientComponent(inputContext)));
if (!runOnAppKit.get()) {
runnable.run();
@@ -894,4 +891,12 @@ public class CInputMethod extends InputMethodAdapter {
}
}
}
static void invokeAndWaitNoThrow(Runnable runnable, Component component) {
try {
LWCToolkit.invokeAndWait(runnable, component, false);
} catch (Throwable e) {
e.printStackTrace();
}
}
}

View File

@@ -1296,10 +1296,16 @@ JNF_CLASS_CACHE(jc_CInputMethod, "sun/lwawt/macosx/CInputMethod");
fprintf(stderr, "AWTView InputMethod Selector Called : [attributedSubstringFromRange] location=%lu, length=%lu\n", (unsigned long)theRange.location, (unsigned long)theRange.length);
#endif // IM_DEBUG
if (!fInputMethodLOCKABLE) {
return NULL;
}
static JNF_MEMBER_CACHE(jm_substringFromRange, jc_CInputMethod, "attributedSubstringFromRange", "(II)Ljava/lang/String;");
JNIEnv *env = [ThreadUtilities getJNIEnv];
jobject theString = JNFCallObjectMethod(env, fInputMethodLOCKABLE, jm_substringFromRange, theRange.location, theRange.length); // AWT_THREADING Safe (AWTRunLoopMode)
if (!theString) {
return NULL;
}
id result = [[[NSAttributedString alloc] initWithString:JNFJavaToNSString(env, theString)] autorelease];
#ifdef IM_DEBUG
NSLog(@"attributedSubstringFromRange returning \"%@\"", result);