Can we make prim 118 support mirror logic?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Can we make prim 118 support mirror logic?

Denis Kudriashov
 
Hi.

Right now prim 118 is probably only reflective call which not support mirror logic.
It named #tryPrimitive:withArguments:. And it fails when it is called with receiver as first argument.
Can we add support for it?

The reason why I ask is because now any proxy should define this method to support debugger.

Best regards,
Denis
Reply | Threaded
Open this post in threaded view
|

Re: Can we make prim 118 support mirror logic?

Clément Bera-4
 
Hi Denis,

In the VM the comment for primitive 118 is the following:

"Implement either ProtoObject>>tryPrimitive: primIndex withArgs: argArray
or Context>>receiver: anObject tryPrimitive: primIndex withArgs: argArray.
If this primitive fails, arrange that its error code is a negative integer, to
distinguish between this failing and the primitive it invokes failing."

So mirror logic for primitive 118 should already be supported.

However when I try it...

Mirror new receiver: 20 tryPrimitive: 1 withArgs: { 22 } => primitive failed

20 tryPrimitive: 1 withArgs: { 22 } => 42

So I think it's a bug that should be fixed.

Thanks for reporting.


On Tue, Jan 31, 2017 at 1:40 PM, Denis Kudriashov <[hidden email]> wrote:
 
Hi.

Right now prim 118 is probably only reflective call which not support mirror logic.
It named #tryPrimitive:withArguments:. And it fails when it is called with receiver as first argument.
Can we add support for it?

The reason why I ask is because now any proxy should define this method to support debugger.

Best regards,
Denis


Reply | Threaded
Open this post in threaded view
|

Re: Can we make prim 118 support mirror logic?

Bert Freudenberg
 
It used to work. In the Spur VM we shipped with Squeak 5.0 it works. The VM sources are from Feb 5 2015. With a recent VM, the primitive fails, indeed.

- Bert -

On Tue, Jan 31, 2017 at 3:14 PM, Clément Bera <[hidden email]> wrote:
 
Hi Denis,

In the VM the comment for primitive 118 is the following:

"Implement either ProtoObject>>tryPrimitive: primIndex withArgs: argArray
or Context>>receiver: anObject tryPrimitive: primIndex withArgs: argArray.
If this primitive fails, arrange that its error code is a negative integer, to
distinguish between this failing and the primitive it invokes failing."

So mirror logic for primitive 118 should already be supported.

However when I try it...

Mirror new receiver: 20 tryPrimitive: 1 withArgs: { 22 } => primitive failed

20 tryPrimitive: 1 withArgs: { 22 } => 42

So I think it's a bug that should be fixed.

Thanks for reporting.


On Tue, Jan 31, 2017 at 1:40 PM, Denis Kudriashov <[hidden email]> wrote:
 
Hi.

Right now prim 118 is probably only reflective call which not support mirror logic.
It named #tryPrimitive:withArguments:. And it fails when it is called with receiver as first argument.
Can we add support for it?

The reason why I ask is because now any proxy should define this method to support debugger.

Best regards,
Denis




Reply | Threaded
Open this post in threaded view
|

Re: Can we make prim 118 support mirror logic?

Bert Freudenberg
 
On Tue, Jan 31, 2017 at 3:57 PM, Bert Freudenberg <[hidden email]> wrote:
It used to work. In the Spur VM we shipped with Squeak 5.0 it works. The VM sources are from Feb 5 2015.

That was VMMaker.oscog-eem.1039, if someone wants to bisect :)

- Bert -

 
With a recent VM, the primitive fails, indeed.

- Bert -

On Tue, Jan 31, 2017 at 3:14 PM, Clément Bera <[hidden email]> wrote:
 
Hi Denis,

In the VM the comment for primitive 118 is the following:

"Implement either ProtoObject>>tryPrimitive: primIndex withArgs: argArray
or Context>>receiver: anObject tryPrimitive: primIndex withArgs: argArray.
If this primitive fails, arrange that its error code is a negative integer, to
distinguish between this failing and the primitive it invokes failing."

So mirror logic for primitive 118 should already be supported.

However when I try it...

Mirror new receiver: 20 tryPrimitive: 1 withArgs: { 22 } => primitive failed

20 tryPrimitive: 1 withArgs: { 22 } => 42

So I think it's a bug that should be fixed.

Thanks for reporting.


On Tue, Jan 31, 2017 at 1:40 PM, Denis Kudriashov <[hidden email]> wrote:
 
Hi.

Right now prim 118 is probably only reflective call which not support mirror logic.
It named #tryPrimitive:withArguments:. And it fails when it is called with receiver as first argument.
Can we add support for it?

The reason why I ask is because now any proxy should define this method to support debugger.

Best regards,
Denis