aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed2012-09-17 16:04:18 (EDT)
committerBogdan Gheorghe2013-01-15 16:04:06 (EST)
commit8b213e951dc1a33ca27b4bb9e9ca720881c8fa50 (patch)
treec93eb219c9137757d9ece504211a05bc23cf8e2c
parent8a5c889e981e7341df91a7960d72e607d072992a (diff)
downloadeclipse.platform.swt-8b213e951dc1a33ca27b4bb9e9ca720881c8fa50.zip
eclipse.platform.swt-8b213e951dc1a33ca27b4bb9e9ca720881c8fa50.tar.gz
eclipse.platform.swt-8b213e951dc1a33ca27b4bb9e9ca720881c8fa50.tar.bz2
Bug 324435 - JVM crashes when press a button
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c33
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java4
6 files changed, 51 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c
index efdb5a2..d19f091 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c
@@ -19,6 +19,39 @@
#define OS_NATIVE(func) Java_org_eclipse_swt_internal_gtk_OS_##func
+#ifndef NO__1call_1get_1size
+JNIEXPORT void JNICALL OS_NATIVE(_1call_1get_1size)
+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3, jintLong arg4, jintLong arg5, jintLong arg6, jintLong arg7)
+{
+ /*
+ * Bug in Solaris. For some reason, the assembler generated for this function (when not putting the parameters in the stack) crashes.
+ * It seems that this is caused by a bug in the Sun Studio Compiler when the optimization level is greater or equal to two.
+ * The fix is rewrite the function passing all parameters on the stack. Alternatively, the problem could be fixed by lowering the optimization level,
+ * but this solution would significantly increase the size of the library.
+ */
+ const GdkRectangle rect;
+ gint x, y, width, height;
+ const GdkRectangle *lprect = NULL;
+ gint* lpx = NULL;
+ gint* lpy = NULL;
+ gint* lpwidth = NULL;
+ gint* lpheight = NULL;
+ OS_NATIVE_ENTER(env, that, _1call_1get_1size_FUNC);
+ if (arg3) lprect = ▭
+ if (arg4) lpx = &x;
+ if (arg5) lpy = &y;
+ if (arg6) lpwidth = &width;
+ if (arg7) lpheight = &height;
+ ((void (*)(GtkCellRenderer *, GtkWidget *, const GdkRectangle *, gint *, gint *, gint *, gint *))arg0)((GtkCellRenderer *)arg1, (GtkWidget *)arg2, lprect, lpx, lpy, lpwidth, lpheight);
+ if (arg3) *((GdkRectangle *)arg3) = rect;
+ if (arg4) *((gint *)arg4) = x;
+ if (arg5) *((gint *)arg5) = y;
+ if (arg6) *((gint *)arg6) = width;
+ if (arg7) *((gint *)arg7) = height;
+ OS_NATIVE_EXIT(env, that, _1call_1get_1size_FUNC);
+}
+#endif
+
#ifndef NO_GDK_1WINDOWING_1X11
JNIEXPORT jboolean JNICALL OS_NATIVE(GDK_1WINDOWING_1X11)
(JNIEnv *env, jclass that)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
index 0e1a60c..c3293f6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
@@ -18,8 +18,8 @@
#ifdef NATIVE_STATS
-int OS_nativeFunctionCount = 1404;
-int OS_nativeFunctionCallCount[1404];
+int OS_nativeFunctionCount = 1405;
+int OS_nativeFunctionCallCount[1405];
char * OS_nativeFunctionNames[] = {
#ifndef JNI64
"Call__IIII",
@@ -218,6 +218,7 @@ char * OS_nativeFunctionNames[] = {
"_1atk_1object_1add_1relationship",
"_1atk_1object_1remove_1relationship",
"_1call",
+ "_1call_1get_1size",
"_1dlclose",
"_1dlopen",
"_1dlsym",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
index 914537b..05a523a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
@@ -226,6 +226,7 @@ typedef enum {
_1atk_1object_1add_1relationship_FUNC,
_1atk_1object_1remove_1relationship_FUNC,
_1call_FUNC,
+ _1call_1get_1size_FUNC,
_1dlclose_FUNC,
_1dlopen_FUNC,
_1dlsym_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index d15c29f..f55aeff 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -810,6 +810,16 @@ public static final int /*long*/ call (int /*long*/ function, int /*long*/ arg0,
}
}
/** @method flags=no_gen */
+public static final native void _call_get_size (int /*long*/ function, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ arg3, int /*long*/ arg4, int /*long*/ arg5, int /*long*/ arg6);
+public static final void call_get_size (int /*long*/ function, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ arg3, int /*long*/ arg4, int /*long*/ arg5, int /*long*/ arg6) {
+ lock.lock();
+ try {
+ _call_get_size(function, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
+ } finally {
+ lock.unlock();
+ }
+}
+/** @method flags=no_gen */
public static final native boolean GDK_WINDOWING_X11();
/** @param pixmap cast=(GdkPixmap *) */
public static final native int /*long*/ _GDK_PIXMAP_XID(int /*long*/ pixmap);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index 416c0d0..e472d10 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -2476,7 +2476,7 @@ int /*long*/ rendererGetSizeProc (int /*long*/ cell, int /*long*/ widget, int /*
int /*long*/ g_class = OS.g_type_class_peek_parent (OS.G_OBJECT_GET_CLASS (cell));
GtkCellRendererClass klass = new GtkCellRendererClass ();
OS.memmove (klass, g_class);
- int /*long*/ result = OS.call (klass.get_size, cell, handle, cell_area, x_offset, y_offset, width, height);
+ OS.call_get_size (klass.get_size, cell, handle, cell_area, x_offset, y_offset, width, height);
if (!ignoreSize && OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
int /*long*/ iter = OS.g_object_get_qdata (cell, Display.SWT_OBJECT_INDEX2);
TableItem item = null;
@@ -2531,7 +2531,7 @@ int /*long*/ rendererGetSizeProc (int /*long*/ cell, int /*long*/ widget, int /*
}
}
}
- return result;
+ return 0;
}
int /*long*/ rendererRenderProc (int /*long*/ cell, int /*long*/ window, int /*long*/ widget, int /*long*/ background_area, int /*long*/ cell_area, int /*long*/ expose_area, int /*long*/ flags) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 6aec4f7..02052a5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -2479,7 +2479,7 @@ int /*long*/ rendererGetSizeProc (int /*long*/ cell, int /*long*/ widget, int /*
int /*long*/ g_class = OS.g_type_class_peek_parent (OS.G_OBJECT_GET_CLASS (cell));
GtkCellRendererClass klass = new GtkCellRendererClass ();
OS.memmove (klass, g_class);
- int /*long*/ result = OS.call (klass.get_size, cell, handle, cell_area, x_offset, y_offset, width, height);
+ OS.call_get_size (klass.get_size, cell, handle, cell_area, x_offset, y_offset, width, height);
if (!ignoreSize && OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
int /*long*/ iter = OS.g_object_get_qdata (cell, Display.SWT_OBJECT_INDEX2);
TreeItem item = null;
@@ -2529,7 +2529,7 @@ int /*long*/ rendererGetSizeProc (int /*long*/ cell, int /*long*/ widget, int /*
}
}
}
- return result;
+ return 0;
}
int /*long*/ rendererRenderProc (int /*long*/ cell, int /*long*/ window, int /*long*/ widget, int /*long*/ background_area, int /*long*/ cell_area, int /*long*/ expose_area, int /*long*/ flags) {