diff --git a/.gitignore b/.gitignore index c86ab21..b76aac4 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ *.jar gen_* dotnet/compiler/x.* +dotnet/compiler/NQPSetting.cs java/compiler/x.* +dotnet/runtime/obj/* diff --git a/java/runtime/Rakudo/Metamodel/Representations/P6opaque.java b/java/runtime/Rakudo/Metamodel/Representations/P6opaque.java index e00b571..aa7c488 100644 --- a/java/runtime/Rakudo/Metamodel/Representations/P6opaque.java +++ b/java/runtime/Rakudo/Metamodel/Representations/P6opaque.java @@ -68,7 +68,7 @@ public RakudoObject type_object_for(ThreadContext tc, RakudoObject MetaPackage) public RakudoObject instance_of(ThreadContext tc, RakudoObject what) { if (SlotAllocation == null) - ComputeSlotAllocation(null, what); + ComputeSlotAllocation(tc, what); Instance object = new Instance(what.getSTable()); object.SlotStorage = new RakudoObject[Slots]; return object; @@ -79,7 +79,7 @@ public RakudoObject instance_of(ThreadContext tc, RakudoObject what) /// this a type object", which in trun means "did we allocate /// any storage". /// - /// + /// /// public boolean defined(ThreadContext tc, RakudoObject object) { @@ -89,7 +89,7 @@ public boolean defined(ThreadContext tc, RakudoObject object) /// /// Gets an attribute. /// - /// + /// /// /// /// @@ -123,7 +123,7 @@ public RakudoObject get_attribute(ThreadContext tc, RakudoObject object, RakudoO /// /// Gets the attribute, using the hint if possible. /// - /// + /// /// /// /// @@ -150,7 +150,7 @@ public RakudoObject get_attribute_with_hint(ThreadContext tc, RakudoObject objec /// /// /// - /// + /// /// /// public void bind_attribute(ThreadContext tc, RakudoObject object, RakudoObject classHandle, String name, RakudoObject value) @@ -186,7 +186,7 @@ public void bind_attribute(ThreadContext tc, RakudoObject object, RakudoObject c /// /// Bind the attribute, using the hint if possible. /// - /// + /// /// /// /// @@ -231,33 +231,32 @@ public int hint_for(ThreadContext tc, RakudoObject ClassHandle, String Name) return Hints.NO_HINT; } - public void set_int(ThreadContext tc, RakudoObject Object, int Value) + public void set_int(ThreadContext tc, RakudoObject object, int Value) { - System.err.println("This type of representation cannot box a native int"); - System.exit(1); + throw new UnsupportedOperationException("This type of representation cannot box a native int"); } - public int get_int(ThreadContext tc, RakudoObject Object) + public int get_int(ThreadContext tc, RakudoObject object) { throw new UnsupportedOperationException("This type of representation cannot unbox to a native int"); } - public void set_num(ThreadContext tc, RakudoObject Object, double Value) + public void set_num(ThreadContext tc, RakudoObject object, double Value) { throw new UnsupportedOperationException("This type of representation cannot box a native num"); } - public double get_num(ThreadContext tc, RakudoObject Object) + public double get_num(ThreadContext tc, RakudoObject object) { throw new UnsupportedOperationException("This type of representation cannot unbox to a native num"); } - public void set_str(ThreadContext tc, RakudoObject Object, String Value) + public void set_str(ThreadContext tc, RakudoObject object, String Value) { throw new UnsupportedOperationException("This type of representation cannot box a native String"); } - public String get_str(ThreadContext tc, RakudoObject Object) + public String get_str(ThreadContext tc, RakudoObject object) { throw new UnsupportedOperationException("This type of representation cannot unbox to a native String"); } @@ -314,6 +313,7 @@ private void ComputeSlotAllocation(ThreadContext tc, RakudoObject WHAT) if (ParentElems == 0) { // We're done. \o/ + Slots = CurrentSlot; break; } else if (ParentElems > 1) diff --git a/java/runtime/Rakudo/Runtime/Ops.java b/java/runtime/Rakudo/Runtime/Ops.java index e9baada..c8b97b8 100644 --- a/java/runtime/Rakudo/Runtime/Ops.java +++ b/java/runtime/Rakudo/Runtime/Ops.java @@ -81,9 +81,10 @@ public static RakudoObject get_attr_with_hint(ThreadContext tc, RakudoObject obj /// /// /// - public static void bind_attr_with_hint(ThreadContext tc, RakudoObject object, RakudoObject Class, String name, RakudoObject Value) + public static RakudoObject bind_attr_with_hint(ThreadContext tc, RakudoObject object, RakudoObject Class, String name, RakudoObject value) { - object.getSTable().REPR.bind_attribute(tc, object, Class, name, Value); + object.getSTable().REPR.bind_attribute(tc, object, Class, name, value); + return value; } /// @@ -94,9 +95,10 @@ public static void bind_attr_with_hint(ThreadContext tc, RakudoObject object, Ra /// /// /// - public static void bind_attr_with_hint(ThreadContext tc, RakudoObject object, RakudoObject Class, String name, int Hint, RakudoObject Value) + public static RakudoObject bind_attr_with_hint(ThreadContext tc, RakudoObject object, RakudoObject Class, String name, int Hint, RakudoObject value) { - object.getSTable().REPR.bind_attribute_with_hint(tc, object, Class, name, Hint, Value); + object.getSTable().REPR.bind_attribute_with_hint(tc, object, Class, name, Hint, value); + return value; } ///