primitives

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

primitives

MrGwen
Hi Paolo,

Is it possible to call a primitive like this :

        self callThisPrimitive: 'nameOfThePrimitive' withArgs: args.

Cheers,
Gwenael


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: primitives

Paolo Bonzini-2
Gwenael Casaccio wrote:
> Hi Paolo,
>
> Is it possible to call a primitive like this :
>
> self callThisPrimitive: 'nameOfThePrimitive' withArgs: args.

No, why do you need that?

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: primitives

MrGwen
On Tuesday 24 March 2009 16:02:57 you wrote:

> Gwenael Casaccio wrote:
> > Hi Paolo,
> >
> > Is it possible to call a primitive like this :
> >
> > self callThisPrimitive: 'nameOfThePrimitive' withArgs: args.
>
> No, why do you need that?
>
> Paolo

I'm working on a simulator (which can be used for the debugging tracing,
profiling, and for running old-squeak image, ...)

Gwenael


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: primitives

Paolo Bonzini-2
Gwenael Casaccio wrote:

> On Tuesday 24 March 2009 16:02:57 you wrote:
>> Gwenael Casaccio wrote:
>>> Hi Paolo,
>>>
>>> Is it possible to call a primitive like this :
>>>
>>> self callThisPrimitive: 'nameOfThePrimitive' withArgs: args.
>> No, why do you need that?
>>
>> Paolo
>
> I'm working on a simulator (which can be used for the debugging tracing,
> profiling, and for running old-squeak image, ...)

Ah, I see.  No, there is nothing like that but it should not be hard to
do it (mostly by copying the code of the #perform:withArguments:
primitive).  One question is, what to do if the primitive fails?  You
need a block for that, right?

Still, I think that the single step mode already in the VM is going to
be always faster than a simulator (and it would be usable for tracing
and profiling).  Have you looked at DebugTools?

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: primitives

MrGwen
On Tuesday 24 March 2009 16:16:01 you wrote:

> Gwenael Casaccio wrote:
> > On Tuesday 24 March 2009 16:02:57 you wrote:
> >> Gwenael Casaccio wrote:
> >>> Hi Paolo,
> >>>
> >>> Is it possible to call a primitive like this :
> >>>
> >>> self callThisPrimitive: 'nameOfThePrimitive' withArgs: args.
> >>
> >> No, why do you need that?
> >>
> >> Paolo
> >
> > I'm working on a simulator (which can be used for the debugging tracing,
> > profiling, and for running old-squeak image, ...)
>
> Ah, I see.  No, there is nothing like that but it should not be hard to
> do it (mostly by copying the code of the #perform:withArguments:
> primitive).  One question is, what to do if the primitive fails?  You
> need a block for that, right?
>
> Still, I think that the single step mode already in the VM is going to
> be always faster than a simulator (and it would be usable for tracing
> and profiling).  Have you looked at DebugTools?
>
> Paolo

Thanks I'll look at the DebugTools. By the way I've a question in the
ContextPart there is a byte code for the line of code Am I right ?
Do you store it as an interval for the position in the source code ?

Gwenael


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: primitives

Paolo Bonzini-2

> Thanks I'll look at the DebugTools. By the way I've a question in the
> ContextPart there is a byte code for the line of code Am I right ?
> Do you store it as an interval for the position in the source code ?

The first line bytecode in the method is absolute in the file; the next
ones are relative to the first line in the method (this is to avoid too
many big numbers which would be more expensive to skip over at runtime).
 Source code intervals are never used.

(BTW, DebugTools has SUnit tests that you can refer to).

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk