discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: StepTalk patch: argument bytecode sign bug fix, optimization literal


From: Stefan Urbanek
Subject: Re: StepTalk patch: argument bytecode sign bug fix, optimization literals, stack overflow fix
Date: Thu, 27 May 2004 22:02:20 +0200

Hi,

On 2004-05-26 16:01:23 +0200 Mateu Batle <lists@tragnarion.com> wrote:

Hi everybody !

I have submitted a patch to savannah web, which fixes following bugs:

- Fixed bug with signed/unsigned bytecode, which made StepTalk to crash if has more than 127 literals in the array.


Thanks, fixed.

- Possible problem of stack overflow, returned object are never pop from stack if nobody uses them. Please check this fix.


Can you send me an example code that shows this bug?

- Optimization: literal array usage, don't create a new entry if already exists


I am not sure that this is good idea. Literals are created as mutable objects 
to maintain smalltalk compatibility. If you had two equal array literals and 
added an objectv to one, you will have that object in the other array where you 
thought that it was the same as before.

Some comments also:

- bytecodes seem to be 1 byte long for each, operation and two arguments (max 3 bytes). I think it may fall short in some cases, for example for the literals table index. This is the reason of the optimization submitted in the patch, before all literals where always appended
to the array without checking if they could be reused.


Bytecodes can be extended to any width, there is no problem with that. Or ... 
they can be removed and replaced by direct statement tree.

- In STBytecode bytecode code and arguments are defined as short, but they are always 1 byte.
It does not matter that much, but it can be confusing.


Better would be to ged rid of btecodes in StepTalk.

Thanks!

Stefan
--
http://stefan.agentfarms.net

First they ignore you, then they laugh at you, then they fight you, then you 
win.
- Mahatma Gandhi






reply via email to

[Prev in Thread] Current Thread [Next in Thread]