Java Code Examples for com.apple.jobjc.PrimitiveCoder.SLongLongCoder#INST
The following examples show how to use
com.apple.jobjc.PrimitiveCoder.SLongLongCoder#INST .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SubclassingTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public void testDoubleIntLongMethod(){ final MyObject instObj = new MyObjectClass(runtime).alloc(); final int arg1 = 3; final long arg2 = 4; final float arg3 = 5.5F; final double expected = 12.5D; final MsgSend sel = new MsgSend(runtime, "add:and:and:", DoubleCoder.INST, SIntCoder.INST, SLongLongCoder.INST, FloatCoder.INST); sel.init(ctx, instObj); SIntCoder.INST.push(ctx, arg1); SLongLongCoder.INST.push(ctx, arg2); FloatCoder.INST.push(ctx, arg3); sel.invoke(ctx); final double ret = DoubleCoder.INST.pop(ctx); assertEquals(expected, ret); }
Example 2
Source File: SubclassingTest.java From hottub with GNU General Public License v2.0 | 6 votes |
public void testDoubleIntLongMethod(){ final MyObject instObj = new MyObjectClass(runtime).alloc(); final int arg1 = 3; final long arg2 = 4; final float arg3 = 5.5F; final double expected = 12.5D; final MsgSend sel = new MsgSend(runtime, "add:and:and:", DoubleCoder.INST, SIntCoder.INST, SLongLongCoder.INST, FloatCoder.INST); sel.init(ctx, instObj); SIntCoder.INST.push(ctx, arg1); SLongLongCoder.INST.push(ctx, arg2); FloatCoder.INST.push(ctx, arg3); sel.invoke(ctx); final double ret = DoubleCoder.INST.pop(ctx); assertEquals(expected, ret); }
Example 3
Source File: PrimitiveCoderDescriptor.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public static PrimitiveCoderDescriptor createCoderDescriptorFor(final char encoding) { switch(encoding) { case 'B': return new PrimitiveCoderDescriptor(BoolCoder.INST, "false"); case 'c': return new PrimitiveCoderDescriptor(SCharCoder.INST, "0"); case 'C': return new PrimitiveCoderDescriptor(UCharCoder.INST, "0"); case 's': return new PrimitiveCoderDescriptor(SShortCoder.INST, "0"); case 'S': return new PrimitiveCoderDescriptor(UShortCoder.INST, "0"); case 'i': return new PrimitiveCoderDescriptor(SIntCoder.INST, "0"); case 'I': return new PrimitiveCoderDescriptor(UIntCoder.INST, "0"); case 'l': return new PrimitiveCoderDescriptor(SLongCoder.INST, "0"); case 'L': return new PrimitiveCoderDescriptor(ULongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long."); case 'q': return new PrimitiveCoderDescriptor(SLongLongCoder.INST, "0"); case 'Q': return new PrimitiveCoderDescriptor(ULongLongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long long."); case 'f': return new PrimitiveCoderDescriptor(PrimitiveCoder.FloatCoder.INST, "0"); case 'd': return new PrimitiveCoderDescriptor(PrimitiveCoder.DoubleCoder.INST, "0"); default: throw new RuntimeException("unknown encoding: " + encoding); } }
Example 4
Source File: Coder.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
static public Coder getCoderAtRuntimeForType(Class cls){ if(runtimeCoders == null) runtimeCoders = new Coder[]{ NSClassCoder.INST, IDCoder.INST, PointerCoder.INST, DoubleCoder.INST, FloatCoder.INST, SLongLongCoder.INST, SIntCoder.INST, SShortCoder.INST, SCharCoder.INST, BoolCoder.INST, VoidCoder.INST }; for(Coder c : runtimeCoders) if((c.getJavaClass() != null && c.getJavaClass().isAssignableFrom(cls)) || (c.getJavaPrimitive() != null && c.getJavaPrimitive().isAssignableFrom(cls))) return c; if(Struct.class.isAssignableFrom(cls)){ try { Method m = cls.getDeclaredMethod("getStructCoder"); m.setAccessible(true); return (Coder) m.invoke(null); } catch (Exception e) { throw new RuntimeException(e); } } throw new RuntimeException("Could not find suitable coder for " + cls); }
Example 5
Source File: SubclassingTest.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public void testDoubleIntLongMethod(){ final MyObject instObj = new MyObjectClass(runtime).alloc(); final int arg1 = 3; final long arg2 = 4; final float arg3 = 5.5F; final double expected = 12.5D; final MsgSend sel = new MsgSend(runtime, "add:and:and:", DoubleCoder.INST, SIntCoder.INST, SLongLongCoder.INST, FloatCoder.INST); sel.init(ctx, instObj); SIntCoder.INST.push(ctx, arg1); SLongLongCoder.INST.push(ctx, arg2); FloatCoder.INST.push(ctx, arg3); sel.invoke(ctx); final double ret = DoubleCoder.INST.pop(ctx); assertEquals(expected, ret); }
Example 6
Source File: PrimitiveCoderDescriptor.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public static PrimitiveCoderDescriptor createCoderDescriptorFor(final char encoding) { switch(encoding) { case 'B': return new PrimitiveCoderDescriptor(BoolCoder.INST, "false"); case 'c': return new PrimitiveCoderDescriptor(SCharCoder.INST, "0"); case 'C': return new PrimitiveCoderDescriptor(UCharCoder.INST, "0"); case 's': return new PrimitiveCoderDescriptor(SShortCoder.INST, "0"); case 'S': return new PrimitiveCoderDescriptor(UShortCoder.INST, "0"); case 'i': return new PrimitiveCoderDescriptor(SIntCoder.INST, "0"); case 'I': return new PrimitiveCoderDescriptor(UIntCoder.INST, "0"); case 'l': return new PrimitiveCoderDescriptor(SLongCoder.INST, "0"); case 'L': return new PrimitiveCoderDescriptor(ULongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long."); case 'q': return new PrimitiveCoderDescriptor(SLongLongCoder.INST, "0"); case 'Q': return new PrimitiveCoderDescriptor(ULongLongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long long."); case 'f': return new PrimitiveCoderDescriptor(PrimitiveCoder.FloatCoder.INST, "0"); case 'd': return new PrimitiveCoderDescriptor(PrimitiveCoder.DoubleCoder.INST, "0"); default: throw new RuntimeException("unknown encoding: " + encoding); } }
Example 7
Source File: Coder.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
static public Coder getCoderAtRuntimeForType(Class cls){ if(runtimeCoders == null) runtimeCoders = new Coder[]{ NSClassCoder.INST, IDCoder.INST, PointerCoder.INST, DoubleCoder.INST, FloatCoder.INST, SLongLongCoder.INST, SIntCoder.INST, SShortCoder.INST, SCharCoder.INST, BoolCoder.INST, VoidCoder.INST }; for(Coder c : runtimeCoders) if((c.getJavaClass() != null && c.getJavaClass().isAssignableFrom(cls)) || (c.getJavaPrimitive() != null && c.getJavaPrimitive().isAssignableFrom(cls))) return c; if(Struct.class.isAssignableFrom(cls)){ try { Method m = cls.getDeclaredMethod("getStructCoder"); m.setAccessible(true); return (Coder) m.invoke(null); } catch (Exception e) { throw new RuntimeException(e); } } throw new RuntimeException("Could not find suitable coder for " + cls); }
Example 8
Source File: Coder.java From hottub with GNU General Public License v2.0 | 6 votes |
static public Coder getCoderAtRuntimeForType(Class cls){ if(runtimeCoders == null) runtimeCoders = new Coder[]{ NSClassCoder.INST, IDCoder.INST, PointerCoder.INST, DoubleCoder.INST, FloatCoder.INST, SLongLongCoder.INST, SIntCoder.INST, SShortCoder.INST, SCharCoder.INST, BoolCoder.INST, VoidCoder.INST }; for(Coder c : runtimeCoders) if((c.getJavaClass() != null && c.getJavaClass().isAssignableFrom(cls)) || (c.getJavaPrimitive() != null && c.getJavaPrimitive().isAssignableFrom(cls))) return c; if(Struct.class.isAssignableFrom(cls)){ try { Method m = cls.getDeclaredMethod("getStructCoder"); m.setAccessible(true); return (Coder) m.invoke(null); } catch (Exception e) { throw new RuntimeException(e); } } throw new RuntimeException("Could not find suitable coder for " + cls); }
Example 9
Source File: PrimitiveCoderDescriptor.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public static PrimitiveCoderDescriptor createCoderDescriptorFor(final char encoding) { switch(encoding) { case 'B': return new PrimitiveCoderDescriptor(BoolCoder.INST, "false"); case 'c': return new PrimitiveCoderDescriptor(SCharCoder.INST, "0"); case 'C': return new PrimitiveCoderDescriptor(UCharCoder.INST, "0"); case 's': return new PrimitiveCoderDescriptor(SShortCoder.INST, "0"); case 'S': return new PrimitiveCoderDescriptor(UShortCoder.INST, "0"); case 'i': return new PrimitiveCoderDescriptor(SIntCoder.INST, "0"); case 'I': return new PrimitiveCoderDescriptor(UIntCoder.INST, "0"); case 'l': return new PrimitiveCoderDescriptor(SLongCoder.INST, "0"); case 'L': return new PrimitiveCoderDescriptor(ULongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long."); case 'q': return new PrimitiveCoderDescriptor(SLongLongCoder.INST, "0"); case 'Q': return new PrimitiveCoderDescriptor(ULongLongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long long."); case 'f': return new PrimitiveCoderDescriptor(PrimitiveCoder.FloatCoder.INST, "0"); case 'd': return new PrimitiveCoderDescriptor(PrimitiveCoder.DoubleCoder.INST, "0"); default: throw new RuntimeException("unknown encoding: " + encoding); } }
Example 10
Source File: SubclassingTest.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public void testDoubleIntLongMethod(){ final MyObject instObj = new MyObjectClass(runtime).alloc(); final int arg1 = 3; final long arg2 = 4; final float arg3 = 5.5F; final double expected = 12.5D; final MsgSend sel = new MsgSend(runtime, "add:and:and:", DoubleCoder.INST, SIntCoder.INST, SLongLongCoder.INST, FloatCoder.INST); sel.init(ctx, instObj); SIntCoder.INST.push(ctx, arg1); SLongLongCoder.INST.push(ctx, arg2); FloatCoder.INST.push(ctx, arg3); sel.invoke(ctx); final double ret = DoubleCoder.INST.pop(ctx); assertEquals(expected, ret); }
Example 11
Source File: PrimitiveCoderDescriptor.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public static PrimitiveCoderDescriptor createCoderDescriptorFor(final char encoding) { switch(encoding) { case 'B': return new PrimitiveCoderDescriptor(BoolCoder.INST, "false"); case 'c': return new PrimitiveCoderDescriptor(SCharCoder.INST, "0"); case 'C': return new PrimitiveCoderDescriptor(UCharCoder.INST, "0"); case 's': return new PrimitiveCoderDescriptor(SShortCoder.INST, "0"); case 'S': return new PrimitiveCoderDescriptor(UShortCoder.INST, "0"); case 'i': return new PrimitiveCoderDescriptor(SIntCoder.INST, "0"); case 'I': return new PrimitiveCoderDescriptor(UIntCoder.INST, "0"); case 'l': return new PrimitiveCoderDescriptor(SLongCoder.INST, "0"); case 'L': return new PrimitiveCoderDescriptor(ULongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long."); case 'q': return new PrimitiveCoderDescriptor(SLongLongCoder.INST, "0"); case 'Q': return new PrimitiveCoderDescriptor(ULongLongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long long."); case 'f': return new PrimitiveCoderDescriptor(PrimitiveCoder.FloatCoder.INST, "0"); case 'd': return new PrimitiveCoderDescriptor(PrimitiveCoder.DoubleCoder.INST, "0"); default: throw new RuntimeException("unknown encoding: " + encoding); } }
Example 12
Source File: PrimitiveCoderDescriptor.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public static PrimitiveCoderDescriptor createCoderDescriptorFor(final char encoding) { switch(encoding) { case 'B': return new PrimitiveCoderDescriptor(BoolCoder.INST, "false"); case 'c': return new PrimitiveCoderDescriptor(SCharCoder.INST, "0"); case 'C': return new PrimitiveCoderDescriptor(UCharCoder.INST, "0"); case 's': return new PrimitiveCoderDescriptor(SShortCoder.INST, "0"); case 'S': return new PrimitiveCoderDescriptor(UShortCoder.INST, "0"); case 'i': return new PrimitiveCoderDescriptor(SIntCoder.INST, "0"); case 'I': return new PrimitiveCoderDescriptor(UIntCoder.INST, "0"); case 'l': return new PrimitiveCoderDescriptor(SLongCoder.INST, "0"); case 'L': return new PrimitiveCoderDescriptor(ULongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long."); case 'q': return new PrimitiveCoderDescriptor(SLongLongCoder.INST, "0"); case 'Q': return new PrimitiveCoderDescriptor(ULongLongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long long."); case 'f': return new PrimitiveCoderDescriptor(PrimitiveCoder.FloatCoder.INST, "0"); case 'd': return new PrimitiveCoderDescriptor(PrimitiveCoder.DoubleCoder.INST, "0"); default: throw new RuntimeException("unknown encoding: " + encoding); } }
Example 13
Source File: Coder.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
static public Coder getCoderAtRuntimeForType(Class cls){ if(runtimeCoders == null) runtimeCoders = new Coder[]{ NSClassCoder.INST, IDCoder.INST, PointerCoder.INST, DoubleCoder.INST, FloatCoder.INST, SLongLongCoder.INST, SIntCoder.INST, SShortCoder.INST, SCharCoder.INST, BoolCoder.INST, VoidCoder.INST }; for(Coder c : runtimeCoders) if((c.getJavaClass() != null && c.getJavaClass().isAssignableFrom(cls)) || (c.getJavaPrimitive() != null && c.getJavaPrimitive().isAssignableFrom(cls))) return c; if(Struct.class.isAssignableFrom(cls)){ try { Method m = cls.getDeclaredMethod("getStructCoder"); m.setAccessible(true); return (Coder) m.invoke(null); } catch (Exception e) { throw new RuntimeException(e); } } throw new RuntimeException("Could not find suitable coder for " + cls); }
Example 14
Source File: SubclassingTest.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public void testDoubleIntLongMethod(){ final MyObject instObj = new MyObjectClass(runtime).alloc(); final int arg1 = 3; final long arg2 = 4; final float arg3 = 5.5F; final double expected = 12.5D; final MsgSend sel = new MsgSend(runtime, "add:and:and:", DoubleCoder.INST, SIntCoder.INST, SLongLongCoder.INST, FloatCoder.INST); sel.init(ctx, instObj); SIntCoder.INST.push(ctx, arg1); SLongLongCoder.INST.push(ctx, arg2); FloatCoder.INST.push(ctx, arg3); sel.invoke(ctx); final double ret = DoubleCoder.INST.pop(ctx); assertEquals(expected, ret); }
Example 15
Source File: Coder.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
static public Coder getCoderAtRuntimeForType(Class cls){ if(runtimeCoders == null) runtimeCoders = new Coder[]{ NSClassCoder.INST, IDCoder.INST, PointerCoder.INST, DoubleCoder.INST, FloatCoder.INST, SLongLongCoder.INST, SIntCoder.INST, SShortCoder.INST, SCharCoder.INST, BoolCoder.INST, VoidCoder.INST }; for(Coder c : runtimeCoders) if((c.getJavaClass() != null && c.getJavaClass().isAssignableFrom(cls)) || (c.getJavaPrimitive() != null && c.getJavaPrimitive().isAssignableFrom(cls))) return c; if(Struct.class.isAssignableFrom(cls)){ try { Method m = cls.getDeclaredMethod("getStructCoder"); m.setAccessible(true); return (Coder) m.invoke(null); } catch (Exception e) { throw new RuntimeException(e); } } throw new RuntimeException("Could not find suitable coder for " + cls); }
Example 16
Source File: Coder.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
static public Coder getCoderAtRuntimeForType(Class cls){ if(runtimeCoders == null) runtimeCoders = new Coder[]{ NSClassCoder.INST, IDCoder.INST, PointerCoder.INST, DoubleCoder.INST, FloatCoder.INST, SLongLongCoder.INST, SIntCoder.INST, SShortCoder.INST, SCharCoder.INST, BoolCoder.INST, VoidCoder.INST }; for(Coder c : runtimeCoders) if((c.getJavaClass() != null && c.getJavaClass().isAssignableFrom(cls)) || (c.getJavaPrimitive() != null && c.getJavaPrimitive().isAssignableFrom(cls))) return c; if(Struct.class.isAssignableFrom(cls)){ try { Method m = cls.getDeclaredMethod("getStructCoder"); m.setAccessible(true); return (Coder) m.invoke(null); } catch (Exception e) { throw new RuntimeException(e); } } throw new RuntimeException("Could not find suitable coder for " + cls); }
Example 17
Source File: Coder.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
static public Coder getCoderAtRuntimeForType(Class cls){ if(runtimeCoders == null) runtimeCoders = new Coder[]{ NSClassCoder.INST, IDCoder.INST, PointerCoder.INST, DoubleCoder.INST, FloatCoder.INST, SLongLongCoder.INST, SIntCoder.INST, SShortCoder.INST, SCharCoder.INST, BoolCoder.INST, VoidCoder.INST }; for(Coder c : runtimeCoders) if((c.getJavaClass() != null && c.getJavaClass().isAssignableFrom(cls)) || (c.getJavaPrimitive() != null && c.getJavaPrimitive().isAssignableFrom(cls))) return c; if(Struct.class.isAssignableFrom(cls)){ try { Method m = cls.getDeclaredMethod("getStructCoder"); m.setAccessible(true); return (Coder) m.invoke(null); } catch (Exception e) { throw new RuntimeException(e); } } throw new RuntimeException("Could not find suitable coder for " + cls); }
Example 18
Source File: SubclassingTest.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public void testDoubleIntLongMethod(){ final MyObject instObj = new MyObjectClass(runtime).alloc(); final int arg1 = 3; final long arg2 = 4; final float arg3 = 5.5F; final double expected = 12.5D; final MsgSend sel = new MsgSend(runtime, "add:and:and:", DoubleCoder.INST, SIntCoder.INST, SLongLongCoder.INST, FloatCoder.INST); sel.init(ctx, instObj); SIntCoder.INST.push(ctx, arg1); SLongLongCoder.INST.push(ctx, arg2); FloatCoder.INST.push(ctx, arg3); sel.invoke(ctx); final double ret = DoubleCoder.INST.pop(ctx); assertEquals(expected, ret); }
Example 19
Source File: Coder.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
static public Coder getCoderAtRuntimeForType(Class cls){ if(runtimeCoders == null) runtimeCoders = new Coder[]{ NSClassCoder.INST, IDCoder.INST, PointerCoder.INST, DoubleCoder.INST, FloatCoder.INST, SLongLongCoder.INST, SIntCoder.INST, SShortCoder.INST, SCharCoder.INST, BoolCoder.INST, VoidCoder.INST }; for(Coder c : runtimeCoders) if((c.getJavaClass() != null && c.getJavaClass().isAssignableFrom(cls)) || (c.getJavaPrimitive() != null && c.getJavaPrimitive().isAssignableFrom(cls))) return c; if(Struct.class.isAssignableFrom(cls)){ try { Method m = cls.getDeclaredMethod("getStructCoder"); m.setAccessible(true); return (Coder) m.invoke(null); } catch (Exception e) { throw new RuntimeException(e); } } throw new RuntimeException("Could not find suitable coder for " + cls); }
Example 20
Source File: SubclassingTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public void testDoubleIntLongMethod(){ final MyObject instObj = new MyObjectClass(runtime).alloc(); final int arg1 = 3; final long arg2 = 4; final float arg3 = 5.5F; final double expected = 12.5D; final MsgSend sel = new MsgSend(runtime, "add:and:and:", DoubleCoder.INST, SIntCoder.INST, SLongLongCoder.INST, FloatCoder.INST); sel.init(ctx, instObj); SIntCoder.INST.push(ctx, arg1); SLongLongCoder.INST.push(ctx, arg2); FloatCoder.INST.push(ctx, arg3); sel.invoke(ctx); final double ret = DoubleCoder.INST.pop(ctx); assertEquals(expected, ret); }