c12bd490a43a2ba604290a130b5337d2d973589d
[WebKit-https.git] / Source / JavaScriptCore / ChangeLog
1 2018-01-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2
3         [JSC] Remove LocalScope
4         https://bugs.webkit.org/show_bug.cgi?id=181206
5
6         Reviewed by Geoffrey Garen.
7
8         The last user of HandleStack and LocalScope is JSON. But MarkedArgumentBuffer is enough for their use.
9         This patch changes JSON parsing and stringifying to using MarkedArgumentBuffer. And remove HandleStack
10         and LocalScope.
11
12         We make Stringifier and Walker WTF_FORBID_HEAP_ALLOCATION to place them on the stack. So they can hold
13         JSObject* directly in their fields.
14
15         * JavaScriptCore.xcodeproj/project.pbxproj:
16         * Sources.txt:
17         * heap/HandleStack.cpp: Removed.
18         * heap/HandleStack.h: Removed.
19         * heap/Heap.cpp:
20         (JSC::Heap::addCoreConstraints):
21         * heap/Heap.h:
22         (JSC::Heap::handleSet):
23         (JSC::Heap::handleStack): Deleted.
24         * heap/Local.h: Removed.
25         * heap/LocalScope.h: Removed.
26         * runtime/JSONObject.cpp:
27         (JSC::Stringifier::Holder::object const):
28         (JSC::gap):
29         (JSC::Stringifier::Stringifier):
30         (JSC::Stringifier::stringify):
31         (JSC::Stringifier::appendStringifiedValue):
32         (JSC::Stringifier::Holder::Holder):
33         (JSC::Stringifier::Holder::appendNextProperty):
34         (JSC::Walker::Walker):
35         (JSC::Walker::callReviver):
36         (JSC::Walker::walk):
37         (JSC::JSONProtoFuncParse):
38         (JSC::JSONProtoFuncStringify):
39         (JSC::JSONParse):
40         (JSC::JSONStringify):
41
42 2018-01-04  Yusuke Suzuki  <utatane.tea@gmail.com>
43
44         [FTL] Optimize ObjectAllocationSinking mergePointerSets by using removeIf
45         https://bugs.webkit.org/show_bug.cgi?id=180238
46
47         Reviewed by Saam Barati.
48
49         We can optimize ObjectAllocationSinking a bit by using removeIf.
50
51         * dfg/DFGObjectAllocationSinkingPhase.cpp:
52
53 2018-01-04  Yusuke Suzuki  <utatane.tea@gmail.com>
54
55         [JSC] Create parallel SlotVisitors apriori
56         https://bugs.webkit.org/show_bug.cgi?id=180907
57
58         Reviewed by Saam Barati.
59
60         The number of SlotVisitors are capped with the number of HeapHelperPool's threads + 2.
61         If we create these SlotVisitors apriori, we do not need to create SlotVisitors dynamically.
62         Then we do not need to grab locks while iterating all the SlotVisitors.
63
64         In addition, we do not need to consider the case that the number of SlotVisitors increases
65         after setting up VisitCounters in MarkingConstraintSolver since the number of SlotVisitors
66         does not increase any more.
67
68         * heap/Heap.cpp:
69         (JSC::Heap::Heap):
70         (JSC::Heap::runBeginPhase):
71         * heap/Heap.h:
72         * heap/HeapInlines.h:
73         (JSC::Heap::forEachSlotVisitor):
74         (JSC::Heap::numberOfSlotVisitors): Deleted.
75         * heap/MarkingConstraintSolver.cpp:
76         (JSC::MarkingConstraintSolver::didVisitSomething const):
77
78 2018-01-03  Ting-Wei Lan  <lantw44@gmail.com>
79
80         Replace hard-coded paths in shebangs with #!/usr/bin/env
81         https://bugs.webkit.org/show_bug.cgi?id=181040
82
83         Reviewed by Alex Christensen.
84
85         * Scripts/UpdateContents.py:
86         * Scripts/cssmin.py:
87         * Scripts/generate-combined-inspector-json.py:
88         * Scripts/xxd.pl:
89         * create_hash_table:
90         * generate-bytecode-files:
91         * wasm/generateWasm.py:
92         * wasm/generateWasmOpsHeader.py:
93         * yarr/generateYarrCanonicalizeUnicode:
94
95 2018-01-03  Michael Saboff  <msaboff@apple.com>
96
97         Disable SharedArrayBuffers from Web API
98         https://bugs.webkit.org/show_bug.cgi?id=181266
99
100         Reviewed by Saam Barati.
101
102         Removed SharedArrayBuffer prototype and structure from GlobalObject creation
103         to disable.
104
105         * runtime/JSGlobalObject.cpp:
106         (JSC::JSGlobalObject::init):
107         (JSC::JSGlobalObject::visitChildren):
108         * runtime/JSGlobalObject.h:
109         (JSC::JSGlobalObject::arrayBufferPrototype const):
110         (JSC::JSGlobalObject::arrayBufferStructure const):
111
112 2018-01-03  Michael Saboff  <msaboff@apple.com>
113
114         Add "noInline" to $vm
115         https://bugs.webkit.org/show_bug.cgi?id=181265
116
117         Reviewed by Mark Lam.
118
119         This would be useful for web based tests.
120
121         * tools/JSDollarVM.cpp:
122         (JSC::getExecutableForFunction):
123         (JSC::functionNoInline):
124         (JSC::JSDollarVM::finishCreation):
125
126 2018-01-03  Michael Saboff  <msaboff@apple.com>
127
128         Remove unnecessary flushing of Butterfly pointer in functionCpuClflush()
129         https://bugs.webkit.org/show_bug.cgi?id=181263
130
131         Reviewed by Mark Lam.
132
133         Flushing the butterfly pointer provides no benefit and slows this function.
134
135         * tools/JSDollarVM.cpp:
136         (JSC::functionCpuClflush):
137
138 2018-01-03  Saam Barati  <sbarati@apple.com>
139
140         Fix BytecodeParser op_catch assert to work with useProfiler=1
141         https://bugs.webkit.org/show_bug.cgi?id=181260
142
143         Reviewed by Keith Miller.
144
145         op_catch was asserting that the current block was empty. This is only true
146         if the profiler isn't enabled. When the profiler is enabled, we will
147         insert a CountExecution node before each bytecode. This patch fixes the
148         assert to work with the profiler.
149
150         * dfg/DFGByteCodeParser.cpp:
151         (JSC::DFG::ByteCodeParser::parseBlock):
152
153 2018-01-03  Per Arne Vollan  <pvollan@apple.com>
154
155         [Win][Debug] testapi link error.
156         https://bugs.webkit.org/show_bug.cgi?id=181247
157         <rdar://problem/36166729>
158
159         Reviewed by Brent Fulgham.
160
161         Do not set the runtime library compile flag for C files, it is already set to the correct value.
162  
163         * shell/PlatformWin.cmake:
164
165 2018-01-03  Robin Morisset  <rmorisset@apple.com>
166
167         Inlining of a function that ends in op_unreachable crashes
168         https://bugs.webkit.org/show_bug.cgi?id=181027
169
170         Reviewed by Filip Pizlo.
171
172         * dfg/DFGByteCodeParser.cpp:
173         (JSC::DFG::ByteCodeParser::allocateTargetableBlock):
174         (JSC::DFG::ByteCodeParser::inlineCall):
175
176 2018-01-02  Saam Barati  <sbarati@apple.com>
177
178         Incorrect assertion inside AccessCase
179         https://bugs.webkit.org/show_bug.cgi?id=181200
180         <rdar://problem/35494754>
181
182         Reviewed by Yusuke Suzuki.
183
184         Consider a PutById compiled to a setter in a function like so:
185         
186         ```
187         function foo(o) { o.f = o; }
188         ```
189         
190         The DFG will often assign the same registers to the baseGPR (o in o.f) and the
191         valueRegsPayloadGPR (o in the RHS). The code totally works when these are assigned
192         to the same register. However, we're asserting that they're not the same register.
193         This patch just removes this invalid assertion.
194
195         * bytecode/AccessCase.cpp:
196         (JSC::AccessCase::generateImpl):
197
198 2018-01-02  Caio Lima  <ticaiolima@gmail.com>
199
200         [ESNext][BigInt] Implement BigIntConstructor and BigIntPrototype
201         https://bugs.webkit.org/show_bug.cgi?id=175359
202
203         Reviewed by Yusuke Suzuki.
204
205         This patch is implementing BigIntConstructor and BigIntPrototype
206         following spec[1, 2]. As addition, we are also implementing BigIntObject
207         warapper to handle ToObject(v) abstract operation when "v" is a BigInt
208         primitive. With these classes, now it's possible to syntetize
209         BigInt.prototype and then call "toString", "valueOf" and
210         "toLocaleString" when the primitive is a BigInt.
211         BigIntConstructor exposes an API to parse other primitives such as
212         Number, Boolean and String to BigInt.
213         We decided to skip parseInt implementation, since it was removed from
214         spec.
215
216         [1] - https://tc39.github.io/proposal-bigint/#sec-bigint-constructor
217         [2] - https://tc39.github.io/proposal-bigint/#sec-properties-of-the-bigint-prototype-object 
218
219         * CMakeLists.txt:
220         * DerivedSources.make:
221         * JavaScriptCore.xcodeproj/project.pbxproj:
222         * Sources.txt:
223         * jsc.cpp:
224         * runtime/BigIntConstructor.cpp: Added.
225         (JSC::BigIntConstructor::BigIntConstructor):
226         (JSC::BigIntConstructor::finishCreation):
227         (JSC::isSafeInteger):
228         (JSC::toBigInt):
229         (JSC::callBigIntConstructor):
230         (JSC::bigIntConstructorFuncAsUintN):
231         (JSC::bigIntConstructorFuncAsIntN):
232         * runtime/BigIntConstructor.h: Added.
233         (JSC::BigIntConstructor::create):
234         (JSC::BigIntConstructor::createStructure):
235         * runtime/BigIntObject.cpp: Added.
236         (JSC::BigIntObject::BigIntObject):
237         (JSC::BigIntObject::finishCreation):
238         (JSC::BigIntObject::toStringName):
239         (JSC::BigIntObject::defaultValue):
240         * runtime/BigIntObject.h: Added.
241         (JSC::BigIntObject::create):
242         (JSC::BigIntObject::internalValue const):
243         (JSC::BigIntObject::createStructure):
244         * runtime/BigIntPrototype.cpp: Added.
245         (JSC::BigIntPrototype::BigIntPrototype):
246         (JSC::BigIntPrototype::finishCreation):
247         (JSC::toThisBigIntValue):
248         (JSC::bigIntProtoFuncToString):
249         (JSC::bigIntProtoFuncToLocaleString):
250         (JSC::bigIntProtoFuncValueOf):
251         * runtime/BigIntPrototype.h: Added.
252         (JSC::BigIntPrototype::create):
253         (JSC::BigIntPrototype::createStructure):
254         * runtime/IntlCollator.cpp:
255         (JSC::IntlCollator::initializeCollator):
256         * runtime/IntlNumberFormat.cpp:
257         (JSC::IntlNumberFormat::initializeNumberFormat):
258         * runtime/JSBigInt.cpp:
259         (JSC::JSBigInt::createFrom):
260         (JSC::JSBigInt::parseInt):
261         (JSC::JSBigInt::toObject const):
262         * runtime/JSBigInt.h:
263         * runtime/JSCJSValue.cpp:
264         (JSC::JSValue::synthesizePrototype const):
265         * runtime/JSCPoisonedPtr.cpp:
266         * runtime/JSCell.cpp:
267         (JSC::JSCell::toObjectSlow const):
268         * runtime/JSGlobalObject.cpp:
269         (JSC::JSGlobalObject::init):
270         (JSC::JSGlobalObject::visitChildren):
271         * runtime/JSGlobalObject.h:
272         (JSC::JSGlobalObject::bigIntPrototype const):
273         (JSC::JSGlobalObject::bigIntObjectStructure const):
274         * runtime/StructureCache.h:
275         * runtime/StructureInlines.h:
276         (JSC::prototypeForLookupPrimitiveImpl):
277
278 2018-01-02  Tim Horton  <timothy_horton@apple.com>
279
280         Fix the MathCommon build with a recent compiler
281         https://bugs.webkit.org/show_bug.cgi?id=181216
282
283         Reviewed by Sam Weinig.
284
285         * runtime/MathCommon.cpp:
286         (JSC::fdlibmPow):
287         This cast drops the 'const' qualifier from the pointer to 'one',
288         but it doesn't have to, and it makes the compiler sad.
289
290 == Rolled over to ChangeLog-2018-01-01 ==