8148214: Slow object allocation due to multiple synchronization
Reviewed-by: attila, mhaupt
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptFunction.java Wed Jul 05 21:15:54 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptFunction.java Tue Jan 26 13:46:00 2016 +0100
@@ -553,7 +553,7 @@
* @param prototype actual prototype object
* @return property map
*/
- private synchronized PropertyMap getAllocatorMap(final ScriptObject prototype) {
+ private PropertyMap getAllocatorMap(final ScriptObject prototype) {
if (allocatorMap == null || allocatorMap.isInvalidSharedMapFor(prototype)) {
// The prototype map has changed since this function was last used as constructor.
// Get a new allocator map.