зеркало из https://github.com/mozilla/pluotsorbet.git
Merge branch 'fix-is-final' of https://github.com/brendandahl/j2me.js into fix-is-final
Conflicts: jit/analyze.ts
This commit is contained in:
Коммит
9ca46db104
|
@ -203,7 +203,7 @@ module J2ME {
|
|||
this.isStatic = opts.isStatic;
|
||||
this.isSynchronized = opts.isSynchronized;
|
||||
this.isAbstract = opts.isAbstract;
|
||||
this.isFinal = opts.isAbstract;
|
||||
this.isFinal = opts.isFinal;
|
||||
this.state = MethodState.Cold;
|
||||
this.key = (this.isStatic ? "S." : "I.") + this.name + "." + this.signature;
|
||||
this.implKey = this.classInfo.className + "." + this.name + "." + this.signature;
|
||||
|
|
|
@ -88,26 +88,29 @@ module J2ME {
|
|||
}
|
||||
|
||||
export function isFinalMethod(methodInfo: MethodInfo): boolean {
|
||||
// XXX Determine whether we can start using the code in this function.
|
||||
return false;
|
||||
var result = methodInfo.isFinal;
|
||||
if (!result) {
|
||||
var classInfo = methodInfo.classInfo;
|
||||
var allSubClasses = classInfo.allSubClasses;
|
||||
result = true;
|
||||
for (var i = 0; i < allSubClasses.length; i++) {
|
||||
var subClassMethods = allSubClasses[i].methods;
|
||||
for (var j = 0; j < subClassMethods.length; j++) {
|
||||
var subClassMethodInfo = subClassMethods[j];
|
||||
if (methodInfo.name === subClassMethodInfo.name &&
|
||||
methodInfo.signature === subClassMethodInfo.signature) {
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isFinalClass(methodInfo.classInfo)) {
|
||||
return true;
|
||||
}
|
||||
return result;
|
||||
return methodInfo.isFinal;
|
||||
// XXX The following can only be used if every class in all jars is loaded.
|
||||
//var result = methodInfo.isFinal;
|
||||
//if (!result) {
|
||||
// var classInfo = methodInfo.classInfo;
|
||||
// var allSubClasses = classInfo.allSubClasses;
|
||||
// result = true;
|
||||
// for (var i = 0; i < allSubClasses.length; i++) {
|
||||
// var subClassMethods = allSubClasses[i].methods;
|
||||
// for (var j = 0; j < subClassMethods.length; j++) {
|
||||
// var subClassMethodInfo = subClassMethods[j];
|
||||
// if (methodInfo.name === subClassMethodInfo.name &&
|
||||
// methodInfo.signature === subClassMethodInfo.signature) {
|
||||
// result = false;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//return result;
|
||||
}
|
||||
|
||||
export function gatherCallees(callees: MethodInfo [], classInfo: ClassInfo, methodInfo: MethodInfo) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче