Skip to content

Commit 284b535

Browse files
committed
Remove legacy support for switching to libpolyglot using --polyglot in node launcher.
1 parent 4e372cc commit 284b535

File tree

3 files changed

+7
-23
lines changed

3 files changed

+7
-23
lines changed

graal-nodejs/deps/v8/src/graal/graal_isolate.cc

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -88,23 +88,17 @@
8888

8989
#ifdef __APPLE__
9090
#define LIBNODESVM_NAME "libgraal-nodejs.dylib"
91-
#define LIBPOLYGLOT_NAME "libpolyglot.dylib"
9291
#define LIBNODESVM_RELPATH "/languages/nodejs/lib/" LIBNODESVM_NAME
93-
#define LIBPOLYGLOT_RELPATH "/lib/polyglot/" LIBPOLYGLOT_NAME
9492
#define LIBJVM_RELPATH "/lib/server/libjvm.dylib"
9593
// libjli.dylib has moved in JDK 12, see https://bugs.openjdk.java.net/browse/JDK-8210931
9694
#define LIBJLI_RELPATH "/lib/libjli.dylib"
9795
#elif defined(_WIN32)
9896
#define LIBNODESVM_NAME "graal-nodejs.dll"
99-
#define LIBPOLYGLOT_NAME "polyglot.dll"
10097
#define LIBNODESVM_RELPATH "\\languages\\nodejs\\lib\\" LIBNODESVM_NAME
101-
#define LIBPOLYGLOT_RELPATH "\\lib\\polyglot\\" LIBPOLYGLOT_NAME
10298
#define LIBJVM_RELPATH "\\bin\\server\\jvm.dll"
10399
#else
104100
#define LIBNODESVM_NAME "libgraal-nodejs.so"
105-
#define LIBPOLYGLOT_NAME "libpolyglot.so"
106101
#define LIBNODESVM_RELPATH "/languages/nodejs/lib/" LIBNODESVM_NAME
107-
#define LIBPOLYGLOT_RELPATH "/lib/polyglot/" LIBPOLYGLOT_NAME
108102
#define LIBJVM_RELPATH "/lib/server/libjvm.so"
109103
#endif
110104

@@ -311,7 +305,7 @@ v8::Isolate* GraalIsolate::New(v8::Isolate::CreateParams const& params, v8::Isol
311305
jdk_path = graalvm_home;
312306
SetEnv("JAVA_HOME", jdk_path.c_str());
313307

314-
jvmlib_path = graalvm_home + (polyglot ? LIBPOLYGLOT_RELPATH : LIBNODESVM_RELPATH);
308+
jvmlib_path = graalvm_home + LIBNODESVM_RELPATH;
315309

316310
if (mode == kModeNative || (mode == kModeDefault && file_exists(jvmlib_path))) {
317311
SetEnv("NODE_JVM_LIB", jvmlib_path.c_str());
@@ -375,9 +369,7 @@ v8::Isolate* GraalIsolate::New(v8::Isolate::CreateParams const& params, v8::Isol
375369
}
376370

377371
if (!file_exists(jvmlib_path)) {
378-
if (is_graalvm && polyglot) {
379-
fprintf(stderr, "Cannot find %s. Rebuild the polyglot library with `gu rebuild-images libpolyglot`, specify JAVA_HOME so that $JAVA_HOME%s exists, or specify NODE_JVM_LIB directly.\n", jvmlib_path.c_str(), LIBJVM_RELPATH);
380-
} else if (mode == kModeNative) {
372+
if (mode == kModeNative) {
381373
fprintf(stderr, "Cannot find %s. Specify NODE_JVM_LIB directly.\n", jvmlib_path.c_str());
382374
} else if (mode == kModeJVM) {
383375
fprintf(stderr, "Cannot find %s. Specify JAVA_HOME so that $JAVA_HOME%s exists.\n", jvmlib_path.c_str(), LIBJVM_RELPATH);
@@ -1444,7 +1436,6 @@ v8::Local<v8::Value> GraalIsolate::CorrectReturnValue(v8::internal::Address valu
14441436
int GraalIsolate::argc = 0;
14451437
char** GraalIsolate::argv = nullptr;
14461438
int GraalIsolate::mode = GraalIsolate::kModeDefault;
1447-
bool GraalIsolate::polyglot = false;
14481439
bool GraalIsolate::use_classpath_env_var = false;
14491440

14501441
void GraalIsolate::SetPromiseHook(v8::PromiseHook promise_hook) {

graal-nodejs/deps/v8/src/graal/graal_isolate.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -767,13 +767,10 @@ class GraalIsolate {
767767
}
768768
}
769769

770-
static void SetMode(int mode, bool polyglot) {
770+
static void SetMode(int mode) {
771771
if (mode != kModeDefault) {
772772
GraalIsolate::mode = mode;
773773
}
774-
if (polyglot) {
775-
GraalIsolate::polyglot = true;
776-
}
777774
}
778775

779776
static void InitThreadLocals();
@@ -863,7 +860,6 @@ class GraalIsolate {
863860
static int argc;
864861
static char** argv;
865862
static int mode;
866-
static bool polyglot;
867863
static bool use_classpath_env_var;
868864
friend v8::V8;
869865

graal-nodejs/deps/v8/src/graal/v8.cc

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -1237,7 +1237,6 @@ namespace v8 {
12371237
bool show_help = false;
12381238
bool use_jvm = false;
12391239
bool use_native = false;
1240-
bool use_polyglot = false;
12411240
bool show_jvm_warning = false;
12421241
bool show_native_warning = false;
12431242
std::string vm_args;
@@ -1297,8 +1296,6 @@ namespace v8 {
12971296
} else {
12981297
if (!strcmp(arg, "--help")) {
12991298
show_help = true;
1300-
} else if (!strcmp(arg, "--polyglot")) {
1301-
use_polyglot = true;
13021299
}
13031300
argv[++unprocessed] = arg;
13041301
}
@@ -1324,7 +1321,7 @@ namespace v8 {
13241321
GraalIsolate::SetEnv("NODE_JVM_OPTIONS", vm_args.c_str());
13251322
}
13261323

1327-
GraalIsolate::SetMode(use_jvm ? GraalIsolate::kModeJVM : (use_native ? GraalIsolate::kModeNative : GraalIsolate::kModeDefault), use_polyglot);
1324+
GraalIsolate::SetMode(use_jvm ? GraalIsolate::kModeJVM : (use_native ? GraalIsolate::kModeNative : GraalIsolate::kModeDefault));
13281325
GraalIsolate::SetFlags(unprocessed, argv + 1);
13291326
if (remove_flags) {
13301327
// claim that we understood and processed all command line options

0 commit comments

Comments
 (0)