This commit is contained in:
Andreas Gal 2014-07-19 17:33:14 -07:00
Родитель a51f7e27fa
Коммит 8a2bdec2b2
1 изменённых файлов: 5 добавлений и 10 удалений

Просмотреть файл

@ -33,21 +33,16 @@ Native.prototype.invokeNative = function(caller, methodInfo) {
var signature = Signature.parse(methodInfo.signature);
var args = popArgs(signature.IN);
if (!methodInfo.native)
methodInfo.native = this.getNativeMethod(methodInfo);
if (!methodInfo.native) {
methodInfo.native = this[methodInfo.classInfo.className + "." +
methodInfo.name + "." +
methodInfo.signature];
}
var result = methodInfo.native.apply(caller, args);
if (signature.OUT.length)
pushType(signature.OUT[0].type, result);
}
Native.prototype.getNativeMethod = function(methodInfo) {
var classInfo = methodInfo.classInfo;
var className = classInfo.className;
var methodName = methodInfo.name;
var signature = methodInfo.signature;
return this[className + "." + methodName + "." + signature];
}
Native.prototype["java/lang/System.arraycopy.(Ljava/lang/Object;ILjava/lang/Object;II)V"] = function(src, srcOffset, dst, dstOffset, length) {
if (!src || !dst) {
throw VM.newException("java/lang/NullPointerException", "Cannot copy to/from a null array.");