author | hannesw |
Sat, 19 Sep 2015 16:04:28 +0200 | |
changeset 32781 | d8f34ffbbc7a |
parent 30390 | 357f9a3f9394 |
child 34732 | 6605efbe8447 |
permissions | -rw-r--r-- |
16147 | 1 |
/* |
16151 | 2 |
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
16147 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
16240
e1468b33e201
8008239: Unpublicized parts of the code generator package that were only package internal.
lagergren
parents:
16224
diff
changeset
|
26 |
package jdk.nashorn.internal.codegen; |
16147 | 27 |
|
28 |
import static jdk.nashorn.internal.codegen.CompilerConstants.ARGUMENTS; |
|
29 |
import static jdk.nashorn.internal.codegen.CompilerConstants.constructorNoLookup; |
|
30 |
import static jdk.nashorn.internal.codegen.CompilerConstants.typeDescriptor; |
|
24778
2ff5d7041566
8044638: Tidy up Nashorn codebase for code standards
attila
parents:
24738
diff
changeset
|
31 |
import static jdk.nashorn.internal.codegen.ObjectClassGenerator.PRIMITIVE_FIELD_TYPE; |
24719 | 32 |
import static jdk.nashorn.internal.codegen.ObjectClassGenerator.getFieldName; |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
33 |
import static jdk.nashorn.internal.codegen.ObjectClassGenerator.getPaddedFieldCount; |
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
18852
diff
changeset
|
34 |
import static jdk.nashorn.internal.runtime.arrays.ArrayIndex.getArrayIndex; |
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
18852
diff
changeset
|
35 |
import static jdk.nashorn.internal.runtime.arrays.ArrayIndex.isValidArrayIndex; |
16147 | 36 |
|
37 |
import java.util.List; |
|
38 |
import jdk.nashorn.internal.codegen.types.Type; |
|
39 |
import jdk.nashorn.internal.ir.Symbol; |
|
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
40 |
import jdk.nashorn.internal.runtime.Context; |
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
18852
diff
changeset
|
41 |
import jdk.nashorn.internal.runtime.JSType; |
16147 | 42 |
import jdk.nashorn.internal.runtime.PropertyMap; |
43 |
import jdk.nashorn.internal.runtime.ScriptObject; |
|
44 |
import jdk.nashorn.internal.runtime.arrays.ArrayIndex; |
|
45 |
||
46 |
/** |
|
47 |
* Analyze an object's characteristics for appropriate code generation. This |
|
48 |
* is used for functions and for objects. A field object take a set of values which |
|
49 |
* to assign to the various fields in the object. This is done by the generated code |
|
50 |
* |
|
51 |
* @param <T> the value type for the fields being written on object creation, e.g. Node |
|
52 |
* @see jdk.nashorn.internal.ir.Node |
|
53 |
*/ |
|
24719 | 54 |
public abstract class FieldObjectCreator<T> extends ObjectCreator<T> { |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
55 |
|
24719 | 56 |
private String fieldObjectClassName; |
57 |
private Class<? extends ScriptObject> fieldObjectClass; |
|
58 |
private int fieldCount; |
|
59 |
private int paddedFieldCount; |
|
60 |
private int paramCount; |
|
16147 | 61 |
|
62 |
/** call site flags to be used for invocations */ |
|
24719 | 63 |
private final int callSiteFlags; |
25240
f92c14b1ca11
8047959: bindings created for declarations in eval code are not mutable
sundar
parents:
24778
diff
changeset
|
64 |
/** are we creating this field object from 'eval' code? */ |
f92c14b1ca11
8047959: bindings created for declarations in eval code are not mutable
sundar
parents:
24778
diff
changeset
|
65 |
private final boolean evalCode; |
16147 | 66 |
|
67 |
/** |
|
68 |
* Constructor |
|
69 |
* |
|
70 |
* @param codegen code generator |
|
26377
028dad61662f
8051889: Implement block scoping in symbol assignment and scope computation
hannesw
parents:
25865
diff
changeset
|
71 |
* @param tuples tuples for fields in object |
16147 | 72 |
*/ |
24719 | 73 |
FieldObjectCreator(final CodeGenerator codegen, final List<MapTuple<T>> tuples) { |
74 |
this(codegen, tuples, false, false); |
|
16147 | 75 |
} |
76 |
||
77 |
/** |
|
78 |
* Constructor |
|
79 |
* |
|
16206
83069fa0935b
8006529: Methods always get callee - it should be conditional
attila
parents:
16151
diff
changeset
|
80 |
* @param codegen code generator |
26377
028dad61662f
8051889: Implement block scoping in symbol assignment and scope computation
hannesw
parents:
25865
diff
changeset
|
81 |
* @param tuples tuples for fields in object |
16206
83069fa0935b
8006529: Methods always get callee - it should be conditional
attila
parents:
16151
diff
changeset
|
82 |
* @param isScope is this a scope object |
16224
0c49ad4e3b55
8006222: Move slot from SpillProperty to Property
jlaskey
parents:
16206
diff
changeset
|
83 |
* @param hasArguments does the created object have an "arguments" property |
16147 | 84 |
*/ |
24719 | 85 |
FieldObjectCreator(final CodeGenerator codegen, final List<MapTuple<T>> tuples, final boolean isScope, final boolean hasArguments) { |
86 |
super(codegen, tuples, isScope, hasArguments); |
|
16147 | 87 |
this.callSiteFlags = codegen.getCallSiteFlags(); |
25240
f92c14b1ca11
8047959: bindings created for declarations in eval code are not mutable
sundar
parents:
24778
diff
changeset
|
88 |
this.evalCode = codegen.isEvalCode(); |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
89 |
countFields(); |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
90 |
findClass(); |
16206
83069fa0935b
8006529: Methods always get callee - it should be conditional
attila
parents:
16151
diff
changeset
|
91 |
} |
83069fa0935b
8006529: Methods always get callee - it should be conditional
attila
parents:
16151
diff
changeset
|
92 |
|
16147 | 93 |
@Override |
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
94 |
public void createObject(final MethodEmitter method) { |
16147 | 95 |
makeMap(); |
24719 | 96 |
final String className = getClassName(); |
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
97 |
// NOTE: we must load the actual structure class here, because the API operates with Nashorn Type objects, |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
98 |
// and Type objects need a loaded class, for better or worse. We also have to be specific and use the type |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
99 |
// of the actual structure class, we can't generalize it to e.g. Type.typeFor(ScriptObject.class) as the |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
100 |
// exact type information is needed for generating continuations in rest-of methods. If we didn't do this, |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
101 |
// object initializers like { x: arr[i] } would fail during deoptimizing compilation on arr[i], as the |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
102 |
// values restored from the RewriteException would be cast to "ScriptObject" instead of to e.g. "JO4", and |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
103 |
// subsequently the "PUTFIELD J04.L0" instruction in the continuation code would fail bytecode verification. |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
104 |
assert fieldObjectClass != null; |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
105 |
method._new(fieldObjectClass).dup(); |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
106 |
|
16147 | 107 |
loadMap(method); //load the map |
108 |
||
109 |
if (isScope()) { |
|
16206
83069fa0935b
8006529: Methods always get callee - it should be conditional
attila
parents:
16151
diff
changeset
|
110 |
loadScope(method); |
16147 | 111 |
|
16224
0c49ad4e3b55
8006222: Move slot from SpillProperty to Property
jlaskey
parents:
16206
diff
changeset
|
112 |
if (hasArguments()) { |
17233 | 113 |
method.loadCompilerConstant(ARGUMENTS); |
24719 | 114 |
method.invoke(constructorNoLookup(className, PropertyMap.class, ScriptObject.class, ARGUMENTS.type())); |
16147 | 115 |
} else { |
24719 | 116 |
method.invoke(constructorNoLookup(className, PropertyMap.class, ScriptObject.class)); |
16147 | 117 |
} |
118 |
} else { |
|
24719 | 119 |
method.invoke(constructorNoLookup(className, PropertyMap.class)); |
16147 | 120 |
} |
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
121 |
} |
16147 | 122 |
|
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
123 |
@Override |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
124 |
public void populateRange(final MethodEmitter method, final Type objectType, final int objectSlot, final int start, final int end) { |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
125 |
method.load(objectType, objectSlot); |
16147 | 126 |
// Set values. |
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
127 |
for (int i = start; i < end; i++) { |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
128 |
final MapTuple<T> tuple = tuples.get(i); |
24719 | 129 |
//we only load when we have both symbols and values (which can be == the symbol) |
130 |
//if we didn't load, we need an array property |
|
131 |
if (tuple.symbol != null && tuple.value != null) { |
|
132 |
final int index = getArrayIndex(tuple.key); |
|
30390
357f9a3f9394
8079269: Optimistic rewrite in object literal causes ArrayIndexOutOfBoundsException
attila
parents:
29834
diff
changeset
|
133 |
method.dup(); |
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
18852
diff
changeset
|
134 |
if (!isValidArrayIndex(index)) { |
24719 | 135 |
putField(method, tuple.key, tuple.symbol.getFieldIndex(), tuple); |
16147 | 136 |
} else { |
24719 | 137 |
putSlot(method, ArrayIndex.toLongIndex(index), tuple); |
16147 | 138 |
} |
24738
be2026c9717c
8039746: Transform applies to calls wherever possible, for ScriptFunctions and JSObjects.
lagergren
parents:
24721
diff
changeset
|
139 |
|
be2026c9717c
8039746: Transform applies to calls wherever possible, for ScriptFunctions and JSObjects.
lagergren
parents:
24721
diff
changeset
|
140 |
//this is a nop of tuple.key isn't e.g. "apply" or another special name |
be2026c9717c
8039746: Transform applies to calls wherever possible, for ScriptFunctions and JSObjects.
lagergren
parents:
24721
diff
changeset
|
141 |
method.invalidateSpecialName(tuple.key); |
16147 | 142 |
} |
143 |
} |
|
144 |
} |
|
145 |
||
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
146 |
@Override |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
147 |
protected PropertyMap makeMap() { |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
148 |
assert propertyMap == null : "property map already initialized"; |
29834
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
26648
diff
changeset
|
149 |
propertyMap = newMapCreator(fieldObjectClass).makeFieldMap(hasArguments(), codegen.useDualFields(), fieldCount, paddedFieldCount, evalCode); |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
150 |
return propertyMap; |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
151 |
} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
152 |
|
16147 | 153 |
/** |
154 |
* Store a value in a field of the generated class object. |
|
155 |
* |
|
156 |
* @param method Script method. |
|
157 |
* @param key Property key. |
|
158 |
* @param fieldIndex Field number. |
|
26377
028dad61662f
8051889: Implement block scoping in symbol assignment and scope computation
hannesw
parents:
25865
diff
changeset
|
159 |
* @param tuple Tuple to store. |
16147 | 160 |
*/ |
24719 | 161 |
private void putField(final MethodEmitter method, final String key, final int fieldIndex, final MapTuple<T> tuple) { |
29834
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
26648
diff
changeset
|
162 |
final Type fieldType = codegen.useDualFields() && tuple.isPrimitive() ? PRIMITIVE_FIELD_TYPE : Type.OBJECT; |
24719 | 163 |
final String fieldClass = getClassName(); |
164 |
final String fieldName = getFieldName(fieldIndex, fieldType); |
|
165 |
final String fieldDesc = typeDescriptor(fieldType.getTypeClass()); |
|
166 |
||
24721
81f70e23cd3b
8036127: Prototype filter needs to be applied to getter guard as well, not just getter
lagergren
parents:
24719
diff
changeset
|
167 |
assert fieldName.equals(getFieldName(fieldIndex, PRIMITIVE_FIELD_TYPE)) || fieldType.isObject() : key + " object keys must store to L*-fields"; |
81f70e23cd3b
8036127: Prototype filter needs to be applied to getter guard as well, not just getter
lagergren
parents:
24719
diff
changeset
|
168 |
assert fieldName.equals(getFieldName(fieldIndex, Type.OBJECT)) || fieldType.isPrimitive() : key + " primitive keys must store to J*-fields"; |
81f70e23cd3b
8036127: Prototype filter needs to be applied to getter guard as well, not just getter
lagergren
parents:
24719
diff
changeset
|
169 |
|
81f70e23cd3b
8036127: Prototype filter needs to be applied to getter guard as well, not just getter
lagergren
parents:
24719
diff
changeset
|
170 |
loadTuple(method, tuple); |
81f70e23cd3b
8036127: Prototype filter needs to be applied to getter guard as well, not just getter
lagergren
parents:
24719
diff
changeset
|
171 |
|
24719 | 172 |
method.putField(fieldClass, fieldName, fieldDesc); |
16147 | 173 |
} |
174 |
||
175 |
/** |
|
176 |
* Store a value in an indexed slot of a generated class object. |
|
177 |
* |
|
178 |
* @param method Script method. |
|
179 |
* @param index Slot index. |
|
26377
028dad61662f
8051889: Implement block scoping in symbol assignment and scope computation
hannesw
parents:
25865
diff
changeset
|
180 |
* @param tuple Tuple to store. |
16147 | 181 |
*/ |
24719 | 182 |
private void putSlot(final MethodEmitter method, final long index, final MapTuple<T> tuple) { |
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
18852
diff
changeset
|
183 |
if (JSType.isRepresentableAsInt(index)) { |
24719 | 184 |
method.load((int)index); |
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
18852
diff
changeset
|
185 |
} else { |
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
18852
diff
changeset
|
186 |
method.load(index); |
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
18852
diff
changeset
|
187 |
} |
24719 | 188 |
loadTuple(method, tuple, false); //we don't pack array like objects |
16147 | 189 |
method.dynamicSetIndex(callSiteFlags); |
190 |
} |
|
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
191 |
|
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
192 |
/** |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
193 |
* Locate (or indirectly create) the object container class. |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
194 |
*/ |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
195 |
private void findClass() { |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
196 |
fieldObjectClassName = isScope() ? |
29834
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
26648
diff
changeset
|
197 |
ObjectClassGenerator.getClassName(fieldCount, paramCount, codegen.useDualFields()) : |
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
26648
diff
changeset
|
198 |
ObjectClassGenerator.getClassName(paddedFieldCount, codegen.useDualFields()); |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
199 |
|
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
200 |
try { |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
201 |
this.fieldObjectClass = Context.forStructureClass(Compiler.binaryName(fieldObjectClassName)); |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
202 |
} catch (final ClassNotFoundException e) { |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
203 |
throw new AssertionError("Nashorn has encountered an internal error. Structure can not be created."); |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
204 |
} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
205 |
} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
206 |
|
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
207 |
@Override |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
208 |
protected Class<? extends ScriptObject> getAllocatorClass() { |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
209 |
return fieldObjectClass; |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
210 |
} |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
211 |
|
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
212 |
/** |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
213 |
* Get the class name for the object class, |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
214 |
* e.g. {@code com.nashorn.oracle.scripts.JO2P0} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
215 |
* |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
216 |
* @return script class name |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
217 |
*/ |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
218 |
String getClassName() { |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
219 |
return fieldObjectClassName; |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
220 |
} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
221 |
|
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
222 |
/** |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
223 |
* Tally the number of fields and parameters. |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
224 |
*/ |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
225 |
private void countFields() { |
24719 | 226 |
for (final MapTuple<T> tuple : tuples) { |
227 |
final Symbol symbol = tuple.symbol; |
|
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
228 |
if (symbol != null) { |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
229 |
if (hasArguments() && symbol.isParam()) { |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
230 |
symbol.setFieldIndex(paramCount++); |
26648
9a64e15eff37
8056978: ClassCastException: cannot cast jdk.nashorn.internal.scripts.JO*
hannesw
parents:
26377
diff
changeset
|
231 |
} else if (!isValidArrayIndex(getArrayIndex(tuple.key))) { |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
232 |
symbol.setFieldIndex(fieldCount++); |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
233 |
} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
234 |
} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
235 |
} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
236 |
|
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
237 |
paddedFieldCount = getPaddedFieldCount(fieldCount); |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
238 |
} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
18318
diff
changeset
|
239 |
|
16147 | 240 |
} |