Commit Graph

1813 Commits

Author SHA1 Message Date
Hannes Wallnöfer
4f2891ca8d 8007060: Primitive wrap filter throws ClassCastException in test262parallel
Reviewed-by: sundar, jlaskey, lagergren
2013-02-01 02:24:15 +01:00
Attila Szegedi
fe52eb5992 8006529: Methods always get callee - it should be conditional
This commit streamlines the bytecode function signatures, prologue, local variable use, scope creation, and invocation. It started out quite innocently when we noticed that we always emit __callee__ parameters for all functions even when they are not needed, but it turned out to be quite a deep rabbit hole. In the end, I identified exact conditions when functions need to have a callee parameter, when they need to receive parent scope, when they need to create their own scope, when they need to have variable arity signature, and when they need to have an "arguments" object, and made sure that callee parameters in signatures only show up when they are needed, that parent function's scope is only passed to a child function when it is needed, that the function only creates its own scope when it is needed. In crypto.js, the number of scopes dropped from 446 to 244, and the number of callees dropped from 315 to 145.

Reviewed-by: jlaskey, lagergren
2013-01-31 18:34:42 +01:00
Athijegannathan Sundararajan
bdcffc23f7 8007286: Add JavaAdapter and importPackage to compatibility script
Reviewed-by: lagergren, jlaskey
2013-01-31 20:07:40 +05:30
Athijegannathan Sundararajan
fcd28bdcc5 8007140: Java.extend crashes when attempting to extend java.lang.Object
Reviewed-by: lagergren, hannesw
2013-01-30 21:15:14 +05:30
Hannes Wallnöfer
411b70d54a 8007109: Regression: String(ConsString) does not flatten argument to String
Reviewed-by: sundar, lagergren
2013-01-30 14:57:19 +01:00
Athijegannathan Sundararajan
8cd63a75f2 8007132: Java objects returned from constructor functions are lost
Reviewed-by: hannesw, lagergren, attila
2013-01-30 17:52:54 +05:30
Marcus Lagergren
30b950d2d2 8007062: Split Lower up into Lower/Attr/FinalizeTypes. Integrate AccessSpecalizer into FinalizeTypes
Lower suffered from being a "God class" trying to do everything at once.  As Nashorn code generation has grown, so has Lower. It does several post processing passes, tries to do several things at once even though all type information isn't in place, adjusting state afterwards and so on. It also performs control flow analysis, type attribution and constant folding, and  everything else code generation related before byte code emission. I have now separated the compilation process into Lower (create low level nodes from high level ones, copy code such as finally block inlining etc), Attr (assign types and symbols to all nodes - freeze slot and scope information) and FinalizeTypes (insert explicit casts, specialize invoke dynamic types for scope accesses). I've removed the kludgy AccessSpecializer, as this now integrates naturally with typing. Everything is now much easier to read and each module performs only one thing. I have added separate loggers for the separate tiers. In the process I have also fixed: (1) problems with type coercion (see test/script/basic/typecoercion.js, basically our coercion was too late and our symbol inference was erroneous. This only manifested itself in very rare occasions where toNumber coercion has side effects, such as for example when valueOf is overridden)  (2) copying literal nodes (literal copy did not use the superclass copy, which made all the Node specific fields not to be copied  (3) erroneous literal tokenization (literals shouldn't always just inherit token information from whatever node that creates them) (4) splitter weighnodes - unary nodes were considered weightless  (4) removed the hateful and kludgy "VarNode.shouldAppend", which really isn't needed when we have an attribution phase that determines self reference symbols (the only thing it was used for) (5) duplicate line number issues in the parser (6) convert bug in CodeGenerator for intermediate results of scope accesses (see test/script/basic/access-specializer.js) ... Several of these things just stopped being problems with the new architecture "can't happen anymore" and are not bug fixes per se. All tests run. No performance regressions exist that I've been able to measure. Some increases in performance were measured, but in the statistical margin of error (which is very wide as HotSpot currently has warmup issues with LambdaForms/invoke dynamic). Compile speed has not measurably increased.

Reviewed-by: jlaskey, attila
2013-01-30 12:26:45 +01:00
James Laskey
b342e3c536 8007094: Apply version to nashorn.jar manifest
Reviewed-by: sundar
2013-01-29 14:25:39 -04:00
Athijegannathan Sundararajan
ae80adfc10 8007091: Provide private API to pass application class loader for nashorn script engine
Reviewed-by: jlaskey, lagergren
2013-01-29 19:57:25 +05:30
James Laskey
0b9014a9d6 8006676: Integrate Nashorn into new build system
Reviewed-by: jlaskey
2013-01-28 16:22:03 -04:00
Athijegannathan Sundararajan
97a071dc3d 8007004: nashorn script engine should not use thread context class loader as script 'application loader'
Reviewed-by: attila, hannesw
2013-01-28 21:29:05 +05:30
Athijegannathan Sundararajan
daaeb20eff 8006983: Introduce a command line option to switch off syntactic extensions of nashorn
Reviewed-by: lagergren, attila
2013-01-28 18:10:16 +05:30
Hannes Wallnöfer
327a6cf1b7 8006766: Array-like access to characters of a string is slow
Reviewed-by: lagergren, attila
2013-01-25 17:35:31 +01:00
Athijegannathan Sundararajan
5231fef61c 8006857: ClassCastException when interface implementing function uses arguments object
Reviewed-by: jlaskey, lagergren
2013-01-24 22:38:58 +05:30
James Laskey
c2bdb49b75 8006852: Move tests from JIRA for prepopulated map failures
Reviewed-by: sundar
2013-01-24 12:15:29 -04:00
Hannes Wallnöfer
d9ecc2ea0c 8006408: Clean up and specialize NativeString
Reviewed-by: jlaskey, lagergren
2013-01-24 14:55:57 +01:00
Athijegannathan Sundararajan
d3f071dc73 8006755: Functions inside with statements dont get correct scope
Reviewed-by: lagergren, attila
2013-01-24 17:49:03 +05:30
Athijegannathan Sundararajan
67db0ba236 8006575: Error in codegen for element access on primitive value
Reviewed-by: hannesw, lagergren
2013-01-24 16:21:32 +05:30
Athijegannathan Sundararajan
4135674f92 8006736: nashorn script engine should support the usage multiple global objects with same engine instance
Reviewed-by: lagergren, jlaskey, hannesw
2013-01-23 17:04:02 +05:30
Athijegannathan Sundararajan
7014b0cced 8006678: Avoid too many Context.getGlobal() calls
Reviewed-by: lagergren, jlaskey
2013-01-22 22:07:12 +05:30
Attila Szegedi
245ec829ff 8006677: Remove unused FunctionNode flags
Reviewed-by: hannesw, jlaskey
2013-01-22 14:36:28 +01:00
Hannes Wallnöfer
739b531642 8006570: This-value for non-strict functions should be converted to object
Reviewed-by: jlaskey, lagergren, attila
2013-01-22 14:14:37 +01:00
Athijegannathan Sundararajan
017fe2d002 8006635: Reduce access levels as much as possible
Reviewed-by: jlaskey, lagergren, attila
2013-01-21 21:17:38 +05:30
Attila Szegedi
acaee2a2f4 8006525: Give StaticClass objects their own linker
Reviewed-by: hannesw, lagergren
2013-01-21 11:03:56 +01:00
Athijegannathan Sundararajan
993b92c985 8006557: JDK8/Lambda build clashes on Map.replace()
Reviewed-by: jlaskey
2013-01-19 22:35:43 +05:30
Athijegannathan Sundararajan
7784f11d28 8006584: improve variable handling in NashornScriptEngine
Reviewed-by: jlaskey, hannesw
2013-01-19 09:14:43 +05:30
Athijegannathan Sundararajan
cef1f6c50b 8006562: findOwnMH in nashorn "objects" package should be cleaned up
Reviewed-by: jlaskey, lagergren
2013-01-18 17:55:04 +05:30
Athijegannathan Sundararajan
07484149d6 8006527: nashorn jsr223 engine does not work in sandbox
Reviewed-by: jlaskey, attila, lagergren
2013-01-18 08:45:06 +05:30
James Laskey
e1e509319e 8006517: PropertyHashMap.Element.equals() compares to Property
Reviewed-by: sundar
2013-01-17 10:33:39 -04:00
Athijegannathan Sundararajan
71e9d57ee3 8006424: Passing null or undefined to adapter class constructors results in NPE or ClassCastException
Reviewed-by: attila, hannesw, jlaskey
2013-01-16 21:26:55 +05:30
Athijegannathan Sundararajan
d35ae9ab05 8006412: Improve toString method of ScriptObjectMirror class
Reviewed-by: jlaskey, lagergren
2013-01-16 17:58:51 +05:30
James Laskey
c6c424f27a 8006304: Remove pre-population of maps for constructor produced maps
Reviewed-by: sundar
2013-01-16 07:06:40 -04:00
Attila Szegedi
a2efb1b4f5 8006337: Discarded arguments for INVOKESTATIC must still be evaluated for side effects
Reviewed-by: hannesw, jlaskey, sundar
2013-01-15 18:08:50 +01:00
Attila Szegedi
311e57397d 8005958: invoking a function through INVOKESTATIC with more arguments than it declares resulted in malformed bytecode being generated
Reviewed-by: lagergren, jlaskey
2013-01-15 17:09:44 +01:00
Attila Szegedi
0c53c5de50 8006293: Reduce ScriptObject.findCallMethodMethod
Reviewed-by: lagergren, jlaskey
2013-01-15 13:10:20 +01:00
Andreas Rieber
246e4e8daf 8006181: nashorn script engine does not run jrunscript's initialization script
Reviewed-by: lagergren, jlaskey
2013-01-14 21:30:13 +05:30
Attila Szegedi
f36a46aea4 8006168: ability to generate multi-type Java adapters
Reviewed-by: lagergren, jlaskey
2013-01-14 16:00:55 +01:00
Athijegannathan Sundararajan
7e7ea2a295 8006093: Add a makefile target to run all tests (test, test262, perf tests)
Reviewed-by: attila, hannesw
2013-01-11 20:34:22 +05:30
Athijegannathan Sundararajan
a8b9e9a36d 8006082: Provide option to run octane benchmarks in separate processes
Reviewed-by: lagergren, jlaskey
2013-01-11 18:26:18 +05:30
Marcus Lagergren
8bbf26bc89 8005976: Break out AccessSpecializer into one pass before CodeGenerator instead of iterative applications from CodeGenerator
Now scope and slot information is guaranteed to be fixed AND NOT CHANGE before CodeGeneration. We want to keep it that way to build future type specializations and bring all type work out of CodeGenerator.

Reviewed-by: attila, hannesw
2013-01-11 10:40:51 +01:00
Attila Szegedi
ddf4b86c57 8005983: JavaAdapterFactory generated proxy classes should take extra constructor arguments at the end
Reviewed-by: lagergren, sundar
2013-01-10 15:28:05 +01:00
Athijegannathan Sundararajan
164350cecf 8005982: NASHORN-71.js failing in nightlys
Reviewed-by: attila, lagergren, jlaskey
2013-01-10 19:55:38 +05:30
Athijegannathan Sundararajan
643a6b824c 8005987: ant octane tries to run non-benchmark scripts
Reviewed-by: lagergren, attila, jlaskey
2013-01-10 19:03:25 +05:30
Marcus Lagergren
3d269485fc 8005971: runsunspider.js should check results of benchmarks
Reviewed-by: attila, hannesw
2013-01-10 10:28:57 +01:00
Athijegannathan Sundararajan
ff9829969f 8005940: provide ant targets to get and update external test scripts
Reviewed-by: jlaskey, lagergren
2013-01-09 22:32:40 +05:30
Attila Szegedi
12801c40c5 8005777: Bug in the FacetIntrospector of Dynalink - non-public class should search super
Reviewed-by: lagergren, sundar
2013-01-09 15:02:48 +01:00
Athijegannathan Sundararajan
e40b456a27 8005848: assigning to global toString variable affects Object.prototype.toString
Reviewed-by: jlaskey, lagergren
2013-01-08 21:16:07 +05:30
Marcus Lagergren
dd47345d51 8005842: Loops in ASTWriter. Corrected @Reference and @Ignore node annotation for IR nodes
Reviewed-by: hannesw, sundar
2013-01-08 15:20:40 +01:00
Attila Szegedi
df21b0860f 8005801: Refactor findSetMethod
FindSetMethod() was a very large single method, very unreadable and unmaintainable. It was broken into easy-to-understand pieces. The refactoring required introduction of a comand-object like entity, SetMethodCreator, to contain the nontrivial transient state of the algorithm that made the original big method so resistant to refactoring in the first place.

Reviewed-by: lagergren, sundar
2013-01-08 14:14:17 +01:00
Attila Szegedi
3cb7831567 8005846: Remove Mangler in favor of Dynalink's NameCodec
Reviewed-by: jlaskey, sundar
2013-01-08 13:50:11 +01:00
Marcus Lagergren
eb0f10508f 8005843: refSymbols lookup of unbound variable could cause NullPointerException in Lower
Reviewed-by: hannesw, attila
2013-01-08 10:52:11 +01:00
Athijegannathan Sundararajan
d8e79f1ce1 8005835: NASHORN-668 output fails to compare with the corresponding .EXPECTED file
Reviewed-by: lagergren, hannesw
2013-01-08 15:02:36 +05:30
Marcus Lagergren
51ceb76240 8005788: Loggers and their corresponding system properties not working correctly
1-1 mapping now maintained. Used Context err instead of System.err in several places (after bootstrapping Context). Problematic closing of err stream replaced by @SuppressWarnings("resource")

Reviewed-by: jlaskey, sundar
2013-01-08 09:59:28 +01:00
Athijegannathan Sundararajan
b501e8fdc4 8005782: get rid of javadoc errors, warnings in nashorn build
Reviewed-by: lagergren
2013-01-08 08:51:00 +05:30
Petr Hejl
569e8ef170 8005703: Offsets miscalculated for blocks
Reviewed-by: lagergren
2013-01-07 14:41:16 -04:00
Marcus Lagergren
24e583d55f 8005789: Forgot to document -Dnashorn.unstable.relink.threshold
Added documentation to DEVELOPER_README, fixed code convention warnings

Reviewed-by: attila
2013-01-07 19:31:36 +01:00
James Laskey
311f43d5a6 8005663: Update copyright year to 2013
Reviewed-by: sundar
2013-01-04 09:58:33 -04:00
James Laskey
33e2b39ed3 8005665: JavaDoc should only display public interfaces
Reviewed-by: sundar
2013-01-04 09:58:30 -04:00
James Laskey
440f8df1ec 8005666: Add webrev to .hgignore
Reviewed-by: sundar
2013-01-04 09:58:26 -04:00
James Laskey
dca6998949 8005440: Improve .hgignore filtering for Nashorn repo
Reviewed-by: sundar
2012-12-22 08:49:58 -04:00
Jim Laskey
98762d6ee0 8005403: Open-source Nashorn
Co-authored-by: Akhil Arora <akhil.arora@oracle.com>
Co-authored-by: Andreas Woess <andreas.woess@jku.at>
Co-authored-by: Attila Szegedi <attila.szegedi@oracle.com>
Co-authored-by: Hannes Wallnoefer <hannes.wallnoefer@oracle.com>
Co-authored-by: Henry Jen <henry.jen@oracle.com>
Co-authored-by: Marcus Lagergren <marcus.lagergren@oracle.com>
Co-authored-by: Pavel Semenov <pavel.semenov@oracle.com>
Co-authored-by: Pavel Stepanov <pavel.stepanov@oracle.com>
Co-authored-by: Petr Hejl <petr.hejl@oracle.com>
Co-authored-by: Petr Pisl <petr.pisl@oracle.com>
Co-authored-by: Sundararajan Athijegannathan <sundararajan.athijegannathan@oracle.com>
Reviewed-by: attila, hannesw, lagergren, sundar
2012-12-21 16:36:24 -04:00
John Coomes
958099576a 8005364: initial hg tags for nashorn repo
Reviewed-by: amurillo
2012-12-20 14:16:21 -08:00
J. Duke
db7a00335a Initial load 2007-12-01 00:00:00 +00:00