Closed Bug 281247 Opened 20 years ago Closed 20 years ago

JDK compatibility via special class

Categories

(Rhino Graveyard :: Core, enhancement)

x86
Linux
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: igor, Assigned: igor)

Details

Attachments

(1 file, 2 obsolete files)

Rhino core supports JDK 1.1 compatibility to be able to run under MS JVM. To
take advantage of more recent JDK Rhino uses reflection. That introduce overhead
in the vast majority of Rhino embeddings and clutter code with verbose
preparations for reflection calls.

I suggest to replace that by a special compatibility interfaces and use
reflection only once to initialize it.
Attached patch VMBridge implementation (obsolete) — Splinter Review
The patch introduces the new abstract class, omj.VMBridge, with methods to
implement the following functionality:

1. Context.(enter|exit|call)
2. Access to thread-local classloader
3. Access to java.lang.reflect.AccessibleObject API to mark method as
accessible.

There are 2 implementations, omj.jdk11.VMBridge_jdk11 and
omj.jdk13.VMBridge_jdk13. The code for jdk13 case can run under JDK 1.2 but
since support for JDK 1.2 is not on the agenda and in future features like
java.lang.reflect.Proxy could be used by Rhino I explicitly referred to JDK 1.3
in the class name.

During initialization Rhino loads jdk11 case only if it failed to create an
instance of omj.jdk13.VMBridge_jdk13. In addition for additional Rhino also
tries to load initially omj.VMBridge_custom class which Rhino embedding can
provide if necessary.
Attached patch Comments and cleanup (obsolete) — Splinter Review
Changes from the previous version:

1. Comments including reference to the recent changes by Attila Szegedi in bug
281067.

2. VMBridge instance variable is moved from Context to the class itself since
it is not only Context that uses it.
Attachment #173524 - Attachment is obsolete: true
Attached patch Patch to commitSplinter Review
In this version I removed no longer used Class constants in ScriptRuntime.
Attachment #173550 - Attachment is obsolete: true
I committed the last version of the patch
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: