com.apple.jobjc.Coder.IDCoder Java Examples

The following examples show how to use com.apple.jobjc.Coder.IDCoder. 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: Invoke.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void init(final NativeArgumentBuffer argBuf, final ID obj, final NSClass cls) {
    funCall.init(argBuf);

    // Instead of mallocing a struct, or keeping another thread local,
    // let's write objc_super out to the argbuf, and then point an argument
    // to the data.

    final long valPtr = argBuf.argValuesPtr;
    final int ptrLen = JObjCRuntime.PTR_LEN;

    IDCoder     .INST.push(argBuf.runtime, valPtr,          obj);
    NSClassCoder.INST.push(argBuf.runtime, valPtr + ptrLen, cls);
    argBuf.argValuesPtr += ptrLen + ptrLen;

    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, valPtr);
    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, selPtr);
}
 
Example #2
Source File: Invoke.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void init(final NativeArgumentBuffer argBuf, final ID obj, final NSClass cls) {
    funCall.init(argBuf);

    // Instead of mallocing a struct, or keeping another thread local,
    // let's write objc_super out to the argbuf, and then point an argument
    // to the data.

    final long valPtr = argBuf.argValuesPtr;
    final int ptrLen = JObjCRuntime.PTR_LEN;

    IDCoder     .INST.push(argBuf.runtime, valPtr,          obj);
    NSClassCoder.INST.push(argBuf.runtime, valPtr + ptrLen, cls);
    argBuf.argValuesPtr += ptrLen + ptrLen;

    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, valPtr);
    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, selPtr);
}
 
Example #3
Source File: Invoke.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void init(final NativeArgumentBuffer argBuf, final ID obj, final NSClass cls) {
    funCall.init(argBuf);

    // Instead of mallocing a struct, or keeping another thread local,
    // let's write objc_super out to the argbuf, and then point an argument
    // to the data.

    final long valPtr = argBuf.argValuesPtr;
    final int ptrLen = JObjCRuntime.PTR_LEN;

    IDCoder     .INST.push(argBuf.runtime, valPtr,          obj);
    NSClassCoder.INST.push(argBuf.runtime, valPtr + ptrLen, cls);
    argBuf.argValuesPtr += ptrLen + ptrLen;

    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, valPtr);
    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, selPtr);
}
 
Example #4
Source File: Invoke.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void init(final NativeArgumentBuffer argBuf, final ID obj, final NSClass cls) {
    funCall.init(argBuf);

    // Instead of mallocing a struct, or keeping another thread local,
    // let's write objc_super out to the argbuf, and then point an argument
    // to the data.

    final long valPtr = argBuf.argValuesPtr;
    final int ptrLen = JObjCRuntime.PTR_LEN;

    IDCoder     .INST.push(argBuf.runtime, valPtr,          obj);
    NSClassCoder.INST.push(argBuf.runtime, valPtr + ptrLen, cls);
    argBuf.argValuesPtr += ptrLen + ptrLen;

    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, valPtr);
    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, selPtr);
}
 
Example #5
Source File: Invoke.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void init(final NativeArgumentBuffer argBuf, final ID obj, final NSClass cls) {
    funCall.init(argBuf);

    // Instead of mallocing a struct, or keeping another thread local,
    // let's write objc_super out to the argbuf, and then point an argument
    // to the data.

    final long valPtr = argBuf.argValuesPtr;
    final int ptrLen = JObjCRuntime.PTR_LEN;

    IDCoder     .INST.push(argBuf.runtime, valPtr,          obj);
    NSClassCoder.INST.push(argBuf.runtime, valPtr + ptrLen, cls);
    argBuf.argValuesPtr += ptrLen + ptrLen;

    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, valPtr);
    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, selPtr);
}
 
Example #6
Source File: Invoke.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void init(final NativeArgumentBuffer argBuf, final ID obj, final NSClass cls) {
    funCall.init(argBuf);

    // Instead of mallocing a struct, or keeping another thread local,
    // let's write objc_super out to the argbuf, and then point an argument
    // to the data.

    final long valPtr = argBuf.argValuesPtr;
    final int ptrLen = JObjCRuntime.PTR_LEN;

    IDCoder     .INST.push(argBuf.runtime, valPtr,          obj);
    NSClassCoder.INST.push(argBuf.runtime, valPtr + ptrLen, cls);
    argBuf.argValuesPtr += ptrLen + ptrLen;

    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, valPtr);
    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, selPtr);
}
 
Example #7
Source File: Invoke.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void init(final NativeArgumentBuffer argBuf, final ID obj, final NSClass cls) {
    funCall.init(argBuf);

    // Instead of mallocing a struct, or keeping another thread local,
    // let's write objc_super out to the argbuf, and then point an argument
    // to the data.

    final long valPtr = argBuf.argValuesPtr;
    final int ptrLen = JObjCRuntime.PTR_LEN;

    IDCoder     .INST.push(argBuf.runtime, valPtr,          obj);
    NSClassCoder.INST.push(argBuf.runtime, valPtr + ptrLen, cls);
    argBuf.argValuesPtr += ptrLen + ptrLen;

    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, valPtr);
    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, selPtr);
}
 
Example #8
Source File: Invoke.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void init(final NativeArgumentBuffer argBuf, final ID obj, final NSClass cls) {
    funCall.init(argBuf);

    // Instead of mallocing a struct, or keeping another thread local,
    // let's write objc_super out to the argbuf, and then point an argument
    // to the data.

    final long valPtr = argBuf.argValuesPtr;
    final int ptrLen = JObjCRuntime.PTR_LEN;

    IDCoder     .INST.push(argBuf.runtime, valPtr,          obj);
    NSClassCoder.INST.push(argBuf.runtime, valPtr + ptrLen, cls);
    argBuf.argValuesPtr += ptrLen + ptrLen;

    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, valPtr);
    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, selPtr);
}
 
Example #9
Source File: Invoke.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void init(final NativeArgumentBuffer argBuf, final ID obj, final NSClass cls) {
    funCall.init(argBuf);

    // Instead of mallocing a struct, or keeping another thread local,
    // let's write objc_super out to the argbuf, and then point an argument
    // to the data.

    final long valPtr = argBuf.argValuesPtr;
    final int ptrLen = JObjCRuntime.PTR_LEN;

    IDCoder     .INST.push(argBuf.runtime, valPtr,          obj);
    NSClassCoder.INST.push(argBuf.runtime, valPtr + ptrLen, cls);
    argBuf.argValuesPtr += ptrLen + ptrLen;

    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, valPtr);
    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, selPtr);
}
 
Example #10
Source File: Invoke.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void init(final NativeArgumentBuffer argBuf, final ID obj, final NSClass cls) {
    funCall.init(argBuf);

    // Instead of mallocing a struct, or keeping another thread local,
    // let's write objc_super out to the argbuf, and then point an argument
    // to the data.

    final long valPtr = argBuf.argValuesPtr;
    final int ptrLen = JObjCRuntime.PTR_LEN;

    IDCoder     .INST.push(argBuf.runtime, valPtr,          obj);
    NSClassCoder.INST.push(argBuf.runtime, valPtr + ptrLen, cls);
    argBuf.argValuesPtr += ptrLen + ptrLen;

    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, valPtr);
    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, selPtr);
}
 
Example #11
Source File: Invoke.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void init(final NativeArgumentBuffer argBuf, final ID obj, final NSClass cls) {
    funCall.init(argBuf);

    // Instead of mallocing a struct, or keeping another thread local,
    // let's write objc_super out to the argbuf, and then point an argument
    // to the data.

    final long valPtr = argBuf.argValuesPtr;
    final int ptrLen = JObjCRuntime.PTR_LEN;

    IDCoder     .INST.push(argBuf.runtime, valPtr,          obj);
    NSClassCoder.INST.push(argBuf.runtime, valPtr + ptrLen, cls);
    argBuf.argValuesPtr += ptrLen + ptrLen;

    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, valPtr);
    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, selPtr);
}
 
Example #12
Source File: Invoke.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void init(final NativeArgumentBuffer argBuf, final ID obj, final NSClass cls) {
    funCall.init(argBuf);

    // Instead of mallocing a struct, or keeping another thread local,
    // let's write objc_super out to the argbuf, and then point an argument
    // to the data.

    final long valPtr = argBuf.argValuesPtr;
    final int ptrLen = JObjCRuntime.PTR_LEN;

    IDCoder     .INST.push(argBuf.runtime, valPtr,          obj);
    NSClassCoder.INST.push(argBuf.runtime, valPtr + ptrLen, cls);
    argBuf.argValuesPtr += ptrLen + ptrLen;

    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, valPtr);
    PrimitivePointerCoder.INST.push(argBuf.runtime, argBuf, selPtr);
}
 
Example #13
Source File: SubclassingTest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void testNSStringNSStringMethod(){
    final MyObject instObj = new MyObjectClass(runtime).alloc();

    final NSString orig = Utils.get().strings().nsString("foobar");
    final String expected = "foobarfoobarfoobar";

    final MsgSend sel = new MsgSend(runtime, "stringTimesThree:", IDCoder.INST, IDCoder.INST);
    sel.init(ctx, instObj);
    IDCoder.INST.push(ctx, orig);
    sel.invoke(ctx);
    NSString ret = (NSString) IDCoder.INST.pop(ctx);
    assertEquals(expected, Utils.get().strings().javaString(ret));
}
 
Example #14
Source File: Invoke.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static Coder[] getSelCoders(final Coder[] argCoders) {
    final Coder[] selArgCoders = new Coder[argCoders.length + 2];
    selArgCoders[0] = IDCoder.INST;
    selArgCoders[1] = SELCoder.INST;
    for (int i = 0; i < argCoders.length; i++)
        selArgCoders[i + 2] = argCoders[i];
    return selArgCoders;
}
 
Example #15
Source File: Invoke.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static Coder[] getSelCoders(final Coder[] argCoders) {
    final Coder[] selArgCoders = new Coder[argCoders.length + 2];
    selArgCoders[0] = IDCoder.INST;
    selArgCoders[1] = SELCoder.INST;
    for (int i = 0; i < argCoders.length; i++)
        selArgCoders[i + 2] = argCoders[i];
    return selArgCoders;
}
 
Example #16
Source File: SubclassingTest.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void testNSStringNSStringMethod(){
    final MyObject instObj = new MyObjectClass(runtime).alloc();

    final NSString orig = Utils.get().strings().nsString("foobar");
    final String expected = "foobarfoobarfoobar";

    final MsgSend sel = new MsgSend(runtime, "stringTimesThree:", IDCoder.INST, IDCoder.INST);
    sel.init(ctx, instObj);
    IDCoder.INST.push(ctx, orig);
    sel.invoke(ctx);
    NSString ret = (NSString) IDCoder.INST.pop(ctx);
    assertEquals(expected, Utils.get().strings().javaString(ret));
}
 
Example #17
Source File: SubclassingTest.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void testNSStringNSStringMethod(){
    final MyObject instObj = new MyObjectClass(runtime).alloc();

    final NSString orig = Utils.get().strings().nsString("foobar");
    final String expected = "foobarfoobarfoobar";

    final MsgSend sel = new MsgSend(runtime, "stringTimesThree:", IDCoder.INST, IDCoder.INST);
    sel.init(ctx, instObj);
    IDCoder.INST.push(ctx, orig);
    sel.invoke(ctx);
    NSString ret = (NSString) IDCoder.INST.pop(ctx);
    assertEquals(expected, Utils.get().strings().javaString(ret));
}
 
Example #18
Source File: Invoke.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
static Coder[] getSelCoders(final Coder[] argCoders) {
    final Coder[] selArgCoders = new Coder[argCoders.length + 2];
    selArgCoders[0] = IDCoder.INST;
    selArgCoders[1] = SELCoder.INST;
    for (int i = 0; i < argCoders.length; i++)
        selArgCoders[i + 2] = argCoders[i];
    return selArgCoders;
}
 
Example #19
Source File: SubclassingTest.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void testNSStringNSStringMethod(){
    final MyObject instObj = new MyObjectClass(runtime).alloc();

    final NSString orig = Utils.get().strings().nsString("foobar");
    final String expected = "foobarfoobarfoobar";

    final MsgSend sel = new MsgSend(runtime, "stringTimesThree:", IDCoder.INST, IDCoder.INST);
    sel.init(ctx, instObj);
    IDCoder.INST.push(ctx, orig);
    sel.invoke(ctx);
    NSString ret = (NSString) IDCoder.INST.pop(ctx);
    assertEquals(expected, Utils.get().strings().javaString(ret));
}
 
Example #20
Source File: Invoke.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
static Coder[] getSelCoders(final Coder[] argCoders) {
    final Coder[] selArgCoders = new Coder[argCoders.length + 2];
    selArgCoders[0] = IDCoder.INST;
    selArgCoders[1] = SELCoder.INST;
    for (int i = 0; i < argCoders.length; i++)
        selArgCoders[i + 2] = argCoders[i];
    return selArgCoders;
}
 
Example #21
Source File: SubclassingTest.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void testNSStringNSStringMethod(){
    final MyObject instObj = new MyObjectClass(runtime).alloc();

    final NSString orig = Utils.get().strings().nsString("foobar");
    final String expected = "foobarfoobarfoobar";

    final MsgSend sel = new MsgSend(runtime, "stringTimesThree:", IDCoder.INST, IDCoder.INST);
    sel.init(ctx, instObj);
    IDCoder.INST.push(ctx, orig);
    sel.invoke(ctx);
    NSString ret = (NSString) IDCoder.INST.pop(ctx);
    assertEquals(expected, Utils.get().strings().javaString(ret));
}
 
Example #22
Source File: Invoke.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
static Coder[] getSelCoders(final Coder[] argCoders) {
    final Coder[] selArgCoders = new Coder[argCoders.length + 2];
    selArgCoders[0] = IDCoder.INST;
    selArgCoders[1] = SELCoder.INST;
    for (int i = 0; i < argCoders.length; i++)
        selArgCoders[i + 2] = argCoders[i];
    return selArgCoders;
}
 
Example #23
Source File: SubclassingTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void testNSStringNSStringMethod(){
    final MyObject instObj = new MyObjectClass(runtime).alloc();

    final NSString orig = Utils.get().strings().nsString("foobar");
    final String expected = "foobarfoobarfoobar";

    final MsgSend sel = new MsgSend(runtime, "stringTimesThree:", IDCoder.INST, IDCoder.INST);
    sel.init(ctx, instObj);
    IDCoder.INST.push(ctx, orig);
    sel.invoke(ctx);
    NSString ret = (NSString) IDCoder.INST.pop(ctx);
    assertEquals(expected, Utils.get().strings().javaString(ret));
}
 
Example #24
Source File: Invoke.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static Coder[] getSelCoders(final Coder[] argCoders) {
    final Coder[] selArgCoders = new Coder[argCoders.length + 2];
    selArgCoders[0] = IDCoder.INST;
    selArgCoders[1] = SELCoder.INST;
    for (int i = 0; i < argCoders.length; i++)
        selArgCoders[i + 2] = argCoders[i];
    return selArgCoders;
}
 
Example #25
Source File: SubclassingTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void testNSStringNSStringMethod(){
    final MyObject instObj = new MyObjectClass(runtime).alloc();

    final NSString orig = Utils.get().strings().nsString("foobar");
    final String expected = "foobarfoobarfoobar";

    final MsgSend sel = new MsgSend(runtime, "stringTimesThree:", IDCoder.INST, IDCoder.INST);
    sel.init(ctx, instObj);
    IDCoder.INST.push(ctx, orig);
    sel.invoke(ctx);
    NSString ret = (NSString) IDCoder.INST.pop(ctx);
    assertEquals(expected, Utils.get().strings().javaString(ret));
}
 
Example #26
Source File: Invoke.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
static Coder[] getSelCoders(final Coder[] argCoders) {
    final Coder[] selArgCoders = new Coder[argCoders.length + 2];
    selArgCoders[0] = IDCoder.INST;
    selArgCoders[1] = SELCoder.INST;
    for (int i = 0; i < argCoders.length; i++)
        selArgCoders[i + 2] = argCoders[i];
    return selArgCoders;
}
 
Example #27
Source File: SubclassingTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void testNSStringNSStringMethod(){
    final MyObject instObj = new MyObjectClass(runtime).alloc();

    final NSString orig = Utils.get().strings().nsString("foobar");
    final String expected = "foobarfoobarfoobar";

    final MsgSend sel = new MsgSend(runtime, "stringTimesThree:", IDCoder.INST, IDCoder.INST);
    sel.init(ctx, instObj);
    IDCoder.INST.push(ctx, orig);
    sel.invoke(ctx);
    NSString ret = (NSString) IDCoder.INST.pop(ctx);
    assertEquals(expected, Utils.get().strings().javaString(ret));
}
 
Example #28
Source File: Invoke.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
static Coder[] getSelCoders(final Coder[] argCoders) {
    final Coder[] selArgCoders = new Coder[argCoders.length + 2];
    selArgCoders[0] = IDCoder.INST;
    selArgCoders[1] = SELCoder.INST;
    for (int i = 0; i < argCoders.length; i++)
        selArgCoders[i + 2] = argCoders[i];
    return selArgCoders;
}
 
Example #29
Source File: SubclassingTest.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void testNSStringNSStringMethod(){
    final MyObject instObj = new MyObjectClass(runtime).alloc();

    final NSString orig = Utils.get().strings().nsString("foobar");
    final String expected = "foobarfoobarfoobar";

    final MsgSend sel = new MsgSend(runtime, "stringTimesThree:", IDCoder.INST, IDCoder.INST);
    sel.init(ctx, instObj);
    IDCoder.INST.push(ctx, orig);
    sel.invoke(ctx);
    NSString ret = (NSString) IDCoder.INST.pop(ctx);
    assertEquals(expected, Utils.get().strings().javaString(ret));
}
 
Example #30
Source File: SubclassingTest.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void testNSStringNSStringMethod(){
    final MyObject instObj = new MyObjectClass(runtime).alloc();

    final NSString orig = Utils.get().strings().nsString("foobar");
    final String expected = "foobarfoobarfoobar";

    final MsgSend sel = new MsgSend(runtime, "stringTimesThree:", IDCoder.INST, IDCoder.INST);
    sel.init(ctx, instObj);
    IDCoder.INST.push(ctx, orig);
    sel.invoke(ctx);
    NSString ret = (NSString) IDCoder.INST.pop(ctx);
    assertEquals(expected, Utils.get().strings().javaString(ret));
}