158 Commits

Author SHA1 Message Date
Robert Muir
e2f999b025 make this static final 2016-06-11 14:33:48 -04:00
Robert Muir
8d5a70200f write refs for functions 2016-06-11 14:29:15 -04:00
Robert Muir
ab457be9d8 remove unnecessary semicolon and return 2016-06-11 13:48:04 -04:00
Robert Muir
0bfb166eeb merge master 2016-06-11 13:23:17 -04:00
Nik Everett
4a265d0279 Painless: Add } as a delimiter. Kindof.
Add `}` is statement delimiter but only in places where it is
otherwise a valid part of the syntax, specificall the end of a block.
We do this by matching but not consuming it. Antlr 4 doesn't have
syntax for this so we have to kind of hack it together by actually
matching the `}` and then seeking backwards in the token stream to
"unmatch" it. This looks reasonably efficient. Not perfect, but way
better than the alternatives.

I tried and rejected a few options:
1. Actually consuming the `}` and piping a boolean all through the
grammar from the last statement in a block to the delimiter. This
ended up being a rather large change and made the grammar way more
complicated.
2. Adding a semantic predicate to delimiter that just does the
lookahead. This doesn't work out well because it doesn't work (I
never figured out why) and because it generates an *amazing*
`adaptivePredict` which makes a super huge DFA. It looks super
inefficient.

Closes #18821
2016-06-11 12:51:25 -04:00
Jack Conradson
e293000d8d Merge branch 'master' into stubby 2016-06-10 16:22:17 -07:00
Jack Conradson
bd94c62adf Added a stub node for lambda expressions. 2016-06-10 16:18:36 -07:00
Robert Muir
16d17351f7 don't use loadLocal, add new node to package-info 2016-06-10 17:37:57 -04:00
Robert Muir
9e0a70c4b2 Merge branch 'master' into capturingReferences 2016-06-10 17:10:56 -04:00
Jack Conradson
f98be6fa06 Add functions to Painless.
Closes #18810
2016-06-10 13:59:59 -07:00
Robert Muir
edb0fd3b88 painless: add capturing method references 2016-06-10 14:24:58 -04:00
Robert Muir
9826b64e1f Exempt LocalDate from bridge method checks on java 9
The painless whitelist has a lot of self-checking, in this case, it checks
for missing covariant overrides. It fails on java 9, because LocalDate.getEra()
now returns IsoEra instead of Era: https://bugs.openjdk.java.net/browse/JDK-8072746

To our checker, it thinks we were lazy with whitelisting :)

This means painless works on java 9 again
2016-06-08 15:47:09 -04:00
Jack Conradson
be168f528b Merge pull request #18771 from jdconrad/methods
Add Method to Get New MethodWriters
2016-06-07 11:47:29 -07:00
Jack Conradson
f9b45107c4 Added method to allow creation of new methods on-the-fly. 2016-06-07 11:24:33 -07:00
Robert Muir
f23e8c3722 more cleanups 2016-06-07 12:42:19 -04:00
Robert Muir
89224dbc3c switch FunctionRef over to methodhandles 2016-06-07 11:56:44 -04:00
Robert Muir
32965f043a convert FunctionRef/Def usage to methodhandles. 2016-06-07 10:23:49 -04:00
Robert Muir
3108c399f0 use painless types in FunctionRef 2016-06-07 09:49:54 -04:00
Robert Muir
39550354a7 compute functional interface stuff in Definition 2016-06-07 09:41:03 -04:00
Uwe Schindler
3238868cc4 Make checkstyle happy (add Lookup import, line length) 2016-06-07 13:06:23 +02:00
Uwe Schindler
cac111ff73 Don't hide LambdaConversionException and behave like real javac compiled code when a conversion fails. This works anyways, because fallback is allowed to throw any Throwable 2016-06-07 13:00:36 +02:00
Uwe Schindler
6913be2ec2 Pass through the lookup given by invokedynamic to the LambdaMetaFactory. Without it real lambdas won't work, as their implementations are private to script class 2016-06-07 12:32:59 +02:00
Robert Muir
950b093fc7 Merge branch 'master' into painless_method_references 2016-06-06 22:39:28 -04:00
Jack Conradson
b3804c47f7 Cleaned up SEach node. 2016-06-06 18:21:08 -07:00
Robert Muir
231268c89d remove outdated TODO 2016-06-06 21:04:59 -04:00
Jack Conradson
6dace47c1f Reverted S-node design change. 2016-06-06 17:59:39 -07:00
Robert Muir
8db9a971e5 enable test 2016-06-06 20:30:42 -04:00
Robert Muir
2852e82ab9 add def iteration over arrays 2016-06-06 20:07:32 -04:00
Robert Muir
d331f8768e implement dynamic case for iterables 2016-06-06 19:41:37 -04:00
Jack Conradson
aeaf39f36d Added a for each stub node for a target type of def. 2016-06-06 16:07:12 -07:00
Jack Conradson
a088d367f7 More comments. 2016-06-06 15:58:56 -07:00
Jack Conradson
f897342296 Updated package info documentation. 2016-06-06 15:34:51 -07:00
Jack Conradson
9a78f6955b Added foreach for array types. 2016-06-06 15:25:09 -07:00
Robert Muir
23d7cdd043 ban slow methods in MethodHandle 2016-06-06 17:58:00 -04:00
Robert Muir
b32f6abb26 remove unnecessary caching 2016-06-06 17:29:03 -04:00
Jack Conradson
a4ffaa6e7a Working iterable foreach with tests. 2016-06-06 13:53:31 -07:00
Jack Conradson
b2e648dfde Implementation of iterable. 2016-06-06 12:33:25 -07:00
Jack Conradson
260b0fd40f Stubbed foreach node. 2016-06-06 10:49:40 -07:00
Jack Conradson
0c9174decc Merge branch 'master' into each 2016-06-06 09:23:01 -07:00
Robert Muir
881e4058ee don't do a no-op filter, that was just for testing 2016-06-06 09:39:39 -04:00
Robert Muir
6dbf7ab1ea initial messy impl of painless method references 2016-06-06 09:27:19 -04:00
Uwe Schindler
c0a3a20071 painless: Add support for the new Java 9 MethodHandles#arrayLength() factory (see https://bugs.openjdk.java.net/browse/JDK-8156915) 2016-06-03 23:35:11 +02:00
Jack Conradson
9a0d0d7cff Fixed a grammar mistake in a comment. 2016-06-02 15:30:11 -07:00
Robert Muir
b5393ce55e Improve painless compile-time exceptions 2016-06-02 18:23:47 -04:00
Jack Conradson
b6e1429760 Merge branch 'master' into each 2016-05-31 09:36:04 -07:00
Robert Muir
2d1eb89aef improve date api for expressions/painless fields 2016-05-31 09:32:33 -04:00
Jack Conradson
d1f4e2ef04 Merge branch 'master' into each 2016-05-30 16:22:14 -07:00
Jack Conradson
f5be0982d9 Added initial infrastructure to allow for each to be made. 2016-05-27 17:41:31 -07:00
Jack Conradson
2d8030f09f Added foreach in grammar. 2016-05-27 13:50:38 -07:00
Robert Muir
aa53285448 add java.time packages to painless whitelist 2016-05-27 15:07:27 -04:00