Skip to content

Backport/names names names #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 17 commits into from
Closed

Conversation

retronym
Copy link
Owner

@retronym retronym commented Mar 4, 2019

No description provided.

lrytz and others added 13 commits March 4, 2019 14:40
Added in ced7214, no longer needed since ICodeReader is gone.

(cherry picked from commit e216e0e)
No longer run the classfile parser on Scala generated classfiles that
don't have a Scala signature (module classes, inner classes, etc).

Various cleanups in the classfile parser, minimize the work performed
on Scala classfiles. Before, the attributes section was parsed twice:
once to find the ScalaSig attribute, the second time to find the
ScalaSignature in the RuntimeVisibleAnnotations. Now everything happens
in the first iteration.

Also fixes a bug in the backend: classes ending in `$` did not get a
ScalaSignature by mistake. They were filtered out by the name-based
test that is supposed to identify module classes.

(cherry picked from commit 3aea776)
We can just keep these are short-lived Strings, rather than interning
them into the Name table for the entire lifetime of Global.

(cherry picked from commit 688bf0f)
…ass/method

I've used lazy types for field/method/class infos, which is analagous to what we
do in `Unpickler` for scala originated types.  We read all data needed by the
inner class table and the type completers from the pool eagerly, but still be
lazy about interning strings to Names and completion of the field/method
types themselves.

This fixes some long standing spurious cyclic errors:

Manually tested with:

```
$ scalac -cp $(coursier fetch -q -p com.datastax.cassandra:dse-driver:1.0.0) test.scala
test.scala:2: error: illegal cyclic reference involving class Cluster
	new com.datastax.driver.dse.DseCluster.Builder()
                                               ^
one error found

$ /code/scala/build/quick/bin/scalac -cp $(coursier fetch -q -p com.datastax.cassandra:dse-driver:1.0.0) test.scala

$ cat test.scala
class Test {
	new com.datastax.driver.dse.DseCluster.Builder()
}
```

```
class Test {
  new com.datastax.driver.dse.DseCluster.Builder()
}
```

It subsumes `-Ybreak-cycles`. I was to compile `pos/cycle{-jsoup,}` without the experimental
`-Ybreak-cycles`. I've removed the entire `-Ybreak-cycles` option and supporting code.

It also subsumes the existing implementation related to cycle avoidance
(`queueLoad` / `raiseLoaderLevel`.)

Descriptor, signature, constant, and param names are made available to the field/method lazy
completer which can use them if and when the symbol is completed.

After classfile parsing the constant pool is discarded (some entries are of course captured by
the lazy type completers.)

Fixes scala/bug#3809

(cherry picked from commit 4554e02)
Classfile parsing does re-enter when we're reading package objects
or classfiles for things like `scala/native.class`.

But for the most part the prior refactorings mean that we typically
only parse a single classfile at a time, and as such we can profit
from a one-element cache for the buffer to read this into.

(cherry picked from commit ed8d95e)
There is no good reason for these dotted names to be
Names and stick around in the name table. Let's use
short lived strings instead.

Reduces the name table by 5% in terms of entries and 10%
in terms of characters when compiling src/scalap/**/*.scala

(cherry picked from commit ae18049)
Compiling
    @deprecated val foo: T = some.deprecated(call)
yielded
    private[this] val `foo `: T = some.deprecated(call)
    @deprecated <accessor> def foo: T = this.`foo `
where the `@deprecated` has been slapped on the def (where it'll incur
deprecation warnings on callers) but not on the val (where it'll
suppress deprecation warnings on the body.

Just copy the annotation across.

Fixes scala/bug#11538 in an expedient manner.
…and InterruptedException as well as Awaitable.ready.
SethTisue and others added 4 commits June 18, 2019 13:18
Awaitable.result should have a throws annotation of TimeoutException and InterruptedException as well as Awaitable.ready
Also deprecate backing field symbols.
Windows compat for PipelineMainTest, finally?
@retronym
Copy link
Owner Author

Submitted to scala/scala

@retronym retronym closed this Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants