aboutsummaryrefslogtreecommitdiff
path: root/buildtools/nasgen
diff options
context:
space:
mode:
authorhannesw <none@none>2013-07-05 14:36:54 +0200
committerhannesw <none@none>2013-07-05 14:36:54 +0200
commit3e6b14405217bed1b38b25efbce8b2e015fd0b66 (patch)
tree0b0c324cd89ec0731448329cc38a8d50b41ac466 /buildtools/nasgen
parent48f4f1edffddc0bd3368942fa77f75286cc286e7 (diff)
downloadnashorn-3e6b14405217bed1b38b25efbce8b2e015fd0b66.tar.gz
8017084: Use spill properties for large object literals
Reviewed-by: lagergren, sundar
Diffstat (limited to 'buildtools/nasgen')
-rw-r--r--buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java4
-rw-r--r--buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/StringConstants.java4
2 files changed, 3 insertions, 5 deletions
diff --git a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java
index bc6bb4b2..ed0eee61 100644
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java
@@ -25,6 +25,7 @@
package jdk.nashorn.internal.tools.nasgen;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_FINAL;
import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PRIVATE;
import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC;
@@ -164,7 +165,6 @@ public class ClassGenerator {
mi.visitCode();
mi.pushNull();
mi.putStatic(className, MAP_FIELD_NAME, MAP_DESC);
- mi.loadClass(className);
mi.invokeStatic(MAP_TYPE, MAP_NEWMAP, MAP_NEWMAP_DESC);
// stack: PropertyMap
}
@@ -236,7 +236,7 @@ public class ClassGenerator {
static void addMapField(final ClassVisitor cv) {
// add a MAP static field
- final FieldVisitor fv = cv.visitField(ACC_PRIVATE | ACC_STATIC,
+ final FieldVisitor fv = cv.visitField(ACC_PRIVATE | ACC_STATIC | ACC_FINAL,
MAP_FIELD_NAME, MAP_DESC, null, null);
if (fv != null) {
fv.visitEnd();
diff --git a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/StringConstants.java b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/StringConstants.java
index 5a5032f9..d0e3168b 100644
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/StringConstants.java
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/StringConstants.java
@@ -96,12 +96,10 @@ public interface StringConstants {
static final String MAP_TYPE = TYPE_PROPERTYMAP.getInternalName();
static final String MAP_DESC = TYPE_PROPERTYMAP.getDescriptor();
static final String MAP_NEWMAP = "newMap";
- static final String MAP_NEWMAP_DESC = Type.getMethodDescriptor(TYPE_PROPERTYMAP, TYPE_CLASS);
+ static final String MAP_NEWMAP_DESC = Type.getMethodDescriptor(TYPE_PROPERTYMAP);
static final String MAP_DUPLICATE = "duplicate";
static final String MAP_DUPLICATE_DESC = Type.getMethodDescriptor(TYPE_PROPERTYMAP);
- static final String MAP_SETFLAGS = "setFlags";
static final String LOOKUP_TYPE = TYPE_LOOKUP.getInternalName();
- static final String LOOKUP_GETMETHOD = "getMethod";
static final String LOOKUP_NEWPROPERTY = "newProperty";
static final String LOOKUP_NEWPROPERTY_DESC =
Type.getMethodDescriptor(TYPE_PROPERTYMAP, TYPE_PROPERTYMAP, TYPE_STRING, Type.INT_TYPE, TYPE_METHODHANDLE, TYPE_METHODHANDLE);