Skip to content

Commit

Permalink
[java] catch up to dotnet in runtime/ but not in compiler/
Browse files Browse the repository at this point in the history
  • Loading branch information
mberends committed Sep 27, 2010
1 parent c7ab6ac commit c0c6232
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -6,4 +6,6 @@
*.jar
gen_*
dotnet/compiler/x.*
dotnet/compiler/NQPSetting.cs
java/compiler/x.*
dotnet/runtime/obj/*
28 changes: 14 additions & 14 deletions java/runtime/Rakudo/Metamodel/Representations/P6opaque.java
Expand Up @@ -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;
Expand All @@ -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".
/// </summary>
/// <param name="Object"></param>
/// <param name="object"></param>
/// <returns></returns>
public boolean defined(ThreadContext tc, RakudoObject object)
{
Expand All @@ -89,7 +89,7 @@ public boolean defined(ThreadContext tc, RakudoObject object)
/// <summary>
/// Gets an attribute.
/// </summary>
/// <param name="Object"></param>
/// <param name="object"></param>
/// <param name="ClassHandle"></param>
/// <param name="Name"></param>
/// <returns></returns>
Expand Down Expand Up @@ -123,7 +123,7 @@ public RakudoObject get_attribute(ThreadContext tc, RakudoObject object, RakudoO
/// <summary>
/// Gets the attribute, using the hint if possible.
/// </summary>
/// <param name="Object"></param>
/// <param name="object"></param>
/// <param name="ClassHandle"></param>
/// <param name="Name"></param>
/// <param name="Hint"></param>
Expand All @@ -150,7 +150,7 @@ public RakudoObject get_attribute_with_hint(ThreadContext tc, RakudoObject objec
/// <summary>
///
/// </summary>
/// <param name="Object"></par /// <param name="ClassHandle"></param>
/// <param name="object"></par /// <param name="ClassHandle"></param>
/// <param name="Name"></param>
/// <param name="Value"></param>
public void bind_attribute(ThreadContext tc, RakudoObject object, RakudoObject classHandle, String name, RakudoObject value)
Expand Down Expand Up @@ -186,7 +186,7 @@ public void bind_attribute(ThreadContext tc, RakudoObject object, RakudoObject c
/// <summary>
/// Bind the attribute, using the hint if possible.
/// </summary>
/// <param name="Object"></param>
/// <param name="object"></param>
/// <param name="ClassHandle"></param>
/// <param name="Name"></param>
/// <param name="Hint"></param>
Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 6 additions & 4 deletions java/runtime/Rakudo/Runtime/Ops.java
Expand Up @@ -81,9 +81,10 @@ public static RakudoObject get_attr_with_hint(ThreadContext tc, RakudoObject obj
/// <param name="Class"></param>
/// <param name="name"></param>
/// <param name="Hint"></param>
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;
}

/// <summary>
Expand All @@ -94,9 +95,10 @@ public static void bind_attr_with_hint(ThreadContext tc, RakudoObject object, Ra
/// <param name="Class"></param>
/// <param name="name"></param>
/// <param name="Hint"></param>
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;
}

/// <summary>
Expand Down

0 comments on commit c0c6232

Please sign in to comment.