mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
improve the "ignore redefinition" in ClassPath. The first should win.
This commit is contained in:
parent
b26b290464
commit
ce1d3ddb38
@ -61,6 +61,17 @@ public class FunctionManager {
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if this function is already known/registered.
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
* the function name
|
||||||
|
* @return true, if known
|
||||||
|
*/
|
||||||
|
boolean isKnown( FunctionName name ) {
|
||||||
|
return states.get( name ) != null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mark the a function as a import function. Only if the function is also needed then it will imported from
|
* Mark the a function as a import function. Only if the function is also needed then it will imported from
|
||||||
* compiler.
|
* compiler.
|
||||||
|
@ -367,8 +367,12 @@ public class ModuleGenerator {
|
|||||||
private void prepareMethod( MethodInfo method ) throws WasmException {
|
private void prepareMethod( MethodInfo method ) throws WasmException {
|
||||||
try {
|
try {
|
||||||
FunctionName name = new FunctionName( method );
|
FunctionName name = new FunctionName( method );
|
||||||
|
if( functions.isKnown( name ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Map<String,Object> annotationValues;
|
Map<String,Object> annotationValues;
|
||||||
if( (annotationValues = method.getAnnotation( JWebAssembly.REPLACE_ANNOTATION )) != null ) {
|
if( (annotationValues = method.getAnnotation( JWebAssembly.REPLACE_ANNOTATION )) != null ) {
|
||||||
|
functions.isStatic( name ); // register this class that process the annotation of this replacement function not a second time. iSKnown() returns true now.
|
||||||
String signatureName = (String)annotationValues.get( "value" );
|
String signatureName = (String)annotationValues.get( "value" );
|
||||||
name = new FunctionName( signatureName );
|
name = new FunctionName( signatureName );
|
||||||
functions.addReplacement( name, method );
|
functions.addReplacement( name, method );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user