author | hannesw |
Sat, 19 Sep 2015 16:04:28 +0200 | |
changeset 32781 | d8f34ffbbc7a |
parent 30390 | 357f9a3f9394 |
child 33690 | 46a1bc24cf2c |
permissions | -rw-r--r-- |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
1 |
/* |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
2 |
* Copyright (c) 2010-2013, Oracle and/or its affiliates. All rights reserved. |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
4 |
* |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
10 |
* |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
15 |
* accompanied this code). |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
16 |
* |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
20 |
* |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
23 |
* questions. |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
24 |
*/ |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
25 |
|
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
26 |
package jdk.nashorn.internal.codegen; |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
27 |
|
18867
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
18852
diff
changeset
|
28 |
import static jdk.nashorn.internal.codegen.CompilerConstants.constructorNoLookup; |
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
29 |
import static jdk.nashorn.internal.codegen.CompilerConstants.virtualCallNoLookup; |
24738
be2026c9717c
8039746: Transform applies to calls wherever possible, for ScriptFunctions and JSObjects.
lagergren
parents:
24733
diff
changeset
|
30 |
|
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
31 |
import java.util.LinkedHashSet; |
18867
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
18852
diff
changeset
|
32 |
import java.util.List; |
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
33 |
import java.util.Set; |
24751 | 34 |
import jdk.nashorn.internal.codegen.types.Type; |
18867
bc91e3fcc5ba
8013925: Remove symbol fields from nodes that don't need them
attila
parents:
18852
diff
changeset
|
35 |
import jdk.nashorn.internal.ir.Expression; |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
36 |
import jdk.nashorn.internal.ir.LiteralNode; |
24733
1e825be55fd1
8027043: Turn global accesses into MethodHandle.constant, with one chance of reassignment, e.g. x = value occuring once in the global scope is ok, twice is not.
lagergren
parents:
24719
diff
changeset
|
37 |
import jdk.nashorn.internal.runtime.JSType; |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
38 |
import jdk.nashorn.internal.runtime.Property; |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
39 |
import jdk.nashorn.internal.runtime.PropertyMap; |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
40 |
import jdk.nashorn.internal.runtime.ScriptObject; |
24719 | 41 |
import jdk.nashorn.internal.runtime.ScriptRuntime; |
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
42 |
import jdk.nashorn.internal.runtime.arrays.ArrayData; |
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
43 |
import jdk.nashorn.internal.runtime.arrays.ArrayIndex; |
29834
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
44 |
import jdk.nashorn.internal.scripts.JD; |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
45 |
import jdk.nashorn.internal.scripts.JO; |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
46 |
|
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
47 |
/** |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
48 |
* An object creator that uses spill properties. |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
49 |
*/ |
24719 | 50 |
public final class SpillObjectCreator extends ObjectCreator<Expression> { |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
51 |
|
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
52 |
/** |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
53 |
* Constructor |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
54 |
* |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
55 |
* @param codegen code generator |
24719 | 56 |
* @param tuples tuples for key, symbol, value |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
57 |
*/ |
24719 | 58 |
SpillObjectCreator(final CodeGenerator codegen, final List<MapTuple<Expression>> tuples) { |
59 |
super(codegen, tuples, false, false); |
|
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
60 |
makeMap(); |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
61 |
} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
62 |
|
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
63 |
@Override |
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
64 |
public void createObject(final MethodEmitter method) { |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
65 |
assert !isScope() : "spill scope objects are not currently supported"; |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
66 |
|
24719 | 67 |
final int length = tuples.size(); |
29834
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
68 |
final boolean dualFields = codegen.useDualFields(); |
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
69 |
final int spillLength = ScriptObject.spillAllocationLength(length); |
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
70 |
final long[] jpresetValues = dualFields ? new long[spillLength] : null; |
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
71 |
final Object[] opresetValues = new Object[spillLength]; |
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
72 |
final Class<?> objectClass = getAllocatorClass(); |
24719 | 73 |
ArrayData arrayData = ArrayData.allocate(ScriptRuntime.EMPTY_ARRAY); |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
74 |
|
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
75 |
// Compute constant property values |
24719 | 76 |
int pos = 0; |
77 |
for (final MapTuple<Expression> tuple : tuples) { |
|
78 |
final String key = tuple.key; |
|
79 |
final Expression value = tuple.value; |
|
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
80 |
|
24738
be2026c9717c
8039746: Transform applies to calls wherever possible, for ScriptFunctions and JSObjects.
lagergren
parents:
24733
diff
changeset
|
81 |
//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:
24733
diff
changeset
|
82 |
method.invalidateSpecialName(tuple.key); |
be2026c9717c
8039746: Transform applies to calls wherever possible, for ScriptFunctions and JSObjects.
lagergren
parents:
24733
diff
changeset
|
83 |
|
24719 | 84 |
if (value != null) { |
85 |
final Object constantValue = LiteralNode.objectAsConstant(value); |
|
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
86 |
if (constantValue != LiteralNode.POSTSET_MARKER) { |
24719 | 87 |
final Property property = propertyMap.findProperty(key); |
88 |
if (property != null) { |
|
89 |
// normal property key |
|
29834
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
90 |
property.setType(dualFields ? JSType.unboxedFieldType(constantValue) : Object.class); |
24719 | 91 |
final int slot = property.getSlot(); |
29834
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
92 |
if (dualFields && constantValue instanceof Number) { |
24719 | 93 |
jpresetValues[slot] = ObjectClassGenerator.pack((Number)constantValue); |
94 |
} else { |
|
95 |
opresetValues[slot] = constantValue; |
|
96 |
} |
|
97 |
} else { |
|
98 |
// array index key |
|
99 |
final long oldLength = arrayData.length(); |
|
100 |
final int index = ArrayIndex.getArrayIndex(key); |
|
101 |
final long longIndex = ArrayIndex.toLongIndex(index); |
|
102 |
||
103 |
assert ArrayIndex.isValidArrayIndex(index); |
|
104 |
||
105 |
if (longIndex >= oldLength) { |
|
106 |
arrayData = arrayData.ensure(longIndex); |
|
107 |
} |
|
108 |
||
109 |
//avoid blowing up the array if we can |
|
110 |
if (constantValue instanceof Integer) { |
|
111 |
arrayData = arrayData.set(index, ((Integer)constantValue).intValue(), false); |
|
112 |
} else if (constantValue instanceof Long) { |
|
113 |
arrayData = arrayData.set(index, ((Long)constantValue).longValue(), false); |
|
114 |
} else if (constantValue instanceof Double) { |
|
115 |
arrayData = arrayData.set(index, ((Double)constantValue).doubleValue(), false); |
|
116 |
} else { |
|
117 |
arrayData = arrayData.set(index, constantValue, false); |
|
118 |
} |
|
119 |
||
120 |
if (longIndex > oldLength) { |
|
121 |
arrayData = arrayData.delete(oldLength, longIndex - 1); |
|
122 |
} |
|
123 |
} |
|
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
124 |
} |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
125 |
} |
24719 | 126 |
pos++; |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
127 |
} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
128 |
|
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
129 |
// create object and invoke constructor |
29834
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
130 |
method._new(objectClass).dup(); |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
131 |
codegen.loadConstant(propertyMap); |
24719 | 132 |
|
30388
3a270ce8e030
8078049: Nashorn crashes when attempting to start TypeScript compiler
hannesw
parents:
29834
diff
changeset
|
133 |
// load primitive value spill array |
29834
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
134 |
if (dualFields) { |
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
135 |
codegen.loadConstant(jpresetValues); |
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
136 |
} else { |
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
137 |
method.loadNull(); |
24719 | 138 |
} |
30388
3a270ce8e030
8078049: Nashorn crashes when attempting to start TypeScript compiler
hannesw
parents:
29834
diff
changeset
|
139 |
// load object value spill array |
24719 | 140 |
codegen.loadConstant(opresetValues); |
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
141 |
|
30388
3a270ce8e030
8078049: Nashorn crashes when attempting to start TypeScript compiler
hannesw
parents:
29834
diff
changeset
|
142 |
// instantiate the script object with spill objects |
29834
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
143 |
method.invoke(constructorNoLookup(objectClass, PropertyMap.class, long[].class, Object[].class)); |
24719 | 144 |
|
145 |
// Set prefix array data if any |
|
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
146 |
if (arrayData.length() > 0) { |
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
147 |
method.dup(); |
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
148 |
codegen.loadConstant(arrayData); |
24719 | 149 |
method.invoke(virtualCallNoLookup(ScriptObject.class, "setArray", void.class, ArrayData.class)); |
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
150 |
} |
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
151 |
} |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
152 |
|
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
153 |
@Override |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
154 |
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
|
155 |
final int callSiteFlags = codegen.getCallSiteFlags(); |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
156 |
method.load(objectType, objectSlot); |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
157 |
|
30388
3a270ce8e030
8078049: Nashorn crashes when attempting to start TypeScript compiler
hannesw
parents:
29834
diff
changeset
|
158 |
// set postfix values |
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
159 |
for (int i = start; i < end; i++) { |
29834
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
160 |
final MapTuple<Expression> tuple = tuples.get(i); |
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
161 |
|
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
162 |
if (LiteralNode.isConstant(tuple.value)) { |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
163 |
continue; |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
164 |
} |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
165 |
|
29834
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
166 |
final Property property = propertyMap.findProperty(tuple.key); |
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
167 |
|
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
168 |
if (property == null) { |
24719 | 169 |
final int index = ArrayIndex.getArrayIndex(tuple.key); |
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
170 |
assert ArrayIndex.isValidArrayIndex(index); |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
171 |
method.dup(); |
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
172 |
method.load(ArrayIndex.toLongIndex(index)); |
24719 | 173 |
loadTuple(method, tuple); |
19236
73d242d205f9
8020132: Big object literal with numerical keys exceeds method size
hannesw
parents:
19097
diff
changeset
|
174 |
method.dynamicSetIndex(callSiteFlags); |
30388
3a270ce8e030
8078049: Nashorn crashes when attempting to start TypeScript compiler
hannesw
parents:
29834
diff
changeset
|
175 |
} else { |
3a270ce8e030
8078049: Nashorn crashes when attempting to start TypeScript compiler
hannesw
parents:
29834
diff
changeset
|
176 |
method.dup(); |
3a270ce8e030
8078049: Nashorn crashes when attempting to start TypeScript compiler
hannesw
parents:
29834
diff
changeset
|
177 |
loadTuple(method, tuple); |
3a270ce8e030
8078049: Nashorn crashes when attempting to start TypeScript compiler
hannesw
parents:
29834
diff
changeset
|
178 |
method.dynamicSet(property.getKey(), codegen.getCallSiteFlags(), false); |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
179 |
} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
180 |
} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
181 |
} |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
182 |
|
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
183 |
@Override |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
184 |
protected PropertyMap makeMap() { |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
185 |
assert propertyMap == null : "property map already initialized"; |
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
186 |
final Class<? extends ScriptObject> clazz = getAllocatorClass(); |
29834
f678f348c947
8067215: Disable dual fields when not using optimistic types
hannesw
parents:
27307
diff
changeset
|
187 |
propertyMap = new MapCreator<>(clazz, tuples).makeSpillMap(false, codegen.useDualFields()); |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
188 |
return propertyMap; |
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
189 |
} |
24719 | 190 |
|
191 |
@Override |
|
24751 | 192 |
protected void loadValue(final Expression expr, final Type type) { |
193 |
codegen.loadExpressionAsType(expr, type); |
|
24719 | 194 |
} |
32781
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
195 |
|
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
196 |
@Override |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
197 |
protected Class<? extends ScriptObject> getAllocatorClass() { |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
198 |
return codegen.useDualFields() ? JD.class : JO.class; |
d8f34ffbbc7a
8135190: Method code too large in Babel browser.js script
hannesw
parents:
30390
diff
changeset
|
199 |
} |
18852
604c1d681b6f
8017084: Use spill properties for large object literals
hannesw
parents:
diff
changeset
|
200 |
} |