mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
On the Java backend, use specialised MethodPtr interfaces so that when calling
Branches: main
On the Java backend, use specialised MethodPtr interfaces so that when calling
a method pointer input arguments do not have to be passed via a temporary
array, for arities up to 15. For higher arities the temporary array is still
used.
java/runtime/MethodPtr.java:
java/runtime/MethodPtr1.java:
java/runtime/MethodPtr10.java:
java/runtime/MethodPtr11.java:
java/runtime/MethodPtr12.java:
java/runtime/MethodPtr13.java:
java/runtime/MethodPtr14.java:
java/runtime/MethodPtr15.java:
java/runtime/MethodPtr2.java:
java/runtime/MethodPtr3.java:
java/runtime/MethodPtr4.java:
java/runtime/MethodPtr5.java:
java/runtime/MethodPtr6.java:
java/runtime/MethodPtr7.java:
java/runtime/MethodPtr8.java:
java/runtime/MethodPtr9.java:
java/runtime/MethodPtrN.java:
Add specialised MethodPtr interfaces and MethodPtrN for any higher
arities.
compiler/mlds_to_java.m:
Make the code generator use the specialised MethodPtr interfaces.
library/Mmakefile:
Compile java/runtime/*.java files explicitly as some MethodPtr*.java
files won't be compiled implicitly when compiling the standard library.
library/exception.m:
java/runtime/Exception.java:
library/rtti_implementation.m:
Conform to changes.
This commit is contained in:
@@ -9,7 +9,7 @@ package jmercury.runtime;
|
||||
public class Exception extends java.lang.Error {
|
||||
// This is to be set when the exception module is initialised, to avoid
|
||||
// having the runtime depend on the standard library.
|
||||
public static MethodPtr getMessageHook = null;
|
||||
public static MethodPtr1 getMessageHook = null;
|
||||
|
||||
// Should be univ.Univ_0 but we don't want to depend on the standard
|
||||
// library.
|
||||
@@ -21,8 +21,7 @@ public class Exception extends java.lang.Error {
|
||||
|
||||
public String getMessage() {
|
||||
if (getMessageHook != null) {
|
||||
Object[] args = new Object[] { exception };
|
||||
return (String) getMessageHook.call___0_0(args);
|
||||
return (String) getMessageHook.call___0_0(exception);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user