6ce7c338fef3372e56aa274e7498cc0fb810c6fc
[WebKit-https.git] / Source / JavaScriptCore / ChangeLog
1 2018-09-17  Devin Rousso  <drousso@apple.com>
2
3         Web Inspector: generate CSSKeywordCompletions from backend values
4         https://bugs.webkit.org/show_bug.cgi?id=189041
5
6         Reviewed by Joseph Pecoraro.
7
8         * inspector/protocol/CSS.json:
9         Include an optional `aliases` array and `inherited` boolean for `CSSPropertyInfo`.
10
11 2018-09-17  Saam barati  <sbarati@apple.com>
12
13         We must convert ProfileType to CheckStructureOrEmpty instead of CheckStructure
14         https://bugs.webkit.org/show_bug.cgi?id=189676
15         <rdar://problem/39682897>
16
17         Reviewed by Michael Saboff.
18
19         Because the incoming value may be TDZ, CheckStructure may end up crashing.
20         Since the Type Profile does not currently record TDZ values in any of its
21         data structures, this is not a semantic change in how it will show you data.
22         It just fixes crashes when we emit a CheckStructure and the incoming value
23         is TDZ.
24
25         * dfg/DFGFixupPhase.cpp:
26         (JSC::DFG::FixupPhase::fixupNode):
27         * dfg/DFGNode.h:
28         (JSC::DFG::Node::convertToCheckStructureOrEmpty):
29
30 2018-09-17  Darin Adler  <darin@apple.com>
31
32         Use OpaqueJSString rather than JSRetainPtr inside WebKit
33         https://bugs.webkit.org/show_bug.cgi?id=189652
34
35         Reviewed by Saam Barati.
36
37         * API/JSCallbackObjectFunctions.h: Removed an uneeded include of
38         JSStringRef.h.
39
40         * API/JSContext.mm:
41         (-[JSContext evaluateScript:withSourceURL:]): Use OpaqueJSString::create rather
42         than JSStringCreateWithCFString, simplifying the code and also obviating the
43         need for explicit JSStringRelease.
44         (-[JSContext setName:]): Ditto.
45
46         * API/JSStringRef.cpp:
47         (JSStringIsEqualToUTF8CString): Use adoptRef rather than explicit JSStringRelease.
48         It seems that additional optimization is possible, obviating the need to allocate
49         an OpaqueJSString, but that's true almost everywhere else in this patch, too.
50
51         * API/JSValue.mm:
52         (+[JSValue valueWithNewRegularExpressionFromPattern:flags:inContext:]): Use
53         OpaqueJSString::create and adoptRef as appropriate.
54         (+[JSValue valueWithNewErrorFromMessage:inContext:]): Ditto.
55         (+[JSValue valueWithNewSymbolFromDescription:inContext:]): Ditto.
56         (performPropertyOperation): Ditto.
57         (-[JSValue invokeMethod:withArguments:]): Ditto.
58         (valueToObjectWithoutCopy): Ditto.
59         (containerValueToObject): Ditto.
60         (valueToString): Ditto.
61         (objectToValueWithoutCopy): Ditto.
62         (objectToValue): Ditto.
63
64 2018-09-08  Darin Adler  <darin@apple.com>
65
66         Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
67         https://bugs.webkit.org/show_bug.cgi?id=189455
68
69         Reviewed by Keith Miller.
70
71         * API/JSObjectRef.cpp:
72         (OpaqueJSPropertyNameArray): Use Ref<OpaqueJSString> instead of
73         JSRetainPtr<JSStringRef>.
74         (JSObjectCopyPropertyNames): Remove now-unneeded use of leakRef and
75         adopt constructor.
76         (JSPropertyNameArrayGetNameAtIndex): Use ptr() instead of get() since
77         the array elements are now Ref.
78
79         * API/JSRetainPtr.h: While JSRetainPtr is written as a template,
80         it only works for two specific unrelated types, JSStringRef and
81         JSGlobalContextRef. Simplified the default constructor using data
82         member initialization. Prepared to make the adopt constructor private
83         (got everything compiling that way, then made it public again so that
84         Apple internal software will still build). Got rid of unneeded
85         templated constructor and assignment operator, since it's not relevant
86         since there is no inheritance between JSRetainPtr template types.
87         Added WARN_UNUSED_RETURN to leakRef as in RefPtr and RetainPtr.
88         Added move constructor and move assignment operator for slightly better
89         performance. Simplified implementations of various member functions
90         so they are more obviously correct, by using leakPtr in more of them
91         and using std::exchange to make the flow of values more obvious.
92
93         * API/JSValue.mm:
94         (+[JSValue valueWithNewSymbolFromDescription:inContext:]): Added a
95         missing JSStringRelease to fix a leak.
96
97         * API/tests/CustomGlobalObjectClassTest.c:
98         (customGlobalObjectClassTest): Added a JSGlobalContextRelease to fix a leak.
99         (globalObjectSetPrototypeTest): Ditto.
100         (globalObjectPrivatePropertyTest): Ditto.
101
102         * API/tests/ExecutionTimeLimitTest.cpp:
103         (testResetAfterTimeout): Added a call to JSStringRelease to fix a leak.
104         (testExecutionTimeLimit): Ditto, lots more.
105
106         * API/tests/FunctionOverridesTest.cpp:
107         (testFunctionOverrides): Added a call to JSStringRelease to fix a leak.
108
109         * API/tests/JSObjectGetProxyTargetTest.cpp:
110         (testJSObjectGetProxyTarget): Added a call to JSGlobalContextRelease to fix
111         a leak.
112
113         * API/tests/PingPongStackOverflowTest.cpp:
114         (testPingPongStackOverflow): Added calls to JSGlobalContextRelease and
115         JSStringRelease to fix leaks.
116
117         * API/tests/testapi.c:
118         (throwException): Added. Helper function for repeated idiom where we want
119         to throw an exception, but with additional JSStringRelease calls so we don't
120         have to leak just to keep the code simpler to read.
121         (MyObject_getProperty): Use throwException.
122         (MyObject_setProperty): Ditto.
123         (MyObject_deleteProperty): Ditto.
124         (isValueEqualToString): Added. Helper function for an idiom where we check
125         if something is a string and then if it's equal to a particular string
126         constant, but a version that has an additional JSStringRelease call so we
127         don't have to leak just to keep the code simpler to read.
128         (MyObject_callAsFunction): Use isValueEqualToString and throwException.
129         (MyObject_callAsConstructor): Ditto.
130         (MyObject_hasInstance): Ditto.
131         (globalContextNameTest): Added a JSGlobalContextRelease to fix a leak.
132         (testMarkingConstraintsAndHeapFinalizers): Ditto.
133
134 2018-09-14  Saam barati  <sbarati@apple.com>
135
136         Don't dump OSRAvailabilityData in Graph::dump because a stale Availability may point to a Node that is already freed
137         https://bugs.webkit.org/show_bug.cgi?id=189628
138         <rdar://problem/39481690>
139
140         Reviewed by Mark Lam.
141
142         An Availability may point to a Node. And that Node may be removed from
143         the graph, e.g, it's freed and its memory is no longer owned by Graph.
144         This patch makes it so we no longer dump this metadata by default. If
145         this metadata is interesting to you, you'll need to go in and change
146         Graph::dump to dump the needed metadata.
147
148         * dfg/DFGGraph.cpp:
149         (JSC::DFG::Graph::dump):
150
151 2018-09-14  Mark Lam  <mark.lam@apple.com>
152
153         Refactor some ForInContext code for better encapsulation.
154         https://bugs.webkit.org/show_bug.cgi?id=189626
155         <rdar://problem/44466415>
156
157         Reviewed by Keith Miller.
158
159         1. Add a ForInContext::m_type field to store the context type.  This does not
160            increase the class size, but eliminates the need for a virtual call to get the
161            type.
162
163            Note: we still need a virtual destructor because we'll be mingling
164            IndexedForInContexts and StructureForInContexts in the BytecodeGenerator::m_forInContextStack.
165
166         2. Add ForInContext::isIndexedForInContext() and ForInContext::isStructureForInContext()
167            convenience methods.
168
169         3. Add ForInContext::asIndexedForInContext() and ForInContext::asStructureForInContext()
170            to do the casting to the subclass types.  This ensures that we'll properly
171            assert that the casting is legal.
172
173         * bytecompiler/BytecodeGenerator.cpp:
174         (JSC::BytecodeGenerator::emitGetByVal):
175         (JSC::BytecodeGenerator::popIndexedForInScope):
176         (JSC::BytecodeGenerator::popStructureForInScope):
177         * bytecompiler/BytecodeGenerator.h:
178         (JSC::ForInContext::type const):
179         (JSC::ForInContext::isIndexedForInContext const):
180         (JSC::ForInContext::isStructureForInContext const):
181         (JSC::ForInContext::asIndexedForInContext):
182         (JSC::ForInContext::asStructureForInContext):
183         (JSC::ForInContext::ForInContext):
184         (JSC::StructureForInContext::StructureForInContext):
185         (JSC::IndexedForInContext::IndexedForInContext):
186         (JSC::ForInContext::~ForInContext): Deleted.
187
188 2018-09-14  Devin Rousso  <webkit@devinrousso.com>
189
190         Web Inspector: Record actions performed on ImageBitmapRenderingContext
191         https://bugs.webkit.org/show_bug.cgi?id=181341
192
193         Reviewed by Joseph Pecoraro.
194
195         * inspector/protocol/Recording.json:
196         * inspector/scripts/codegen/generator.py:
197
198 2018-09-14  Mike Gorse  <mgorse@suse.com>
199
200         builtins directory causes name conflict on Python 3
201         https://bugs.webkit.org/show_bug.cgi?id=189552
202
203         Reviewed by Michael Catanzaro.
204
205         * CMakeLists.txt: builtins -> wkbuiltins.
206         * DerivedSources.make: builtins -> wkbuiltins.
207         * Scripts/generate-js-builtins.py: import wkbuiltins, rather than
208           builtins.
209         * Scripts/wkbuiltins/__init__.py: Renamed from Source/JavaScriptCore/Scripts/builtins/__init__.py.
210         * Scripts/wkbuiltins/builtins_generate_combined_header.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_combined_header.py.
211         * Scripts/wkbuiltins/builtins_generate_internals_wrapper_implementation.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_internals_wrapper_implementation.py.
212         * Scripts/wkbuiltins/builtins_generate_separate_header.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_header.py.
213         * Scripts/wkbuiltins/builtins_generate_separate_implementation.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_implementation.py.
214         * Scripts/wkbuiltins/builtins_generate_wrapper_header.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_wrapper_header.py.
215         * Scripts/wkbuiltins/builtins_generate_wrapper_implementation.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_wrapper_implementation.py.
216         * Scripts/wkbuiltins/builtins_generator.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generator.py.
217         * Scripts/wkbuiltins/builtins_model.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_model.py.
218         * Scripts/wkbuiltins/builtins_templates.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_templates.py.
219         * Scripts/wkbuiltins/wkbuiltins.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins.py.
220         * JavaScriptCore.xcodeproj/project.pbxproj: Update for the renaming.
221
222 2018-09-13  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
223
224         [WebAssembly] Inline WasmContext accessor functions
225         https://bugs.webkit.org/show_bug.cgi?id=189416
226
227         Reviewed by Saam Barati.
228
229         WasmContext accessor functions are very small while it resides in the critical path of
230         JS to Wasm function call. This patch makes them inline to improve performance.
231         This change improves a small benchmark (calling JS to Wasm function 1e7 times) from 320ms to 270ms.
232
233         * JavaScriptCore.xcodeproj/project.pbxproj:
234         * Sources.txt:
235         * interpreter/CallFrame.cpp:
236         * jit/AssemblyHelpers.cpp:
237         * wasm/WasmB3IRGenerator.cpp:
238         * wasm/WasmContextInlines.h: Renamed from Source/JavaScriptCore/wasm/WasmContext.cpp.
239         (JSC::Wasm::Context::useFastTLS):
240         (JSC::Wasm::Context::load const):
241         (JSC::Wasm::Context::store):
242         * wasm/WasmMemoryInformation.cpp:
243         * wasm/WasmModuleParser.cpp: Include <wtf/SHA1.h> due to changes of unified source combinations.
244         * wasm/js/JSToWasm.cpp:
245         * wasm/js/WebAssemblyFunction.cpp:
246
247 2018-09-12  David Kilzer  <ddkilzer@apple.com>
248
249         Move JavaScriptCore files to match Xcode project hierarchy
250         <https://webkit.org/b/189574>
251
252         Reviewed by Filip Pizlo.
253
254         * API/JSAPIValueWrapper.cpp: Rename from Source/JavaScriptCore/runtime/JSAPIValueWrapper.cpp.
255         * API/JSAPIValueWrapper.h: Rename from Source/JavaScriptCore/runtime/JSAPIValueWrapper.h.
256         * CMakeLists.txt: Update for new path to
257         generateYarrUnicodePropertyTables.py, hasher.py and
258         JSAPIValueWrapper.h.
259         * DerivedSources.make: Ditto. Add missing dependency on
260         hasher.py captured by CMakeLists.txt.
261         * JavaScriptCore.xcodeproj/project.pbxproj: Update for new file
262         reference paths. Add hasher.py library to project.
263         * Sources.txt: Update for new path to
264         JSAPIValueWrapper.cpp.
265         * runtime/JSImmutableButterfly.h: Add missing includes
266         after changes to Sources.txt and regenerating unified
267         sources.
268         * runtime/RuntimeType.h: Ditto.
269         * yarr/generateYarrUnicodePropertyTables.py: Rename from Source/JavaScriptCore/Scripts/generateYarrUnicodePropertyTables.py.
270         * yarr/hasher.py: Rename from Source/JavaScriptCore/Scripts/hasher.py.
271
272 2018-09-12  David Kilzer  <ddkilzer@apple.com>
273
274         Let Xcode have its way with the JavaScriptCore project
275
276         * JavaScriptCore.xcodeproj/project.pbxproj:
277
278 2018-09-12  Guillaume Emont  <guijemont@igalia.com>
279
280         Add IGNORE_WARNING_.* macros
281         https://bugs.webkit.org/show_bug.cgi?id=188996
282
283         Reviewed by Michael Catanzaro.
284
285         * API/JSCallbackObject.h:
286         * API/tests/testapi.c:
287         * assembler/LinkBuffer.h:
288         (JSC::LinkBuffer::finalizeCodeWithDisassembly):
289         * b3/B3LowerToAir.cpp:
290         * b3/B3Opcode.cpp:
291         * b3/B3Type.h:
292         * b3/B3TypeMap.h:
293         * b3/B3Width.h:
294         * b3/air/AirArg.cpp:
295         * b3/air/AirArg.h:
296         * b3/air/AirCode.h:
297         * bytecode/Opcode.h:
298         (JSC::padOpcodeName):
299         * dfg/DFGSpeculativeJIT.cpp:
300         (JSC::DFG::SpeculativeJIT::speculateNumber):
301         (JSC::DFG::SpeculativeJIT::speculateMisc):
302         * dfg/DFGSpeculativeJIT64.cpp:
303         * ftl/FTLOutput.h:
304         * jit/CCallHelpers.h:
305         (JSC::CCallHelpers::calculatePokeOffset):
306         * llint/LLIntData.cpp:
307         * llint/LLIntSlowPaths.cpp:
308         (JSC::LLInt::slowPathLogF):
309         * runtime/ConfigFile.cpp:
310         (JSC::ConfigFile::canonicalizePaths):
311         * runtime/JSDataViewPrototype.cpp:
312         * runtime/JSGenericTypedArrayViewConstructor.h:
313         * runtime/JSGenericTypedArrayViewPrototype.h:
314         * runtime/Options.cpp:
315         (JSC::Options::setAliasedOption):
316         * tools/CodeProfiling.cpp:
317         * wasm/WasmSections.h:
318         * wasm/generateWasmValidateInlinesHeader.py:
319
320 == Rolled over to ChangeLog-2018-09-11 ==