Skip to content

Commit

Permalink
Automatic merge of jdk:master into master
Browse files Browse the repository at this point in the history
  • Loading branch information
duke committed Nov 4, 2020
2 parents 02581b8 + 804bd72 commit 31967cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
14 changes: 4 additions & 10 deletions make/autoconf/flags-cflags.m4
Expand Up @@ -670,16 +670,10 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -DARCH='\"$FLAGS_CPU_LEGACY\"' \
-D$FLAGS_CPU_LEGACY"
if test "x$FLAGS_CPU_BITS" = x64; then
# -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in
# unpack200.exe.
if test "x$FLAGS_OS" = xlinux || test "x$FLAGS_OS" = xmacosx; then
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_LP64=1"
fi
if test "x$FLAGS_OS" != xaix; then
# xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it.
$1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -D_LP64=1"
fi
if test "x$FLAGS_CPU_BITS" = x64 && test "x$FLAGS_OS" != xaix; then
# xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it.
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_LP64=1"
$1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -D_LP64=1"
fi
# toolchain dependend, per-cpu
Expand Down
Expand Up @@ -22,40 +22,41 @@
*/
#include <jni.h>
#include <stdlib.h>
#include "jlong.h"

#include "points.h"

JNIEXPORT jlong JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_points_support_JNIPoint_allocate
(JNIEnv *env, jclass nativePointClass) {
Point* p = malloc(sizeof *p);
return (jlong) p;
return ptr_to_jlong(p);
}

JNIEXPORT void JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_points_support_JNIPoint_free
(JNIEnv *env, jclass cls, jlong thisPoint) {
free((Point*) thisPoint);
free(jlong_to_ptr(thisPoint));
}

JNIEXPORT jint JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_points_support_JNIPoint_getX
(JNIEnv *env, jclass cls, jlong thisPoint) {
Point* point = (Point*) thisPoint;
Point* point = jlong_to_ptr(thisPoint);
return point->x;
}

JNIEXPORT void JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_points_support_JNIPoint_setX
(JNIEnv *env, jclass cls, jlong thisPoint, jint value) {
Point* point = (Point*) thisPoint;
Point* point = jlong_to_ptr(thisPoint);
point->x = value;
}

JNIEXPORT jint JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_points_support_JNIPoint_getY
(JNIEnv *env, jclass cls, jlong thisPoint) {
Point* point = (Point*) thisPoint;
Point* point = jlong_to_ptr(thisPoint);
return point->y;
}

JNIEXPORT void JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_points_support_JNIPoint_setY
(JNIEnv *env, jclass cls, jlong thisPoint, jint value) {
Point* point = (Point*) thisPoint;
Point* point = jlong_to_ptr(thisPoint);
point->y = value;
}

0 comments on commit 31967cb

Please sign in to comment.