[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [glob2-devel] scripting language
From: |
martin . voelkle |
Subject: |
Re: [glob2-devel] scripting language |
Date: |
Wed, 25 May 2005 13:31:53 +0200 |
User-agent: |
Internet Messaging Program (IMP) 3.2.7 |
> >Actually, no. The DotGNU Portable.NET guys have written a paper about
> efficient
> >bytecode execution and it looks like the the fastest is to store the address
> of
> >the method as the opcode and jump directly to the code of the next
> instruction
> >after executing the current one (a method called computed gotos).
> >
> >
> Sounds much like the old forth language, but I still hav'nt seen the
> possibilite to make an array of goto labels in C :-)
With GCC only, you can get the address of a label like this:
static void *array[] = { &&foo, &&bar, &&hack };
goto *array[i];
foo:
bar:
hack:
Of course, this does exactly the same as a switch. But it becomes interesting
when you replace the opcodes of the instructions in the bytecode with the
addresses of the labels so you can directly jump to the address of the next
instruction without falling back in the loop code.
Martin
Re: [glob2-devel] scripting language, Andrew Sayers, 2005/05/24
- Re: [glob2-devel] scripting language, Bo Lorentsen, 2005/05/25
- Re: [glob2-devel] scripting language, Bo Lorentsen, 2005/05/25
- Re: [glob2-devel] scripting language,
martin . voelkle <=
- Re: [glob2-devel] scripting language, Bo Lorentsen, 2005/05/25
- Re: [glob2-devel] scripting language, martin . voelkle, 2005/05/25
- Re: [glob2-devel] scripting language, Bo Lorentsen, 2005/05/25
- Re: [glob2-devel] scripting language, martin . voelkle, 2005/05/25
Re: [glob2-devel] scripting language, Bo Lorentsen, 2005/05/25
Re: [glob2-devel] licence, MUNTEANU Olimpiu Andrei, 2005/05/25
Re: [glob2-devel] licence, Andrew Sayers, 2005/05/25
Re: [glob2-devel] licence, Bo Lorentsen, 2005/05/25
Re: [glob2-devel] licence, Bo Lorentsen, 2005/05/25