guile-devel
[Top][All Lists]
Advanced

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

Patches for wip-rtl


From: Noah Lavine
Subject: Patches for wip-rtl
Date: Sat, 20 Apr 2013 19:30:55 -0400

Hello,

I've attached three patches for wip-rtl. The first is somewhat different than the other two: it fixes an error that occurred when moving the linker to its own file. (system vm rtl) and (system vm linker) both contain a function called link-string-table, and (system vm rtl) was calling the wrong one, which made rtl.test fail. I solved this with an @-reference.

The second two provide better VM errors when box-ref and box-set! are called on something that is not a variable. In particular, they throw an exception instead of aborting. This could occur in user code, if the user wants to hand-write RTL code, but it's also very useful in trying a new compiler implementation. The first patch handles box-ref, and the second handles box-set!. Also note that I had to add a new type of exception to (test-suite lib) to catch these errors.

Lastly, I'd like to ask for ideas on how to test for errors in VM instructions that don't cause immediate problems, but do put the VM in an inconsistent state. I know of a collection of these errors, and while I could fix them, I'd rather fix them and add a test for them. I can think of two possibilities off the top of my head: 1) add Scheme accessors for VM state (I don't think mutators are necessary for now) or 2) write the tests in C instead of Scheme.

I'd prefer option 1, mostly because I think that making the VM state more explicit is a good direction to go in anyway - eventually it would be great if the debugger could print the contents of registers, and that would require VM introspection anyway, so I think starting now is good.

What do other people think of the patches and the ideas?

Best,
Noah

Attachment: 0001-Bugfix-in-rtl.scm.patch
Description: Binary data

Attachment: 0002-Better-Exception-in-RTL-VM.patch
Description: Binary data

Attachment: 0003-Better-Exception-in-RTL-VM.patch
Description: Binary data


reply via email to

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