GNU bug report logs - #4470
23.1; threaded interpreter

Previous Next

Package: emacs;

Reported by: Tom Tromey <tromey <at> redhat.com>

Date: Thu, 17 Sep 2009 21:05:04 UTC

Severity: wishlist

Tags: patch

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 4470 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Tom Tromey <tromey <at> redhat.com>
Cc: 4470 <at> debbugs.gnu.org
Subject: Re: bug#4470: Acknowledgement (23.1; threaded interpreter)
Date: Fri, 18 Sep 2009 20:25:46 +0200
Tom Tromey <tromey <at> redhat.com> writes:

> +      static int initialized;
> +
> +      if (!initialized)
> +	{
> +	  int i;
> +	  initialized = 1;
> +	  /* We must initialize every slot in the table.  An empty
> +	     slot before Bconstant should just abort.  All the opcodes
> +	     after Bconstant should use the same code as Bconstant.  */
> +	  for (i = 0; i < 256; ++i)
> +	    {
> +	      if (!targets[i])
> +		targets[i] = i < Bconstant ? &&insn_default : &&insn_Bconstant;
> +	    }
> +	}
> +#endif

You can use [0 ... 255] = &&insn_default, [Bconstant ... 255] =
&&insn_Bconstant to statically initialize the array, avoiding the
runtime initialisation.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



This bug report was last modified 12 years and 286 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.