Hello.

On Tue, Mar 1, 2011 at 5:42 AM, Andy Dougherty <[email protected]> wrote:
> Is it just me, or is the write barrier in this snippet from core_ops.c
> in the wrong place?  Note the "return" on the line above it!

Yes. This is a bug. Currently opsc is under major rewriting in
opsc_full_parse branch. I'll fix it right after merge.

> Also, in many of the files generated from PMCs, there are strange
> placements of return and GC_WRITE_BARRIER statements.  Here's an excerpt
> from src/pmc/float.c.  Note the write barrier on line 432, the return on
> 433, and another write barrier on line 440.  I'd estimate there are about
> 200 more such examples.

This is legitimate handling of PCC RETURN() inside PMCs. In the nutshell:

METHOD foo() {
  INTVAL bar = ...;
  RETURN (INTVAL bar);
}

This will produce 2 write barriers: 1 for RETURN, 1 for whole METHOD.
Pmc2c doesn't do any semantic parsing of METHODs and we can't avoid
putting write barrier all over possible return points.

-- 
Bacek
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to