Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
LabelDef parameters - previously defined vs new
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Vlad Ureche  
View profile  
 More options May 16 2012, 7:51 am
From: Vlad Ureche <vlad.ure...@gmail.com>
Date: Wed, 16 May 2012 13:51:49 +0200
Local: Wed, May 16 2012 7:51 am
Subject: LabelDef parameters - previously defined vs new

Hi,

I've been working on SI-5788
<https://issues.scala-lang.org/browse/SI-5788>and I stumbled upon two
very different ways LabelDefs are generated:
 - if generated by the tailcalls phase, their parameters are existing
symbols defined in the code before the tailcall
 - if generated by the virtualized pattern matcher, their parameters are
new symbols, appearing there for the first time
Gist here <https://gist.github.com/2709762> - look for BEHAVIOR1 and
BEHAVIOR2 for a quick lookup.

My question is: what should be the behavior of LabelDefs? Should they pick
up existing symbols or not?

Thanks,
Vlad


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adriaan Moors  
View profile  
 More options May 16 2012, 8:18 am
From: Adriaan Moors <adriaan.mo...@epfl.ch>
Date: Wed, 16 May 2012 14:18:01 +0200
Local: Wed, May 16 2012 8:18 am
Subject: Re: [scala-internals] LabelDef parameters - previously defined vs new

On Wed, May 16, 2012 at 1:51 PM, Vlad Ureche <vlad.ure...@gmail.com> wrote:
> Hi,

> I've been working on SI-5788<https://issues.scala-lang.org/browse/SI-5788>and I stumbled upon two very different ways LabelDefs are generated:

really?

they seem to be generated quite similarly

 - if generated by the tailcalls phase, their parameters are existing

> symbols defined in the code before the tailcall

          val label     = method.newLabel(newTermName("_" + method.name),
method.pos)
          val thisParam =
method.newSyntheticValueParam(currentClass.typeOfThis)
          label setInfo MethodType(thisParam :: method.tpe.params,
method.tpe.finalResultType)

>  - if generated by the virtualized pattern matcher, their parameters are
> new symbols, appearing there for the first time

        val matchEnd = NoSymbol.newLabel(freshName("matchEnd"), NoPosition)
setFlag SYNTH_CASE
        val matchRes = NoSymbol.newValueParameter(newTermName("x"),
NoPosition, SYNTHETIC) setInfo restpe.withoutAnnotations //
        matchEnd setInfo MethodType(List(matchRes), restpe)

ignore the NoSymbol -- the owner is changed later (yes, I know, this needs
to be fixed, and I will get to that)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adriaan Moors  
View profile  
 More options May 16 2012, 8:21 am
From: Adriaan Moors <adriaan.mo...@epfl.ch>
Date: Wed, 16 May 2012 14:21:38 +0200
Local: Wed, May 16 2012 8:21 am
Subject: Re: [scala-internals] LabelDef parameters - previously defined vs new

ah whoops, i missed the ` :: method.tpe.params`, sorry about that
so the same label has one symbol that's created for it, and reuses the
parameters from the method
that seems pretty icky to me

On Wed, May 16, 2012 at 2:18 PM, Adriaan Moors <adriaan.mo...@epfl.ch>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »