24e3205f70e5adda7067377064357fdb1f0a23e5
[WebKit-https.git] / Source / JavaScriptCore / ChangeLog
1 2018-09-25  Joseph Pecoraro  <pecoraro@apple.com>
2
3         Web Inspector: Stricter block syntax in generated ObjC protocol interfaces
4         https://bugs.webkit.org/show_bug.cgi?id=189962
5         <rdar://problem/44648287>
6
7         Reviewed by Brian Burg.
8
9         * inspector/scripts/codegen/generate_objc_header.py:
10         (ObjCHeaderGenerator._callback_block_for_command):
11         If there are no return parameters include "void" in the block signature.
12
13         * inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
14         * inspector/scripts/tests/generic/expected/domain-availability.json-result:
15         * inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result:
16         * inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
17         * inspector/scripts/tests/generic/expected/worker-supported-domains.json-result:
18         * inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:
19         Rebaseline test results.
20
21 2018-09-24  Joseph Pecoraro  <pecoraro@apple.com>
22
23         Remove AUTHORS and THANKS files which are stale
24         https://bugs.webkit.org/show_bug.cgi?id=189941
25
26         Reviewed by Darin Adler.
27
28         Included mentions below so their names are still in ChangeLogs.
29
30         * AUTHORS: Removed.
31         Harri Porten (porten@kde.org) and Peter Kelly (pmk@post.com).
32         These authors remain mentioned in copyrights in source files.
33
34         * THANKS: Removed.
35         Richard Moore <rich@kde.org> - for filling the Math object with some life
36         Daegeun Lee <realking@mizi.com> - for pointing out some bugs and providing much code for the String and Date object.
37         Marco Pinelli <pinmc@libero.it> - for his patches
38         Christian Kirsch <ck@held.mind.de> - for his contribution to the Date object
39         
40 2018-09-24  Fujii Hironori  <Hironori.Fujii@sony.com>
41
42         Rename WTF_COMPILER_GCC_OR_CLANG to WTF_COMPILER_GCC_COMPATIBLE
43         https://bugs.webkit.org/show_bug.cgi?id=189733
44
45         Reviewed by Michael Catanzaro.
46
47         * assembler/ARM64Assembler.h:
48         * assembler/ARMAssembler.h:
49         (JSC::ARMAssembler::cacheFlush):
50         * assembler/MacroAssemblerARM.cpp:
51         (JSC::isVFPPresent):
52         * assembler/MacroAssemblerARM64.cpp:
53         * assembler/MacroAssemblerARMv7.cpp:
54         * assembler/MacroAssemblerMIPS.cpp:
55         * assembler/MacroAssemblerX86Common.cpp:
56         * heap/HeapCell.cpp:
57         * heap/HeapCell.h:
58         * jit/HostCallReturnValue.h:
59         * jit/JIT.h:
60         * jit/JITOperations.cpp:
61         * jit/ThunkGenerators.cpp:
62         * runtime/ArrayConventions.cpp:
63         (JSC::clearArrayMemset):
64         * runtime/JSBigInt.cpp:
65         (JSC::JSBigInt::digitDiv):
66
67 2018-09-24  Saam Barati  <sbarati@apple.com>
68
69         Array.prototype.indexOf fast path needs to ensure the length is still valid after performing effects
70         https://bugs.webkit.org/show_bug.cgi?id=189922
71         <rdar://problem/44651275>
72
73         Reviewed by Mark Lam.
74
75         The implementation was first getting the length to iterate up to,
76         then getting the starting index. However, getting the starting
77         index may perform effects. e.g, it could change the length of the
78         array. This changes it so we verify the length is still valid.
79
80         * runtime/ArrayPrototype.cpp:
81         (JSC::arrayProtoFuncIndexOf):
82
83 2018-09-24  Tadeu Zagallo  <tzagallo@apple.com>
84
85         offlineasm: fix macro scoping
86         https://bugs.webkit.org/show_bug.cgi?id=189902
87
88         Reviewed by Mark Lam.
89
90         In the code below, the reference to `f` in `g`, which should refer to
91         the outer macro definition will instead refer to the f argument of the
92         anonymous macro passed to `g`. That leads to this code failing to
93         compile (f expected 0 args but got 1).
94         
95         ```
96         macro f(x)
97             move x, t0
98         end
99         
100         macro g(fn)
101             fn(macro () f(42) end)
102         end
103         
104         g(macro(f) f() end)
105         ```
106
107         * offlineasm/ast.rb:
108         * offlineasm/transform.rb:
109
110 2018-09-24  Tadeu Zagallo  <tzagallo@apple.com>
111
112         Add forEach method for iterating CodeBlock's ValueProfiles
113         https://bugs.webkit.org/show_bug.cgi?id=189897
114
115         Reviewed by Mark Lam.
116
117         Add method to abstract how we find ValueProfiles in a CodeBlock in
118         preparation for https://bugs.webkit.org/show_bug.cgi?id=189785, when
119         ValueProfiles will be stored in the MetadataTable.
120
121         * bytecode/CodeBlock.cpp:
122         (JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
123         (JSC::CodeBlock::updateAllValueProfilePredictions):
124         (JSC::CodeBlock::shouldOptimizeNow):
125         (JSC::CodeBlock::dumpValueProfiles):
126         * bytecode/CodeBlock.h:
127         (JSC::CodeBlock::forEachValueProfile):
128         (JSC::CodeBlock::numberOfArgumentValueProfiles):
129         (JSC::CodeBlock::valueProfileForArgument):
130         (JSC::CodeBlock::numberOfValueProfiles):
131         (JSC::CodeBlock::valueProfile):
132         (JSC::CodeBlock::totalNumberOfValueProfiles): Deleted.
133         (JSC::CodeBlock::getFromAllValueProfiles): Deleted.
134         * tools/HeapVerifier.cpp:
135         (JSC::HeapVerifier::validateJSCell):
136
137 2018-09-24  Saam barati  <sbarati@apple.com>
138
139         ArgumentsEliminationPhase should snip basic blocks after proven OSR exits
140         https://bugs.webkit.org/show_bug.cgi?id=189682
141         <rdar://problem/43557315>
142
143         Reviewed by Mark Lam.
144
145         Otherwise, if we have code like this:
146         ```
147         a: Arguments
148         b: GetButterfly(@a)
149         c: ForceExit
150         d: GetArrayLength(@a, @b)
151         ```
152         it will get transformed into this invalid DFG IR:
153         ```
154         a: PhantomArguments
155         b: Check(@a)
156         c: ForceExit
157         d: GetArrayLength(@a, @b)
158         ```
159         
160         And we will fail DFG validation since @b does not have a result.
161         
162         The fix is to just remove all nodes after the ForceExit and plant an
163         Unreachable after it. So the above code program will now turn into this:
164         ```
165         a: PhantomArguments
166         b: Check(@a)
167         c: ForceExit
168         e: Unreachable
169         ```
170
171         * dfg/DFGArgumentsEliminationPhase.cpp:
172
173 2018-09-22  Saam barati  <sbarati@apple.com>
174
175         The sampling should not use Strong<CodeBlock> in its machineLocation field
176         https://bugs.webkit.org/show_bug.cgi?id=189319
177
178         Reviewed by Filip Pizlo.
179
180         The sampling profiler has a CLI mode where we gather information about inline
181         call frames. That data structure was using a Strong<CodeBlock>. We were
182         constructing this Strong<CodeBlock> during GC concurrently to processing all
183         the Strong handles. This is a bug since we end up corrupting that data
184         structure. This patch fixes this by just making this data structure use the
185         sampling profiler's mechanism for holding onto and properly visiting heap pointers.
186
187         * inspector/agents/InspectorScriptProfilerAgent.cpp:
188         (Inspector::InspectorScriptProfilerAgent::trackingComplete):
189         * runtime/SamplingProfiler.cpp:
190         (JSC::SamplingProfiler::processUnverifiedStackTraces):
191
192         (JSC::SamplingProfiler::reportTopFunctions):
193         (JSC::SamplingProfiler::reportTopBytecodes):
194         These CLI helpers needed a DeferGC otherwise we may end up deadlocking when we
195         cause a GC to happen while already holding the sampling profiler's
196         lock.
197
198 2018-09-21  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
199
200         [JSC] Enable LLInt ASM interpreter on X64 and ARM64 in non JIT configuration
201         https://bugs.webkit.org/show_bug.cgi?id=189778
202
203         Reviewed by Keith Miller.
204
205         LLInt ASM interpreter is 2x and 15% faster than CLoop interpreter on
206         Linux and macOS respectively. We would like to enable it for non JIT
207         configurations in X86_64 and ARM64.
208
209         This patch enables LLInt for non JIT builds in X86_64 and ARM64 architectures.
210         Previously, we switch LLInt ASM interpreter and CLoop by using ENABLE(JIT)
211         configuration. But it is wrong in the new scenario since we have a build
212         configuration that uses LLInt ASM interpreter and JIT is disabled. We introduce
213         ENABLE(C_LOOP) option, which represents that we use CLoop. And we replace
214         ENABLE(JIT) with ENABLE(C_LOOP) if the previous ENABLE(JIT) is essentially just
215         related to LLInt ASM interpreter and not related to JIT.
216
217         We also replace some ENABLE(JIT) configurations with ENABLE(ASSEMBLER).
218         ENABLE(ASSEMBLER) is now enabled even if we disable JIT since MacroAssembler
219         has machine register information that is used in LLInt ASM interpreter.
220
221         * API/tests/PingPongStackOverflowTest.cpp:
222         (testPingPongStackOverflow):
223         * CMakeLists.txt:
224         * JavaScriptCore.xcodeproj/project.pbxproj:
225         * assembler/MaxFrameExtentForSlowPathCall.h:
226         * bytecode/CallReturnOffsetToBytecodeOffset.h: Removed. It is no longer used.
227         * bytecode/CodeBlock.cpp:
228         (JSC::CodeBlock::finishCreation):
229         * bytecode/CodeBlock.h:
230         (JSC::CodeBlock::calleeSaveRegisters const):
231         (JSC::CodeBlock::numberOfLLIntBaselineCalleeSaveRegisters):
232         (JSC::CodeBlock::llintBaselineCalleeSaveSpaceAsVirtualRegisters):
233         (JSC::CodeBlock::calleeSaveSpaceAsVirtualRegisters):
234         * bytecode/Opcode.h:
235         (JSC::padOpcodeName):
236         * heap/Heap.cpp:
237         (JSC::Heap::gatherJSStackRoots):
238         (JSC::Heap::stopThePeriphery):
239         * interpreter/CLoopStack.cpp:
240         * interpreter/CLoopStack.h:
241         * interpreter/CLoopStackInlines.h:
242         * interpreter/EntryFrame.h:
243         * interpreter/Interpreter.cpp:
244         (JSC::Interpreter::Interpreter):
245         (JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):
246         * interpreter/Interpreter.h:
247         * interpreter/StackVisitor.cpp:
248         (JSC::StackVisitor::Frame::calleeSaveRegisters):
249         * interpreter/VMEntryRecord.h:
250         * jit/ExecutableAllocator.h:
251         * jit/FPRInfo.h:
252         (WTF::printInternal):
253         * jit/GPRInfo.cpp:
254         * jit/GPRInfo.h:
255         (WTF::printInternal):
256         * jit/HostCallReturnValue.cpp:
257         (JSC::getHostCallReturnValueWithExecState): Moved. They are used in LLInt ASM interpreter too.
258         * jit/HostCallReturnValue.h:
259         * jit/JITOperations.cpp:
260         (JSC::getHostCallReturnValueWithExecState): Deleted.
261         * jit/JITOperationsMSVC64.cpp:
262         * jit/Reg.cpp:
263         * jit/Reg.h:
264         * jit/RegisterAtOffset.cpp:
265         * jit/RegisterAtOffset.h:
266         * jit/RegisterAtOffsetList.cpp:
267         * jit/RegisterAtOffsetList.h:
268         * jit/RegisterMap.h:
269         * jit/RegisterSet.cpp:
270         * jit/RegisterSet.h:
271         * jit/TempRegisterSet.cpp:
272         * jit/TempRegisterSet.h:
273         * llint/LLIntCLoop.cpp:
274         * llint/LLIntCLoop.h:
275         * llint/LLIntData.cpp:
276         (JSC::LLInt::initialize):
277         (JSC::LLInt::Data::performAssertions):
278         * llint/LLIntData.h:
279         * llint/LLIntOfflineAsmConfig.h:
280         * llint/LLIntOpcode.h:
281         * llint/LLIntPCRanges.h:
282         * llint/LLIntSlowPaths.cpp:
283         (JSC::LLInt::LLINT_SLOW_PATH_DECL):
284         * llint/LLIntSlowPaths.h:
285         * llint/LLIntThunks.cpp:
286         * llint/LowLevelInterpreter.cpp:
287         * llint/LowLevelInterpreter.h:
288         * runtime/JSCJSValue.h:
289         * runtime/MachineContext.h:
290         * runtime/SamplingProfiler.cpp:
291         (JSC::SamplingProfiler::processUnverifiedStackTraces): Enable SamplingProfiler
292         for LLInt ASM interpreter with non JIT configuration.
293         * runtime/TestRunnerUtils.cpp:
294         (JSC::optimizeNextInvocation):
295         * runtime/VM.cpp:
296         (JSC::VM::VM):
297         (JSC::VM::getHostFunction):
298         (JSC::VM::updateSoftReservedZoneSize):
299         (JSC::sanitizeStackForVM):
300         (JSC::VM::committedStackByteCount):
301         * runtime/VM.h:
302         * runtime/VMInlines.h:
303         (JSC::VM::ensureStackCapacityFor):
304         (JSC::VM::isSafeToRecurseSoft const):
305
306 2018-09-21  Keith Miller  <keith_miller@apple.com>
307
308         Add Promise SPI
309         https://bugs.webkit.org/show_bug.cgi?id=189809
310
311         Reviewed by Saam Barati.
312
313         The Patch adds new SPI to create promises. It's mostly SPI because
314         I want to see how internal users react to it before we make it
315         public.
316
317         This patch adds a couple of new Obj-C SPI methods. The first
318         creates a new promise using the same API that JS does where the
319         user provides an executor callback. If an exception is raised
320         in/to that callback the promise is automagically rejected. The
321         other methods create a pre-resolved or rejected promise as this
322         appears to be a common way to initialize a promise.
323
324         I was also considering adding a second version of executor API
325         where it would catch specific Obj-C exceptions. This would work by
326         taking a Class paramter and checking isKindOfClass: on the
327         exception. I decided against this as nothing else in our API
328         handles Obj-C exceptions. I'm pretty sure the VM will end up in a
329         corrupt state if an Obj-C exception unwinds through JS frames.
330
331         This patch adds a new C function that will create a "deferred"
332         promise. A deferred promise is a style of creating promise/futures
333         where the resolve and reject functions are passed as outputs of a
334         function. I went with this style for the C SPI because we don't have
335         any concept of forwarding exceptions in the C API.
336
337         In order to make the C API work I refactored a bit of the promise code
338         so that we can call a static method on JSDeferredPromise and just get
339         the components without allocating an extra cell wrapper.
340
341         * API/JSContext.mm:
342         (+[JSContext currentCallee]):
343         * API/JSObjectRef.cpp:
344         (JSObjectMakeDeferredPromise):
345         * API/JSObjectRefPrivate.h:
346         * API/JSValue.mm:
347         (+[JSValue valueWithNewPromiseInContext:fromExecutor:]):
348         (+[JSValue valueWithNewPromiseResolvedWithResult:inContext:]):
349         (+[JSValue valueWithNewPromiseRejectedWithReason:inContext:]):
350         * API/JSValuePrivate.h: Added.
351         * API/JSVirtualMachine.mm:
352         * API/JSVirtualMachinePrivate.h:
353         * API/tests/testapi.c:
354         (main):
355         * API/tests/testapi.cpp:
356         (APIContext::operator JSC::ExecState*):
357         (TestAPI::failed const):
358         (TestAPI::check):
359         (TestAPI::basicSymbol):
360         (TestAPI::symbolsTypeof):
361         (TestAPI::symbolsGetPropertyForKey):
362         (TestAPI::symbolsSetPropertyForKey):
363         (TestAPI::symbolsHasPropertyForKey):
364         (TestAPI::symbolsDeletePropertyForKey):
365         (TestAPI::promiseResolveTrue):
366         (TestAPI::promiseRejectTrue):
367         (testCAPIViaCpp):
368         (TestAPI::run): Deleted.
369         * API/tests/testapi.mm:
370         (testObjectiveCAPIMain):
371         (promiseWithExecutor):
372         (promiseRejectOnJSException):
373         (promiseCreateResolved):
374         (promiseCreateRejected):
375         (parallelPromiseResolveTest):
376         (testObjectiveCAPI):
377         * JavaScriptCore.xcodeproj/project.pbxproj:
378         * runtime/JSInternalPromiseDeferred.cpp:
379         (JSC::JSInternalPromiseDeferred::create):
380         * runtime/JSPromise.h:
381         * runtime/JSPromiseConstructor.cpp:
382         (JSC::constructPromise):
383         * runtime/JSPromiseDeferred.cpp:
384         (JSC::JSPromiseDeferred::createDeferredData):
385         (JSC::JSPromiseDeferred::create):
386         (JSC::JSPromiseDeferred::finishCreation):
387         (JSC::newPromiseCapability): Deleted.
388         * runtime/JSPromiseDeferred.h:
389         (JSC::JSPromiseDeferred::promise const):
390         (JSC::JSPromiseDeferred::resolve const):
391         (JSC::JSPromiseDeferred::reject const):
392
393 2018-09-21  Ryan Haddad  <ryanhaddad@apple.com>
394
395         Unreviewed, rolling out r236359.
396
397         Broke the Windows build.
398
399         Reverted changeset:
400
401         "Add Promise SPI"
402         https://bugs.webkit.org/show_bug.cgi?id=189809
403         https://trac.webkit.org/changeset/236359
404
405 2018-09-21  Mark Lam  <mark.lam@apple.com>
406
407         JSRopeString::resolveRope() wrongly assumes that tryGetValue() passes it a valid ExecState.
408         https://bugs.webkit.org/show_bug.cgi?id=189855
409         <rdar://problem/44680181>
410
411         Reviewed by Filip Pizlo.
412
413         tryGetValue() always passes a nullptr to JSRopeString::resolveRope() for the
414         ExecState* argument.  This is intentional so that resolveRope() does not throw
415         in the event of an OutOfMemory error.  Hence, JSRopeString::resolveRope() should
416         get the VM from the cell instead of via the ExecState.
417
418         Also removed an obsolete and unused field in JSString.
419
420         * runtime/JSString.cpp:
421         (JSC::JSRopeString::resolveRope const):
422         (JSC::JSRopeString::outOfMemory const):
423         * runtime/JSString.h:
424         (JSC::JSString::tryGetValue const):
425
426 2018-09-21  Michael Saboff  <msaboff@apple.com>
427
428         Add functions to measure memory footprint to JSC
429         https://bugs.webkit.org/show_bug.cgi?id=189768
430
431         Reviewed by Saam Barati.
432
433         Rolling this back in again.
434
435         Provide system memory metrics for the current process to aid in memory reduction measurement and
436         tuning using native JS tests.
437
438         * jsc.cpp:
439         (MemoryFootprint::now):
440         (MemoryFootprint::resetPeak):
441         (GlobalObject::finishCreation):
442         (JSCMemoryFootprint::JSCMemoryFootprint):
443         (JSCMemoryFootprint::createStructure):
444         (JSCMemoryFootprint::create):
445         (JSCMemoryFootprint::finishCreation):
446         (JSCMemoryFootprint::addProperty):
447         (functionResetMemoryPeak):
448
449 2018-09-21  Keith Miller  <keith_miller@apple.com>
450
451         Add Promise SPI
452         https://bugs.webkit.org/show_bug.cgi?id=189809
453
454         Reviewed by Saam Barati.
455
456         The Patch adds new SPI to create promises. It's mostly SPI because
457         I want to see how internal users react to it before we make it
458         public.
459
460         This patch adds a couple of new Obj-C SPI methods. The first
461         creates a new promise using the same API that JS does where the
462         user provides an executor callback. If an exception is raised
463         in/to that callback the promise is automagically rejected. The
464         other methods create a pre-resolved or rejected promise as this
465         appears to be a common way to initialize a promise.
466
467         I was also considering adding a second version of executor API
468         where it would catch specific Obj-C exceptions. This would work by
469         taking a Class paramter and checking isKindOfClass: on the
470         exception. I decided against this as nothing else in our API
471         handles Obj-C exceptions. I'm pretty sure the VM will end up in a
472         corrupt state if an Obj-C exception unwinds through JS frames.
473
474         This patch adds a new C function that will create a "deferred"
475         promise. A deferred promise is a style of creating promise/futures
476         where the resolve and reject functions are passed as outputs of a
477         function. I went with this style for the C SPI because we don't have
478         any concept of forwarding exceptions in the C API.
479
480         In order to make the C API work I refactored a bit of the promise code
481         so that we can call a static method on JSDeferredPromise and just get
482         the components without allocating an extra cell wrapper.
483
484         * API/JSContext.mm:
485         (+[JSContext currentCallee]):
486         * API/JSObjectRef.cpp:
487         (JSObjectMakeDeferredPromise):
488         * API/JSObjectRefPrivate.h:
489         * API/JSValue.mm:
490         (+[JSValue valueWithNewPromiseInContext:fromExecutor:]):
491         (+[JSValue valueWithNewPromiseResolvedWithResult:inContext:]):
492         (+[JSValue valueWithNewPromiseRejectedWithReason:inContext:]):
493         * API/JSValuePrivate.h: Added.
494         * API/JSVirtualMachine.mm:
495         * API/JSVirtualMachinePrivate.h:
496         * API/tests/testapi.c:
497         (main):
498         * API/tests/testapi.cpp:
499         (APIContext::operator JSC::ExecState*):
500         (TestAPI::failed const):
501         (TestAPI::check):
502         (TestAPI::basicSymbol):
503         (TestAPI::symbolsTypeof):
504         (TestAPI::symbolsGetPropertyForKey):
505         (TestAPI::symbolsSetPropertyForKey):
506         (TestAPI::symbolsHasPropertyForKey):
507         (TestAPI::symbolsDeletePropertyForKey):
508         (TestAPI::promiseResolveTrue):
509         (TestAPI::promiseRejectTrue):
510         (testCAPIViaCpp):
511         (TestAPI::run): Deleted.
512         * API/tests/testapi.mm:
513         (testObjectiveCAPIMain):
514         (promiseWithExecutor):
515         (promiseRejectOnJSException):
516         (promiseCreateResolved):
517         (promiseCreateRejected):
518         (parallelPromiseResolveTest):
519         (testObjectiveCAPI):
520         * JavaScriptCore.xcodeproj/project.pbxproj:
521         * runtime/JSInternalPromiseDeferred.cpp:
522         (JSC::JSInternalPromiseDeferred::create):
523         * runtime/JSPromise.h:
524         * runtime/JSPromiseConstructor.cpp:
525         (JSC::constructPromise):
526         * runtime/JSPromiseDeferred.cpp:
527         (JSC::JSPromiseDeferred::createDeferredData):
528         (JSC::JSPromiseDeferred::create):
529         (JSC::JSPromiseDeferred::finishCreation):
530         (JSC::newPromiseCapability): Deleted.
531         * runtime/JSPromiseDeferred.h:
532         (JSC::JSPromiseDeferred::promise const):
533         (JSC::JSPromiseDeferred::resolve const):
534         (JSC::JSPromiseDeferred::reject const):
535
536 2018-09-21  Truitt Savell  <tsavell@apple.com>
537
538         Rebaseline tests after changes in https://trac.webkit.org/changeset/236321/webkit
539         https://bugs.webkit.org/show_bug.cgi?id=156674
540
541         Unreviewed Test Gardening
542
543         * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result:
544         * Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result:
545
546 2018-09-21  Mike Gorse  <mgorse@suse.com>
547
548         Build tools should work when the /usr/bin/python is python3
549         https://bugs.webkit.org/show_bug.cgi?id=156674
550
551         Reviewed by Michael Catanzaro.
552
553         * Scripts/cssmin.py:
554         * Scripts/generate-js-builtins.py:
555         (do_open):
556         (generate_bindings_for_builtins_files):
557         * Scripts/generateIntlCanonicalizeLanguage.py:
558         * Scripts/jsmin.py:
559         (JavascriptMinify.minify.write):
560         (JavascriptMinify):
561         (JavascriptMinify.minify):
562         * Scripts/make-js-file-arrays.py:
563         (chunk):
564         (main):
565         * Scripts/wkbuiltins/__init__.py:
566         * Scripts/wkbuiltins/builtins_generate_combined_header.py:
567         (generate_section_for_global_private_code_name_macro):
568         * Scripts/wkbuiltins/builtins_generate_internals_wrapper_header.py:
569         (BuiltinsInternalsWrapperHeaderGenerator.__init__):
570         * Scripts/wkbuiltins/builtins_generate_internals_wrapper_implementation.py:
571         (BuiltinsInternalsWrapperImplementationGenerator.__init__):
572         * Scripts/wkbuiltins/builtins_model.py:
573         (BuiltinFunction.__lt__):
574         (BuiltinsCollection.copyrights):
575         (BuiltinsCollection._parse_functions):
576         * disassembler/udis86/ud_opcode.py:
577         (UdOpcodeTables.pprint.printWalk):
578         * generate-bytecode-files:
579         * inspector/scripts/codegen/__init__.py:
580         * inspector/scripts/codegen/cpp_generator.py:
581         * inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py:
582         (CppAlternateBackendDispatcherHeaderGenerator.generate_output):
583         * inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py:
584         (CppBackendDispatcherHeaderGenerator.domains_to_generate):
585         (CppBackendDispatcherHeaderGenerator.generate_output):
586         (CppBackendDispatcherHeaderGenerator._generate_dispatcher_declarations_for_domain):
587         * inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:
588         (CppBackendDispatcherImplementationGenerator.domains_to_generate):
589         (CppBackendDispatcherImplementationGenerator.generate_output):
590         * inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py:
591         (CppFrontendDispatcherHeaderGenerator.domains_to_generate):
592         (CppFrontendDispatcherHeaderGenerator.generate_output):
593         * inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py:
594         (CppFrontendDispatcherImplementationGenerator.domains_to_generate):
595         (CppFrontendDispatcherImplementationGenerator.generate_output):
596         * inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
597         (CppProtocolTypesHeaderGenerator.generate_output):
598         (CppProtocolTypesHeaderGenerator._generate_forward_declarations):
599         * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
600         (CppProtocolTypesImplementationGenerator.generate_output):
601         (CppProtocolTypesImplementationGenerator._generate_enum_conversion_methods_for_domain):
602         (CppProtocolTypesImplementationGenerator._generate_enum_mapping_and_conversion_methods):
603         (CppProtocolTypesImplementationGenerator._generate_open_field_names):
604         (CppProtocolTypesImplementationGenerator._generate_builders_for_domain):
605         (CppProtocolTypesImplementationGenerator._generate_assertion_for_object_declaration):
606         * inspector/scripts/codegen/generate_js_backend_commands.py:
607         (JSBackendCommandsGenerator.should_generate_domain):
608         (JSBackendCommandsGenerator.domains_to_generate):
609         (JSBackendCommandsGenerator.generate_output):
610         (JSBackendCommandsGenerator.generate_domain):
611         * inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py:
612         (ObjCBackendDispatcherHeaderGenerator.domains_to_generate):
613         (ObjCBackendDispatcherHeaderGenerator.generate_output):
614         * inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py:
615         (ObjCBackendDispatcherImplementationGenerator.domains_to_generate):
616         (ObjCBackendDispatcherImplementationGenerator.generate_output):
617         (ObjCBackendDispatcherImplementationGenerator._generate_success_block_for_command):
618         * inspector/scripts/codegen/generate_objc_configuration_header.py:
619         * inspector/scripts/codegen/generate_objc_configuration_implementation.py:
620         * inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py:
621         (ObjCFrontendDispatcherImplementationGenerator.domains_to_generate):
622         (ObjCFrontendDispatcherImplementationGenerator.generate_output):
623         (ObjCFrontendDispatcherImplementationGenerator._generate_event):
624         * inspector/scripts/codegen/generate_objc_header.py:
625         (ObjCHeaderGenerator.generate_output):
626         (ObjCHeaderGenerator._generate_type_interface):
627         * inspector/scripts/codegen/generate_objc_internal_header.py:
628         (ObjCInternalHeaderGenerator.generate_output):
629         * inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py:
630         (ObjCProtocolTypeConversionsHeaderGenerator.domains_to_generate):
631         (ObjCProtocolTypeConversionsHeaderGenerator.generate_output):
632         * inspector/scripts/codegen/generate_objc_protocol_type_conversions_implementation.py:
633         (ObjCProtocolTypeConversionsImplementationGenerator.domains_to_generate):
634         * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py:
635         (ObjCProtocolTypesImplementationGenerator.domains_to_generate):
636         (ObjCProtocolTypesImplementationGenerator.generate_output):
637         (ObjCProtocolTypesImplementationGenerator.generate_type_implementation):
638         (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_required_members):
639         * inspector/scripts/codegen/generator.py:
640         (Generator.non_supplemental_domains):
641         (Generator.open_fields):
642         (Generator.calculate_types_requiring_shape_assertions):
643         (Generator._traverse_and_assign_enum_values):
644         (Generator.stylized_name_for_enum_value):
645         * inspector/scripts/codegen/models.py:
646         (find_duplicates):
647         * inspector/scripts/codegen/objc_generator.py:
648         * wasm/generateWasm.py:
649         (opcodeIterator):
650         * yarr/generateYarrCanonicalizeUnicode:
651         * yarr/generateYarrUnicodePropertyTables.py:
652         * yarr/hasher.py:
653         (stringHash):
654
655 2018-09-21  Tomas Popela  <tpopela@redhat.com>
656
657         [ARM] Build broken on armv7hl after r235517
658         https://bugs.webkit.org/show_bug.cgi?id=189831
659
660         Reviewed by Yusuke Suzuki.
661
662         Add missing implementation of patchebleBranch8() for traditional ARM.
663
664         * assembler/MacroAssemblerARM.h:
665         (JSC::MacroAssemblerARM::patchableBranch8):
666
667 2018-09-20  Ryan Haddad  <ryanhaddad@apple.com>
668
669         Unreviewed, rolling out r236293.
670
671         Internal build still broken.
672
673         Reverted changeset:
674
675         "Add functions to measure memory footprint to JSC"
676         https://bugs.webkit.org/show_bug.cgi?id=189768
677         https://trac.webkit.org/changeset/236293
678
679 2018-09-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
680
681         [JSC] Heap::reportExtraMemoryVisited shows contention if we have many JSString
682         https://bugs.webkit.org/show_bug.cgi?id=189558
683
684         Reviewed by Mark Lam.
685
686         When running web-tooling-benchmark postcss test on Linux JSCOnly port, we get the following result in `perf report`.
687
688             10.95%  AutomaticThread  libJavaScriptCore.so.1.0.0  [.] JSC::Heap::reportExtraMemoryVisited
689
690         This is because postcss produces bunch of JSString, which require reportExtraMemoryVisited calls in JSString::visitChildren.
691         And since reportExtraMemoryVisited attempts to update atomic counter, if we have bunch of marking threads, it becomes super contended.
692
693         This patch reduces the frequency of updating the atomic counter. Each SlotVisitor has per-SlotVisitor m_extraMemorySize counter.
694         And we propagate this value to the global atomic counter when rebalance happens.
695
696         We also reduce HeapCell::heap() access by using `vm.heap`.
697
698         * heap/SlotVisitor.cpp:
699         (JSC::SlotVisitor::didStartMarking):
700         (JSC::SlotVisitor::propagateExternalMemoryVisitedIfNecessary):
701         (JSC::SlotVisitor::drain):
702         (JSC::SlotVisitor::performIncrementOfDraining):
703         * heap/SlotVisitor.h:
704         * heap/SlotVisitorInlines.h:
705         (JSC::SlotVisitor::reportExtraMemoryVisited):
706         * runtime/JSString.cpp:
707         (JSC::JSRopeString::resolveRopeToAtomicString const):
708         (JSC::JSRopeString::resolveRope const):
709         * runtime/JSString.h:
710         (JSC::JSString::finishCreation):
711         * wasm/js/JSWebAssemblyInstance.cpp:
712         (JSC::JSWebAssemblyInstance::finishCreation):
713         * wasm/js/JSWebAssemblyMemory.cpp:
714         (JSC::JSWebAssemblyMemory::finishCreation):
715
716 2018-09-20  Michael Saboff  <msaboff@apple.com>
717
718         Add functions to measure memory footprint to JSC
719         https://bugs.webkit.org/show_bug.cgi?id=189768
720
721         Reviewed by Saam Barati.
722
723         Rolling this back in.
724
725         Provide system memory metrics for the current process to aid in memory reduction measurement and
726         tuning using native JS tests.
727
728         * jsc.cpp:
729         (MemoryFootprint::now):
730         (MemoryFootprint::resetPeak):
731         (GlobalObject::finishCreation):
732         (JSCMemoryFootprint::JSCMemoryFootprint):
733         (JSCMemoryFootprint::createStructure):
734         (JSCMemoryFootprint::create):
735         (JSCMemoryFootprint::finishCreation):
736         (JSCMemoryFootprint::addProperty):
737         (functionResetMemoryPeak):
738
739 2018-09-20  Ryan Haddad  <ryanhaddad@apple.com>
740
741         Unreviewed, rolling out r236235.
742
743         Breaks internal builds.
744
745         Reverted changeset:
746
747         "Add functions to measure memory footprint to JSC"
748         https://bugs.webkit.org/show_bug.cgi?id=189768
749         https://trac.webkit.org/changeset/236235
750
751 2018-09-20  Fujii Hironori  <Hironori.Fujii@sony.com>
752
753         [Win][Clang] JITMathIC.h: error: missing 'template' keyword prior to dependent template name 'retagged'
754         https://bugs.webkit.org/show_bug.cgi?id=189730
755
756         Reviewed by Saam Barati.
757
758         Clang for Windows can't compile the workaround for MSVC quirk in generateOutOfLine.
759
760         * jit/JITMathIC.h:
761         (generateOutOfLine): Append "&& !COMPILER(CLANG)" to "#if COMPILER(MSVC)".
762
763 2018-09-19  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
764
765         [JSC] Optimize Array#indexOf in C++ runtime
766         https://bugs.webkit.org/show_bug.cgi?id=189507
767
768         Reviewed by Saam Barati.
769
770         C++ Array#indexOf runtime function takes so much time in babylon benchmark in
771         web-tooling-benchmark. While our DFG and FTL has Array#indexOf optimization
772         and actually it is working well, C++ Array#indexOf is called significant amount
773         of time before tiering up, and it takes 6.74% of jsc main thread samples according
774         to perf command in Linux. This is because C++ Array#indexOf is too generic and
775         misses the chance to optimize JSArray cases.
776
777         This patch adds JSArray fast path for Array#indexOf. If we know that indexed
778         access to the given JSArray is non-observable and indexing type is good for the fast
779         path, we go to the fast path. This makes sampling of Array#indexOf 3.83% in
780         babylon web-tooling-benchmark.
781
782         * runtime/ArrayPrototype.cpp:
783         (JSC::arrayProtoFuncIndexOf):
784         * runtime/JSArray.h:
785         * runtime/JSArrayInlines.h:
786         (JSC::JSArray::canDoFastIndexedAccess):
787         (JSC::toLength):
788         * runtime/JSCJSValueInlines.h:
789         (JSC::JSValue::JSValue):
790         * runtime/JSGlobalObject.h:
791         * runtime/JSGlobalObjectInlines.h:
792         (JSC::JSGlobalObject::isArrayPrototypeIndexedAccessFastAndNonObservable):
793         (JSC::JSGlobalObject::isArrayPrototypeIteratorProtocolFastAndNonObservable):
794         * runtime/MathCommon.h:
795         (JSC::canBeStrictInt32):
796         (JSC::canBeInt32):
797
798 2018-09-19  Michael Saboff  <msaboff@apple.com>
799
800         Add functions to measure memory footprint to JSC
801         https://bugs.webkit.org/show_bug.cgi?id=189768
802
803         Reviewed by Saam Barati.
804
805         Provide system memory metrics for the current process to aid in memory reduction measurement and
806         tuning using native JS tests.
807
808         * jsc.cpp:
809         (MemoryFootprint::now):
810         (MemoryFootprint::resetPeak):
811         (GlobalObject::finishCreation):
812         (JSCMemoryFootprint::JSCMemoryFootprint):
813         (JSCMemoryFootprint::createStructure):
814         (JSCMemoryFootprint::create):
815         (JSCMemoryFootprint::finishCreation):
816         (JSCMemoryFootprint::addProperty):
817         (functionResetMemoryPeak):
818
819 2018-09-19  Saam barati  <sbarati@apple.com>
820
821         CheckStructureOrEmpty should pass in a tempGPR to emitStructureCheck since it may jump over that code
822         https://bugs.webkit.org/show_bug.cgi?id=189703
823
824         Reviewed by Mark Lam.
825
826         This fixes a crash that a TypeProfiler change revealed.
827
828         * dfg/DFGSpeculativeJIT64.cpp:
829         (JSC::DFG::SpeculativeJIT::compile):
830
831 2018-09-19  Saam barati  <sbarati@apple.com>
832
833         AI rule for MultiPutByOffset executes its effects in the wrong order
834         https://bugs.webkit.org/show_bug.cgi?id=189757
835         <rdar://problem/43535257>
836
837         Reviewed by Michael Saboff.
838
839         The AI rule for MultiPutByOffset was executing effects in the wrong order.
840         It first executed the transition effects and the effects on the base, and
841         then executed the filtering effects on the value being stored. However, you
842         can end up with the wrong type when the base and the value being stored
843         are the same. E.g, in a program like `o.f = o`. These effects need to happen
844         in the opposite order, modeling what happens in the runtime executing of
845         MultiPutByOffset.
846
847         * dfg/DFGAbstractInterpreterInlines.h:
848         (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
849
850 2018-09-18  Mark Lam  <mark.lam@apple.com>
851
852         Ensure that ForInContexts are invalidated if their loop local is over-written.
853         https://bugs.webkit.org/show_bug.cgi?id=189571
854         <rdar://problem/44402277>
855
856         Reviewed by Saam Barati.
857
858         Instead of hunting down every place in the BytecodeGenerator that potentially
859         needs to invalidate an enclosing ForInContext (if one exists), we simply iterate
860         the bytecode range of the loop body when the ForInContext is popped, and
861         invalidate the context if we ever find the loop temp variable over-written.
862
863         This has 2 benefits:
864         1. It ensures that every type of opcode that can write to the loop temp will be
865            handled appropriately, not just the op_mov that we've hunted down.
866         2. It avoids us having to check the BytecodeGenerator's m_forInContextStack
867            every time we emit an op_mov (or other opcodes that can write to a local)
868            even when we're not inside a for-in loop.
869
870         JSC benchmarks show that that this change is performance neutral.
871
872         * bytecompiler/BytecodeGenerator.cpp:
873         (JSC::BytecodeGenerator::pushIndexedForInScope):
874         (JSC::BytecodeGenerator::popIndexedForInScope):
875         (JSC::BytecodeGenerator::pushStructureForInScope):
876         (JSC::BytecodeGenerator::popStructureForInScope):
877         (JSC::ForInContext::finalize):
878         (JSC::StructureForInContext::finalize):
879         (JSC::IndexedForInContext::finalize):
880         (JSC::BytecodeGenerator::invalidateForInContextForLocal): Deleted.
881         * bytecompiler/BytecodeGenerator.h:
882         (JSC::ForInContext::ForInContext):
883         (JSC::ForInContext::bodyBytecodeStartOffset const):
884         (JSC::StructureForInContext::StructureForInContext):
885         (JSC::IndexedForInContext::IndexedForInContext):
886         * bytecompiler/NodesCodegen.cpp:
887         (JSC::PostfixNode::emitResolve):
888         (JSC::PrefixNode::emitResolve):
889         (JSC::ReadModifyResolveNode::emitBytecode):
890         (JSC::AssignResolveNode::emitBytecode):
891         (JSC::EmptyLetExpression::emitBytecode):
892         (JSC::ForInNode::emitLoopHeader):
893         (JSC::ForOfNode::emitBytecode):
894         (JSC::BindingNode::bindValue const):
895         (JSC::AssignmentElementNode::bindValue const):
896         * runtime/CommonSlowPaths.cpp:
897         (JSC::SLOW_PATH_DECL):
898
899 2018-09-17  Devin Rousso  <drousso@apple.com>
900
901         Web Inspector: generate CSSKeywordCompletions from backend values
902         https://bugs.webkit.org/show_bug.cgi?id=189041
903
904         Reviewed by Joseph Pecoraro.
905
906         * inspector/protocol/CSS.json:
907         Include an optional `aliases` array and `inherited` boolean for `CSSPropertyInfo`.
908
909 2018-09-17  Saam barati  <sbarati@apple.com>
910
911         We must convert ProfileType to CheckStructureOrEmpty instead of CheckStructure
912         https://bugs.webkit.org/show_bug.cgi?id=189676
913         <rdar://problem/39682897>
914
915         Reviewed by Michael Saboff.
916
917         Because the incoming value may be TDZ, CheckStructure may end up crashing.
918         Since the Type Profile does not currently record TDZ values in any of its
919         data structures, this is not a semantic change in how it will show you data.
920         It just fixes crashes when we emit a CheckStructure and the incoming value
921         is TDZ.
922
923         * dfg/DFGFixupPhase.cpp:
924         (JSC::DFG::FixupPhase::fixupNode):
925         * dfg/DFGNode.h:
926         (JSC::DFG::Node::convertToCheckStructureOrEmpty):
927
928 2018-09-17  Darin Adler  <darin@apple.com>
929
930         Use OpaqueJSString rather than JSRetainPtr inside WebKit
931         https://bugs.webkit.org/show_bug.cgi?id=189652
932
933         Reviewed by Saam Barati.
934
935         * API/JSCallbackObjectFunctions.h: Removed an uneeded include of
936         JSStringRef.h.
937
938         * API/JSContext.mm:
939         (-[JSContext evaluateScript:withSourceURL:]): Use OpaqueJSString::create rather
940         than JSStringCreateWithCFString, simplifying the code and also obviating the
941         need for explicit JSStringRelease.
942         (-[JSContext setName:]): Ditto.
943
944         * API/JSStringRef.cpp:
945         (JSStringIsEqualToUTF8CString): Use adoptRef rather than explicit JSStringRelease.
946         It seems that additional optimization is possible, obviating the need to allocate
947         an OpaqueJSString, but that's true almost everywhere else in this patch, too.
948
949         * API/JSValue.mm:
950         (+[JSValue valueWithNewRegularExpressionFromPattern:flags:inContext:]): Use
951         OpaqueJSString::create and adoptRef as appropriate.
952         (+[JSValue valueWithNewErrorFromMessage:inContext:]): Ditto.
953         (+[JSValue valueWithNewSymbolFromDescription:inContext:]): Ditto.
954         (performPropertyOperation): Ditto.
955         (-[JSValue invokeMethod:withArguments:]): Ditto.
956         (valueToObjectWithoutCopy): Ditto.
957         (containerValueToObject): Ditto.
958         (valueToString): Ditto.
959         (objectToValueWithoutCopy): Ditto.
960         (objectToValue): Ditto.
961
962 2018-09-08  Darin Adler  <darin@apple.com>
963
964         Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
965         https://bugs.webkit.org/show_bug.cgi?id=189455
966
967         Reviewed by Keith Miller.
968
969         * API/JSObjectRef.cpp:
970         (OpaqueJSPropertyNameArray): Use Ref<OpaqueJSString> instead of
971         JSRetainPtr<JSStringRef>.
972         (JSObjectCopyPropertyNames): Remove now-unneeded use of leakRef and
973         adopt constructor.
974         (JSPropertyNameArrayGetNameAtIndex): Use ptr() instead of get() since
975         the array elements are now Ref.
976
977         * API/JSRetainPtr.h: While JSRetainPtr is written as a template,
978         it only works for two specific unrelated types, JSStringRef and
979         JSGlobalContextRef. Simplified the default constructor using data
980         member initialization. Prepared to make the adopt constructor private
981         (got everything compiling that way, then made it public again so that
982         Apple internal software will still build). Got rid of unneeded
983         templated constructor and assignment operator, since it's not relevant
984         since there is no inheritance between JSRetainPtr template types.
985         Added WARN_UNUSED_RETURN to leakRef as in RefPtr and RetainPtr.
986         Added move constructor and move assignment operator for slightly better
987         performance. Simplified implementations of various member functions
988         so they are more obviously correct, by using leakPtr in more of them
989         and using std::exchange to make the flow of values more obvious.
990
991         * API/JSValue.mm:
992         (+[JSValue valueWithNewSymbolFromDescription:inContext:]): Added a
993         missing JSStringRelease to fix a leak.
994
995         * API/tests/CustomGlobalObjectClassTest.c:
996         (customGlobalObjectClassTest): Added a JSGlobalContextRelease to fix a leak.
997         (globalObjectSetPrototypeTest): Ditto.
998         (globalObjectPrivatePropertyTest): Ditto.
999
1000         * API/tests/ExecutionTimeLimitTest.cpp:
1001         (testResetAfterTimeout): Added a call to JSStringRelease to fix a leak.
1002         (testExecutionTimeLimit): Ditto, lots more.
1003
1004         * API/tests/FunctionOverridesTest.cpp:
1005         (testFunctionOverrides): Added a call to JSStringRelease to fix a leak.
1006
1007         * API/tests/JSObjectGetProxyTargetTest.cpp:
1008         (testJSObjectGetProxyTarget): Added a call to JSGlobalContextRelease to fix
1009         a leak.
1010
1011         * API/tests/PingPongStackOverflowTest.cpp:
1012         (testPingPongStackOverflow): Added calls to JSGlobalContextRelease and
1013         JSStringRelease to fix leaks.
1014
1015         * API/tests/testapi.c:
1016         (throwException): Added. Helper function for repeated idiom where we want
1017         to throw an exception, but with additional JSStringRelease calls so we don't
1018         have to leak just to keep the code simpler to read.
1019         (MyObject_getProperty): Use throwException.
1020         (MyObject_setProperty): Ditto.
1021         (MyObject_deleteProperty): Ditto.
1022         (isValueEqualToString): Added. Helper function for an idiom where we check
1023         if something is a string and then if it's equal to a particular string
1024         constant, but a version that has an additional JSStringRelease call so we
1025         don't have to leak just to keep the code simpler to read.
1026         (MyObject_callAsFunction): Use isValueEqualToString and throwException.
1027         (MyObject_callAsConstructor): Ditto.
1028         (MyObject_hasInstance): Ditto.
1029         (globalContextNameTest): Added a JSGlobalContextRelease to fix a leak.
1030         (testMarkingConstraintsAndHeapFinalizers): Ditto.
1031
1032 2018-09-14  Saam barati  <sbarati@apple.com>
1033
1034         Don't dump OSRAvailabilityData in Graph::dump because a stale Availability may point to a Node that is already freed
1035         https://bugs.webkit.org/show_bug.cgi?id=189628
1036         <rdar://problem/39481690>
1037
1038         Reviewed by Mark Lam.
1039
1040         An Availability may point to a Node. And that Node may be removed from
1041         the graph, e.g, it's freed and its memory is no longer owned by Graph.
1042         This patch makes it so we no longer dump this metadata by default. If
1043         this metadata is interesting to you, you'll need to go in and change
1044         Graph::dump to dump the needed metadata.
1045
1046         * dfg/DFGGraph.cpp:
1047         (JSC::DFG::Graph::dump):
1048
1049 2018-09-14  Mark Lam  <mark.lam@apple.com>
1050
1051         Refactor some ForInContext code for better encapsulation.
1052         https://bugs.webkit.org/show_bug.cgi?id=189626
1053         <rdar://problem/44466415>
1054
1055         Reviewed by Keith Miller.
1056
1057         1. Add a ForInContext::m_type field to store the context type.  This does not
1058            increase the class size, but eliminates the need for a virtual call to get the
1059            type.
1060
1061            Note: we still need a virtual destructor because we'll be mingling
1062            IndexedForInContexts and StructureForInContexts in the BytecodeGenerator::m_forInContextStack.
1063
1064         2. Add ForInContext::isIndexedForInContext() and ForInContext::isStructureForInContext()
1065            convenience methods.
1066
1067         3. Add ForInContext::asIndexedForInContext() and ForInContext::asStructureForInContext()
1068            to do the casting to the subclass types.  This ensures that we'll properly
1069            assert that the casting is legal.
1070
1071         * bytecompiler/BytecodeGenerator.cpp:
1072         (JSC::BytecodeGenerator::emitGetByVal):
1073         (JSC::BytecodeGenerator::popIndexedForInScope):
1074         (JSC::BytecodeGenerator::popStructureForInScope):
1075         * bytecompiler/BytecodeGenerator.h:
1076         (JSC::ForInContext::type const):
1077         (JSC::ForInContext::isIndexedForInContext const):
1078         (JSC::ForInContext::isStructureForInContext const):
1079         (JSC::ForInContext::asIndexedForInContext):
1080         (JSC::ForInContext::asStructureForInContext):
1081         (JSC::ForInContext::ForInContext):
1082         (JSC::StructureForInContext::StructureForInContext):
1083         (JSC::IndexedForInContext::IndexedForInContext):
1084         (JSC::ForInContext::~ForInContext): Deleted.
1085
1086 2018-09-14  Devin Rousso  <webkit@devinrousso.com>
1087
1088         Web Inspector: Record actions performed on ImageBitmapRenderingContext
1089         https://bugs.webkit.org/show_bug.cgi?id=181341
1090
1091         Reviewed by Joseph Pecoraro.
1092
1093         * inspector/protocol/Recording.json:
1094         * inspector/scripts/codegen/generator.py:
1095
1096 2018-09-14  Mike Gorse  <mgorse@suse.com>
1097
1098         builtins directory causes name conflict on Python 3
1099         https://bugs.webkit.org/show_bug.cgi?id=189552
1100
1101         Reviewed by Michael Catanzaro.
1102
1103         * CMakeLists.txt: builtins -> wkbuiltins.
1104         * DerivedSources.make: builtins -> wkbuiltins.
1105         * Scripts/generate-js-builtins.py: import wkbuiltins, rather than
1106           builtins.
1107         * Scripts/wkbuiltins/__init__.py: Renamed from Source/JavaScriptCore/Scripts/builtins/__init__.py.
1108         * Scripts/wkbuiltins/builtins_generate_combined_header.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_combined_header.py.
1109         * Scripts/wkbuiltins/builtins_generate_internals_wrapper_implementation.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_internals_wrapper_implementation.py.
1110         * Scripts/wkbuiltins/builtins_generate_separate_header.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_header.py.
1111         * Scripts/wkbuiltins/builtins_generate_separate_implementation.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_implementation.py.
1112         * Scripts/wkbuiltins/builtins_generate_wrapper_header.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_wrapper_header.py.
1113         * Scripts/wkbuiltins/builtins_generate_wrapper_implementation.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_wrapper_implementation.py.
1114         * Scripts/wkbuiltins/builtins_generator.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generator.py.
1115         * Scripts/wkbuiltins/builtins_model.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_model.py.
1116         * Scripts/wkbuiltins/builtins_templates.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_templates.py.
1117         * Scripts/wkbuiltins/wkbuiltins.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins.py.
1118         * JavaScriptCore.xcodeproj/project.pbxproj: Update for the renaming.
1119
1120 2018-09-13  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1121
1122         [WebAssembly] Inline WasmContext accessor functions
1123         https://bugs.webkit.org/show_bug.cgi?id=189416
1124
1125         Reviewed by Saam Barati.
1126
1127         WasmContext accessor functions are very small while it resides in the critical path of
1128         JS to Wasm function call. This patch makes them inline to improve performance.
1129         This change improves a small benchmark (calling JS to Wasm function 1e7 times) from 320ms to 270ms.
1130
1131         * JavaScriptCore.xcodeproj/project.pbxproj:
1132         * Sources.txt:
1133         * interpreter/CallFrame.cpp:
1134         * jit/AssemblyHelpers.cpp:
1135         * wasm/WasmB3IRGenerator.cpp:
1136         * wasm/WasmContextInlines.h: Renamed from Source/JavaScriptCore/wasm/WasmContext.cpp.
1137         (JSC::Wasm::Context::useFastTLS):
1138         (JSC::Wasm::Context::load const):
1139         (JSC::Wasm::Context::store):
1140         * wasm/WasmMemoryInformation.cpp:
1141         * wasm/WasmModuleParser.cpp: Include <wtf/SHA1.h> due to changes of unified source combinations.
1142         * wasm/js/JSToWasm.cpp:
1143         * wasm/js/WebAssemblyFunction.cpp:
1144
1145 2018-09-12  David Kilzer  <ddkilzer@apple.com>
1146
1147         Move JavaScriptCore files to match Xcode project hierarchy
1148         <https://webkit.org/b/189574>
1149
1150         Reviewed by Filip Pizlo.
1151
1152         * API/JSAPIValueWrapper.cpp: Rename from Source/JavaScriptCore/runtime/JSAPIValueWrapper.cpp.
1153         * API/JSAPIValueWrapper.h: Rename from Source/JavaScriptCore/runtime/JSAPIValueWrapper.h.
1154         * CMakeLists.txt: Update for new path to
1155         generateYarrUnicodePropertyTables.py, hasher.py and
1156         JSAPIValueWrapper.h.
1157         * DerivedSources.make: Ditto. Add missing dependency on
1158         hasher.py captured by CMakeLists.txt.
1159         * JavaScriptCore.xcodeproj/project.pbxproj: Update for new file
1160         reference paths. Add hasher.py library to project.
1161         * Sources.txt: Update for new path to
1162         JSAPIValueWrapper.cpp.
1163         * runtime/JSImmutableButterfly.h: Add missing includes
1164         after changes to Sources.txt and regenerating unified
1165         sources.
1166         * runtime/RuntimeType.h: Ditto.
1167         * yarr/generateYarrUnicodePropertyTables.py: Rename from Source/JavaScriptCore/Scripts/generateYarrUnicodePropertyTables.py.
1168         * yarr/hasher.py: Rename from Source/JavaScriptCore/Scripts/hasher.py.
1169
1170 2018-09-12  David Kilzer  <ddkilzer@apple.com>
1171
1172         Let Xcode have its way with the JavaScriptCore project
1173
1174         * JavaScriptCore.xcodeproj/project.pbxproj:
1175
1176 2018-09-12  Guillaume Emont  <guijemont@igalia.com>
1177
1178         Add IGNORE_WARNING_.* macros
1179         https://bugs.webkit.org/show_bug.cgi?id=188996
1180
1181         Reviewed by Michael Catanzaro.
1182
1183         * API/JSCallbackObject.h:
1184         * API/tests/testapi.c:
1185         * assembler/LinkBuffer.h:
1186         (JSC::LinkBuffer::finalizeCodeWithDisassembly):
1187         * b3/B3LowerToAir.cpp:
1188         * b3/B3Opcode.cpp:
1189         * b3/B3Type.h:
1190         * b3/B3TypeMap.h:
1191         * b3/B3Width.h:
1192         * b3/air/AirArg.cpp:
1193         * b3/air/AirArg.h:
1194         * b3/air/AirCode.h:
1195         * bytecode/Opcode.h:
1196         (JSC::padOpcodeName):
1197         * dfg/DFGSpeculativeJIT.cpp:
1198         (JSC::DFG::SpeculativeJIT::speculateNumber):
1199         (JSC::DFG::SpeculativeJIT::speculateMisc):
1200         * dfg/DFGSpeculativeJIT64.cpp:
1201         * ftl/FTLOutput.h:
1202         * jit/CCallHelpers.h:
1203         (JSC::CCallHelpers::calculatePokeOffset):
1204         * llint/LLIntData.cpp:
1205         * llint/LLIntSlowPaths.cpp:
1206         (JSC::LLInt::slowPathLogF):
1207         * runtime/ConfigFile.cpp:
1208         (JSC::ConfigFile::canonicalizePaths):
1209         * runtime/JSDataViewPrototype.cpp:
1210         * runtime/JSGenericTypedArrayViewConstructor.h:
1211         * runtime/JSGenericTypedArrayViewPrototype.h:
1212         * runtime/Options.cpp:
1213         (JSC::Options::setAliasedOption):
1214         * tools/CodeProfiling.cpp:
1215         * wasm/WasmSections.h:
1216         * wasm/generateWasmValidateInlinesHeader.py:
1217
1218 == Rolled over to ChangeLog-2018-09-11 ==