[Mono-devel-list] mcs patch for precise location handling

Atsushi Eno atsushi at ximian.com
Tue Jun 28 11:37:43 EDT 2005


Hi Marek,

Thanks for the comments.

> That is massive ;-)

Well, I can split the patch into maybe two parts: 1) make changes
to Location, Report and tokenizer, and 2) make changes to parser
(lexer.Location elimination). But 1) won't make sense as a
standalone patch. And in fact most of the changes are in 2).

> In the most cases we don't need to pass Location as extra parameter now.
> It would be nice to remove also this redundant casts and arguments.
> For example.
> 
> $$ = new ComposedCast ((Expression) $1, "*", ((Expression) $1).Location);
> 
> or 
> 
> $$ = new Invocation ((Expression) $1, args, ((Expression) $1).Location);
> 
> replaced by
> 
> $$ = new ComposedCast ((Expression) $1, "*");
> 
> $$ = new Invocation ((Expression) $1, args)

Yeah, I totally agree.

So, based on your suggestion, I created further patch. Now it's
much more massive than before (hehe).
It recuded Location argument in several expressions and statements.
For members in iterators (MoveNext() and so on), it reuses the
same Location of the corresponding iterator itself.
http://monkey.workarea.jp/tmp/20050627/precise-location-20050628.diff

Total memory allocated decreased a bit: 77618 KB
http://monkey.workarea.jp/tmp/20050627/perf-new3.txt

Additionally, I also added the fix for bug #57047 as Hari suggested
in tokenizer, parser and Attribute class so that Attribute accepts
"nameEscaped" bool parameter which is passed from tokenizer.

I think this patch can be delayed for review after the first one.

Atsushi Eno



More information about the Mono-devel-list mailing list