ソースを参照

Remove more java internals

Rudy Ges 1 年間 前
コミット
a794a31e1a

+ 0 - 4
std/java/Boot.hx

@@ -22,9 +22,6 @@
 
 package java;
 
-import java.internal.Function;
-import java.internal.HxObject;
-import java.internal.Runtime;
 import java.Lib;
 import java.Init;
 import java.StdTypes;
@@ -42,7 +39,6 @@ import java.lang.Integer;
 import java.lang.Long;
 import java.lang.Short;
 import java.lang.Throwable;
-import java.internal.FieldLookup;
 
 @:dox(hide)
 extern class Boot {}

+ 0 - 110
std/java/internal/FieldLookup.hx

@@ -1,110 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package java.internal;
-
-import java.lang.System;
-
-@:native('haxe.lang.FieldLookup')
-@:keep
-@:static class FieldLookup {
-	@:functionCode('
-		return s.hashCode();
-	')
-	public static function hash(s:String):Int {
-		return 0;
-	}
-
-	public static function findHash(hash:String, hashs:java.NativeArray<String>, length:Int):Int {
-		var min = 0;
-		var max = length;
-
-		while (min < max) {
-			var mid = Std.int((max + min) / 2); // overflow safe
-			var classify = untyped hash.compareTo(hashs[mid]);
-			if (classify < 0) {
-				max = mid;
-			} else if (classify > 0) {
-				min = mid + 1;
-			} else {
-				return mid;
-			}
-		}
-		// if not found, return a negative value of where it should be inserted
-		return ~min;
-	}
-
-	public static function removeString(a:java.NativeArray<String>, length:Int, pos:Int) {
-		System.arraycopy(a, pos + 1, a, pos, length - pos - 1);
-		a[length - 1] = null;
-	}
-
-	public static function removeFloat(a:java.NativeArray<Float>, length:Int, pos:Int) {
-		System.arraycopy(a, pos + 1, a, pos, length - pos - 1);
-		a[length - 1] = 0;
-	}
-
-	public static function removeDynamic(a:java.NativeArray<Dynamic>, length:Int, pos:Int) {
-		System.arraycopy(a, pos + 1, a, pos, length - pos - 1);
-		a[length - 1] = null;
-	}
-
-	extern static inline function __insert<T>(a:java.NativeArray<T>, length:Int, pos:Int, x:T):java.NativeArray<T> {
-		var capacity = a.length;
-		if (pos == length) {
-			if (capacity == length) {
-				var newarr = new NativeArray((length << 1) + 1);
-				System.arraycopy(a, 0, newarr, 0, a.length);
-				a = newarr;
-			}
-		} else if (pos == 0) {
-			if (capacity == length) {
-				var newarr = new NativeArray((length << 1) + 1);
-				System.arraycopy(a, 0, newarr, 1, length);
-				a = newarr;
-			} else {
-				System.arraycopy(a, 0, a, 1, length);
-			}
-		} else {
-			if (capacity == length) {
-				var newarr = new NativeArray((length << 1) + 1);
-				System.arraycopy(a, 0, newarr, 0, pos);
-				System.arraycopy(a, pos, newarr, pos + 1, length - pos);
-				a = newarr;
-			} else {
-				System.arraycopy(a, pos, a, pos + 1, length - pos);
-				System.arraycopy(a, 0, a, 0, pos);
-			}
-		}
-		a[pos] = x;
-		return a;
-	}
-
-	public static function insertString(a:java.NativeArray<String>, length:Int, pos:Int, x:String):java.NativeArray<String>
-		return __insert(a, length, pos, x);
-
-	public static function insertFloat(a:java.NativeArray<Float>, length:Int, pos:Int, x:Float):java.NativeArray<Float>
-		return __insert(a, length, pos, x);
-
-	public static function insertDynamic(a:java.NativeArray<Dynamic>, length:Int, pos:Int, x:Dynamic):java.NativeArray<Dynamic>
-		return __insert(a, length, pos, x);
-}

+ 0 - 82
std/java/internal/Function.hx

@@ -1,82 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package java.internal;
-
-import java.internal.Runtime;
-
-/**
- * These classes are automatically generated by the compiler. They are only
- * here so there is an option for e.g. defining them as externs if you are compiling
- * in modules (untested)
- *
- * @author waneck
- */
-@:abstract @:nativeGen @:native("haxe.lang.Function") @:keep class Function {
-	function new(arity:Int, type:Int) {}
-}
-
-@:nativeGen @:native("haxe.lang.VarArgsBase") @:keep private class VarArgsBase extends Function {
-	public function __hx_invokeDynamic(dynArgs:java.NativeArray<Dynamic>):Dynamic {
-		throw "Abstract implementation";
-	}
-}
-
-@:nativeGen @:native('haxe.lang.VarArgsFunction') @:keep class VarArgsFunction extends VarArgsBase {
-	private var fun:Array<Dynamic>->Dynamic;
-
-	public function new(fun) {
-		super(-1, -1);
-		this.fun = fun;
-	}
-
-	override public function __hx_invokeDynamic(dynArgs:java.NativeArray<Dynamic>):Dynamic {
-		return fun(dynArgs == null ? [] : @:privateAccess Array.ofNative(dynArgs));
-	}
-}
-
-@:nativeGen @:native('haxe.lang.Closure') @:keep class Closure extends VarArgsBase {
-	private var obj:Dynamic;
-	private var field:String;
-
-	public function new(obj:Dynamic, field) {
-		super(-1, -1);
-		this.obj = obj;
-		this.field = field;
-	}
-
-	override public function __hx_invokeDynamic(dynArgs:java.NativeArray<Dynamic>):Dynamic {
-		return Runtime.callField(obj, field, dynArgs);
-	}
-
-	public function equals(obj:Dynamic):Bool {
-		if (obj == null)
-			return false;
-
-		var c:Closure = cast obj;
-		return (c.obj == this.obj && c.field == this.field);
-	}
-
-	public function hashCode():Int {
-		return obj.hashCode() ^ untyped field.hashCode();
-	}
-}

+ 0 - 297
std/java/internal/HxObject.hx

@@ -1,297 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package java.internal;
-
-import java.internal.IEquatable;
-import haxe.ds.Vector;
-
-private typedef StdType = Type;
-
-@:native('haxe.lang.HxObject')
-@:keep
-private class HxObject implements IHxObject {}
-
-@:native('haxe.lang.IHxObject')
-@:keep
-interface IHxObject {}
-
-@:native('haxe.lang.DynamicObject')
-@:keep
-class DynamicObject extends HxObject {
-	@:skipReflection var __hx_fields:java.NativeArray<String>;
-	@:skipReflection var __hx_dynamics:java.NativeArray<Dynamic>;
-
-	@:skipReflection var __hx_fields_f:java.NativeArray<String>;
-	@:skipReflection var __hx_dynamics_f:java.NativeArray<Float>;
-
-	@:skipReflection var __hx_length:Int;
-	@:skipReflection var __hx_length_f:Int;
-
-	@:skipReflection static var __hx_toString_depth = 0;
-
-	@:overload public function new() {
-		this.__hx_fields = new java.NativeArray(0);
-		this.__hx_dynamics = new java.NativeArray(0);
-		this.__hx_fields_f = new java.NativeArray(0);
-		this.__hx_dynamics_f = new java.NativeArray(0);
-	}
-
-	@:overload public function new(fields:NativeArray<String>, dynamics:NativeArray<Dynamic>, fields_f:NativeArray<String>, dynamics_f:NativeArray<Float>) {
-		this.__hx_fields = fields;
-		this.__hx_dynamics = dynamics;
-		this.__hx_fields_f = fields_f;
-		this.__hx_dynamics_f = dynamics_f;
-		this.__hx_length = fields.length;
-		this.__hx_length_f = fields_f.length;
-	}
-
-	public function __hx_deleteField(field:String):Bool {
-		var res = FieldLookup.findHash(field, this.__hx_fields, this.__hx_length);
-		if (res >= 0) {
-			FieldLookup.removeString(this.__hx_fields, this.__hx_length, res);
-			FieldLookup.removeDynamic(this.__hx_dynamics, this.__hx_length, res);
-			this.__hx_length--;
-			return true;
-		}
-		var res = FieldLookup.findHash(field, this.__hx_fields_f, this.__hx_length_f);
-		if (res >= 0) {
-			FieldLookup.removeString(this.__hx_fields_f, this.__hx_length_f, res);
-			FieldLookup.removeFloat(this.__hx_dynamics_f, this.__hx_length_f, res);
-			this.__hx_length_f--;
-			return true;
-		}
-		return false;
-	}
-
-	public function __hx_getField(field:String, throwErrors:Bool, isCheck:Bool, handleProperties:Bool):Dynamic {
-		var res = FieldLookup.findHash(field, this.__hx_fields, this.__hx_length);
-		if (res >= 0) {
-			return this.__hx_dynamics[res];
-		}
-		res = FieldLookup.findHash(field, this.__hx_fields_f, this.__hx_length_f);
-		if (res >= 0) {
-			return this.__hx_dynamics_f[res];
-		}
-
-		return isCheck ? Runtime.undefined : null;
-	}
-
-	public function __hx_setField(field:String, value:Dynamic, handleProperties:Bool):Dynamic {
-		var res = FieldLookup.findHash(field, this.__hx_fields, this.__hx_length);
-		if (res >= 0) {
-			return this.__hx_dynamics[res] = value;
-		} else {
-			var res = FieldLookup.findHash(field, this.__hx_fields_f, this.__hx_length_f);
-			if (res >= 0) {
-				if (Std.isOfType(value, Float)) {
-					return this.__hx_dynamics_f[res] = value;
-				}
-
-				FieldLookup.removeString(this.__hx_fields_f, this.__hx_length_f, res);
-				FieldLookup.removeFloat(this.__hx_dynamics_f, this.__hx_length_f, res);
-				this.__hx_length_f--;
-			}
-		}
-
-		this.__hx_fields = FieldLookup.insertString(this.__hx_fields, this.__hx_length, ~(res), field);
-		this.__hx_dynamics = FieldLookup.insertDynamic(this.__hx_dynamics, this.__hx_length, ~(res), value);
-		this.__hx_length++;
-		return value;
-	}
-
-	public function __hx_getField_f(field:String, throwErrors:Bool, handleProperties:Bool):Float {
-		var res = FieldLookup.findHash(field, this.__hx_fields_f, this.__hx_length_f);
-		if (res >= 0) {
-			return this.__hx_dynamics_f[res];
-		}
-		res = FieldLookup.findHash(field, this.__hx_fields, this.__hx_length);
-		if (res >= 0) {
-			return this.__hx_dynamics[res];
-		}
-
-		return 0.0;
-	}
-
-	public function __hx_setField_f(field:String, value:Float, handleProperties:Bool):Float {
-		var res = FieldLookup.findHash(field, this.__hx_fields_f, this.__hx_length_f);
-		if (res >= 0) {
-			return this.__hx_dynamics_f[res] = value;
-		} else {
-			var res = FieldLookup.findHash(field, this.__hx_fields, this.__hx_length);
-			if (res >= 0) {
-				// return this.__hx_dynamics[res] = value;
-				FieldLookup.removeString(this.__hx_fields, this.__hx_length, res);
-				FieldLookup.removeDynamic(this.__hx_dynamics, this.__hx_length, res);
-				this.__hx_length--;
-			}
-		}
-
-		this.__hx_fields_f = FieldLookup.insertString(this.__hx_fields_f, this.__hx_length_f, ~(res), field);
-		this.__hx_dynamics_f = FieldLookup.insertFloat(this.__hx_dynamics_f, this.__hx_length_f, ~(res), value);
-		this.__hx_length_f++;
-		return value;
-	}
-
-	public function __hx_getFields(baseArr:Array<String>):Void {
-		for (i in 0...this.__hx_length) {
-			baseArr.push(this.__hx_fields[i]);
-		}
-		for (i in 0...this.__hx_length_f) {
-			baseArr.push(this.__hx_fields_f[i]);
-		}
-	}
-
-	public function __hx_invokeField(field:String, dynargs:NativeArray<Dynamic>):Dynamic {
-		if (field == "toString") {
-			return this.toString();
-		}
-		var fn:Function = this.__hx_getField(field, false, false, false);
-		if (fn == null) {
-			throw 'Cannot invoke field $field: It does not exist';
-		}
-
-		return untyped fn.__hx_invokeDynamic(dynargs);
-	}
-
-	public function toString():String {
-		if (__hx_toString_depth >= 5) {
-			return "...";
-		}
-		++__hx_toString_depth;
-		try {
-			var s = __hx_toString();
-			--__hx_toString_depth;
-			return s;
-		} catch (e:Dynamic) {
-			--__hx_toString_depth;
-			throw(e);
-		}
-	}
-
-	function __hx_toString() {
-		var ts = this.__hx_getField("toString", false, false, false);
-		if (ts != null)
-			return ts();
-		var ret = new StringBuf();
-		ret.add("[");
-		var first = true;
-		for (f in Reflect.fields(this)) {
-			if (first)
-				first = false;
-			else
-				ret.add(",");
-			ret.add(" ");
-			ret.add(f);
-			ret.add(" : ");
-			ret.add(Reflect.field(this, f));
-		}
-		if (!first)
-			ret.add(" ");
-		ret.add("]");
-		return ret.toString();
-	}
-}
-
-@:keep @:native('haxe.lang.Enum') @:nativeGen
-class HxEnum {
-	@:readOnly private var index(default, never):Int;
-
-	public function new(index:Int) {
-		untyped this.index = index;
-	}
-
-	public function getTag():String {
-		return throw new haxe.exceptions.NotImplementedException();
-	}
-
-	public function getParams():Array<{}> {
-		return [];
-	}
-
-	public function toString():String {
-		return getTag();
-	}
-}
-
-@:keep @:native('haxe.lang.ParamEnum') @:nativeGen
-private class ParamEnum extends HxEnum {
-	@:readOnly private var params(default, never):Vector<Dynamic>;
-
-	public function new(index:Int, params:Vector<Dynamic>) {
-		super(index);
-		untyped this.params = params;
-	}
-
-	override public function getParams():Array<{}> {
-		return params == null ? [] : cast params.toArray();
-	}
-
-	override public function toString():String {
-		if (params == null || params.length == 0)
-			return getTag();
-		var ret = new StringBuf();
-		ret.add(getTag());
-		ret.add("(");
-		var first = true;
-		for (p in params) {
-			if (first)
-				first = false;
-			else
-				ret.add(",");
-			ret.add(p);
-		}
-		ret.add(")");
-		return ret.toString();
-	}
-
-	public function equals(obj:Dynamic) {
-		if (obj == this) // we cannot use == as .Equals !
-			return true;
-		var obj:ParamEnum = Std.isOfType(obj, ParamEnum) ? cast obj : null;
-		var ret = obj != null && Std.isOfType(obj, StdType.getEnum(cast this)) && obj.index == this.index;
-		if (!ret)
-			return false;
-		if (obj.params == this.params)
-			return true;
-		var len = 0;
-		if (obj.params == null || this.params == null || (len = this.params.length) != obj.params.length)
-			return false;
-		for (i in 0...len) {
-			if (!StdType.enumEq(obj.params[i], this.params[i]))
-				return false;
-		}
-		return true;
-	}
-
-	public function hashCode():Int {
-		var h = 19;
-		if (params != null)
-			for (p in params) {
-				h = h * 31;
-				if (p != null)
-					untyped h += p.hashCode();
-			}
-		h += index;
-		return h;
-	}
-}

+ 0 - 30
std/java/internal/IEquatable.hx

@@ -1,30 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package java.internal;
-
-@:native('haxe.lang.IEquatable')
-@:keep
-@:nativeGen
-interface IEquatable {
-	public function equals(to:Dynamic):Bool;
-}

+ 0 - 598
std/java/internal/Runtime.hx

@@ -1,598 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package java.internal;
-
-/**
-	This class is meant for internal compiler use only. It provides the Haxe runtime
-	compatibility to the host language. Do not access it directly.
-**/
-@:native('haxe.lang.Runtime')
-@:nativeGen
-@:classCode('
-	public static java.lang.Object getField(haxe.lang.IHxObject obj, java.lang.String field, boolean throwErrors)
-	{
-		if (obj == null && !throwErrors) return null;
-		return obj.__hx_getField(field, throwErrors, false, false);
-	}
-
-	public static double getField_f(haxe.lang.IHxObject obj, java.lang.String field, boolean throwErrors)
-	{
-		if (obj == null && !throwErrors) return 0.0;
-		return obj.__hx_getField_f(field, throwErrors, false);
-	}
-
-	public static java.lang.Object setField(haxe.lang.IHxObject obj, java.lang.String field, java.lang.Object value)
-	{
-		return obj.__hx_setField(field, value, false);
-	}
-
-	public static double setField_f(haxe.lang.IHxObject obj, java.lang.String field, double value)
-	{
-		return obj.__hx_setField_f(field, value, false);
-	}
-
-	public static java.lang.Object callField(haxe.lang.IHxObject obj, java.lang.String field, java.lang.Object[] args)
-	{
-		return obj.__hx_invokeField(field, args);
-	}
-')
-@:keep class Runtime {
-	public static var undefined:Dynamic = {};
-
-	@:functionCode('
-	return new haxe.lang.Closure(obj, field);
-	')
-	public static function closure(obj:Dynamic, field:String):Dynamic {
-		return null;
-	}
-
-	@:functionCode('
-			if (v1 == v2)
-				return true;
-			if (v1 == null || v2 == null)
-				return false;
-
-			if (v1 instanceof java.lang.Number)
-			{
-				if (!(v2 instanceof java.lang.Number))
-					return false;
-
-				java.lang.Number v1c = (java.lang.Number) v1;
-				java.lang.Number v2c = (java.lang.Number) v2;
-				if (v1 instanceof java.lang.Long || v2 instanceof java.lang.Long)
-					return v1c.longValue() == v2c.longValue();
-				return v1c.doubleValue() == v2c.doubleValue();
-			} else if (v1 instanceof java.lang.String || v1 instanceof haxe.lang.IEquatable) { //TODO see what happens with Boolean cases
-				return v1.equals(v2);
-			}
-
-			return false;
-	')
-	public static function eq(v1:Dynamic, v2:Dynamic):Bool {
-		return false;
-	}
-
-	@:functionCode('
-		if (v1 == v2)
-			return true;
-
-		if (v1 instanceof java.lang.String || v1 instanceof haxe.lang.IEquatable)
-		{
-			return v1 != null && v1.equals(v2);
-		} else {
-			return v1 == v2;
-		}
-	')
-	public static function refEq(v1:{}, v2:{}):Bool {
-		return false;
-	}
-
-	@:functionCode('
-		return v1 == v2 || (v1 != null && v1.equals(v2));
-	')
-	public static function valEq(v1:{}, v2:{}):Bool {
-		return false;
-	}
-
-	@:functionCode('
-		return (obj == null) ? 0.0 : ((java.lang.Number) obj).doubleValue();
-	')
-	public static function toDouble(obj:Dynamic):Float {
-		return 0.0;
-	}
-
-	public static function toBool(obj:java.lang.Boolean):Bool {
-		return obj == null ? false : obj.booleanValue();
-	}
-
-	@:functionCode('
-		return (obj == null) ? 0 : ((java.lang.Number) obj).intValue();
-	')
-	public static function toInt(obj:Dynamic):Int {
-		return 0;
-	}
-
-	public static function toLong(obj:Dynamic):haxe.Int64 {
-		return obj == null ? 0 : (obj : java.lang.Number).longValue();
-	}
-
-	@:functionCode('
-		if (obj != null && obj instanceof java.lang.Number)
-		{
-			return true;
-		} else {
-			return false;
-		}
-	')
-	public static function isDouble(obj:Dynamic):Bool {
-		return false;
-	}
-
-	@:overload public static function isInt(obj:Dynamic):Bool {
-		if (Std.isOfType(obj, java.lang.Number)) {
-			var n:java.lang.Number = obj;
-			return n.doubleValue() == n.intValue();
-		} else {
-			return false;
-		}
-	}
-
-	@:overload public static function isInt(num:java.lang.Number):Bool {
-		return num != null && num.doubleValue() == num.intValue();
-	}
-
-	@:functionCode('
-		java.lang.Class cl = null;
-		if (o instanceof java.lang.Class)
-		{
-			if (o == java.lang.String.class)
-				return field.equals("fromCharCode");
-
-			cl = (java.lang.Class) o;
-		} else if (o instanceof java.lang.String) {
-			return haxe.lang.StringRefl.handleGetField( (java.lang.String) o, field, false) != null;
-		} else {
-			cl = o.getClass();
-		}
-
-		try
-		{
-			java.lang.reflect.Field f = cl.getField(field);
-			return true;
-		}
-		catch(Throwable t)
-		{
-			java.lang.reflect.Method[] ms = cl.getMethods();
-			for (int i = 0; i < ms.length; i++)
-			{
-				if (ms[i].getName().equals(field))
-				{
-					return true;
-				}
-			}
-		}
-
-		return false;
-	')
-	public static function slowHasField(o:Dynamic, field:String):Bool {
-		return false;
-	}
-
-	@:functionCode('
-			if (v1 == v2)
-				return 0;
-			if (v1 == null) return -1;
-			if (v2 == null) return 1;
-
-			if (v1 instanceof java.lang.Number || v2 instanceof java.lang.Number)
-			{
-				java.lang.Number v1c = (java.lang.Number) v1;
-				java.lang.Number v2c = (java.lang.Number) v2;
-
-				if (v1 instanceof java.lang.Long || v2 instanceof java.lang.Long)
-				{
-					long l1 = (v1 == null) ? 0L : v1c.longValue();
-					long l2 = (v2 == null) ? 0L : v2c.longValue();
-          return (l1 < l2) ? -1 : (l1 > l2) ? 1 : 0;
-				} else {
-					double d1 = (v1 == null) ? 0.0 : v1c.doubleValue();
-					double d2 = (v2 == null) ? 0.0 : v2c.doubleValue();
-
-          return (d1 < d2) ? -1 : (d1 > d2) ? 1 : 0;
-				}
-			}
-			//if it\'s not a number it must be a String
-			return ((java.lang.String) v1).compareTo((java.lang.String) v2);
-	')
-	public static function compare(v1:Dynamic, v2:Dynamic):Int {
-		return 0;
-	}
-
-	@:functionCode('
-			if (v1 instanceof java.lang.String || v2 instanceof java.lang.String)
-				return toString(v1) + toString(v2);
-
-			if (v1 instanceof java.lang.Number || v2 instanceof java.lang.Number)
-			{
-				java.lang.Number v1c = (java.lang.Number) v1;
-				java.lang.Number v2c = (java.lang.Number) v2;
-
-				double d1 = (v1 == null) ? 0.0 : v1c.doubleValue();
-				double d2 = (v2 == null) ? 0.0 : v2c.doubleValue();
-
-				return d1 + d2;
-			}
-
-			throw new java.lang.IllegalArgumentException("Cannot dynamically add " + v1 + " and " + v2);
-	')
-	public static function plus(v1:Dynamic, v2:Dynamic):Dynamic {
-		return null;
-	}
-
-	@:functionCode('
-
-	if (obj == null)
-		if (throwErrors)
-			throw new java.lang.NullPointerException("Cannot access field \'" + field + "\' of null.");
-		else
-			return null;
-
-	java.lang.Class cl = null;
-	try
-	{
-		if (obj instanceof java.lang.Class)
-		{
-			if (obj == java.lang.String.class && field.equals("fromCharCode"))
-				return new haxe.lang.Closure(haxe.lang.StringExt.class, field);
-
-			cl = (java.lang.Class) obj;
-			obj = null;
-		} else if (obj instanceof java.lang.String) {
-			return haxe.lang.StringRefl.handleGetField((java.lang.String) obj, field, throwErrors);
-		} else {
-			cl = obj.getClass();
-		}
-
-		java.lang.reflect.Field f = cl.getField(field);
-		f.setAccessible(true);
-		return f.get(obj);
-	} catch (Throwable t)
-	{
-		try
-		{
-			java.lang.reflect.Method[] ms = cl.getMethods();
-			for (int i = 0; i < ms.length; i++)
-			{
-				if (ms[i].getName().equals(field))
-				{
-					return new haxe.lang.Closure(obj != null ? obj : cl, field);
-				}
-			}
-		} catch (Throwable t2)
-		{
-
-		}
-
-		if (throwErrors)
-			throw (java.lang.RuntimeException)haxe.Exception.thrown(t);
-
-		return null;
-	}
-
-	')
-	public static function slowGetField(obj:Dynamic, field:String, throwErrors:Bool):Dynamic {
-		return null;
-	}
-
-	@:functionCode('
-		java.lang.Class cl = null;
-		if (obj instanceof java.lang.Class)
-		{
-			cl = (java.lang.Class) obj;
-			obj = null;
-		} else {
-			cl = obj.getClass();
-		}
-
-		try {
-			java.lang.reflect.Field f = cl.getField(field);
-			f.setAccessible(true);
-
-			//FIXME we must evaluate if field to be set receives either int or double
-			if (isInt(value))
-			{
-				f.setInt(obj, toInt(value));
-			} else if (isDouble(value)) {
-				f.setDouble(obj, toDouble(value));
-			} else {
-				f.set(obj, value);
-			}
-			return value;
-		}
-		catch (Throwable t)
-		{
-			throw (java.lang.RuntimeException)haxe.Exception.thrown(t);
-		}
-	')
-	public static function slowSetField(obj:Dynamic, field:String, value:Dynamic):Dynamic {
-		return null;
-	}
-
-	@:functionCode('
-		java.lang.Class cl = null;
-		if (obj instanceof java.lang.Class)
-		{
-			if (obj == java.lang.String.class && field.equals("fromCharCode"))
-				return haxe.lang.StringExt.fromCharCode(toInt(args[0]));
-
-			cl = (java.lang.Class) obj;
-			obj = null;
-		} else if (obj instanceof java.lang.String) {
-			return haxe.lang.StringRefl.handleCallField((java.lang.String) obj, field, args);
-		} else {
-			cl = obj.getClass();
-		}
-
-		if (args == null) args = new java.lang.Object[0];
-
-		int len = args.length;
-		java.lang.Class[] cls = new java.lang.Class[len];
-		java.lang.Object[] objs = new java.lang.Object[len];
-
-		java.lang.reflect.Method[] ms = cl.getMethods();
-		int msl = ms.length;
-		int realMsl = 0;
-		for(int i =0; i < msl; i++)
-		{
-			if (!ms[i].getName().equals(field) || (!ms[i].isVarArgs() && ms[i].getParameterTypes().length != len))
-			{
-				ms[i] = null;
-			} else {
-				ms[realMsl] = ms[i];
-				if (realMsl != i)
-					ms[i] = null;
-				realMsl++;
-			}
-		}
-
-		boolean hasNumber = false;
-
-		for (int i = 0; i < len; i++)
-		{
-			Object o = args[i];
-			if (o == null)
-			{
-				continue; //can be anything
-			}
-			objs[i]= o;
-			cls[i] = o.getClass();
-			boolean isNum = false;
-
-			if (o instanceof java.lang.Number)
-			{
-				cls[i] = java.lang.Number.class;
-				isNum = hasNumber = true;
-			} else if (o instanceof java.lang.Boolean) {
-				cls[i] = java.lang.Boolean.class;
-				isNum = true;
-			}
-
-			msl = realMsl;
-			realMsl = 0;
-
-			for (int j = 0; j < msl; j++)
-			{
-				java.lang.Class[] allcls = ms[j].getParameterTypes();
-				if (i < allcls.length)
-				{
-					if (!  ((isNum && allcls[i].isPrimitive()) || allcls[i].isAssignableFrom(cls[i])) )
-					{
-						ms[j] = null;
-					} else {
-						ms[realMsl] = ms[j];
-						if (realMsl != j)
-							ms[j] = null;
-						realMsl++;
-					}
-				}
-			}
-
-		}
-
-		java.lang.reflect.Method found;
-		if (ms.length == 0 || (found = ms[0]) == null)
-			throw (java.lang.RuntimeException)haxe.Exception.thrown("No compatible method found for: " + field);
-
-		if (hasNumber)
-		{
-			java.lang.Class[] allcls = found.getParameterTypes();
-
-			for (int i = 0; i < len; i++)
-			{
-				java.lang.Object o = objs[i];
-				if (o instanceof java.lang.Number)
-				{
-					java.lang.Class curCls = null;
-					if (i < allcls.length)
-					{
-						curCls = allcls[i];
-						if (!curCls.isAssignableFrom(o.getClass()))
-						{
-							String name = curCls.getName();
-							if (name.equals("double") || name.equals("java.lang.Double"))
-							{
-								objs[i] = ((java.lang.Number)o).doubleValue();
-							} else if (name.equals("int") || name.equals("java.lang.Integer"))
-							{
-								objs[i] = ((java.lang.Number)o).intValue();
-							} else if (name.equals("float") || name.equals("java.lang.Float"))
-							{
-								objs[i] = ((java.lang.Number)o).floatValue();
-							} else if (name.equals("byte") || name.equals("java.lang.Byte"))
-							{
-								objs[i] = ((java.lang.Number)o).byteValue();
-							} else if (name.equals("short") || name.equals("java.lang.Short"))
-							{
-								objs[i] = ((java.lang.Number)o).shortValue();
-							} else if (name.equals("long") || name.equals("java.lang.Long"))
-							{
-								objs[i] = ((java.lang.Number)o).longValue();
-							}
-						}
-					} //else varargs not handled TODO
-				}
-			}
-		}
-
-		try {
-			found.setAccessible(true);
-			return found.invoke(obj, objs);
-		}
-
-		catch (java.lang.reflect.InvocationTargetException e)
-		{
-			throw (java.lang.RuntimeException)haxe.Exception.thrown(e.getCause());
-		}
-
-		catch (Throwable t)
-		{
-			throw (java.lang.RuntimeException)haxe.Exception.thrown(t);
-		}
-	')
-	public static function slowCallField(obj:Dynamic, field:String, args:java.NativeArray<Dynamic>):Dynamic {
-		return null;
-	}
-
-	@:functionCode('
-		if (obj instanceof haxe.lang.IHxObject)
-		{
-			return ((haxe.lang.IHxObject) obj).__hx_invokeField(field, args);
-		}
-
-		return slowCallField(obj, field, args);
-	')
-	public static function callField(obj:Dynamic, field:String, args:java.NativeArray<Dynamic>):Dynamic {
-		return null;
-	}
-
-	@:functionCode('
-
-		if (obj instanceof haxe.lang.IHxObject)
-			return ((haxe.lang.IHxObject) obj).__hx_getField(field, throwErrors, false, false);
-
-		return slowGetField(obj, field, throwErrors);
-
-	')
-	public static function getField(obj:Dynamic, field:String, throwErrors:Bool):Dynamic {
-		return null;
-	}
-
-	@:functionCode('
-
-		if (obj instanceof haxe.lang.IHxObject)
-			return ((haxe.lang.IHxObject) obj).__hx_getField_f(field, throwErrors, false);
-
-		return toDouble(slowGetField(obj, field, throwErrors));
-
-	')
-	public static function getField_f(obj:Dynamic, field:String, throwErrors:Bool):Float {
-		return 0.0;
-	}
-
-	@:functionCode('
-
-		if (obj instanceof haxe.lang.IHxObject)
-			return ((haxe.lang.IHxObject) obj).__hx_setField(field, value, false);
-
-		return slowSetField(obj, field, value);
-
-	')
-	public static function setField(obj:Dynamic, field:String, value:Dynamic):Dynamic {
-		return null;
-	}
-
-	@:functionCode('
-
-		if (obj instanceof haxe.lang.IHxObject)
-			return ((haxe.lang.IHxObject) obj).__hx_setField_f(field, value, false);
-
-		return toDouble(slowSetField(obj, field, value));
-
-	')
-	public static function setField_f(obj:Dynamic, field:String, value:Float):Float {
-		return 0.0;
-	}
-
-	public static function toString(obj:Dynamic):String {
-		if (obj == null)
-			return null;
-
-		if (Std.isOfType(obj, java.lang.Number) && !Std.isOfType(obj, java.lang.Integer.IntegerClass) && isInt((obj : java.lang.Number)))
-			return java.lang.Integer._toString(toInt(obj));
-		return untyped obj.toString();
-	}
-
-	public static function isFinite(v:Float):Bool {
-		return (v == v) && !java.lang.Double.DoubleClass._isInfinite(v);
-	}
-
-	public static function getIntFromNumber(n:java.lang.Number):Int {
-		return n == null ? 0 : n.intValue();
-	}
-
-	public static function getFloatFromNumber(n:java.lang.Number):Float {
-		return n == null ? 0.0 : n.doubleValue();
-	}
-
-	public static function getInt64FromNumber(n:java.lang.Number):java.StdTypes.Int64 {
-		return n == null ? 0.0 : n.longValue();
-	}
-
-	public static function numToInteger(num:java.lang.Number):java.lang.Integer {
-		return num == null ? null : (Std.isOfType(num, java.lang.Integer.IntegerClass) ? cast num : java.lang.Integer.valueOf(num.intValue()));
-	}
-
-	public static function numToDouble(num:java.lang.Number):java.lang.Double {
-		return num == null ? null : (Std.isOfType(num, java.lang.Double.DoubleClass) ? cast num : java.lang.Double.valueOf(num.doubleValue()));
-	}
-
-	public static function numToFloat(num:java.lang.Number):java.lang.Float {
-		return num == null ? null : (Std.isOfType(num, java.lang.Float.FloatClass) ? cast num : java.lang.Float.valueOf(num.floatValue()));
-	}
-
-	public static function numToByte(num:java.lang.Number):java.lang.Byte {
-		return num == null ? null : (Std.isOfType(num, java.lang.Byte.ByteClass) ? cast num : java.lang.Byte.valueOf(num.byteValue()));
-	}
-
-	public static function numToLong(num:java.lang.Number):java.lang.Long {
-		return num == null ? null : (Std.isOfType(num, java.lang.Long.LongClass) ? cast num : java.lang.Long.valueOf(num.longValue()));
-	}
-
-	public static function numToShort(num:java.lang.Number):java.lang.Short {
-		return num == null ? null : (Std.isOfType(num, java.lang.Short.ShortClass) ? cast num : java.lang.Short.valueOf(num.shortValue()));
-	}
-}
-
-@:keep @:native("haxe.lang.EmptyObject") enum EmptyObject {
-	EMPTY;
-}