| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Helps to spot usage of unsafe that would lead to undefined behaviour.
|
|
|
|
|
| |
This one is able to encode creation of array of any type and any dimension.
Note, it does not handle value classes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the method `Arrays.newRefArray` was one of the only 3
methods that are kept generic after erasure. This commit removes
this magic, by making it take an actual `j.l.Class[T]` as
parameter.
Moreover, the methods `newXArray` all receive an actual body,
implemented on top of Java reflection, which means that a back-end
does not *have to* special-case those methods for correctness.
It might still be required for performance, though, depending on
the back-end.
The JVM back-end is made non-optimal in this commit, precisely
because it does not specialize that method anymore. Doing so
requires modifying the fork of scalac that we use, which should
be done separately.
The JS back-end is adapted simply by doing nothing at all on any
of the newXArray methods. It will normally call the user-space
implementations which use reflection. The Scala.js optimizer will
inline and intrinsify the reflective calls, producing optimal
code, at the end of the day.
|
|
|
|
|
|
| |
This prevented Dotty from bootstrapping when the file arguments were
given in a certain order because of #1017. Regardless of what we do
regarding #1017, it makes sense to use "def clone()" here.
|
| |
|
|
|
|
| |
More magic is needed, as enumerating array symbols does not work in backend.
|
|\
| |
| | |
Add run tests to pending.
|
| | |
|
|\ \
| |/
|/| |
Forked ScalaRuntime and minimal classtags for arrays of value classes.
|
| | |
|
| | |
|
| |
| |
| |
| | |
It can be done with non-abstract rhs of method.
|
| |
| |
| |
| |
| |
| |
| |
| | |
[error] /Users/dark/workspace/dotty/src/dotty/runtime/vc/VCPrototype.scala:10: overriding method clone in class VCArrayPrototype of type ()Object;
[error] method clone in class Object of type ()Object has weaker access privileges; it should be public;
[error] (Note that method clone in class VCArrayPrototype of type ()Object is abstract,
[error] and is therefore overridden by concrete method clone in class Object of type ()Object)
[error] abstract class VCArrayPrototype[T <: VCPrototype] extends Object with Cloneable {
|
| | |
|
| |
| |
| |
| | |
Unfortunately needed to sacrifice the immutability of inner field.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Works as Array[T] is erased to Object.
|
| |
| |
| |
| | |
Decreases the size of companion of case value class to 1/8 of it's original size.
|
| |
| |
| |
| |
| |
| |
| | |
Making actual value classes extend this prototypes serves two goals:
- This is a basis for implementing arrays of value classes.
- Having underlying final in those glasses makes all unbox methods monomorphic and final.
- this decreases size of an empty case-class to 1/3 of previous size.
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Now the scheme doesn't introduce circular dependencies between container vals.
|
|
|
|
|
| |
Arguments of the form (xs: _*) which are passed to
Java methods need to be converted to arrays, not sequences.
|
|
|
|
|
|
| |
Now: All new Array[T] methods are translated to calls of the form
dotty.Arrays.newXYZArray ...
|
|
Creates accessors for lazy vals:
1) lazy local vals are rewritten to dotty.runtime.Lazy*** holders
2) for a non-volatile field lazy val create a non-thread-safe accessor and flag:
2.a) if lazy val type indicates that val is not nullable, uses null value as a flag
2.b) else uses boolean flag for sake of performance, method size, and
allowing more jvm optimizations
3) for a volatile field lazy val use double locking scheme, that guaranties no
spurious deadlocks, using long bits as bitmaps and creating companion
objects to store offsets needed for unsafe methods.
Conflicts:
test/dotc/tests.scala
|