078d2cfb4addd532d879f04b15dd270a48b543d1
[WebKit-https.git] / Source / JavaScriptCore / ChangeLog
1 2016-09-26  Benjamin Poulain  <benjamin@webkit.org>
2
3         [JSC] Shrink the Math inline caches some more
4         https://bugs.webkit.org/show_bug.cgi?id=162485
5
6         Reviewed by Saam Barati.
7
8         This patch applies some lessons learnt from op_negate
9         to shrink the generated asm of the previous 3 inline
10         caches.
11
12         In order of importance:
13         -We do not need to pass the pointer to ArithProfile
14          on the slow path. We can just get the profile out
15          of the Math IC.
16          This saves us from materializing a 64bits value
17          in a register before the call on the slow path.
18         -We can remove a bunch of mov by setting up the registers
19          in the way the slow path needs them.
20          The slow path makes a function calls with the input
21          as second and third arguments, and return the result in
22          the "return register". By using those as target when
23          loading/storing from the stack, we remove 3 mov per slow path.
24         -When performing integer add, we can set the result directly in
25          the output register if that does not trashes one of the input
26          register. This removes one mov per integer add.
27
28         The inline cache average sizes on Sunspider change as follow:
29         -Adds: 147.573099->131.555556 (~10%)
30         -Muls: 186.882353->170.991597 (~8%)
31         -Subs: 139.127907->121.523256 (~12%)
32
33         * jit/JIT.h:
34         * jit/JITAddGenerator.cpp:
35         (JSC::JITAddGenerator::generateInline):
36         (JSC::JITAddGenerator::generateFastPath):
37         * jit/JITArithmetic.cpp:
38         (JSC::JIT::emitMathICFast):
39         (JSC::JIT::emitMathICSlow):
40         * jit/JITInlines.h:
41         (JSC::JIT::callOperation): Deleted.
42         * jit/JITOperations.cpp:
43         * jit/JITOperations.h:
44
45 2016-09-26  Mark Lam  <mark.lam@apple.com>
46
47         Added RETURN_IF_EXCEPTION() macro and use it for exception checks.
48         https://bugs.webkit.org/show_bug.cgi?id=162521
49
50         Reviewed by Saam Barati.
51
52         Also, where possible, if the return type is JSValue, changed the returned value
53         (on exception) to the empty JSValue (instead of sometimes jsUndefined, jsNull,
54         or the thrown exception value).
55
56         There are a few places where I had to continue to return the previously returned
57         value (instead of the empty JSValue) in order for tests to pass.  This is needed
58         because there are missing exception checks that will need to be added before I
59         can change those to return the empty JSValue too.  Identifying all the places
60         where those checks need to be added is beyond the scope of this patch.  I will
61         work on adding missing exception checks in a subsequent patch.
62
63         In this patch, there is one missing exception check in replaceUsingRegExpSearch()
64         that was easily identified, and is necessary so that Interpreter::execute()
65         functions can return JSValue.  I've added this missing check.
66
67         This patch has passed the JSC and layout tests.
68
69         * dfg/DFGOperations.cpp:
70         (JSC::DFG::operationPutByValInternal):
71         * inspector/JSInjectedScriptHost.cpp:
72         (Inspector::JSInjectedScriptHost::evaluateWithScopeExtension):
73         (Inspector::JSInjectedScriptHost::getInternalProperties):
74         (Inspector::JSInjectedScriptHost::weakMapEntries):
75         (Inspector::JSInjectedScriptHost::weakSetEntries):
76         (Inspector::JSInjectedScriptHost::iteratorEntries):
77         * inspector/JSJavaScriptCallFrame.cpp:
78         (Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
79         * interpreter/Interpreter.cpp:
80         (JSC::eval):
81         (JSC::sizeOfVarargs):
82         (JSC::Interpreter::execute):
83         (JSC::Interpreter::executeCall):
84         (JSC::Interpreter::executeConstruct):
85         * interpreter/ShadowChicken.cpp:
86         (JSC::ShadowChicken::functionsOnStack):
87         * jit/JITOperations.cpp:
88         (JSC::getByVal):
89         * jsc.cpp:
90         (WTF::ImpureGetter::getOwnPropertySlot):
91         (functionRun):
92         (functionRunString):
93         (functionLoad):
94         (functionLoadString):
95         (functionReadFile):
96         (functionCheckSyntax):
97         (functionSetRandomSeed):
98         (functionLoadModule):
99         (functionCreateBuiltin):
100         (functionCheckModuleSyntax):
101         * llint/LLIntSlowPaths.cpp:
102         (JSC::LLInt::getByVal):
103         (JSC::LLInt::LLINT_SLOW_PATH_DECL):
104         * profiler/ProfilerBytecodeSequence.cpp:
105         (JSC::Profiler::BytecodeSequence::addSequenceProperties):
106         * profiler/ProfilerCompilation.cpp:
107         (JSC::Profiler::Compilation::toJS):
108         * profiler/ProfilerDatabase.cpp:
109         (JSC::Profiler::Database::toJS):
110         * profiler/ProfilerOSRExitSite.cpp:
111         (JSC::Profiler::OSRExitSite::toJS):
112         * profiler/ProfilerOriginStack.cpp:
113         (JSC::Profiler::OriginStack::toJS):
114         * runtime/ArrayPrototype.cpp:
115         (JSC::speciesConstructArray):
116         (JSC::shift):
117         (JSC::unshift):
118         (JSC::arrayProtoFuncToString):
119         (JSC::arrayProtoFuncToLocaleString):
120         (JSC::slowJoin):
121         (JSC::fastJoin):
122         (JSC::arrayProtoFuncJoin):
123         (JSC::arrayProtoFuncPop):
124         (JSC::arrayProtoFuncPush):
125         (JSC::arrayProtoFuncReverse):
126         (JSC::arrayProtoFuncShift):
127         (JSC::arrayProtoFuncSlice):
128         (JSC::arrayProtoFuncSplice):
129         (JSC::arrayProtoFuncUnShift):
130         (JSC::arrayProtoFuncIndexOf):
131         (JSC::arrayProtoFuncLastIndexOf):
132         (JSC::moveElements):
133         (JSC::arrayProtoPrivateFuncConcatMemcpy):
134         * runtime/BooleanConstructor.cpp:
135         (JSC::constructWithBooleanConstructor):
136         * runtime/CommonSlowPaths.h:
137         (JSC::CommonSlowPaths::opIn):
138         * runtime/Completion.cpp:
139         (JSC::loadAndEvaluateModule):
140         (JSC::loadModule):
141         * runtime/ConsoleObject.cpp:
142         (JSC::consoleProtoFuncAssert):
143         (JSC::consoleProtoFuncProfile):
144         (JSC::consoleProtoFuncProfileEnd):
145         (JSC::consoleProtoFuncTakeHeapSnapshot):
146         (JSC::consoleProtoFuncTime):
147         (JSC::consoleProtoFuncTimeEnd):
148         * runtime/DateConstructor.cpp:
149         (JSC::constructDate):
150         (JSC::dateParse):
151         * runtime/DatePrototype.cpp:
152         (JSC::dateProtoFuncToPrimitiveSymbol):
153         (JSC::dateProtoFuncToJSON):
154         * runtime/ErrorConstructor.cpp:
155         (JSC::Interpreter::constructWithErrorConstructor):
156         * runtime/ErrorInstance.cpp:
157         (JSC::ErrorInstance::sanitizedToString):
158         * runtime/ErrorPrototype.cpp:
159         (JSC::errorProtoFuncToString):
160         * runtime/ExceptionScope.h:
161         * runtime/FunctionConstructor.cpp:
162         (JSC::constructFunctionSkippingEvalEnabledCheck):
163         * runtime/GenericArgumentsInlines.h:
164         (JSC::GenericArguments<Type>::copyToArguments):
165         * runtime/GetterSetter.cpp:
166         (JSC::callGetter):
167         * runtime/HashMapImpl.h:
168         (JSC::jsMapHash):
169         (JSC::HashMapImpl::finishCreation):
170         (JSC::HashMapImpl::findBucket):
171         (JSC::HashMapImpl::add):
172         (JSC::HashMapImpl::rehash):
173         * runtime/InspectorInstrumentationObject.cpp:
174         (JSC::inspectorInstrumentationObjectLog):
175         * runtime/InternalFunction.cpp:
176         (JSC::InternalFunction::createSubclassStructure):
177         * runtime/IntlCollator.cpp:
178         (JSC::IntlCollator::initializeCollator):
179         * runtime/IntlCollatorConstructor.cpp:
180         (JSC::constructIntlCollator):
181         (JSC::IntlCollatorConstructorFuncSupportedLocalesOf):
182         * runtime/IntlCollatorPrototype.cpp:
183         (JSC::IntlCollatorFuncCompare):
184         (JSC::IntlCollatorPrototypeGetterCompare):
185         * runtime/IntlDateTimeFormat.cpp:
186         (JSC::toDateTimeOptionsAnyDate):
187         (JSC::IntlDateTimeFormat::initializeDateTimeFormat):
188         * runtime/IntlDateTimeFormatConstructor.cpp:
189         (JSC::constructIntlDateTimeFormat):
190         (JSC::IntlDateTimeFormatConstructorFuncSupportedLocalesOf):
191         * runtime/IntlDateTimeFormatPrototype.cpp:
192         (JSC::IntlDateTimeFormatFuncFormatDateTime):
193         (JSC::IntlDateTimeFormatPrototypeGetterFormat):
194         * runtime/IntlNumberFormat.cpp:
195         (JSC::IntlNumberFormat::initializeNumberFormat):
196         * runtime/IntlNumberFormatConstructor.cpp:
197         (JSC::constructIntlNumberFormat):
198         (JSC::IntlNumberFormatConstructorFuncSupportedLocalesOf):
199         * runtime/IntlNumberFormatPrototype.cpp:
200         (JSC::IntlNumberFormatFuncFormatNumber):
201         (JSC::IntlNumberFormatPrototypeGetterFormat):
202         * runtime/IntlObject.cpp:
203         (JSC::intlBooleanOption):
204         (JSC::intlStringOption):
205         (JSC::intlNumberOption):
206         (JSC::canonicalizeLocaleList):
207         (JSC::supportedLocales):
208         * runtime/IntlObjectInlines.h:
209         (JSC::constructIntlInstanceWithWorkaroundForLegacyIntlConstructor):
210         * runtime/IteratorOperations.cpp:
211         (JSC::iteratorNext):
212         (JSC::iteratorStep):
213         (JSC::iteratorClose):
214         (JSC::iteratorForIterable):
215         * runtime/IteratorOperations.h:
216         (JSC::forEachInIterable):
217         * runtime/JSArray.cpp:
218         (JSC::JSArray::pop):
219         (JSC::JSArray::copyToArguments):
220         * runtime/JSArrayBufferConstructor.cpp:
221         (JSC::constructArrayBuffer):
222         * runtime/JSArrayBufferPrototype.cpp:
223         (JSC::arrayBufferProtoFuncSlice):
224         * runtime/JSArrayInlines.h:
225         (JSC::getLength):
226         (JSC::toLength):
227         * runtime/JSBoundFunction.cpp:
228         (JSC::getBoundFunctionStructure):
229         (JSC::JSBoundFunction::create):
230         * runtime/JSCJSValue.cpp:
231         (JSC::JSValue::putToPrimitive):
232         (JSC::JSValue::toStringSlowCase):
233         * runtime/JSCJSValueInlines.h:
234         (JSC::toPreferredPrimitiveType):
235         (JSC::JSValue::getPropertySlot):
236         (JSC::JSValue::equalSlowCaseInline):
237         * runtime/JSDataViewPrototype.cpp:
238         (JSC::getData):
239         (JSC::setData):
240         * runtime/JSFunction.cpp:
241         (JSC::JSFunction::setFunctionName):
242         * runtime/JSGenericTypedArrayView.h:
243         (JSC::JSGenericTypedArrayView::setIndex):
244         * runtime/JSGenericTypedArrayViewConstructorInlines.h:
245         (JSC::constructGenericTypedArrayViewFromIterator):
246         (JSC::constructGenericTypedArrayViewWithArguments):
247         (JSC::constructGenericTypedArrayView):
248         * runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
249         (JSC::speciesConstruct):
250         (JSC::genericTypedArrayViewProtoFuncSet):
251         (JSC::genericTypedArrayViewProtoFuncCopyWithin):
252         (JSC::genericTypedArrayViewProtoFuncIncludes):
253         (JSC::genericTypedArrayViewProtoFuncIndexOf):
254         (JSC::genericTypedArrayViewProtoFuncJoin):
255         (JSC::genericTypedArrayViewProtoFuncLastIndexOf):
256         (JSC::genericTypedArrayViewProtoFuncSlice):
257         (JSC::genericTypedArrayViewPrivateFuncSubarrayCreate):
258         * runtime/JSGlobalObject.h:
259         (JSC::constructEmptyArray):
260         (JSC::constructArray):
261         (JSC::constructArrayNegativeIndexed):
262         * runtime/JSGlobalObjectFunctions.cpp:
263         (JSC::globalFuncEval):
264         * runtime/JSModuleRecord.cpp:
265         (JSC::JSModuleRecord::instantiateDeclarations):
266         * runtime/JSONObject.cpp:
267         (JSC::Stringifier::stringify):
268         (JSC::Stringifier::toJSON):
269         (JSC::Stringifier::appendStringifiedValue):
270         (JSC::Stringifier::Holder::appendNextProperty):
271         (JSC::Walker::walk):
272         (JSC::JSONProtoFuncParse):
273         * runtime/JSObject.cpp:
274         (JSC::ordinarySetSlow):
275         (JSC::JSObject::setPrototypeWithCycleCheck):
276         (JSC::callToPrimitiveFunction):
277         (JSC::JSObject::defaultHasInstance):
278         (JSC::JSObject::getPropertyNames):
279         (JSC::JSObject::toNumber):
280         (JSC::JSObject::toString):
281         (JSC::JSObject::defineOwnNonIndexProperty):
282         (JSC::JSObject::getGenericPropertyNames):
283         (JSC::JSObject::getMethod):
284         * runtime/JSObjectInlines.h:
285         (JSC::createListFromArrayLike):
286         (JSC::JSObject::getPropertySlot):
287         (JSC::JSObject::getNonIndexPropertySlot):
288         * runtime/JSPromiseConstructor.cpp:
289         (JSC::constructPromise):
290         * runtime/JSPromiseDeferred.cpp:
291         (JSC::JSPromiseDeferred::create):
292         * runtime/JSPropertyNameEnumerator.h:
293         (JSC::propertyNameEnumerator):
294         * runtime/JSPropertyNameIterator.cpp:
295         (JSC::JSPropertyNameIterator::create):
296         * runtime/JSScope.cpp:
297         (JSC::isUnscopable):
298         * runtime/JSString.cpp:
299         (JSC::JSString::equalSlowCase):
300         * runtime/JSStringJoiner.cpp:
301         (JSC::JSStringJoiner::join):
302         * runtime/LiteralParser.cpp:
303         (JSC::LiteralParser<CharType>::parse):
304         * runtime/MapBase.h:
305         (JSC::MapBase::finishCreation):
306         * runtime/MapConstructor.cpp:
307         (JSC::constructMap):
308         * runtime/MathObject.cpp:
309         (JSC::mathProtoFuncClz32):
310         (JSC::mathProtoFuncHypot):
311         (JSC::mathProtoFuncIMul):
312         * runtime/ModuleLoaderPrototype.cpp:
313         (JSC::moduleLoaderPrototypeParseModule):
314         (JSC::moduleLoaderPrototypeRequestedModules):
315         (JSC::moduleLoaderPrototypeModuleDeclarationInstantiation):
316         * runtime/NativeErrorConstructor.cpp:
317         (JSC::Interpreter::constructWithNativeErrorConstructor):
318         * runtime/NumberConstructor.cpp:
319         (JSC::constructWithNumberConstructor):
320         * runtime/ObjectConstructor.cpp:
321         (JSC::constructObject):
322         (JSC::objectConstructorGetPrototypeOf):
323         (JSC::objectConstructorSetPrototypeOf):
324         (JSC::objectConstructorGetOwnPropertyDescriptor):
325         (JSC::objectConstructorGetOwnPropertyDescriptors):
326         (JSC::objectConstructorGetOwnPropertyNames):
327         (JSC::objectConstructorGetOwnPropertySymbols):
328         (JSC::objectConstructorKeys):
329         (JSC::ownEnumerablePropertyKeys):
330         (JSC::toPropertyDescriptor):
331         (JSC::objectConstructorDefineProperty):
332         (JSC::defineProperties):
333         (JSC::objectConstructorSeal):
334         (JSC::objectConstructorFreeze):
335         (JSC::objectConstructorIsSealed):
336         (JSC::objectConstructorIsFrozen):
337         (JSC::objectConstructorIsExtensible):
338         (JSC::ownPropertyKeys):
339         * runtime/ObjectConstructor.h:
340         (JSC::constructObjectFromPropertyDescriptor):
341         * runtime/ObjectPrototype.cpp:
342         (JSC::objectProtoFuncHasOwnProperty):
343         (JSC::objectProtoFuncIsPrototypeOf):
344         (JSC::objectProtoFuncDefineGetter):
345         (JSC::objectProtoFuncDefineSetter):
346         (JSC::objectProtoFuncLookupGetter):
347         (JSC::objectProtoFuncLookupSetter):
348         (JSC::objectProtoFuncPropertyIsEnumerable):
349         (JSC::objectProtoFuncToLocaleString):
350         (JSC::objectProtoFuncToString):
351         * runtime/Operations.cpp:
352         (JSC::jsAddSlowCase):
353         * runtime/PropertyDescriptor.cpp:
354         (JSC::PropertyDescriptor::slowGetterSetter):
355         * runtime/ProxyConstructor.cpp:
356         (JSC::makeRevocableProxy):
357         * runtime/ProxyObject.cpp:
358         (JSC::performProxyGet):
359         (JSC::ProxyObject::performGet):
360         (JSC::ProxyObject::performInternalMethodGetOwnProperty):
361         (JSC::ProxyObject::performHasProperty):
362         (JSC::ProxyObject::performPut):
363         (JSC::ProxyObject::putByIndexCommon):
364         (JSC::performProxyCall):
365         (JSC::performProxyConstruct):
366         (JSC::ProxyObject::performDelete):
367         (JSC::ProxyObject::performPreventExtensions):
368         (JSC::ProxyObject::performIsExtensible):
369         (JSC::ProxyObject::performDefineOwnProperty):
370         (JSC::ProxyObject::performGetOwnPropertyNames):
371         (JSC::ProxyObject::performSetPrototype):
372         (JSC::ProxyObject::performGetPrototype):
373         * runtime/ReflectObject.cpp:
374         (JSC::reflectObjectConstruct):
375         (JSC::reflectObjectDefineProperty):
376         (JSC::reflectObjectGet):
377         (JSC::reflectObjectGetOwnPropertyDescriptor):
378         (JSC::reflectObjectIsExtensible):
379         (JSC::reflectObjectPreventExtensions):
380         (JSC::reflectObjectSet):
381         (JSC::reflectObjectSetPrototypeOf):
382         * runtime/RegExpConstructor.cpp:
383         (JSC::toFlags):
384         (JSC::regExpCreate):
385         (JSC::constructRegExp):
386         * runtime/RegExpConstructor.h:
387         (JSC::isRegExp):
388         * runtime/RegExpObject.cpp:
389         (JSC::collectMatches):
390         (JSC::RegExpObject::matchGlobal):
391         * runtime/RegExpPrototype.cpp:
392         (JSC::regExpProtoFuncCompile):
393         (JSC::flagsString):
394         (JSC::regExpProtoFuncToString):
395         (JSC::regExpProtoGetterFlags):
396         (JSC::regExpProtoFuncSearchFast):
397         (JSC::regExpProtoFuncSplitFast):
398         * runtime/SetConstructor.cpp:
399         (JSC::constructSet):
400         * runtime/StringConstructor.cpp:
401         (JSC::stringFromCodePoint):
402         (JSC::constructWithStringConstructor):
403         * runtime/StringObject.cpp:
404         (JSC::StringObject::defineOwnProperty):
405         * runtime/StringPrototype.cpp:
406         (JSC::replaceUsingRegExpSearch):
407         (JSC::operationStringProtoFuncReplaceRegExpEmptyStr):
408         (JSC::replaceUsingStringSearch):
409         (JSC::replace):
410         (JSC::stringProtoFuncReplaceUsingRegExp):
411         (JSC::stringProtoFuncReplaceUsingStringSearch):
412         (JSC::stringProtoFuncCodePointAt):
413         (JSC::stringProtoFuncSlice):
414         (JSC::stringProtoFuncSplitFast):
415         (JSC::stringProtoFuncSubstr):
416         (JSC::stringProtoFuncSubstring):
417         (JSC::stringProtoFuncLocaleCompare):
418         (JSC::toLocaleCase):
419         (JSC::stringProtoFuncBig):
420         (JSC::stringProtoFuncSmall):
421         (JSC::stringProtoFuncBlink):
422         (JSC::stringProtoFuncBold):
423         (JSC::stringProtoFuncFixed):
424         (JSC::stringProtoFuncItalics):
425         (JSC::stringProtoFuncStrike):
426         (JSC::stringProtoFuncSub):
427         (JSC::stringProtoFuncSup):
428         (JSC::stringProtoFuncFontcolor):
429         (JSC::stringProtoFuncFontsize):
430         (JSC::stringProtoFuncAnchor):
431         (JSC::stringProtoFuncLink):
432         (JSC::trimString):
433         (JSC::stringProtoFuncStartsWith):
434         (JSC::stringProtoFuncEndsWith):
435         (JSC::stringIncludesImpl):
436         (JSC::stringProtoFuncIncludes):
437         (JSC::builtinStringIncludesInternal):
438         (JSC::stringProtoFuncNormalize):
439         * runtime/SymbolConstructor.cpp:
440         (JSC::symbolConstructorFor):
441         * runtime/TemplateRegistry.cpp:
442         (JSC::TemplateRegistry::getTemplateObject):
443         * runtime/WeakMapConstructor.cpp:
444         (JSC::constructWeakMap):
445         * runtime/WeakSetConstructor.cpp:
446         (JSC::constructWeakSet):
447         * tools/JSDollarVMPrototype.cpp:
448         (JSC::functionPrint):
449
450 2016-09-26  Don Olmstead  <don.olmstead@am.sony.com>
451
452         [JSC] Allow fixedExecutableMemoryPoolSize to be set during build
453         https://bugs.webkit.org/show_bug.cgi?id=162514
454
455         Reviewed by Mark Lam.
456
457         * jit/ExecutableAllocator.h:
458
459 == Rolled over to ChangeLog-2016-09-26 ==