1 2016-04-18 Filip Pizlo <fpizlo@apple.com>
5 Rubber stampted by Benjamin Poulain.
7 AVX is silly. If you use it and some of your other code isn't careful with float register bits, you
8 will run 10x slower. We could fix the underlying issue, but it's better to stay away from this odd
11 This fixes a massive regression on some real code.
13 * assembler/MacroAssemblerX86Common.h:
14 (JSC::MacroAssemblerX86Common::supportsAVX):
15 (JSC::MacroAssemblerX86Common::updateEax1EcxFlags):
17 2016-04-18 Filip Pizlo <fpizlo@apple.com>
19 ToThis should have a fast path based on type info flags
20 https://bugs.webkit.org/show_bug.cgi?id=156712
22 Reviewed by Geoffrey Garen.
24 Prior to this change, if we couldn't nail down the type of ToThis to something easy, we'd emit code
25 that would take slow path if the argument was not a final object. We'd end up taking that slow path
28 This adds a type info flag for ToThis having non-obvious behavior and changes the DFG and FTL paths
29 to test this flag. This is a sub-1% speed-up on SunSpider and Octane.
31 * dfg/DFGSpeculativeJIT32_64.cpp:
32 (JSC::DFG::SpeculativeJIT::compile):
33 * dfg/DFGSpeculativeJIT64.cpp:
34 (JSC::DFG::SpeculativeJIT::compile):
35 * ftl/FTLLowerDFGToB3.cpp:
36 (JSC::FTL::DFG::LowerDFGToB3::compileToThis):
37 * runtime/JSGlobalObject.h:
38 (JSC::JSGlobalObject::create):
39 * runtime/JSLexicalEnvironment.h:
40 (JSC::JSLexicalEnvironment::create):
42 * runtime/JSTypeInfo.h:
43 (JSC::TypeInfo::overridesGetOwnPropertySlot):
44 (JSC::TypeInfo::interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero):
45 (JSC::TypeInfo::structureIsImmortal):
46 (JSC::TypeInfo::overridesToThis):
47 (JSC::TypeInfo::overridesGetPropertyNames):
48 (JSC::TypeInfo::prohibitsPropertyCaching):
49 (JSC::TypeInfo::getOwnPropertySlotIsImpure):
50 * runtime/StrictEvalActivation.h:
51 (JSC::StrictEvalActivation::create):
54 2016-04-18 Filip Pizlo <fpizlo@apple.com>
56 Check to see how the perf bots react to megamorphic load being disabled.
58 Rubber stamped by Chris Dumez.
62 2016-04-18 Keith Miller <keith_miller@apple.com>
64 We should support delete in the DFG
65 https://bugs.webkit.org/show_bug.cgi?id=156607
67 Reviewed by Benjamin Poulain.
69 This patch adds support for the delete in the DFG as it appears that
70 some major frameworks use the operation in particularly hot functions.
71 As a result, even if the function rarely ever calls delete we would never
72 tier up to the DFG. This patch also changes operationDeleteById to take a
73 UniquedStringImpl and return a size_t.
75 * dfg/DFGAbstractInterpreterInlines.h:
76 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
77 * dfg/DFGByteCodeParser.cpp:
78 (JSC::DFG::ByteCodeParser::parseBlock):
79 * dfg/DFGCapabilities.cpp:
80 (JSC::DFG::capabilityLevel):
81 * dfg/DFGClobberize.h:
82 (JSC::DFG::clobberize):
85 * dfg/DFGFixupPhase.cpp:
86 (JSC::DFG::FixupPhase::fixupNode):
88 (JSC::DFG::Node::hasIdentifier):
90 * dfg/DFGPredictionPropagationPhase.cpp:
91 (JSC::DFG::PredictionPropagationPhase::propagate):
92 * dfg/DFGSafeToExecute.h:
93 (JSC::DFG::safeToExecute):
94 * dfg/DFGSpeculativeJIT.cpp:
95 (JSC::DFG::SpeculativeJIT::compileDeleteById):
96 * dfg/DFGSpeculativeJIT.h:
97 (JSC::DFG::SpeculativeJIT::callOperation):
98 * dfg/DFGSpeculativeJIT32_64.cpp:
99 (JSC::DFG::SpeculativeJIT::compile):
100 * dfg/DFGSpeculativeJIT64.cpp:
101 (JSC::DFG::SpeculativeJIT::compile):
104 (JSC::JIT::callOperation):
105 * jit/JITOperations.cpp:
106 * jit/JITOperations.h:
107 * jit/JITPropertyAccess.cpp:
108 (JSC::JIT::emit_op_del_by_id):
109 * jit/JITPropertyAccess32_64.cpp:
110 (JSC::JIT::emit_op_del_by_id):
112 2016-04-17 Filip Pizlo <fpizlo@apple.com>
114 FTL should pin the tag registers at inline caches
115 https://bugs.webkit.org/show_bug.cgi?id=156678
117 Reviewed by Saam Barati.
119 This is a long-overdue fix to our inline caches. Back when we had LLVM, we couldn't rely on the tags
120 being pinned to any registers. So, if the inline caches needed tags, they'd have to materialize them.
122 This removes those materializations. This should reduce the amount of code generated in inline caches
123 and it should make inline caches faster. The effect appears to be small.
125 It may be that after this change, we'll even be able to kill the
126 HaveTagRegisters/DoNotHaveTagRegisters logic.
128 * bytecode/PolymorphicAccess.cpp:
129 (JSC::AccessCase::generateWithGuard):
130 (JSC::AccessCase::generateImpl):
131 * ftl/FTLLowerDFGToB3.cpp:
132 (JSC::FTL::DFG::LowerDFGToB3::compilePutById):
133 (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
134 (JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
135 (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
136 (JSC::FTL::DFG::LowerDFGToB3::compileIn):
137 (JSC::FTL::DFG::LowerDFGToB3::getById):
139 (JSC::readCallTarget):
140 (JSC::linkPolymorphicCall):
141 * jit/ThunkGenerators.cpp:
142 (JSC::virtualThunkFor):
144 2016-04-18 Yusuke Suzuki <utatane.tea@gmail.com>
146 [ES7] yield star should not return if the inner iterator.throw returns { done: true }
147 https://bugs.webkit.org/show_bug.cgi?id=156576
149 Reviewed by Saam Barati.
151 This is slight generator fix in ES7. When calling generator.throw(),
152 the yield-star should call the throw() of the inner generator. At that
153 time, when the result of throw() is { done: true}, the generator should
158 yield * (function * () {
163 // Continue executing.
169 shouldBe(g.throw().value, 42);
172 * builtins/GeneratorPrototype.js:
177 * bytecode/BytecodeIntrinsicRegistry.cpp:
178 (JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
179 * bytecode/BytecodeIntrinsicRegistry.h:
180 * bytecompiler/BytecodeGenerator.cpp:
181 (JSC::BytecodeGenerator::emitDelegateYield):
182 * runtime/JSGeneratorFunction.h:
183 * tests/stress/generator-yield-star.js:
185 * tests/stress/yield-star-throw-continue.js: Added.
190 2016-04-17 Jeremy Huddleston Sequoia <jeremyhu@apple.com>
192 Fix incorrect assumption that APPLE implies Mac.
193 https://bugs.webkit.org/show_bug.cgi?id=156683
195 Addresses build failure introduced in r199094
197 Reviewed by Alex Christensen.
201 2016-04-17 Benjamin Poulain <bpoulain@apple.com>
203 [JSC] ReduceDoubleToFloat should work accross Phis
204 https://bugs.webkit.org/show_bug.cgi?id=156603
205 <rdar://problem/25736205>
207 Reviewed by Saam Barati and Filip Pizlo.
209 This patch extends B3's ReduceDoubleToFloat phase to work accross
210 Upsilon-Phis. This is important to optimize loops and some crazy cases.
212 In its simplest form, we can have conversion propagated from something
215 Float @2 = DoubleToFloat(@1)
217 When that happens, we just need to propagate that the result only
218 need float precision accross all values coming to this Phi.
221 There are more complicated cases when the value produced is effectively Float
222 but the user of the value does not do DoubleToFloat.
224 Typically, we have something like:
229 @3 = FloatToDouble(@x)
233 @6 = Add(@5, @somethingFloat)
234 @7 = DoubleToFloat(@6)
236 Here with a Phi-Upsilon that is a Double but can be represented
237 as Float without loss of precision.
239 It is valuable to convert such Phis to float if and only if the value
240 is used as float. Otherwise, you may be just adding useless conversions
241 (for example, two double constants that flow into a double Add should not
242 turn into two float constant flowing into a FloatToDouble then Add).
245 ReduceDoubleToFloat do two analysis passes to gather the necessary
246 meta information. Then we have a simplify() phase to actually reduce
247 operation. Finally, the cleanup() pass put the graph into a valid
250 The two analysis passes work by disproving that something is float.
251 -findCandidates() accumulates anything used as Double.
252 -findPhisContainingFloat() accumulates phis that would lose precision
253 by converting the input to float.
255 With this change, Unity3D improves by ~1.5%, box2d-f32 improves
256 by ~2.8% (on Haswell).
258 * b3/B3ReduceDoubleToFloat.cpp:
259 (JSC::B3::reduceDoubleToFloat):
261 (JSC::B3::testCompareTwoFloatToDouble):
262 (JSC::B3::testCompareOneFloatToDouble):
263 (JSC::B3::testCompareFloatToDoubleThroughPhi):
264 (JSC::B3::testDoubleToFloatThroughPhi):
265 (JSC::B3::testDoubleProducerPhiToFloatConversion):
266 (JSC::B3::testDoubleProducerPhiToFloatConversionWithDoubleConsumer):
267 (JSC::B3::testDoubleProducerPhiWithNonFloatConst):
268 (JSC::B3::testStoreDoubleConstantAsFloat):
270 * tests/stress/double-compare-to-float.js: Added.
271 (canSimplifyToFloat):
272 (canSimplifyToFloatWithConstant):
275 * tests/stress/double-to-float.js: Added.
276 (upsilonReferencingItsPhi):
277 (upsilonReferencingItsPhiAllFloat):
278 (upsilonReferencingItsPhiWithoutConversion):
279 (conversionPropagages):
280 (chainedUpsilonBothConvert):
281 (chainedUpsilonFirstConvert):
283 2016-04-17 Yusuke Suzuki <utatane.tea@gmail.com>
285 [ES6] Use @isObject to check Object Type instead of using instanceof
286 https://bugs.webkit.org/show_bug.cgi?id=156676
288 Reviewed by Darin Adler.
290 Use @isObject instead of `instanceof @Object`.
291 The `instanceof` check is not enough to check Object Type.
292 For example, given 2 realms, the object created in one realm does not inherit the Object of another realm.
293 Another example is that the object which does not inherit Object.
294 This object can be easily created by calling `Object.create(null)`.
296 * builtins/RegExpPrototype.js:
299 (GlobalObject::finishCreation):
300 (functionCreateGlobalObject):
301 * tests/stress/regexp-match-in-other-realm-should-work.js: Added.
303 * tests/stress/regexp-match-should-work-with-objects-not-inheriting-object-prototype.js: Added.
307 2016-04-17 Darin Adler <darin@apple.com>
309 Remove more uses of Deprecated::ScriptXXX
310 https://bugs.webkit.org/show_bug.cgi?id=156660
312 Reviewed by Antti Koivisto.
314 * bindings/ScriptFunctionCall.cpp:
315 (Deprecated::ScriptCallArgumentHandler::appendArgument): Deleted
316 unneeded overloads that take a ScriptObject and ScriptValue.
317 * bindings/ScriptFunctionCall.h: Ditto.
319 * bindings/ScriptObject.h: Added operator so this can change
320 itself into a JSObject*. Helps while phasing this class out.
322 * bindings/ScriptValue.h: Export toInspectorValue so it can be
325 * inspector/InjectedScriptManager.cpp:
326 (Inspector::InjectedScriptManager::createInjectedScript): Changed
327 return value from Deprecated::ScriptObject to JSObject*.
328 (Inspector::InjectedScriptManager::injectedScriptFor): Updated for
329 the return value change above.
330 * inspector/InjectedScriptManager.h: Ditto.
332 2016-04-16 Benjamin Poulain <bpoulain@webkit.org>
334 [JSC] DFG should support relational comparisons of Number and Other
335 https://bugs.webkit.org/show_bug.cgi?id=156669
337 Reviewed by Darin Adler.
339 In Sunspider/3d-raytrace, DFG falls back to JSValue in some important
340 relational compare because profiling sees "undefined" from time to time.
342 This case is fairly common outside Sunspider too because of out-of-bounds array access.
343 Unfortunately for us, our fallback for compare is really inefficient.
345 Fortunately, relational comparison with null/undefined/true/false are trival.
346 We can just convert both side to Double. That's what this patch adds.
348 I also extended constant folding for those cases because I noticed
349 a bunch of "undefined" constant going through DoubleRep at runtime.
351 * dfg/DFGAbstractInterpreterInlines.h:
352 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
353 * dfg/DFGFixupPhase.cpp:
354 (JSC::DFG::FixupPhase::fixupNode):
355 * tests/stress/compare-number-and-other.js: Added.
357 (let.operator.of.operators.eval.testPolymorphic):
358 (let.operator.of.operators.let.left.of.typeCases.let.right.of.typeCases.eval.testMonomorphic):
359 (let.operator.of.operators.let.left.of.typeCases.let.right.of.typeCases.testMonomorphicLeftConstant):
360 (let.operator.of.operators.let.left.of.typeCases.let.right.of.typeCases.testMonomorphicRightConstant):
361 (let.operator.of.operators.let.left.of.typeCases.let.right.of.typeCases.i.testPolymorphic):
363 2016-04-16 Benjamin Poulain <bpoulain@apple.com>
365 [JSC] FRound/Negate can produce an impure NaN out of a pure NaN
366 https://bugs.webkit.org/show_bug.cgi?id=156528
368 Reviewed by Filip Pizlo.
370 If you fround a double with the bits 0xfff7000000000000
371 you get 0xfffe000000000000. The first is a pure NaN, the second isn't.
373 This is without test because I could not find a way to create a 0xfff7000000000000
374 while convincing DFG that its pure.
375 When we purify NaNs from typed array, we use a specific value of NaN if the input
376 is any NaN, making testing tricky.
378 * bytecode/SpeculatedType.cpp:
379 (JSC::typeOfDoubleNegation):
381 2016-04-16 Konstantin Tokarev <annulen@yandex.ru>
383 JS::DFG::nodeValuePairListDump does not compile with libstdc++ 4.8
384 https://bugs.webkit.org/show_bug.cgi?id=156670
386 Reviewed by Darin Adler.
389 (JSC::DFG::nodeValuePairListDump): Modified to use lambda as comparator.
391 2016-04-16 Konstantin Tokarev <annulen@yandex.ru>
393 [mips] Implemented moveZeroToDouble.
394 https://bugs.webkit.org/show_bug.cgi?id=155429
396 Reviewed by Darin Adler.
398 This function is required to fix compilation after r197687.
400 * assembler/MacroAssemblerMIPS.h:
401 (JSC::MacroAssemblerMIPS::moveZeroToDouble):
403 2016-04-15 Darin Adler <darin@apple.com>
405 Reduce use of Deprecated::ScriptXXX classes
406 https://bugs.webkit.org/show_bug.cgi?id=156632
408 Reviewed by Alex Christensen.
410 * bindings/ScriptFunctionCall.cpp:
411 (Deprecated::ScriptCallArgumentHandler::appendArgument): Deleted version that takes a Deprecated::ScriptValue.
412 (Deprecated::ScriptFunctionCall::call): Changed to return a JSValue.
413 * bindings/ScriptFunctionCall.h: Updated for the above.
415 * bindings/ScriptValue.cpp:
416 (Inspector::jsToInspectorValue): Moved from Deprecated namespace to Inspector namespace. Later, we should
417 move this to another source file in the inspector directory.
418 (Inspector::toInspectorValue): Added.
419 (Deprecated::ScriptValue::toInspectorValue): Updated for change to underlying function.
420 * bindings/ScriptValue.h: Update for the above.
422 * inspector/InjectedScript.cpp:
423 (Inspector::InjectedScript::evaluateOnCallFrame): Changed arguments and return values from
424 Deprecated::ScriptValue to JSC::JSValue.
425 (Inspector::InjectedScript::functionDetails): Ditto.
426 (Inspector::InjectedScript::wrapCallFrames): Ditto.
427 (Inspector::InjectedScript::wrapObject): Ditto.
428 (Inspector::InjectedScript::wrapTable): Ditto.
429 (Inspector::InjectedScript::previewValue): Ditto.
430 (Inspector::InjectedScript::setExceptionValue): Ditto.
431 (Inspector::InjectedScript::findObjectById): Ditto.
432 (Inspector::InjectedScript::inspectObject): Ditto.
433 * inspector/InjectedScript.h: Ditto.
434 * inspector/InjectedScriptBase.cpp:
435 (Inspector::InjectedScriptBase::callFunctionWithEvalEnabled): Ditto.
436 (Inspector::InjectedScriptBase::makeCall): Ditto.
437 * inspector/InjectedScriptBase.h: Ditto.
438 * inspector/InjectedScriptModule.cpp:
439 (Inspector::InjectedScriptModule::ensureInjected): Ditto.
440 * inspector/ScriptDebugListener.h: Ditto.
441 * inspector/ScriptDebugServer.cpp:
442 (Inspector::ScriptDebugServer::evaluateBreakpointAction): Ditto.
443 (Inspector::ScriptDebugServer::dispatchDidPause): Ditto.
444 (Inspector::ScriptDebugServer::dispatchBreakpointActionProbe): Ditto.
445 (Inspector::ScriptDebugServer::exceptionOrCaughtValue): Ditto.
446 * inspector/ScriptDebugServer.h: Ditto.
447 * inspector/agents/InspectorDebuggerAgent.cpp:
448 (Inspector::InspectorDebuggerAgent::buildExceptionPauseReason): Ditto.
449 (Inspector::InspectorDebuggerAgent::didPause): Ditto.
450 (Inspector::InspectorDebuggerAgent::breakpointActionProbe): Ditto.
451 (Inspector::InspectorDebuggerAgent::didContinue): Ditto.
452 (Inspector::InspectorDebuggerAgent::clearDebuggerBreakpointState): Ditto.
453 * inspector/agents/InspectorDebuggerAgent.h: Ditto.
454 * inspector/agents/InspectorHeapAgent.cpp:
455 (Inspector::InspectorHeapAgent::getPreview): Ditto.
456 (Inspector::InspectorHeapAgent::getRemoteObject): Ditto.
458 2016-04-15 Keith Miller <keith_miller@apple.com>
460 Some JIT/DFG operations need NativeCallFrameTracers
461 https://bugs.webkit.org/show_bug.cgi?id=156650
463 Reviewed by Michael Saboff.
465 Some of our operation functions did not have native call frame
466 tracers. This meant that we would crash occasionally on some
467 of our tests when they triggered a GC in one of the functions
468 without a tracer. In particular, this was exemplified by another
469 upcoming patch when calling operationSetFunctionName.
471 This patch does not add tests since this happens consistently in
472 the patch adding delete_by_id to the DFG.
474 * dfg/DFGOperations.cpp:
475 * jit/JITOperations.cpp:
477 2016-04-15 Joseph Pecoraro <pecoraro@apple.com>
479 Web Inspector: sourceMappingURL not used when sourceURL is set
480 https://bugs.webkit.org/show_bug.cgi?id=156021
481 <rdar://problem/25438417>
483 Reviewed by Timothy Hatcher.
485 Clean up Debugger.sourceParsed to separately include:
487 - url ("resource URL", "source url" in JSC APIs)
488 - sourceURL - //# sourceURL directive
490 By always having the resource URL the Web Inspector frontend
491 can better match this Script to a Resource of the same URL,
492 and decide to use the sourceURL if it is available when
495 * inspector/protocol/Debugger.json:
496 * inspector/agents/InspectorDebuggerAgent.cpp:
497 (Inspector::InspectorDebuggerAgent::setBreakpointByUrl):
498 (Inspector::InspectorDebuggerAgent::didParseSource):
499 Send the new sourceParsed parameters.
501 2016-04-14 Joseph Pecoraro <pecoraro@apple.com>
503 Web Inspector: Cleanup inspector/debugger tests
504 https://bugs.webkit.org/show_bug.cgi?id=156619
506 Reviewed by Brian Burg.
508 While cleaning up the tests it exposed the fact that breakpoints
509 were not getting disabled when the inspector closes. This means
510 that opening the inspector, with breakpoints, and closing the
511 inspector, would leave the JSC::Debugger thinking breakpoints
512 are active. The JSC::Debugger should be reset.
514 * inspector/agents/InspectorDebuggerAgent.cpp:
515 (Inspector::InspectorDebuggerAgent::disable):
517 2016-04-14 Geoffrey Garen <ggaren@apple.com>
519 CopiedBlock should be 64kB
521 Reviewed by Benjamin Poulain.
523 Let's try another value.
525 This is 25% faster on kraken-audio-beat-detection on Mac Pro.
527 * heap/CopiedBlock.h:
529 2016-04-15 Zan Dobersek <zdobersek@igalia.com>
531 Tail call optimizations lead to crashes on ARM Thumb + Linux
532 https://bugs.webkit.org/show_bug.cgi?id=150083
534 Reviewed by Csaba Osztrogonác.
536 * assembler/AbstractMacroAssembler.h:
537 (JSC::AbstractMacroAssembler::repatchNearCall): In case of a tail call relink to the
538 data location of the destination, and not the executable address. This is needed for
539 the ARM Thumb2 platform where both the source and destination addresses of a jump relink
540 must not have the bottom bit decorated, as asserted in ARMv7Assembler::relinkJump().
542 (JSC::linkPolymorphicCall): Similarly, when linking a tail call we must link to the
543 address that has a non-decorated bottom bit, as asserted in ARMv7Assembler::linkJumpAbsolute().
545 2016-04-14 Geoffrey Garen <ggaren@apple.com>
547 Unreviewed, rolling out r199567.
549 performance regression on kraken on macbook*
553 "CopiedBlock should be 8kB"
554 https://bugs.webkit.org/show_bug.cgi?id=156610
555 http://trac.webkit.org/changeset/199567
557 2016-04-14 Geoffrey Garen <ggaren@apple.com>
559 CopiedBlock should be 8kB
560 https://bugs.webkit.org/show_bug.cgi?id=156610
562 Reviewed by Michael Saboff.
566 15% faster on kraken-audio-beat-detection
568 5% faster on v8-splay
570 Hopefully, this will be OK on MacBook* bots as well.
572 32kB is the full size of L1 cache on x86. So, allocating and zero-filling
573 a 32kB CopiedBlock would basically flush the L1 cache. We can ameliorate
574 this problem by using smaller blocks -- or, if that doesn't work, we can
575 use larger blocks to amortize the cost.
577 * heap/CopiedBlock.h:
579 2016-04-14 Filip Pizlo <fpizlo@apple.com>
581 PolymorphicAccess should try to generate a stub only once
582 https://bugs.webkit.org/show_bug.cgi?id=156555
584 Reviewed by Geoffrey Garen.
586 This changes the PolymorphicAccess heuristics to reduce the amount of code generation even
587 more than before. We used to always generate a monomorphic stub for the first case we saw.
588 This change disables that. This change also increases the buffering countdown to match the
589 cool-down repatch count. This means that we will allow for ten slow paths for adding cases,
590 then we will generate a stub, and then we will go into cool-down and the repatching slow
591 paths will not even attempt repatching for a while. After we emerge from cool-down - which
592 requires a bunch of slow path calls - we will again wait for ten slow paths to get new
593 cases. Note that it only takes 13 cases to cause the stub to give up on future repatching
594 entirely. Also, most stubs don't ever get to 10 cases. Therefore, for most stubs this change
595 means that each IC will repatch once. If they make it to two repatching, then the likelihood
596 of a third becomes infinitesimal because of all of the rules that come into play at that
597 point (the size limit being 13, the fact that we go into exponential cool-down every time we
598 generate code, and the fact that if we have lots of self cases then we will create a
599 catch-all megamorphic load case).
601 This also undoes a change to the megamorphic optimization that I think was unintentional.
602 As in the change that originally introduced megamorphic loads, we want to do this only if we
603 would otherwise exhaust the max size of the IC. This is because megamorphic loads are pretty
604 expensive and it's best to use them only if we know that the alternative is giving up on
607 This is neutral on JS benchmarks, but looks like it's another speed-up for page loading.
609 * bytecode/PolymorphicAccess.cpp:
610 (JSC::AccessCase::canBeReplacedByMegamorphicLoad):
611 (JSC::AccessCase::canReplace):
612 (JSC::AccessCase::dump):
613 (JSC::PolymorphicAccess::regenerate):
614 * bytecode/StructureStubInfo.cpp:
615 (JSC::StructureStubInfo::StructureStubInfo):
618 2016-04-14 Mark Lam <mark.lam@apple.com>
620 Update treatment of invoking RegExp.prototype methods on RegExp.prototype.
621 https://bugs.webkit.org/show_bug.cgi?id=155922
623 Reviewed by Keith Miller.
625 According to the TC39 committee, when invoking the following RegExp.prototype
626 methods on the RegExp.prototype:
627 1. RegExp.prototype.flags yields ""
628 2. RegExp.prototype.global yields undefined
629 3. RegExp.prototype.ignoreCase yields undefined
630 4. RegExp.prototype.multiline yields undefined
631 5. RegExp.prototype.unicode yields undefined
632 6. RegExp.prototype.source yields "(?:)"
633 7. RegExp.prototype.sticky yields undefined
634 8. RegExp.prototype.toString() yields "/(?:)/"
636 and RegExp.prototype is still NOT an instance of RegExp. The above behavior
637 changes is a special dispensation applicable only to RegExp.prototype. The ES6
638 spec of throwing errors still applies if those methods are applied to anything =
639 else that is not a RegExp object.
641 * runtime/RegExpPrototype.cpp:
642 (JSC::regExpProtoGetterGlobal):
643 (JSC::regExpProtoGetterIgnoreCase):
644 (JSC::regExpProtoGetterMultiline):
645 (JSC::regExpProtoGetterSticky):
646 (JSC::regExpProtoGetterUnicode):
647 (JSC::regExpProtoGetterFlags):
648 (JSC::regExpProtoGetterSource):
649 - Implemented new behavior.
651 * tests/es6/miscellaneous_built-in_prototypes_are_not_instances.js:
653 - Updated to match current kangax test.
655 2016-04-14 Geoffrey Garen <ggaren@apple.com>
657 Some imported ES6 tests are missing __createIterableObject
658 https://bugs.webkit.org/show_bug.cgi?id=156584
660 Reviewed by Keith Miller.
662 These tests were failing because I neglected to include __createIterableObject
663 when I first imported them. Now they pass.
666 * tests/es6/Array_static_methods_Array.from_generic_iterables.js:
668 (iterable.Symbol.iterator):
669 (__createIterableObject):
671 * tests/es6/Array_static_methods_Array.from_instances_of_generic_iterables.js:
673 (iterable.Symbol.iterator):
674 (__createIterableObject):
676 * tests/es6/Array_static_methods_Array.from_iterator_closing.js:
678 (iterable.Symbol.iterator):
679 (__createIterableObject):
680 * tests/es6/Array_static_methods_Array.from_map_function_generic_iterables.js:
682 (iterable.Symbol.iterator):
683 (__createIterableObject):
685 * tests/es6/Array_static_methods_Array.from_map_function_instances_of_iterables.js:
687 (iterable.Symbol.iterator):
688 (__createIterableObject):
690 * tests/es6/Map_iterator_closing.js:
692 (iterable.Symbol.iterator):
693 (__createIterableObject):
694 * tests/es6/Promise_Promise.all_generic_iterables.js:
696 (iterable.Symbol.iterator):
697 (__createIterableObject):
698 (test.asyncTestPassed):
699 * tests/es6/Promise_Promise.race_generic_iterables.js:
701 (iterable.Symbol.iterator):
702 (__createIterableObject):
703 (test.asyncTestPassed):
704 * tests/es6/Set_iterator_closing.js:
706 (iterable.Symbol.iterator):
707 (__createIterableObject):
708 * tests/es6/WeakMap_iterator_closing.js:
710 (iterable.Symbol.iterator):
711 (__createIterableObject):
712 * tests/es6/WeakSet_iterator_closing.js:
714 (iterable.Symbol.iterator):
715 (__createIterableObject):
716 * tests/es6/destructuring_iterator_closing.js:
718 (iterable.Symbol.iterator):
719 (__createIterableObject):
720 * tests/es6/destructuring_with_generic_iterables.js:
722 (iterable.Symbol.iterator):
723 (__createIterableObject):
725 * tests/es6/destructuring_with_instances_of_generic_iterables.js:
727 (iterable.Symbol.iterator):
728 (__createIterableObject):
730 * tests/es6/for..of_loops_iterator_closing_break.js:
732 (iterable.Symbol.iterator):
733 (__createIterableObject):
734 * tests/es6/for..of_loops_iterator_closing_throw.js:
736 (iterable.Symbol.iterator):
737 (__createIterableObject):
738 * tests/es6/for..of_loops_with_generic_iterables.js:
740 (iterable.Symbol.iterator):
741 (__createIterableObject):
743 * tests/es6/for..of_loops_with_instances_of_generic_iterables.js:
745 (iterable.Symbol.iterator):
746 (__createIterableObject):
748 * tests/es6/generators_yield_star_generic_iterables.js:
750 (iterable.Symbol.iterator):
751 (__createIterableObject):
752 * tests/es6/generators_yield_star_iterator_closing_via_throw.js:
754 (iterable.Symbol.iterator):
755 (__createIterableObject):
756 * tests/es6/spread_..._operator_with_generic_iterables_in_arrays.js:
758 (iterable.Symbol.iterator):
759 (__createIterableObject):
761 * tests/es6/spread_..._operator_with_generic_iterables_in_calls.js:
763 (iterable.Symbol.iterator):
764 (__createIterableObject):
766 * tests/es6/spread_..._operator_with_instances_of_iterables_in_arrays.js:
768 (iterable.Symbol.iterator):
769 (__createIterableObject):
771 * tests/es6/spread_..._operator_with_instances_of_iterables_in_calls.js:
773 (iterable.Symbol.iterator):
774 (__createIterableObject):
777 2016-04-13 Alex Christensen <achristensen@webkit.org>
779 CMake MiniBrowser should be an app bundle
780 https://bugs.webkit.org/show_bug.cgi?id=156521
782 Reviewed by Brent Fulgham.
785 Unreviewed build fix. Define __STDC_WANT_LIB_EXT1__ so we can find memset_s.
787 2016-04-13 Joseph Pecoraro <pecoraro@apple.com>
789 JSContext Inspector: Improve Class instances and JSC API Exported Values view in Console / ObjectTree
790 https://bugs.webkit.org/show_bug.cgi?id=156566
791 <rdar://problem/16392365>
793 Reviewed by Timothy Hatcher.
795 * inspector/InjectedScriptSource.js:
796 (InjectedScript.RemoteObject.prototype._appendPropertyPreviews):
797 Treat non-basic object types as not lossless so they can be expanded.
798 Show non-enumerable native getters in Object previews.
800 2016-04-13 Michael Saboff <msaboff@apple.com>
802 Some tests fail with ES6 `u` (Unicode) flag for regular expressions
803 https://bugs.webkit.org/show_bug.cgi?id=151597
805 Reviewed by Geoffrey Garen.
807 Added two new tables to handle the anomolies of \w and \W CharacterClassEscapes
808 when specified in RegExp's with both the unicode and ignoreCase flags. Given the
809 case folding rules described in the standard vie the meta function Canonicalize(),
810 which allow cross ASCII case folding when unicode is specified, the unicode characters
811 \u017f (small sharp s) and \u212a (kelvin symbol) are part of the \w (word) characterClassEscape.
812 This is true because they case fold to 's' and 'k' respectively. Because they case fold
813 to lower case letters, the corresponding letters, 'k', 'K', 's' and 'S', are also matched with
814 \W with the unicode and ignoreCase flags.
816 * create_regex_tables:
817 * yarr/YarrPattern.cpp:
818 (JSC::Yarr::YarrPatternConstructor::atomBuiltInCharacterClass):
819 (JSC::Yarr::YarrPatternConstructor::atomCharacterClassBuiltIn):
820 (JSC::Yarr::YarrPattern::YarrPattern):
821 * yarr/YarrPattern.h:
822 (JSC::Yarr::YarrPattern::wordcharCharacterClass):
823 (JSC::Yarr::YarrPattern::wordUnicodeIgnoreCaseCharCharacterClass):
824 (JSC::Yarr::YarrPattern::nonwordcharCharacterClass):
825 (JSC::Yarr::YarrPattern::nonwordUnicodeIgnoreCaseCharCharacterClass):
827 2016-04-13 Commit Queue <commit-queue@webkit.org>
829 Unreviewed, rolling out r199502 and r199511.
830 https://bugs.webkit.org/show_bug.cgi?id=156557
832 Appears to have in-browser perf regression (Requested by mlam
837 "ES6: Implement String.prototype.split and
838 RegExp.prototype[@@split]."
839 https://bugs.webkit.org/show_bug.cgi?id=156013
840 http://trac.webkit.org/changeset/199502
842 "ES6: Implement RegExp.prototype[@@search]."
843 https://bugs.webkit.org/show_bug.cgi?id=156331
844 http://trac.webkit.org/changeset/199511
846 2016-04-13 Keith Miller <keith_miller@apple.com>
848 isJSArray should use ArrayType rather than the ClassInfo
849 https://bugs.webkit.org/show_bug.cgi?id=156551
851 Reviewed by Filip Pizlo.
853 Using the JSType rather than the ClassInfo should be slightly faster
854 since the type is inline on the cell whereas the ClassInfo is only
860 2016-04-13 Mark Lam <mark.lam@apple.com>
862 ES6: Implement RegExp.prototype[@@search].
863 https://bugs.webkit.org/show_bug.cgi?id=156331
865 Reviewed by Keith Miller.
868 1. Implemented search builtin in RegExpPrototype.js.
869 The native path is now used as a fast path.
870 2. Added DFG support for an IsRegExpObjectIntrinsic (modelled after the
872 3. Renamed @isRegExp to @isRegExpObject to match the new IsRegExpObjectIntrinsic.
873 4. Change the esSpecIsRegExpObject() implementation to check if the object's
874 JSType is RegExpObjectType instead of walking the classinfo chain.
876 * builtins/RegExpPrototype.js:
878 * builtins/StringPrototype.js:
880 - fixed some indentation.
882 * dfg/DFGAbstractInterpreterInlines.h:
883 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
884 * dfg/DFGByteCodeParser.cpp:
885 (JSC::DFG::ByteCodeParser::handleIntrinsicCall):
886 * dfg/DFGClobberize.h:
887 (JSC::DFG::clobberize):
890 * dfg/DFGFixupPhase.cpp:
891 (JSC::DFG::FixupPhase::fixupNode):
893 * dfg/DFGPredictionPropagationPhase.cpp:
894 (JSC::DFG::PredictionPropagationPhase::propagate):
895 * dfg/DFGSafeToExecute.h:
896 (JSC::DFG::safeToExecute):
897 * dfg/DFGSpeculativeJIT.cpp:
898 (JSC::DFG::SpeculativeJIT::compileIsArrayConstructor):
899 (JSC::DFG::SpeculativeJIT::compileIsRegExpObject):
900 (JSC::DFG::SpeculativeJIT::compileCallObjectConstructor):
901 * dfg/DFGSpeculativeJIT.h:
902 * dfg/DFGSpeculativeJIT32_64.cpp:
903 (JSC::DFG::SpeculativeJIT::compile):
904 * dfg/DFGSpeculativeJIT64.cpp:
905 (JSC::DFG::SpeculativeJIT::compile):
906 * ftl/FTLCapabilities.cpp:
907 (JSC::FTL::canCompile):
908 * ftl/FTLLowerDFGToB3.cpp:
909 (JSC::FTL::DFG::LowerDFGToB3::compileNode):
910 (JSC::FTL::DFG::LowerDFGToB3::compileIsFunction):
911 (JSC::FTL::DFG::LowerDFGToB3::compileIsRegExpObject):
912 (JSC::FTL::DFG::LowerDFGToB3::compileTypeOf):
913 (JSC::FTL::DFG::LowerDFGToB3::isExoticForTypeof):
914 (JSC::FTL::DFG::LowerDFGToB3::isRegExpObject):
915 (JSC::FTL::DFG::LowerDFGToB3::isType):
916 * runtime/Intrinsic.h:
917 - Added IsRegExpObjectIntrinsic.
919 * runtime/CommonIdentifiers.h:
921 * runtime/ECMAScriptSpecInternalFunctions.cpp:
922 (JSC::esSpecIsConstructor):
923 - Changed to use uncheckedArgument since this is only called from internal code.
924 (JSC::esSpecIsRegExpObject):
925 (JSC::esSpecIsRegExp): Deleted.
926 * runtime/ECMAScriptSpecInternalFunctions.h:
927 - Changed to check the object for a JSType of RegExpObjectType.
929 * runtime/JSGlobalObject.cpp:
930 (JSC::JSGlobalObject::init):
931 - Added split fast path.
933 * runtime/RegExpPrototype.cpp:
934 (JSC::RegExpPrototype::finishCreation):
935 (JSC::regExpProtoFuncSearchFast):
936 (JSC::regExpProtoFuncSearch): Deleted.
937 * runtime/RegExpPrototype.h:
940 * tests/stress/regexp-search.js:
943 2016-04-12 Filip Pizlo <fpizlo@apple.com>
945 PolymorphicAccess::regenerate() shouldn't have to clone non-generated AccessCases
946 https://bugs.webkit.org/show_bug.cgi?id=156493
948 Reviewed by Geoffrey Garen.
950 Cloning AccessCases is only necessary if they hold some artifacts that are used by code that
951 they already generated. So, if the state is not Generated, we don't have to bother with
954 This should speed up PolymorphicAccess regeneration a bit more.
956 * bytecode/PolymorphicAccess.cpp:
957 (JSC::AccessCase::commit):
958 (JSC::PolymorphicAccess::regenerate):
960 2016-04-13 Mark Lam <mark.lam@apple.com>
962 ES6: Implement String.prototype.split and RegExp.prototype[@@split].
963 https://bugs.webkit.org/show_bug.cgi?id=156013
965 Reviewed by Keith Miller.
967 Re-landing r199393 now that the shadow chicken crash has been fixed.
970 * JavaScriptCore.xcodeproj/project.pbxproj:
971 * builtins/GlobalObject.js:
972 (speciesConstructor):
973 * builtins/PromisePrototype.js:
974 - refactored to use the @speciesConstructor internal function.
976 * builtins/RegExpPrototype.js:
977 (advanceStringIndex):
978 - refactored from @advanceStringIndexUnicode() to be match the spec.
979 Benchmarks show that there's no advantage in doing the unicode check outside
980 of the advanceStringIndexUnicode part. So, I simplified the code to match the
981 spec (especially since @@split needs to call advanceStringIndex from more than
984 - Removed an unnecessary call to @Object because it was already proven above.
985 - Changed to use advanceStringIndex instead of advanceStringIndexUnicode.
986 Again, there's no perf regression for this.
988 (hasObservableSideEffectsForRegExpSplit):
990 (advanceStringIndexUnicode): Deleted.
992 * builtins/StringPrototype.js:
994 - Modified to use RegExp.prototype[@@split].
996 * bytecode/BytecodeIntrinsicRegistry.cpp:
997 (JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
998 (JSC::BytecodeIntrinsicRegistry::lookup):
999 * bytecode/BytecodeIntrinsicRegistry.h:
1000 - Added the @@split symbol.
1002 * runtime/CommonIdentifiers.h:
1003 * runtime/ECMAScriptSpecInternalFunctions.cpp: Added.
1004 (JSC::esSpecIsConstructor):
1005 (JSC::esSpecIsRegExp):
1006 * runtime/ECMAScriptSpecInternalFunctions.h: Added.
1008 * runtime/JSGlobalObject.cpp:
1009 (JSC::getGetterById):
1010 (JSC::JSGlobalObject::init):
1012 * runtime/PropertyDescriptor.cpp:
1013 (JSC::PropertyDescriptor::setDescriptor):
1014 - Removed an assert that is no longer valid.
1016 * runtime/RegExpObject.h:
1017 - Made advanceStringUnicode() public so that it can be re-used by the regexp split
1020 * runtime/RegExpPrototype.cpp:
1021 (JSC::RegExpPrototype::finishCreation):
1022 (JSC::regExpProtoFuncExec):
1023 (JSC::regExpProtoFuncSearch):
1024 (JSC::advanceStringIndex):
1025 (JSC::regExpProtoFuncSplitFast):
1026 * runtime/RegExpPrototype.h:
1028 * runtime/StringObject.h:
1029 (JSC::jsStringWithReuse):
1031 - Hoisted some utility functions from StringPrototype.cpp so that they can be
1032 reused by the regexp split fast path.
1034 * runtime/StringPrototype.cpp:
1035 (JSC::StringPrototype::finishCreation):
1036 (JSC::stringProtoFuncSplitFast):
1037 (JSC::stringProtoFuncSubstr):
1038 (JSC::builtinStringSubstrInternal):
1039 (JSC::stringProtoFuncSubstring):
1040 (JSC::stringIncludesImpl):
1041 (JSC::stringProtoFuncIncludes):
1042 (JSC::builtinStringIncludesInternal):
1043 (JSC::jsStringWithReuse): Deleted.
1044 (JSC::jsSubstring): Deleted.
1045 (JSC::stringProtoFuncSplit): Deleted.
1046 * runtime/StringPrototype.h:
1050 2016-04-13 Mark Lam <mark.lam@apple.com>
1052 ShadowChicken::visitChildren() should not visit tailMarkers and throwMarkers.
1053 https://bugs.webkit.org/show_bug.cgi?id=156532
1055 Reviewed by Saam Barati and Filip Pizlo.
1057 ShadowChicken can store tailMarkers and throwMarkers in its log, specifically in
1058 the callee field of a log packet. However, ShadowChicken::visitChildren()
1059 unconditionally visits the callee field of each packet as if they are real
1060 objects. If visitChildren() encounters one of these markers in the log, we get a
1063 This crash was observed in the v8-v6/v8-regexp.js stress test running with shadow
1064 chicken when r199393 landed. r199393 introduced tail calls to a RegExp split
1065 fast path, and the v8-regexp.js test exercised this fast path a lot. Throw in
1066 some timely GCs, and we get a crash party.
1068 The fix is to have ShadowChicken::visitChildren() filter out the tailMarker and
1071 Alternatively, if perf is an issue, we can allocate 2 dedicated objects for
1072 these markers so that ShadowChicken can continue to visit them. For now, I'm
1073 going with the filter.
1075 * interpreter/ShadowChicken.cpp:
1076 (JSC::ShadowChicken::visitChildren):
1078 2016-04-13 Yusuke Suzuki <utatane.tea@gmail.com>
1080 [ES6] Add @@toStringTag to GeneratorFunction
1081 https://bugs.webkit.org/show_bug.cgi?id=156499
1083 Reviewed by Mark Lam.
1085 GeneratorFunction.prototype has @@toStringTag property, "GeneratorFunction".
1086 https://tc39.github.io/ecma262/#sec-generatorfunction.prototype-@@tostringtag
1088 * runtime/GeneratorFunctionPrototype.cpp:
1089 (JSC::GeneratorFunctionPrototype::finishCreation):
1091 * tests/es6/well-known_symbols_Symbol.toStringTag_new_built-ins.js: Added.
1094 2016-04-13 Alberto Garcia <berto@igalia.com>
1096 Fix build in glibc-based BSD systems
1097 https://bugs.webkit.org/show_bug.cgi?id=156533
1099 Reviewed by Carlos Garcia Campos.
1101 Change the order of the #elif conditionals so glibc-based BSD
1102 systems (e.g. Debian GNU/kFreeBSD) use the code inside the
1105 * heap/MachineStackMarker.cpp:
1106 (JSC::MachineThreads::Thread::Registers::stackPointer):
1107 (JSC::MachineThreads::Thread::Registers::framePointer):
1108 (JSC::MachineThreads::Thread::Registers::instructionPointer):
1109 (JSC::MachineThreads::Thread::Registers::llintPC):
1111 2016-04-12 Keith Miller <keith_miller@apple.com>
1113 Unreviewed undo change from ArrayClass to ArrayWithUndecided, which
1114 was not intedend to land with r199397.
1116 * runtime/ArrayPrototype.h:
1117 (JSC::ArrayPrototype::createStructure):
1119 2016-04-12 Mark Lam <mark.lam@apple.com>
1121 Rollout: ES6: Implement String.prototype.split and RegExp.prototype[@@split].
1122 https://bugs.webkit.org/show_bug.cgi?id=156013
1124 Speculative rollout to fix 32-bit shadow-chicken.yaml/tests/v8-v6/v8-regexp.js.shadow-chicken test failure.
1129 * JavaScriptCore.xcodeproj/project.pbxproj:
1130 * builtins/GlobalObject.js:
1132 (speciesConstructor): Deleted.
1133 * builtins/PromisePrototype.js:
1134 * builtins/RegExpPrototype.js:
1135 (advanceStringIndexUnicode):
1137 (advanceStringIndex): Deleted.
1138 (regExpExec): Deleted.
1139 (hasObservableSideEffectsForRegExpSplit): Deleted.
1141 * builtins/StringPrototype.js:
1144 * bytecode/BytecodeIntrinsicRegistry.cpp:
1145 (JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
1146 (JSC::BytecodeIntrinsicRegistry::lookup):
1147 * bytecode/BytecodeIntrinsicRegistry.h:
1148 * runtime/CommonIdentifiers.h:
1149 * runtime/ECMAScriptSpecInternalFunctions.cpp: Removed.
1150 * runtime/ECMAScriptSpecInternalFunctions.h: Removed.
1151 * runtime/JSGlobalObject.cpp:
1152 (JSC::JSGlobalObject::setGlobalThis):
1153 (JSC::JSGlobalObject::init):
1154 (JSC::getGetterById): Deleted.
1155 * runtime/PropertyDescriptor.cpp:
1156 (JSC::PropertyDescriptor::setDescriptor):
1157 * runtime/RegExpObject.h:
1158 (JSC::RegExpObject::offsetOfLastIndexIsWritable):
1159 * runtime/RegExpPrototype.cpp:
1160 (JSC::RegExpPrototype::finishCreation):
1161 (JSC::regExpProtoFuncExec):
1162 (JSC::regExpProtoFuncSearch):
1163 (JSC::advanceStringIndex): Deleted.
1164 (JSC::regExpProtoFuncSplitFast): Deleted.
1165 * runtime/RegExpPrototype.h:
1166 * runtime/StringObject.h:
1167 (JSC::jsStringWithReuse): Deleted.
1168 (JSC::jsSubstring): Deleted.
1169 * runtime/StringPrototype.cpp:
1170 (JSC::StringPrototype::finishCreation):
1171 (JSC::jsStringWithReuse):
1173 (JSC::substituteBackreferencesSlow):
1174 (JSC::splitStringByOneCharacterImpl):
1175 (JSC::stringProtoFuncSplit):
1176 (JSC::stringProtoFuncSubstr):
1177 (JSC::stringProtoFuncSubstring):
1178 (JSC::stringProtoFuncEndsWith):
1179 (JSC::stringProtoFuncIncludes):
1180 (JSC::stringProtoFuncIterator):
1181 (JSC::stringProtoFuncSplitFast): Deleted.
1182 (JSC::builtinStringSubstrInternal): Deleted.
1183 (JSC::stringIncludesImpl): Deleted.
1184 (JSC::builtinStringIncludesInternal): Deleted.
1185 * runtime/StringPrototype.h:
1188 2016-04-12 Mark Lam <mark.lam@apple.com>
1190 Remove 2 unused JSC options.
1191 https://bugs.webkit.org/show_bug.cgi?id=156526
1193 Reviewed by Benjamin Poulain.
1195 The options JSC_assertICSizing and JSC_dumpFailedICSizing are no longer in use
1196 now that we have B3.
1198 * runtime/Options.h:
1200 2016-04-12 Keith Miller <keith_miller@apple.com>
1202 [ES6] Add support for Symbol.isConcatSpreadable.
1203 https://bugs.webkit.org/show_bug.cgi?id=155351
1205 Reviewed by Saam Barati.
1207 This patch adds support for Symbol.isConcatSpreadable. In order to do so it was necessary to move the
1208 Array.prototype.concat function to JS. A number of different optimizations were needed to make such the move to
1209 a builtin performant. First, four new DFG intrinsics were added.
1211 1) IsArrayObject (I would have called it IsArray but we use the same name for an IndexingType): an intrinsic of
1212 the Array.isArray function.
1213 2) IsJSArray: checks the first child is a JSArray object.
1214 3) IsArrayConstructor: checks the first child is an instance of ArrayConstructor.
1215 4) CallObjectConstructor: an intrinsic of the Object constructor.
1217 IsActualObject, IsJSArray, and CallObjectConstructor can all be converted into constants in the abstract interpreter if
1218 we are able to prove that the first child is an Array or for ToObject an Object.
1220 In order to further improve the perfomance we also now cover more indexing types in our fast path memcpy
1221 code. Before we would only memcpy Arrays if they had the same indexing type and did not have Array storage and
1222 were not undecided. Now the memcpy code covers the following additional two cases: One array is undecided and
1223 the other is a non-array storage and the case where one array is Int32 and the other is contiguous (we map this
1224 into a contiguous array).
1226 This patch also adds a new fast path for concat with more than one array argument by using memcpy to append
1227 values onto the result array. This works roughly the same as the two array fast path using the same methodology
1228 to decide if we can memcpy the other butterfly into the result butterfly.
1230 Two new debugging tools are also added to the jsc cli. One is a version of the print function with a private
1231 name so it can be used for debugging builtins. The other is dumpDataLog, which takes a JSValue and runs our
1232 dataLog function on it.
1234 Finally, this patch add a new constructor to JSValueRegsTemporary that allows it to reuse the the registers of a
1235 JSValueOperand if the operand's use count is one.
1237 * JavaScriptCore.xcodeproj/project.pbxproj:
1238 * builtins/ArrayPrototype.js:
1241 * bytecode/BytecodeIntrinsicRegistry.cpp:
1242 (JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
1243 * bytecode/BytecodeIntrinsicRegistry.h:
1244 * dfg/DFGAbstractInterpreterInlines.h:
1245 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
1246 * dfg/DFGByteCodeParser.cpp:
1247 (JSC::DFG::ByteCodeParser::handleIntrinsicCall):
1248 (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
1249 * dfg/DFGClobberize.h:
1250 (JSC::DFG::clobberize):
1251 * dfg/DFGDoesGC.cpp:
1253 * dfg/DFGFixupPhase.cpp:
1254 (JSC::DFG::FixupPhase::fixupNode):
1255 * dfg/DFGNodeType.h:
1256 * dfg/DFGOperations.cpp:
1257 * dfg/DFGOperations.h:
1258 * dfg/DFGPredictionPropagationPhase.cpp:
1259 (JSC::DFG::PredictionPropagationPhase::propagate):
1260 * dfg/DFGSafeToExecute.h:
1261 (JSC::DFG::safeToExecute):
1262 * dfg/DFGSpeculativeJIT.cpp:
1263 (JSC::DFG::SpeculativeJIT::compileCurrentBlock):
1264 (JSC::DFG::SpeculativeJIT::compileIsJSArray):
1265 (JSC::DFG::SpeculativeJIT::compileIsArrayObject):
1266 (JSC::DFG::SpeculativeJIT::compileIsArrayConstructor):
1267 (JSC::DFG::SpeculativeJIT::compileCallObjectConstructor):
1268 * dfg/DFGSpeculativeJIT.h:
1269 (JSC::DFG::SpeculativeJIT::callOperation):
1270 * dfg/DFGSpeculativeJIT32_64.cpp:
1271 (JSC::DFG::SpeculativeJIT::compile):
1272 * dfg/DFGSpeculativeJIT64.cpp:
1273 (JSC::DFG::SpeculativeJIT::compile):
1274 * ftl/FTLCapabilities.cpp:
1275 (JSC::FTL::canCompile):
1276 * ftl/FTLLowerDFGToB3.cpp:
1277 (JSC::FTL::DFG::LowerDFGToB3::compileNode):
1278 (JSC::FTL::DFG::LowerDFGToB3::compileCallObjectConstructor):
1279 (JSC::FTL::DFG::LowerDFGToB3::compileIsArrayObject):
1280 (JSC::FTL::DFG::LowerDFGToB3::compileIsJSArray):
1281 (JSC::FTL::DFG::LowerDFGToB3::compileIsArrayConstructor):
1282 (JSC::FTL::DFG::LowerDFGToB3::isArray):
1283 * jit/JITOperations.h:
1285 (GlobalObject::finishCreation):
1286 (functionDataLogValue):
1287 * runtime/ArrayConstructor.cpp:
1288 (JSC::ArrayConstructor::finishCreation):
1289 (JSC::arrayConstructorPrivateFuncIsArrayConstructor):
1290 * runtime/ArrayConstructor.h:
1291 (JSC::isArrayConstructor):
1292 * runtime/ArrayPrototype.cpp:
1293 (JSC::ArrayPrototype::finishCreation):
1294 (JSC::arrayProtoPrivateFuncIsJSArray):
1295 (JSC::moveElements):
1296 (JSC::arrayProtoPrivateFuncConcatMemcpy):
1297 (JSC::arrayProtoPrivateFuncAppendMemcpy):
1298 (JSC::arrayProtoFuncConcat): Deleted.
1299 * runtime/ArrayPrototype.h:
1300 (JSC::ArrayPrototype::createStructure):
1301 * runtime/CommonIdentifiers.h:
1302 * runtime/Intrinsic.h:
1303 * runtime/JSArray.cpp:
1304 (JSC::JSArray::appendMemcpy):
1305 (JSC::JSArray::fastConcatWith): Deleted.
1306 * runtime/JSArray.h:
1307 (JSC::JSArray::createStructure):
1308 (JSC::JSArray::fastConcatType): Deleted.
1309 * runtime/JSArrayInlines.h: Added.
1310 (JSC::JSArray::memCopyWithIndexingType):
1311 (JSC::JSArray::canFastCopy):
1312 * runtime/JSGlobalObject.cpp:
1313 (JSC::JSGlobalObject::init):
1315 * runtime/ObjectConstructor.h:
1316 (JSC::constructObject):
1318 * tests/stress/array-concat-spread-object.js: Added.
1320 * tests/stress/array-concat-spread-proxy-exception-check.js: Added.
1322 * tests/stress/array-concat-spread-proxy.js: Added.
1324 * tests/stress/array-concat-with-slow-indexingtypes.js: Added.
1326 * tests/stress/array-species-config-array-constructor.js:
1328 2016-04-12 Saam barati <sbarati@apple.com>
1330 Lets not iterate over the constant pool twice every time we link a code block
1331 https://bugs.webkit.org/show_bug.cgi?id=156517
1333 Reviewed by Mark Lam.
1335 I introduced a second iteration over the constant pool when I implemented
1336 block scoping. I did this because we must clone all the symbol tables when
1337 we link a CodeBlock. We can just do this cloning when setting the constant
1338 registers for the first time. There is no need to iterate over the constant
1341 * bytecode/CodeBlock.cpp:
1342 (JSC::CodeBlock::finishCreation):
1343 (JSC::CodeBlock::~CodeBlock):
1344 (JSC::CodeBlock::setConstantRegisters):
1345 (JSC::CodeBlock::setAlternative):
1346 * bytecode/CodeBlock.h:
1347 (JSC::CodeBlock::replaceConstant):
1348 (JSC::CodeBlock::setConstantRegisters): Deleted.
1350 2016-04-12 Mark Lam <mark.lam@apple.com>
1352 ES6: Implement String.prototype.split and RegExp.prototype[@@split].
1353 https://bugs.webkit.org/show_bug.cgi?id=156013
1355 Reviewed by Keith Miller.
1358 * JavaScriptCore.xcodeproj/project.pbxproj:
1359 * builtins/GlobalObject.js:
1360 (speciesConstructor):
1361 * builtins/PromisePrototype.js:
1362 - refactored to use the @speciesConstructor internal function.
1364 * builtins/RegExpPrototype.js:
1365 (advanceStringIndex):
1366 - refactored from @advanceStringIndexUnicode() to be match the spec.
1367 Benchmarks show that there's no advantage in doing the unicode check outside
1368 of the advanceStringIndexUnicode part. So, I simplified the code to match the
1369 spec (especially since @@split needs to call advanceStringIndex from more than
1372 - Removed an unnecessary call to @Object because it was already proven above.
1373 - Changed to use advanceStringIndex instead of advanceStringIndexUnicode.
1374 Again, there's no perf regression for this.
1376 (hasObservableSideEffectsForRegExpSplit):
1378 (advanceStringIndexUnicode): Deleted.
1380 * builtins/StringPrototype.js:
1382 - Modified to use RegExp.prototype[@@split].
1384 * bytecode/BytecodeIntrinsicRegistry.cpp:
1385 (JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
1386 (JSC::BytecodeIntrinsicRegistry::lookup):
1387 * bytecode/BytecodeIntrinsicRegistry.h:
1388 - Added the @@split symbol.
1390 * runtime/CommonIdentifiers.h:
1391 * runtime/ECMAScriptSpecInternalFunctions.cpp: Added.
1392 (JSC::esSpecIsConstructor):
1393 (JSC::esSpecIsRegExp):
1394 * runtime/ECMAScriptSpecInternalFunctions.h: Added.
1396 * runtime/JSGlobalObject.cpp:
1397 (JSC::getGetterById):
1398 (JSC::JSGlobalObject::init):
1400 * runtime/PropertyDescriptor.cpp:
1401 (JSC::PropertyDescriptor::setDescriptor):
1402 - Removed an assert that is no longer valid.
1404 * runtime/RegExpObject.h:
1405 - Made advanceStringUnicode() public so that it can be re-used by the regexp split
1408 * runtime/RegExpPrototype.cpp:
1409 (JSC::RegExpPrototype::finishCreation):
1410 (JSC::regExpProtoFuncExec):
1411 (JSC::regExpProtoFuncSearch):
1412 (JSC::advanceStringIndex):
1413 (JSC::regExpProtoFuncSplitFast):
1414 * runtime/RegExpPrototype.h:
1416 * runtime/StringObject.h:
1417 (JSC::jsStringWithReuse):
1419 - Hoisted some utility functions from StringPrototype.cpp so that they can be
1420 reused by the regexp split fast path.
1422 * runtime/StringPrototype.cpp:
1423 (JSC::StringPrototype::finishCreation):
1424 (JSC::stringProtoFuncSplitFast):
1425 (JSC::stringProtoFuncSubstr):
1426 (JSC::builtinStringSubstrInternal):
1427 (JSC::stringProtoFuncSubstring):
1428 (JSC::stringIncludesImpl):
1429 (JSC::stringProtoFuncIncludes):
1430 (JSC::builtinStringIncludesInternal):
1431 (JSC::jsStringWithReuse): Deleted.
1432 (JSC::jsSubstring): Deleted.
1433 (JSC::stringProtoFuncSplit): Deleted.
1434 * runtime/StringPrototype.h:
1438 2016-04-12 Keith Miller <keith_miller@apple.com>
1440 AbstractValue should use the result type to filter structures
1441 https://bugs.webkit.org/show_bug.cgi?id=156516
1443 Reviewed by Geoffrey Garen.
1445 When filtering an AbstractValue with a SpeculatedType we would not use the merged type when
1446 filtering out the valid structures (despite what the comment directly above said). This
1447 would cause us to crash if our structure-set was Top and the two speculated types were
1448 different kinds of cells.
1450 * dfg/DFGAbstractValue.cpp:
1451 (JSC::DFG::AbstractValue::filter):
1452 * tests/stress/ai-consistency-filter-cells.js: Added.
1454 (attribute.value.get record):
1455 (attribute.attrs.get this):
1457 (let.thisValue.return.serialize):
1458 (let.thisValue.transformFor):
1460 2016-04-12 Filip Pizlo <fpizlo@apple.com>
1462 Unreviewed, remove FIXME for https://bugs.webkit.org/show_bug.cgi?id=156457 and replace it
1463 with a comment that describes what we do now.
1465 * bytecode/PolymorphicAccess.h:
1467 2016-04-12 Saam barati <sbarati@apple.com>
1469 isLocked() assertion broke builds because ConcurrentJITLock isn't always a real lock.
1471 Rubber-stamped by Filip Pizlo.
1473 * bytecode/CodeBlock.cpp:
1474 (JSC::CodeBlock::resultProfileForBytecodeOffset):
1475 (JSC::CodeBlock::ensureResultProfile):
1477 2016-04-11 Filip Pizlo <fpizlo@apple.com>
1479 PolymorphicAccess should buffer AccessCases before regenerating
1480 https://bugs.webkit.org/show_bug.cgi?id=156457
1482 Reviewed by Benjamin Poulain.
1484 Prior to this change, whenever we added an AccessCase to a PolymorphicAccess, we would
1485 regenerate the whole stub. That meant that we'd do O(N^2) work for N access cases.
1487 One way to fix this is to have each AccessCase generate a stub just for itself, which
1488 cascades down to the already-generated cases. But that removes the binary switch
1489 optimization, which makes the IC perform great even when there are many cases.
1491 This change fixes the issue by buffering access cases. When we take slow path and try to add
1492 a new case, the StructureStubInfo will usually just buffer the new case without generating
1493 new code. We simply guarantee that after we buffer a case, we will take at most
1494 Options::repatchBufferingCountdown() slow path calls before generating code for it. That
1495 option is currently 7. Taking 7 more slow paths means that we have 7 more opportunities to
1496 gather more access cases, or to realize that this IC is too crazy to bother with.
1498 This change ensures that the DFG still gets the same kind of profiling. This is because the
1499 buffered AccessCases are still part of PolymorphicAccess and so are still scanned by
1500 GetByIdStatus and PutByIdStatus. The fact that the AccessCases hadn't been generated and so
1501 hadn't executed doesn't change much. Mainly, it increases the likelihood that the DFG will
1502 see an access case that !couldStillSucceed(). The DFG's existing profile parsing logic can
1503 handle this just fine.
1505 There are a bunch of algorithmic changes here. StructureStubInfo now caches the set of
1506 structures that it has seen as a guard to prevent adding lots of redundant cases, in case
1507 we see the same 7 cases after buffering the first one. This cache means we won't wastefully
1508 allocate 7 identical AccessCase instances. PolymorphicAccess is now restructured around
1509 having separate addCase() and regenerate() calls. That means a bit more moving data around.
1510 So far that seems OK for performance, probably since it's O(N) work rather than O(N^2) work.
1511 There is room for improvement for future patches, to be sure.
1513 This is benchmarking as slightly positive or neutral on JS benchmarks. It's meant to reduce
1514 pathologies I saw in page loads.
1516 * bytecode/GetByIdStatus.cpp:
1517 (JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
1518 * bytecode/PolymorphicAccess.cpp:
1519 (JSC::PolymorphicAccess::PolymorphicAccess):
1520 (JSC::PolymorphicAccess::~PolymorphicAccess):
1521 (JSC::PolymorphicAccess::addCases):
1522 (JSC::PolymorphicAccess::addCase):
1523 (JSC::PolymorphicAccess::visitWeak):
1524 (JSC::PolymorphicAccess::dump):
1525 (JSC::PolymorphicAccess::commit):
1526 (JSC::PolymorphicAccess::regenerate):
1527 (JSC::PolymorphicAccess::aboutToDie):
1528 (WTF::printInternal):
1529 (JSC::PolymorphicAccess::regenerateWithCases): Deleted.
1530 (JSC::PolymorphicAccess::regenerateWithCase): Deleted.
1531 * bytecode/PolymorphicAccess.h:
1532 (JSC::AccessCase::isGetter):
1533 (JSC::AccessCase::callLinkInfo):
1534 (JSC::AccessGenerationResult::AccessGenerationResult):
1535 (JSC::AccessGenerationResult::madeNoChanges):
1536 (JSC::AccessGenerationResult::gaveUp):
1537 (JSC::AccessGenerationResult::buffered):
1538 (JSC::AccessGenerationResult::generatedNewCode):
1539 (JSC::AccessGenerationResult::generatedFinalCode):
1540 (JSC::AccessGenerationResult::shouldGiveUpNow):
1541 (JSC::AccessGenerationResult::generatedSomeCode):
1542 (JSC::PolymorphicAccess::isEmpty):
1543 (JSC::PolymorphicAccess::size):
1544 (JSC::PolymorphicAccess::at):
1545 * bytecode/PutByIdStatus.cpp:
1546 (JSC::PutByIdStatus::computeForStubInfo):
1547 * bytecode/StructureStubInfo.cpp:
1548 (JSC::StructureStubInfo::StructureStubInfo):
1549 (JSC::StructureStubInfo::addAccessCase):
1550 (JSC::StructureStubInfo::reset):
1551 (JSC::StructureStubInfo::visitWeakReferences):
1552 * bytecode/StructureStubInfo.h:
1553 (JSC::StructureStubInfo::considerCaching):
1554 (JSC::StructureStubInfo::willRepatch): Deleted.
1555 (JSC::StructureStubInfo::willCoolDown): Deleted.
1556 * jit/JITOperations.cpp:
1558 (JSC::tryCacheGetByID):
1559 (JSC::repatchGetByID):
1560 (JSC::tryCachePutByID):
1561 (JSC::repatchPutByID):
1562 (JSC::tryRepatchIn):
1564 * runtime/JSCJSValue.h:
1565 * runtime/JSCJSValueInlines.h:
1566 (JSC::JSValue::putByIndex):
1567 (JSC::JSValue::structureOrNull):
1568 (JSC::JSValue::structureOrUndefined):
1569 * runtime/Options.h:
1571 2016-04-12 Saam barati <sbarati@apple.com>
1573 There is a race with the compiler thread and the main thread with result profiles
1574 https://bugs.webkit.org/show_bug.cgi?id=156503
1576 Reviewed by Filip Pizlo.
1578 The compiler thread should not be asking for a result
1579 profile while the execution thread is creating one.
1580 We must guard against such races with a lock.
1582 * bytecode/CodeBlock.cpp:
1583 (JSC::CodeBlock::resultProfileForBytecodeOffset):
1584 (JSC::CodeBlock::ensureResultProfile):
1585 (JSC::CodeBlock::capabilityLevel):
1586 * bytecode/CodeBlock.h:
1587 (JSC::CodeBlock::couldTakeSlowCase):
1588 (JSC::CodeBlock::numberOfResultProfiles):
1589 (JSC::CodeBlock::specialFastCaseProfileCountForBytecodeOffset):
1590 (JSC::CodeBlock::ensureResultProfile): Deleted.
1592 2016-04-12 Commit Queue <commit-queue@webkit.org>
1594 Unreviewed, rolling out r199339.
1595 https://bugs.webkit.org/show_bug.cgi?id=156505
1597 memset_s is indeed necessary (Requested by alexchristensen_ on
1602 "Build fix after r199299."
1603 https://bugs.webkit.org/show_bug.cgi?id=155508
1604 http://trac.webkit.org/changeset/199339
1606 2016-04-12 Guillaume Emont <guijemont@igalia.com>
1608 MIPS: add MacroAssemblerMIPS::store8(TrustedImm32,ImplicitAddress)
1609 https://bugs.webkit.org/show_bug.cgi?id=156481
1611 This method with this signature is used by r199075, and therefore
1612 WebKit doesn't build on MIPS since then.
1614 Reviewed by Mark Lam.
1616 * assembler/MacroAssemblerMIPS.h:
1617 (JSC::MacroAssemblerMIPS::store8):
1619 2016-04-12 Saam barati <sbarati@apple.com>
1621 We incorrectly parse arrow function expressions
1622 https://bugs.webkit.org/show_bug.cgi?id=156373
1624 Reviewed by Mark Lam.
1626 This patch removes the notion of "isEndOfArrowFunction".
1627 This was a very weird function and it was incorrect.
1628 It checked that the arrow functions with concise body
1629 grammar production "had a valid ending". "had a valid
1630 ending" is in quotes because concise body arrow functions
1631 have a valid ending as long as their body has a valid
1632 assignment expression. I've removed all notion of this
1633 function because it was wrong and was causing us
1634 to throw syntax errors on valid programs.
1637 (JSC::Lexer<T>::nextTokenIsColon):
1638 (JSC::Lexer<T>::lex):
1639 (JSC::Lexer<T>::setTokenPosition): Deleted.
1641 (JSC::Lexer::setIsReparsingFunction):
1642 (JSC::Lexer::isReparsingFunction):
1643 (JSC::Lexer::lineNumber):
1644 * parser/Parser.cpp:
1645 (JSC::Parser<LexerType>::parseInner):
1646 (JSC::Parser<LexerType>::parseArrowFunctionSingleExpressionBodySourceElements):
1647 (JSC::Parser<LexerType>::parseFunctionInfo):
1649 (JSC::Parser::matchIdentifierOrKeyword):
1650 (JSC::Parser::tokenStart):
1651 (JSC::Parser::autoSemiColon):
1652 (JSC::Parser::canRecurse):
1653 (JSC::Parser::isEndOfArrowFunction): Deleted.
1654 (JSC::Parser::setEndOfStatement): Deleted.
1655 * tests/stress/arrowfunction-others.js:
1657 (simpleArrowFunction):
1661 2016-04-12 Yusuke Suzuki <utatane.tea@gmail.com>
1663 [JSC] addStaticGlobals should emit SymbolTableEntry watchpoints to encourage constant folding in DFG
1664 https://bugs.webkit.org/show_bug.cgi?id=155110
1666 Reviewed by Saam Barati.
1668 `addStaticGlobals` does not emit SymbolTableEntry watchpoints for the added entries.
1669 So, all the global variable lookups pointing to these static globals are not converted
1670 into constants in DFGBytecodeGenerator: this fact leaves these lookups as GetGlobalVar.
1671 Such thing avoids constant folding chance and emits CheckCell for @privateFunction inlining.
1672 This operation is pure overhead.
1674 Static globals are not configurable, and they are typically non-writable.
1675 So they are constants in almost all the cases.
1677 This patch initializes watchpoints for these static globals.
1678 These watchpoints allow DFG to convert these nodes into constants in DFG BytecodeParser.
1679 These watchpoints includes many builtin operations and `undefined`.
1681 The microbenchmark, many-foreach-calls shows 5 - 7% improvement since it removes unnecessary CheckCell.
1683 * bytecode/VariableWriteFireDetail.h:
1684 * runtime/JSGlobalObject.cpp:
1685 (JSC::JSGlobalObject::addGlobalVar):
1686 (JSC::JSGlobalObject::addStaticGlobals):
1687 * runtime/JSSymbolTableObject.h:
1688 (JSC::symbolTablePutTouchWatchpointSet):
1689 (JSC::symbolTablePutInvalidateWatchpointSet):
1690 (JSC::symbolTablePut):
1691 (JSC::symbolTablePutWithAttributesTouchWatchpointSet): Deleted.
1692 * runtime/SymbolTable.h:
1693 (JSC::SymbolTableEntry::SymbolTableEntry):
1694 (JSC::SymbolTableEntry::operator=):
1695 (JSC::SymbolTableEntry::swap):
1697 2016-04-12 Alex Christensen <achristensen@webkit.org>
1699 Build fix after r199299.
1700 https://bugs.webkit.org/show_bug.cgi?id=155508
1702 * jit/ExecutableAllocatorFixedVMPool.cpp:
1703 (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps):
1704 memset_s is not defined. __STDC_WANT_LIB_EXT1__ is not defined anywhere.
1705 Since the return value is unused and set_constraint_handler_s is never called
1706 I'm chaning it to memset.
1708 2016-04-11 Benjamin Poulain <bpoulain@apple.com>
1710 [JSC] B3 can use undefined bits or not defined required bits when spilling
1711 https://bugs.webkit.org/show_bug.cgi?id=156486
1713 Reviewed by Filip Pizlo.
1715 Spilling had issues when replacing arguments in place.
1718 1) If we have a 32bit stackslot, a x86 instruction could still try to load 64bits from it.
1719 2) If we have a 64bit stackslot, Move32 would only set half the bits.
1720 3) We were reducing Move to Move32 even if the top bits are read from the stack slot.
1722 The case 1 appear with something like this:
1724 Op64 %tmp1, %tmp2, %tmp3
1725 When we spill %tmp1, the stack slot is 32bit, Move32 sets 32bits
1726 but Op64 supports addressing for %tmp1. When we substitute %tmp1 in Op64,
1727 we are creating a 64bit read for a 32bit stack slot.
1729 The case 2 is an other common one. If we have:
1739 We have a stack slot of 64bits. When spilling %tmp1 in #1, we are
1740 effectively doing a 32bit store on the stack slot, leaving the top bits undefined.
1742 Case 3 is pretty much the same as 2 but we create the Move32 ourself
1743 because the source is a 32bit with ZDef.
1745 Case (1) is solved by requiring that the stack slot is at least as large as the largest
1746 use/def of that tmp.
1748 Case (2) and (3) are solved by not replacing a Tmp by an Address if the Def
1749 is smaller than the stack slot.
1751 * b3/air/AirIteratedRegisterCoalescing.cpp:
1753 (JSC::B3::testSpillDefSmallerThanUse):
1754 (JSC::B3::testSpillUseLargerThanDef):
1757 2016-04-11 Brian Burg <bburg@apple.com>
1759 Web Inspector: get rid of InspectorBasicValue and InspectorString subclasses
1760 https://bugs.webkit.org/show_bug.cgi?id=156407
1761 <rdar://problem/25627659>
1763 Reviewed by Joseph Pecoraro.
1765 There's no point having these subclasses as they don't save any space.
1766 Add a StringImpl to the union and merge some implementations of writeJSON.
1768 Rename m_data to m_map and explicitly name the union as InspectorValue::m_value.
1769 If the value is a string and the string is not empty or null (i.e., it has a
1770 StringImpl), then we need to ref() and deref() the string as the InspectorValue
1771 is created or destroyed.
1773 Move uses of the subclass to InspectorValue and delete redundant methods.
1774 Now, most InspectorValue methods are non-virtual so they can be templated.
1776 * bindings/ScriptValue.cpp:
1777 (Deprecated::jsToInspectorValue):
1778 * inspector/InjectedScriptBase.cpp:
1779 (Inspector::InjectedScriptBase::makeCall):
1780 Don't used deleted subclasses.
1782 * inspector/InspectorValues.cpp:
1783 (Inspector::InspectorValue::null):
1784 (Inspector::InspectorValue::create):
1785 (Inspector::InspectorValue::asValue):
1786 (Inspector::InspectorValue::asBoolean):
1787 (Inspector::InspectorValue::asDouble):
1788 (Inspector::InspectorValue::asInteger):
1789 (Inspector::InspectorValue::asString):
1790 These only need one implementation now.
1792 (Inspector::InspectorValue::writeJSON):
1793 Still a virtual method since Object and Array need their members.
1795 (Inspector::InspectorObjectBase::InspectorObjectBase):
1796 (Inspector::InspectorBasicValue::asBoolean): Deleted.
1797 (Inspector::InspectorBasicValue::asDouble): Deleted.
1798 (Inspector::InspectorBasicValue::asInteger): Deleted.
1799 (Inspector::InspectorBasicValue::writeJSON): Deleted.
1800 (Inspector::InspectorString::asString): Deleted.
1801 (Inspector::InspectorString::writeJSON): Deleted.
1802 (Inspector::InspectorString::create): Deleted.
1803 (Inspector::InspectorBasicValue::create): Deleted.
1805 * inspector/InspectorValues.h:
1806 (Inspector::InspectorObjectBase::find):
1807 (Inspector::InspectorObjectBase::setBoolean):
1808 (Inspector::InspectorObjectBase::setInteger):
1809 (Inspector::InspectorObjectBase::setDouble):
1810 (Inspector::InspectorObjectBase::setString):
1811 (Inspector::InspectorObjectBase::setValue):
1812 (Inspector::InspectorObjectBase::setObject):
1813 (Inspector::InspectorObjectBase::setArray):
1814 (Inspector::InspectorArrayBase::pushBoolean):
1815 (Inspector::InspectorArrayBase::pushInteger):
1816 (Inspector::InspectorArrayBase::pushDouble):
1817 (Inspector::InspectorArrayBase::pushString):
1818 (Inspector::InspectorArrayBase::pushValue):
1819 (Inspector::InspectorArrayBase::pushObject):
1820 (Inspector::InspectorArrayBase::pushArray):
1821 Use new factory methods.
1823 * replay/EncodedValue.cpp:
1824 (JSC::ScalarEncodingTraits<bool>::encodeValue):
1825 (JSC::ScalarEncodingTraits<double>::encodeValue):
1826 (JSC::ScalarEncodingTraits<float>::encodeValue):
1827 (JSC::ScalarEncodingTraits<int32_t>::encodeValue):
1828 (JSC::ScalarEncodingTraits<int64_t>::encodeValue):
1829 (JSC::ScalarEncodingTraits<uint32_t>::encodeValue):
1830 (JSC::ScalarEncodingTraits<uint64_t>::encodeValue):
1831 * replay/EncodedValue.h:
1832 Use new factory methods.
1834 2016-04-11 Filip Pizlo <fpizlo@apple.com>
1836 It should be possible to edit StructureStubInfo without recompiling the world
1837 https://bugs.webkit.org/show_bug.cgi?id=156470
1839 Reviewed by Keith Miller.
1841 This change makes it less painful to make changes to the IC code. It used to be that any
1842 change to StructureStubInfo caused every JIT-related file to get recompiled. Now only a
1843 smaller set of files - ones that actually peek into StructureStubInfo - will recompile. This
1844 is mainly because CodeBlock.h no longer includes StructureStubInfo.h.
1846 * bytecode/ByValInfo.h:
1847 * bytecode/CodeBlock.cpp:
1848 * bytecode/CodeBlock.h:
1849 * bytecode/GetByIdStatus.cpp:
1850 * bytecode/GetByIdStatus.h:
1851 * bytecode/PutByIdStatus.cpp:
1852 * bytecode/PutByIdStatus.h:
1853 * bytecode/StructureStubInfo.h:
1854 (JSC::getStructureStubInfoCodeOrigin):
1855 * dfg/DFGByteCodeParser.cpp:
1856 * dfg/DFGJITCompiler.cpp:
1857 * dfg/DFGOSRExitCompilerCommon.cpp:
1858 * dfg/DFGSpeculativeJIT.h:
1859 * ftl/FTLLowerDFGToB3.cpp:
1860 * ftl/FTLSlowPathCall.h:
1861 * jit/IntrinsicEmitter.cpp:
1862 * jit/JITInlineCacheGenerator.cpp:
1863 * jit/JITInlineCacheGenerator.h:
1864 * jit/JITOperations.cpp:
1865 * jit/JITPropertyAccess.cpp:
1866 * jit/JITPropertyAccess32_64.cpp:
1868 2016-04-11 Skachkov Oleksandr <gskachkov@gmail.com>
1870 Remove NewArrowFunction from DFG IR
1871 https://bugs.webkit.org/show_bug.cgi?id=156439
1873 Reviewed by Saam Barati.
1875 It seems that NewArrowFunction was left in DFG IR during refactoring by mistake.
1877 * dfg/DFGAbstractInterpreterInlines.h:
1878 * dfg/DFGClobberize.h:
1879 (JSC::DFG::clobberize):
1880 * dfg/DFGClobbersExitState.cpp:
1881 * dfg/DFGDoesGC.cpp:
1882 * dfg/DFGFixupPhase.cpp:
1883 * dfg/DFGMayExit.cpp:
1885 (JSC::DFG::Node::convertToPhantomNewFunction):
1886 * dfg/DFGNodeType.h:
1887 * dfg/DFGObjectAllocationSinkingPhase.cpp:
1888 * dfg/DFGPredictionPropagationPhase.cpp:
1889 * dfg/DFGSafeToExecute.h:
1890 * dfg/DFGSpeculativeJIT.cpp:
1891 (JSC::DFG::SpeculativeJIT::compileNewFunction):
1892 * dfg/DFGSpeculativeJIT32_64.cpp:
1893 * dfg/DFGSpeculativeJIT64.cpp:
1894 * dfg/DFGStoreBarrierInsertionPhase.cpp:
1895 * dfg/DFGStructureRegistrationPhase.cpp:
1896 * ftl/FTLCapabilities.cpp:
1897 * ftl/FTLLowerDFGToB3.cpp:
1898 (JSC::FTL::DFG::LowerDFGToB3::compileNewFunction):
1900 2016-04-05 Oliver Hunt <oliver@apple.com>
1902 Remove compile time define for SEPARATED_HEAP
1903 https://bugs.webkit.org/show_bug.cgi?id=155508
1905 Reviewed by Mark Lam.
1907 Remove the SEPARATED_HEAP compile time flag. The separated
1908 heap is available, but off by default, on x86_64, ARMv7, and
1911 Working through the issues that happened last time essentially
1912 required implementing the ARMv7 path for the separated heap
1913 just so I could find all the ways it was going wrong.
1915 We fixed all the logic by making the branch and jump logic in
1916 the linker and assemblers take two parameters, the location to
1917 write to, and the location we'll actually be writing to. We
1918 need to do this because it's no longer sufficient to compute
1919 jumps relative to region the linker is writing to.
1921 The repatching jump, branch, and call functions only need the
1922 executable address as the patching is performed directly using
1923 performJITMemcpy function which works in terms of the executable
1926 There is no performance impact on jsc-benchmarks with the separate
1927 heap either emabled or disabled.
1929 * Configurations/FeatureDefines.xcconfig:
1930 * assembler/ARM64Assembler.h:
1931 (JSC::ARM64Assembler::linkJump):
1932 (JSC::ARM64Assembler::linkCall):
1933 (JSC::ARM64Assembler::relinkJump):
1934 (JSC::ARM64Assembler::relinkCall):
1935 (JSC::ARM64Assembler::link):
1936 (JSC::ARM64Assembler::linkJumpOrCall):
1937 (JSC::ARM64Assembler::linkCompareAndBranch):
1938 (JSC::ARM64Assembler::linkConditionalBranch):
1939 (JSC::ARM64Assembler::linkTestAndBranch):
1940 (JSC::ARM64Assembler::relinkJumpOrCall):
1941 * assembler/ARMv7Assembler.h:
1942 (JSC::ARMv7Assembler::revertJumpTo_movT3movtcmpT2):
1943 (JSC::ARMv7Assembler::revertJumpTo_movT3):
1944 (JSC::ARMv7Assembler::link):
1945 (JSC::ARMv7Assembler::linkJump):
1946 (JSC::ARMv7Assembler::relinkJump):
1947 (JSC::ARMv7Assembler::repatchCompact):
1948 (JSC::ARMv7Assembler::replaceWithJump):
1949 (JSC::ARMv7Assembler::replaceWithLoad):
1950 (JSC::ARMv7Assembler::replaceWithAddressComputation):
1951 (JSC::ARMv7Assembler::setInt32):
1952 (JSC::ARMv7Assembler::setUInt7ForLoad):
1953 (JSC::ARMv7Assembler::isB):
1954 (JSC::ARMv7Assembler::isBX):
1955 (JSC::ARMv7Assembler::isMOV_imm_T3):
1956 (JSC::ARMv7Assembler::isMOVT):
1957 (JSC::ARMv7Assembler::isNOP_T1):
1958 (JSC::ARMv7Assembler::isNOP_T2):
1959 (JSC::ARMv7Assembler::linkJumpT1):
1960 (JSC::ARMv7Assembler::linkJumpT2):
1961 (JSC::ARMv7Assembler::linkJumpT3):
1962 (JSC::ARMv7Assembler::linkJumpT4):
1963 (JSC::ARMv7Assembler::linkConditionalJumpT4):
1964 (JSC::ARMv7Assembler::linkBX):
1965 (JSC::ARMv7Assembler::linkConditionalBX):
1966 (JSC::ARMv7Assembler::linkJumpAbsolute):
1967 * assembler/LinkBuffer.cpp:
1968 (JSC::LinkBuffer::copyCompactAndLinkCode):
1969 * assembler/MacroAssemblerARM64.h:
1970 (JSC::MacroAssemblerARM64::link):
1971 * assembler/MacroAssemblerARMv7.h:
1972 (JSC::MacroAssemblerARMv7::link):
1973 * jit/ExecutableAllocator.h:
1974 (JSC::performJITMemcpy):
1975 * jit/ExecutableAllocatorFixedVMPool.cpp:
1976 (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps):
1977 (JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator):
1978 (JSC::FixedVMPoolExecutableAllocator::genericWriteToJITRegion):
1979 (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): Deleted.
1980 * runtime/Options.cpp:
1981 (JSC::recomputeDependentOptions):
1982 * runtime/Options.h:
1984 2016-04-10 Filip Pizlo <fpizlo@apple.com>
1986 Clean up how we reason about the states of AccessCases
1987 https://bugs.webkit.org/show_bug.cgi?id=156454
1989 Reviewed by Mark Lam.
1991 Currently when we add an AccessCase to a PolymorphicAccess stub, we regenerate the stub.
1992 That means that as we grow a stub to have N cases, we will do O(N^2) generation work. I want
1993 to explore buffering AccessCases so that we can do O(N) generation work instead. But to
1994 before I go there, I want to make sure that the statefulness of AccessCase makes sense. So,
1995 I broke it down into three different states and added assertions about the transitions. I
1996 also broke out a separate operation called AccessCase::commit(), which is the work that
1997 cannot be buffered since there cannot be any JS effects between when the AccessCase was
1998 created and when we do the work in commit().
2000 This opens up a fairly obvious path to buffering AccessCases: add them to the list without
2001 regenerating. Then when we do eventually trigger regeneration, those cases will get cloned
2002 and generated automagically. This patch doesn't implement this technique yet, but gives us
2003 an opportunity to independently test the scaffolding necessary to do it.
2005 This is perf-neutral on lots of tests.
2007 * bytecode/PolymorphicAccess.cpp:
2008 (JSC::AccessGenerationResult::dump):
2009 (JSC::AccessCase::clone):
2010 (JSC::AccessCase::commit):
2011 (JSC::AccessCase::guardedByStructureCheck):
2012 (JSC::AccessCase::dump):
2013 (JSC::AccessCase::generateWithGuard):
2014 (JSC::AccessCase::generate):
2015 (JSC::AccessCase::generateImpl):
2016 (JSC::PolymorphicAccess::regenerateWithCases):
2017 (JSC::PolymorphicAccess::regenerate):
2018 (WTF::printInternal):
2019 * bytecode/PolymorphicAccess.h:
2020 (JSC::AccessCase::type):
2021 (JSC::AccessCase::state):
2022 (JSC::AccessCase::offset):
2023 (JSC::AccessCase::viaProxy):
2024 (JSC::AccessCase::callLinkInfo):
2025 * bytecode/StructureStubInfo.cpp:
2026 (JSC::StructureStubInfo::addAccessCase):
2027 * bytecode/Watchpoint.h:
2028 * dfg/DFGOperations.cpp:
2030 (JSC::repatchGetByID):
2031 (JSC::repatchPutByID):
2034 (JSC::VM::dumpRegExpTrace):
2035 (JSC::VM::ensureWatchpointSetForImpureProperty):
2036 (JSC::VM::registerWatchpointForImpureProperty):
2037 (JSC::VM::addImpureProperty):
2040 2016-04-11 Fujii Hironori <Hironori.Fujii@jp.sony.com>
2042 [CMake] Make FOLDER property INHERITED
2043 https://bugs.webkit.org/show_bug.cgi?id=156460
2045 Reviewed by Brent Fulgham.
2048 * shell/CMakeLists.txt:
2049 * shell/PlatformWin.cmake:
2050 Set FOLDER property as a directory property not a target property
2052 2016-04-09 Keith Miller <keith_miller@apple.com>
2054 tryGetById should be supported by the DFG/FTL
2055 https://bugs.webkit.org/show_bug.cgi?id=156378
2057 Reviewed by Filip Pizlo.
2059 This patch adds support for tryGetById in the DFG/FTL. It adds a new DFG node
2060 TryGetById, which acts similarly to the normal GetById DFG node. One key
2061 difference between GetById and TryGetById is that in the LLInt and Baseline
2062 we do not profile the result type. This profiling is unnessary for the current
2063 use case of tryGetById, which is expected to be a strict equality comparision
2064 against a specific object or undefined. In either case other DFG optimizations
2065 will make this equally fast with or without the profiling information.
2067 Additionally, this patch adds new reuse modes for JSValueRegsTemporary that take
2068 an operand and attempt to reuse the registers for that operand if they are free
2069 after the current DFG node.
2071 * bytecode/GetByIdStatus.cpp:
2072 (JSC::GetByIdStatus::computeFromLLInt):
2073 (JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
2074 * dfg/DFGAbstractInterpreterInlines.h:
2075 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
2076 * dfg/DFGByteCodeParser.cpp:
2077 (JSC::DFG::ByteCodeParser::handleGetById):
2078 (JSC::DFG::ByteCodeParser::parseBlock):
2079 * dfg/DFGCapabilities.cpp:
2080 (JSC::DFG::capabilityLevel):
2081 * dfg/DFGClobberize.h:
2082 (JSC::DFG::clobberize):
2083 * dfg/DFGDoesGC.cpp:
2085 * dfg/DFGFixupPhase.cpp:
2086 (JSC::DFG::FixupPhase::fixupNode):
2088 (JSC::DFG::Node::hasIdentifier):
2089 * dfg/DFGNodeType.h:
2090 * dfg/DFGPredictionPropagationPhase.cpp:
2091 (JSC::DFG::PredictionPropagationPhase::propagate):
2092 * dfg/DFGSafeToExecute.h:
2093 (JSC::DFG::safeToExecute):
2094 * dfg/DFGSpeculativeJIT.cpp:
2095 (JSC::DFG::SpeculativeJIT::compileTryGetById):
2096 (JSC::DFG::JSValueRegsTemporary::JSValueRegsTemporary):
2097 * dfg/DFGSpeculativeJIT.h:
2098 (JSC::DFG::GPRTemporary::operator=):
2099 * dfg/DFGSpeculativeJIT32_64.cpp:
2100 (JSC::DFG::SpeculativeJIT::cachedGetById):
2101 (JSC::DFG::SpeculativeJIT::compile):
2102 * dfg/DFGSpeculativeJIT64.cpp:
2103 (JSC::DFG::SpeculativeJIT::cachedGetById):
2104 (JSC::DFG::SpeculativeJIT::compile):
2105 * ftl/FTLCapabilities.cpp:
2106 (JSC::FTL::canCompile):
2107 * ftl/FTLLowerDFGToB3.cpp:
2108 (JSC::FTL::DFG::LowerDFGToB3::compileNode):
2109 (JSC::FTL::DFG::LowerDFGToB3::compileGetById):
2110 (JSC::FTL::DFG::LowerDFGToB3::getById):
2111 * jit/JITOperations.cpp:
2112 * jit/JITOperations.h:
2113 * tests/stress/try-get-by-id.js:
2114 (tryGetByIdTextStrict):
2116 (let.get createBuiltin):
2118 (getCaller.obj.1.throw.new.Error): Deleted.
2120 2016-04-09 Saam barati <sbarati@apple.com>
2122 Allocation sinking SSA Defs are allowed to have replacements
2123 https://bugs.webkit.org/show_bug.cgi?id=156444
2125 Reviewed by Filip Pizlo.
2127 Consider the following program and the annotations that explain why
2128 the SSA defs we create in allocation sinking can have replacements.
2131 let o1 = {x: 20, y: 50};
2132 let o2 = {y: 40, o1: o1};
2135 // We're Defing a new variable here, call it o3_field.
2136 // o3_field is defing the value that is the result of
2137 // a GetByOffset that gets eliminated through allocation sinking.
2142 // This control flow is here to not allow the phase to consult
2143 // its local SSA mapping (which properly handles replacements)
2144 // for the value of o3_field.
2151 // Here, we ask for the reaching def of o3_field, and assert
2152 // it doesn't have a replacement. It does have a replacement
2153 // though. The original Def was the GetByOffset. We replaced
2154 // that GetByOffset with the value of the o1_y variable.
2155 let value = o3.field;
2156 assert(value === 50);
2159 * dfg/DFGObjectAllocationSinkingPhase.cpp:
2160 * tests/stress/allocation-sinking-defs-may-have-replacements.js: Added.
2165 2016-04-09 Commit Queue <commit-queue@webkit.org>
2167 Unreviewed, rolling out r199242.
2168 https://bugs.webkit.org/show_bug.cgi?id=156442
2170 Caused many many leaks (Requested by ap on #webkit).
2174 "Web Inspector: get rid of InspectorBasicValue and
2175 InspectorString subclasses"
2176 https://bugs.webkit.org/show_bug.cgi?id=156407
2177 http://trac.webkit.org/changeset/199242
2179 2016-04-09 Filip Pizlo <fpizlo@apple.com>
2181 Debug JSC test failure: stress/multi-put-by-offset-reallocation-butterfly-cse.js.ftl-no-cjit-small-pool
2182 https://bugs.webkit.org/show_bug.cgi?id=156406
2184 Reviewed by Saam Barati.
2186 The failure was because the GC ran from within the butterfly allocation call in a put_by_id
2187 transition AccessCase that had to deal with indexing storage. When the GC runs in a call from a stub,
2188 then we need to be extra careful:
2190 1) The GC may reset the IC and delete the stub. So, the stub needs to tell the GC that it might be on
2191 the stack during GC, so that the GC keeps it alive if it's currently running.
2193 2) If the stub uses (dereferences or stores) some object after the call, then we need to ensure that
2194 the stub routine knows about that object independently of the IC.
2196 In the case of put_by_id transitions that use a helper to allocate the butterfly, we have both
2197 issues. A long time ago, we had to deal with (2), and we still had code to handle that case, although
2198 it appears to be dead. This change revives that code and glues it together with PolymorphicAccess.
2200 * bytecode/PolymorphicAccess.cpp:
2201 (JSC::AccessCase::alternateBase):
2202 (JSC::AccessCase::doesCalls):
2203 (JSC::AccessCase::couldStillSucceed):
2204 (JSC::AccessCase::generate):
2205 (JSC::PolymorphicAccess::regenerate):
2206 * bytecode/PolymorphicAccess.h:
2207 (JSC::AccessCase::customSlotBase):
2208 (JSC::AccessCase::isGetter):
2209 (JSC::AccessCase::doesCalls): Deleted.
2210 * jit/GCAwareJITStubRoutine.cpp:
2211 (JSC::GCAwareJITStubRoutine::markRequiredObjectsInternal):
2212 (JSC::MarkingGCAwareJITStubRoutine::MarkingGCAwareJITStubRoutine):
2213 (JSC::MarkingGCAwareJITStubRoutine::~MarkingGCAwareJITStubRoutine):
2214 (JSC::MarkingGCAwareJITStubRoutine::markRequiredObjectsInternal):
2215 (JSC::GCAwareJITStubRoutineWithExceptionHandler::GCAwareJITStubRoutineWithExceptionHandler):
2216 (JSC::createJITStubRoutine):
2217 (JSC::MarkingGCAwareJITStubRoutineWithOneObject::MarkingGCAwareJITStubRoutineWithOneObject): Deleted.
2218 (JSC::MarkingGCAwareJITStubRoutineWithOneObject::~MarkingGCAwareJITStubRoutineWithOneObject): Deleted.
2219 (JSC::MarkingGCAwareJITStubRoutineWithOneObject::markRequiredObjectsInternal): Deleted.
2220 * jit/GCAwareJITStubRoutine.h:
2221 (JSC::createJITStubRoutine):
2223 2016-04-08 Joseph Pecoraro <pecoraro@apple.com>
2225 Web Inspector: XHRs and Web Worker scripts are not searchable
2226 https://bugs.webkit.org/show_bug.cgi?id=154214
2227 <rdar://problem/24643587>
2229 Reviewed by Timothy Hatcher.
2231 * inspector/protocol/Page.json:
2232 Add optional requestId to search results properties and search
2233 parameters for when the frameId and url are not enough. XHR
2234 resources, and "Other" resources will use this.
2236 2016-04-08 Guillaume Emont <guijemont@igalia.com>
2238 MIPS: support Signed cond in branchTest32()
2239 https://bugs.webkit.org/show_bug.cgi?id=156260
2241 This is needed since r197688 makes use of it.
2243 Reviewed by Mark Lam.
2245 * assembler/MacroAssemblerMIPS.h:
2246 (JSC::MacroAssemblerMIPS::branchTest32):
2248 2016-04-08 Alex Christensen <achristensen@webkit.org>
2250 Progress towards running CMake WebKit2 on Mac
2251 https://bugs.webkit.org/show_bug.cgi?id=156426
2253 Reviewed by Tim Horton.
2255 * PlatformMac.cmake:
2257 2016-04-08 Saam barati <sbarati@apple.com>
2259 Debugger may dereference m_currentCallFrame even after the VM has gone idle
2260 https://bugs.webkit.org/show_bug.cgi?id=156413
2262 Reviewed by Mark Lam.
2264 There is a bug where the debugger may dereference its m_currentCallFrame
2265 pointer after that pointer becomes invalid to read from. This happens like so:
2267 We may step over an instruction which causes the end of execution for the
2268 current program. This causes the VM to exit. Then, we perform a GC which
2269 causes us to collect the global object. The global object being collected
2270 causes us to detach the debugger. In detaching, we think we still have a
2271 valid m_currentCallFrame, we dereference it, and crash. The solution is to
2272 make sure we're paused when dereferencing this pointer inside ::detach().
2274 * debugger/Debugger.cpp:
2275 (JSC::Debugger::detach):
2277 2016-04-08 Brian Burg <bburg@apple.com>
2279 Web Inspector: get rid of InspectorBasicValue and InspectorString subclasses
2280 https://bugs.webkit.org/show_bug.cgi?id=156407
2281 <rdar://problem/25627659>
2283 Reviewed by Timothy Hatcher.
2285 There's no point having these subclasses as they don't save any space.
2286 Add m_stringValue to the union and merge some implementations of writeJSON.
2287 Move uses of the subclass to InspectorValue and delete redundant methods.
2288 Now, most InspectorValue methods are non-virtual so they can be templated.
2290 * bindings/ScriptValue.cpp:
2291 (Deprecated::jsToInspectorValue):
2292 * inspector/InjectedScriptBase.cpp:
2293 (Inspector::InjectedScriptBase::makeCall):
2294 Don't used deleted subclasses.
2296 * inspector/InspectorValues.cpp:
2297 (Inspector::InspectorValue::null):
2298 (Inspector::InspectorValue::create):
2299 (Inspector::InspectorValue::asValue):
2300 (Inspector::InspectorValue::asBoolean):
2301 (Inspector::InspectorValue::asDouble):
2302 (Inspector::InspectorValue::asInteger):
2303 (Inspector::InspectorValue::asString):
2304 These only need one implementation now.
2306 (Inspector::InspectorValue::writeJSON):
2307 Still a virtual method since Object and Array need their members.
2309 (Inspector::InspectorObjectBase::InspectorObjectBase):
2310 (Inspector::InspectorBasicValue::asBoolean): Deleted.
2311 (Inspector::InspectorBasicValue::asDouble): Deleted.
2312 (Inspector::InspectorBasicValue::asInteger): Deleted.
2313 (Inspector::InspectorBasicValue::writeJSON): Deleted.
2314 (Inspector::InspectorString::asString): Deleted.
2315 (Inspector::InspectorString::writeJSON): Deleted.
2316 (Inspector::InspectorString::create): Deleted.
2317 (Inspector::InspectorBasicValue::create): Deleted.
2319 * inspector/InspectorValues.h:
2320 (Inspector::InspectorObjectBase::setBoolean):
2321 (Inspector::InspectorObjectBase::setInteger):
2322 (Inspector::InspectorObjectBase::setDouble):
2323 (Inspector::InspectorObjectBase::setString):
2324 (Inspector::InspectorArrayBase::pushBoolean):
2325 (Inspector::InspectorArrayBase::pushInteger):
2326 (Inspector::InspectorArrayBase::pushDouble):
2327 (Inspector::InspectorArrayBase::pushString):
2328 Use new factory methods.
2330 * replay/EncodedValue.cpp:
2331 (JSC::ScalarEncodingTraits<bool>::encodeValue):
2332 (JSC::ScalarEncodingTraits<double>::encodeValue):
2333 (JSC::ScalarEncodingTraits<float>::encodeValue):
2334 (JSC::ScalarEncodingTraits<int32_t>::encodeValue):
2335 (JSC::ScalarEncodingTraits<int64_t>::encodeValue):
2336 (JSC::ScalarEncodingTraits<uint32_t>::encodeValue):
2337 (JSC::ScalarEncodingTraits<uint64_t>::encodeValue):
2338 * replay/EncodedValue.h:
2339 Use new factory methods.
2341 2016-04-08 Filip Pizlo <fpizlo@apple.com>
2343 Add IC support for arguments.length
2344 https://bugs.webkit.org/show_bug.cgi?id=156389
2346 Reviewed by Geoffrey Garen.
2348 This adds support for caching accesses to arguments.length for both DirectArguments and
2349 ScopedArguments. In strict mode, we already cached these accesses since they were just
2352 Amazingly, we also already supported caching of overridden arguments.length in both
2353 DirectArguments and ScopedArguments. This is because when you override, the property gets
2354 materialized as a normal JS property and the structure is changed.
2356 This patch painstakingly preserves our previous caching of overridden length while
2357 introducing caching of non-overridden length (i.e. the common case). In fact, we even cache
2358 the case where it could either be overridden or not, since we just end up with an AccessCase
2359 for each and they cascade to each other.
2361 This is a >3x speed-up on microbenchmarks that do arguments.length in a polymorphic context.
2362 Entirely monomorphic accesses were already handled by the DFG.
2364 * bytecode/PolymorphicAccess.cpp:
2365 (JSC::AccessGenerationState::calculateLiveRegistersForCallAndExceptionHandling):
2366 (JSC::AccessCase::guardedByStructureCheck):
2367 (JSC::AccessCase::generateWithGuard):
2368 (JSC::AccessCase::generate):
2369 (WTF::printInternal):
2370 * bytecode/PolymorphicAccess.h:
2372 * jit/JITOperations.cpp:
2374 (JSC::tryCacheGetByID):
2375 (JSC::tryCachePutByID):
2376 (JSC::tryRepatchIn):
2377 * tests/stress/direct-arguments-override-length-then-access-normal-length.js: Added.
2382 2016-04-08 Benjamin Poulain <bpoulain@apple.com>
2384 UInt32ToNumber should have an Int52 path
2385 https://bugs.webkit.org/show_bug.cgi?id=125704
2387 Reviewed by Filip Pizlo.
2389 When dealing with big numbers, fall back to Int52 instead
2390 of double when possible.
2392 * dfg/DFGAbstractInterpreterInlines.h:
2393 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
2394 * dfg/DFGFixupPhase.cpp:
2395 (JSC::DFG::FixupPhase::fixupNode):
2396 * dfg/DFGPredictionPropagationPhase.cpp:
2397 (JSC::DFG::PredictionPropagationPhase::propagate):
2398 * dfg/DFGSpeculativeJIT.cpp:
2399 (JSC::DFG::SpeculativeJIT::compileUInt32ToNumber):
2400 * ftl/FTLLowerDFGToB3.cpp:
2401 (JSC::FTL::DFG::LowerDFGToB3::compileUInt32ToNumber):
2403 2016-04-08 Brian Burg <bburg@apple.com>
2405 Web Inspector: protocol generator should emit an error when 'type' is used instead of '$ref'
2406 https://bugs.webkit.org/show_bug.cgi?id=156275
2407 <rdar://problem/25569331>
2409 Reviewed by Darin Adler.
2411 * inspector/protocol/Heap.json: Fix a mistake that's now caught by the protocol generator.
2413 * inspector/scripts/codegen/models.py:
2414 (TypeReference.__init__): Check here if type_kind is on a whitelist of primitive types.
2415 (TypeReference.referenced_name): Update comment.
2417 Add a new test specifically for the case when the type would otherwise be resolved. Rebaseline.
2419 * inspector/scripts/tests/expected/fail-on-type-reference-as-primitive-type.json-error: Added.
2420 * inspector/scripts/tests/expected/fail-on-unknown-type-reference-in-type-declaration.json-error:
2421 * inspector/scripts/tests/fail-on-type-reference-as-primitive-type.json: Added.
2423 2016-04-07 Joseph Pecoraro <pecoraro@apple.com>
2425 Remove ENABLE(ENABLE_ES6_CLASS_SYNTAX) guards
2426 https://bugs.webkit.org/show_bug.cgi?id=156384
2428 Reviewed by Ryosuke Niwa.
2430 * Configurations/FeatureDefines.xcconfig:
2431 * features.json: Mark as Done.
2432 * parser/Parser.cpp:
2433 (JSC::Parser<LexerType>::parseExportDeclaration):
2434 (JSC::Parser<LexerType>::parseStatementListItem):
2435 (JSC::Parser<LexerType>::parsePrimaryExpression):
2436 (JSC::Parser<LexerType>::parseMemberExpression):
2438 2016-04-07 Filip Pizlo <fpizlo@apple.com>
2440 Implementing caching transition puts that need to reallocate with indexing storage
2441 https://bugs.webkit.org/show_bug.cgi?id=130914
2443 Reviewed by Saam Barati.
2445 This enables the IC's put_by_id path to handle reallocating the out-of-line storage even if
2446 the butterfly has indexing storage. Like the DFG, we do this by calling operations that
2447 reallocate the butterfly. Those use JSObject API and do all of the nasty work for us, like
2448 triggering a barrier.
2450 This does a bunch of refactoring to how PolymorphicAccess makes calls. It's a lot easier to
2451 do it now because the hard work is hidden under AccessGenerationState methods. This means
2452 that custom accessors now share logic with put_by_id transitions.
2454 * bytecode/PolymorphicAccess.cpp:
2455 (JSC::AccessGenerationState::succeed):
2456 (JSC::AccessGenerationState::calculateLiveRegistersForCallAndExceptionHandling):
2457 (JSC::AccessGenerationState::preserveLiveRegistersToStackForCall):
2458 (JSC::AccessGenerationState::originalCallSiteIndex):
2459 (JSC::AccessGenerationState::emitExplicitExceptionHandler):
2460 (JSC::AccessCase::AccessCase):
2461 (JSC::AccessCase::transition):
2462 (JSC::AccessCase::generate):
2463 (JSC::PolymorphicAccess::regenerate):
2464 * bytecode/PolymorphicAccess.h:
2465 (JSC::AccessGenerationState::needsToRestoreRegistersIfException):
2466 (JSC::AccessGenerationState::liveRegistersToPreserveAtExceptionHandlingCallSite):
2467 * dfg/DFGOperations.cpp:
2468 * dfg/DFGOperations.h:
2469 * jit/JITOperations.cpp:
2470 * jit/JITOperations.h:
2472 2016-04-07 Joseph Pecoraro <pecoraro@apple.com>
2474 Remote Inspector: When disallowing remote inspection on a debuggable, a listing is still sent to debuggers
2475 https://bugs.webkit.org/show_bug.cgi?id=156380
2476 <rdar://problem/25323727>
2478 Reviewed by Timothy Hatcher.
2480 * inspector/remote/RemoteInspector.mm:
2481 (Inspector::RemoteInspector::updateTarget):
2482 (Inspector::RemoteInspector::updateAutomaticInspectionCandidate):
2483 When a target has been updated and it no longer generates a listing,
2484 we should remove the old listing as that is now stale and should
2485 not be sent. Not generating a listing means this target is no
2486 longer allowed to be debugged.
2488 2016-04-07 Joseph Pecoraro <pecoraro@apple.com>
2490 Web Inspector: Not necessary to validate webinspectord connection on iOS
2491 https://bugs.webkit.org/show_bug.cgi?id=156377
2492 <rdar://problem/25612460>
2494 Reviewed by Simon Fraser.
2496 * inspector/remote/RemoteInspectorXPCConnection.h:
2497 * inspector/remote/RemoteInspectorXPCConnection.mm:
2498 (Inspector::RemoteInspectorXPCConnection::handleEvent):
2500 2016-04-07 Keith Miller <keith_miller@apple.com>
2502 Rename ArrayMode::supportsLength to supportsSelfLength
2503 https://bugs.webkit.org/show_bug.cgi?id=156374
2505 Reviewed by Filip Pizlo.
2507 The name supportsLength is confusing because TypedArray have a
2508 length function however it is on the prototype and not on the
2509 instance. supportsSelfLength makes more sense since we use the
2510 function during fixup to tell if we can intrinsic the length
2511 property lookup on self accesses.
2513 * dfg/DFGArrayMode.h:
2514 (JSC::DFG::ArrayMode::supportsSelfLength):
2515 (JSC::DFG::ArrayMode::supportsLength): Deleted.
2516 * dfg/DFGFixupPhase.cpp:
2517 (JSC::DFG::FixupPhase::attemptToMakeGetArrayLength):
2519 2016-04-07 Joseph Pecoraro <pecoraro@apple.com>
2521 Web Inspector: ProfileView source links are off by 1 line, worse in pretty printed code
2522 https://bugs.webkit.org/show_bug.cgi?id=156371
2524 Reviewed by Timothy Hatcher.
2526 * inspector/protocol/ScriptProfiler.json:
2527 Clarify that these locations are 1-based.
2529 2016-04-07 Jon Davis <jond@apple.com>
2531 Add Web Animations API to Feature Status Page
2532 https://bugs.webkit.org/show_bug.cgi?id=156360
2534 Reviewed by Timothy Hatcher.
2538 2016-04-07 Saam barati <sbarati@apple.com>
2540 Invalid assertion inside DebuggerScope::getOwnPropertySlot
2541 https://bugs.webkit.org/show_bug.cgi?id=156357
2543 Reviewed by Keith Miller.
2545 The Type Profiler might profile JS code that uses DebuggerScope and accesses properties
2546 on it. Therefore, it may have a DebuggerScope object in its log. Objects in the log
2547 are subject to having their getOwnPropertySlot method called. Therefore, the DebuggerScope
2548 might not always be in a valid state when its getOwnPropertySlot method is called.
2549 Therefore, the assertion invalid.
2551 * debugger/DebuggerScope.cpp:
2552 (JSC::DebuggerScope::getOwnPropertySlot):
2554 2016-04-07 Saam barati <sbarati@apple.com>
2556 Initial implementation of annex b.3.3 behavior was incorrect
2557 https://bugs.webkit.org/show_bug.cgi?id=156276
2559 Reviewed by Keith Miller.
2561 I almost got annex B.3.3 correct in my first implementation.
2562 There is a subtlety here I got wrong. We always create a local binding for
2563 a function at the very beginning of execution of a block scope. So we
2564 hoist function declarations to their local binding within a given
2565 block scope. When we actually evaluate the function declaration statement
2566 itself, we must lookup the binding in the current scope, and bind the
2567 value to the binding in the "var" scope. We perform the following
2568 abstract operations when executing a function declaration statement.
2570 f = lookupBindingInCurrentScope("func")
2571 store(varScope, "func", f)
2573 I got this wrong by performing the store to the var binding at the beginning
2574 of the block scope instead of when we evaluate the function declaration statement.
2575 This behavior is observable. For example, a program could change the value
2576 of "func" before the actual function declaration statement executes.
2577 Consider the following two functions:
2580 // func === undefined
2582 // typeof func === "function"
2583 function func() { } // Executing this statement binds the local "func" binding to the implicit "func" var binding.
2584 func = 20 // This sets the local "func" binding to 20.
2586 // typeof func === "function"
2590 // func === undefined
2592 // typeof func === "function"
2593 func = 20 // This sets the local "func" binding to 20.
2594 function func() { } // Executing this statement binds the local "func" binding to the implicit "func" var binding.
2600 * bytecompiler/BytecodeGenerator.cpp:
2601 (JSC::BytecodeGenerator::initializeBlockScopedFunctions):
2602 (JSC::BytecodeGenerator::hoistSloppyModeFunctionIfNecessary):
2603 * bytecompiler/BytecodeGenerator.h:
2604 (JSC::BytecodeGenerator::emitNodeForLeftHandSide):
2605 * bytecompiler/NodesCodegen.cpp:
2606 (JSC::FuncDeclNode::emitBytecode):
2607 * tests/stress/sloppy-mode-function-hoisting.js:
2612 (test.switch.case.0):
2614 (test.switch.capFoo2):
2618 2016-04-07 Alex Christensen <achristensen@webkit.org>
2620 Build fix after r199170
2624 2016-04-07 Keith Miller <keith_miller@apple.com>
2626 We should support the ability to do a non-effectful getById
2627 https://bugs.webkit.org/show_bug.cgi?id=156116
2629 Reviewed by Benjamin Poulain.
2631 Currently, there is no way in JS to do a non-effectful getById. A non-effectful getById is
2632 useful because it enables us to take different code paths based on values that we would
2633 otherwise not be able to have knowledge of. This patch adds this new feature called
2634 try_get_by_id that will attempt to do as much of a get_by_id as possible without performing
2635 an effectful behavior. Thus, try_get_by_id will return the value if the slot is a value, the
2636 GetterSetter object if the slot is a normal accessor (not a CustomGetterSetter) and
2637 undefined if the slot is unset. If the slot is proxied or any other cases then the result
2638 is null. In theory, if we ever wanted to check for null we could add a sentinal object to
2639 the global object that indicates we could not get the result.
2641 In order to implement this feature we add a new enum GetByIdKind that indicates what to do
2642 for accessor properties in PolymorphicAccess. If the GetByIdKind is pure then we treat the
2643 get_by_id the same way we would for load and return the value at the appropriate offset.
2644 Additionally, in order to make sure the we can properly compare the GetterSetter object
2645 with === GetterSetters are now JSObjects. This comes at the cost of eight extra bytes on the
2646 GetterSetter object but it vastly simplifies the patch. Additionally, the extra bytes are
2647 likely to have little to no impact on memory usage as normal accessors are generally rare.
2649 * JavaScriptCore.xcodeproj/project.pbxproj:
2650 * builtins/BuiltinExecutableCreator.cpp: Added.
2651 (JSC::createBuiltinExecutable):
2652 * builtins/BuiltinExecutableCreator.h: Copied from Source/JavaScriptCore/builtins/BuiltinExecutables.h.
2653 * builtins/BuiltinExecutables.cpp:
2654 (JSC::BuiltinExecutables::createDefaultConstructor):
2655 (JSC::BuiltinExecutables::createBuiltinExecutable):
2656 (JSC::createBuiltinExecutable):
2657 (JSC::BuiltinExecutables::createExecutable):
2658 (JSC::createExecutableInternal): Deleted.
2659 * builtins/BuiltinExecutables.h:
2660 * bytecode/BytecodeIntrinsicRegistry.h:
2661 * bytecode/BytecodeList.json:
2662 * bytecode/BytecodeUseDef.h:
2663 (JSC::computeUsesForBytecodeOffset):
2664 (JSC::computeDefsForBytecodeOffset):
2665 * bytecode/CodeBlock.cpp:
2666 (JSC::CodeBlock::dumpBytecode):
2667 * bytecode/PolymorphicAccess.cpp:
2668 (JSC::AccessCase::tryGet):
2669 (JSC::AccessCase::generate):
2670 (WTF::printInternal):
2671 * bytecode/PolymorphicAccess.h:
2672 (JSC::AccessCase::isGet): Deleted.
2673 (JSC::AccessCase::isPut): Deleted.
2674 (JSC::AccessCase::isIn): Deleted.
2675 * bytecode/StructureStubInfo.cpp:
2676 (JSC::StructureStubInfo::reset):
2677 * bytecode/StructureStubInfo.h:
2678 * bytecompiler/BytecodeGenerator.cpp:
2679 (JSC::BytecodeGenerator::emitTryGetById):
2680 * bytecompiler/BytecodeGenerator.h:
2681 * bytecompiler/NodesCodegen.cpp:
2682 (JSC::BytecodeIntrinsicNode::emit_intrinsic_tryGetById):
2683 * dfg/DFGSpeculativeJIT32_64.cpp:
2684 (JSC::DFG::SpeculativeJIT::cachedGetById):
2685 * dfg/DFGSpeculativeJIT64.cpp:
2686 (JSC::DFG::SpeculativeJIT::cachedGetById):
2687 * ftl/FTLLowerDFGToB3.cpp:
2688 (JSC::FTL::DFG::LowerDFGToB3::getById):
2690 (JSC::JIT::privateCompileMainPass):
2691 (JSC::JIT::privateCompileSlowCases):
2693 * jit/JITInlineCacheGenerator.cpp:
2694 (JSC::JITGetByIdGenerator::JITGetByIdGenerator):
2695 * jit/JITInlineCacheGenerator.h:
2697 (JSC::JIT::callOperation):
2698 * jit/JITOperations.cpp:
2699 * jit/JITOperations.h:
2700 * jit/JITPropertyAccess.cpp:
2701 (JSC::JIT::emitGetByValWithCachedId):
2702 (JSC::JIT::emit_op_try_get_by_id):
2703 (JSC::JIT::emitSlow_op_try_get_by_id):
2704 (JSC::JIT::emit_op_get_by_id):
2705 * jit/JITPropertyAccess32_64.cpp:
2706 (JSC::JIT::emitGetByValWithCachedId):
2707 (JSC::JIT::emit_op_try_get_by_id):
2708 (JSC::JIT::emitSlow_op_try_get_by_id):
2709 (JSC::JIT::emit_op_get_by_id):
2711 (JSC::repatchByIdSelfAccess):
2712 (JSC::appropriateOptimizingGetByIdFunction):
2713 (JSC::appropriateGenericGetByIdFunction):
2714 (JSC::tryCacheGetByID):
2715 (JSC::repatchGetByID):
2716 (JSC::resetGetByID):
2719 (GlobalObject::finishCreation):
2720 (functionGetGetterSetter):
2721 (functionCreateBuiltin):
2722 * llint/LLIntData.cpp:
2723 (JSC::LLInt::Data::performAssertions):
2724 * llint/LLIntSlowPaths.cpp:
2725 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
2726 * llint/LLIntSlowPaths.h:
2727 * llint/LowLevelInterpreter.asm:
2728 * runtime/GetterSetter.cpp:
2729 * runtime/GetterSetter.h:
2731 * runtime/PropertySlot.cpp:
2732 (JSC::PropertySlot::getPureResult):
2733 * runtime/PropertySlot.h:
2734 * runtime/ProxyObject.cpp:
2735 (JSC::ProxyObject::getOwnPropertySlotCommon):
2736 * tests/stress/try-get-by-id.js: Added.
2738 (getCaller.obj.1.throw.new.Error.let.func):
2739 (getCaller.obj.1.throw.new.Error):
2740 (throw.new.Error.get let):
2742 (throw.new.Error.let.get createBuiltin):
2744 (let.get createBuiltin):
2749 2016-04-07 Filip Pizlo <fpizlo@apple.com>
2751 Rationalize the makeSpaceForCCall stuff
2752 https://bugs.webkit.org/show_bug.cgi?id=156352
2754 Reviewed by Mark Lam.
2756 I want to add more code to PolymorphicAccess that makes C calls, so that I can finally fix
2757 https://bugs.webkit.org/show_bug.cgi?id=130914 (allow transition caches to handle indexing
2760 When trying to understand what it takes to make a C call, I came across code that was making
2761 room on the stack for spilled arguments. This logic was guarded with some complicated
2762 condition. At first, I tried to just refactor the code so that the same ugly condition
2763 wouldn't have to be copy-pasted everywhere that we made C calls. But then I started thinking
2764 about the condition, and realized that it was probably wrong: if the outer PolymorphicAccess
2765 harness decides to reuse a register for the scratchGPR then the top of the stack will store
2766 the old value of scratchGPR, but the condition wouldn't necessarily trigger. So if the call
2767 then overwrote something on the stack, we'd have a bad time.
2769 Making room on the stack for a call is a cheap operation. It's orders of magnitude cheaper
2770 than the rest of the call. Therefore, I think that it's best to just unconditionally make
2773 This patch makes us do just that. I also made the relevant helpers not inline, because I
2774 think that we have too many inline methods in our assemblers. Now it's much easier to make
2775 C calls from PolymorphicAccess because you just call the AssemblyHelper methods for making
2776 space. There are no special conditions or anything like that.
2778 * bytecode/PolymorphicAccess.cpp:
2779 (JSC::AccessCase::generate):
2780 * jit/AssemblyHelpers.cpp:
2781 (JSC::AssemblyHelpers::emitLoadStructure):
2782 (JSC::AssemblyHelpers::makeSpaceOnStackForCCall):
2783 (JSC::AssemblyHelpers::reclaimSpaceOnStackForCCall):
2784 (JSC::emitRandomThunkImpl):
2785 * jit/AssemblyHelpers.h:
2786 (JSC::AssemblyHelpers::makeSpaceOnStackForCCall): Deleted.
2787 (JSC::AssemblyHelpers::reclaimSpaceOnStackForCCall): Deleted.
2789 2016-04-07 Commit Queue <commit-queue@webkit.org>
2791 Unreviewed, rolling out r199128 and r199141.
2792 https://bugs.webkit.org/show_bug.cgi?id=156348
2794 Causes crashes on multiple webpages (Requested by keith_mi_ on
2797 Reverted changesets:
2799 "[ES6] Add support for Symbol.isConcatSpreadable."
2800 https://bugs.webkit.org/show_bug.cgi?id=155351
2801 http://trac.webkit.org/changeset/199128
2803 "Unreviewed, uncomment accidentally commented line in test."
2804 http://trac.webkit.org/changeset/199141
2806 2016-04-07 Filip Pizlo <fpizlo@apple.com>
2808 Rationalize the handling of PutById transitions a bit
2809 https://bugs.webkit.org/show_bug.cgi?id=156330
2811 Reviewed by Mark Lam.
2813 * bytecode/PolymorphicAccess.cpp:
2814 (JSC::AccessCase::generate): Get rid of the specialized slow calls. We can just use the failAndIgnore jump target. We just need to make sure that we don't make observable effects until we're done with all of the fast path checks.
2815 * bytecode/StructureStubInfo.cpp:
2816 (JSC::StructureStubInfo::addAccessCase): MadeNoChanges indicates that we should keep trying to repatch. Currently PutById transitions might trigger the case that addAccessCase() sees null, if the transition involves an indexing header. Doing repatching in that case is probably not good. But, we should just fix this the right way eventually.
2818 2016-04-07 Per Arne Vollan <peavo@outlook.com>
2820 [Win] Fix for JSC stress test failures.
2821 https://bugs.webkit.org/show_bug.cgi?id=156343
2823 Reviewed by Filip Pizlo.
2825 We need to make it clear to MSVC that the method loadPtr(ImplicitAddress address, RegisterID dest)
2826 should be used, and not loadPtr(const void* address, RegisterID dest).
2828 * jit/CCallHelpers.cpp:
2829 (JSC::CCallHelpers::setupShadowChickenPacket):
2831 2016-04-06 Benjamin Poulain <bpoulain@apple.com>
2833 [JSC] UInt32ToNumber should be NodeMustGenerate
2834 https://bugs.webkit.org/show_bug.cgi?id=156329
2836 Reviewed by Filip Pizlo.
2838 It exits on negative numbers on the integer path.
2840 * dfg/DFGFixupPhase.cpp:
2841 (JSC::DFG::FixupPhase::fixupNode):
2842 * dfg/DFGNodeType.h:
2844 2016-04-04 Geoffrey Garen <ggaren@apple.com>
2846 Unreviewed, rolling out r199016.
2847 https://bugs.webkit.org/show_bug.cgi?id=156140
2849 "Perf bots are down, so I can't re-land this right now."
2853 CopiedBlock should be 16kB
2854 https://bugs.webkit.org/show_bug.cgi?id=156168
2855 http://trac.webkit.org/changeset/199016
2857 2016-04-06 Mark Lam <mark.lam@apple.com>
2859 String.prototype.match() should be calling internal function RegExpCreate.
2860 https://bugs.webkit.org/show_bug.cgi?id=156318
2862 Reviewed by Filip Pizlo.
2864 RegExpCreate is not the same as the RegExp constructor. The current implementation
2865 invokes new @RegExp which calls the constructor. This results in failures in
2866 es6/Proxy_internal_get_calls_String.prototype.match.js, and
2867 es6/Proxy_internal_get_calls_String.prototype.search.js due to observable side
2870 This patch fixes this by factoring out the part of the RegExp constructor that
2871 makes the RegExpCreate function, and changing String's match and search to call
2872 RegExpCreate instead in accordance with the ES6 spec.
2874 * builtins/StringPrototype.js:
2877 * runtime/CommonIdentifiers.h:
2878 * runtime/JSGlobalObject.cpp:
2879 (JSC::JSGlobalObject::init):
2880 * runtime/RegExpConstructor.cpp:
2882 (JSC::regExpCreate):
2883 (JSC::constructRegExp):
2884 (JSC::esSpecRegExpCreate):
2885 (JSC::constructWithRegExpConstructor):
2886 * runtime/RegExpConstructor.h:
2889 2016-04-06 Keith Miller <keith_miller@apple.com>
2891 Unreviewed, uncomment accidentally commented line in test.
2893 * tests/stress/array-concat-spread-object.js:
2895 2016-04-06 Filip Pizlo <fpizlo@apple.com>
2897 JSC should have a simple way of gathering IC statistics
2898 https://bugs.webkit.org/show_bug.cgi?id=156317
2900 Reviewed by Benjamin Poulain.
2902 This adds a cheap, runtime-enabled way of gathering statistics about why we take the slow
2903 paths for inline caches. This is complementary to our existing bytecode profiler. Eventually
2904 we may want to combine the two things.
2906 This is not a slow-down on anything because we only do extra work on IC slow paths and if
2907 it's disabled it's just a load-and-branch to skip the stats gathering code.
2910 * JavaScriptCore.xcodeproj/project.pbxproj:
2911 * jit/ICStats.cpp: Added.
2912 * jit/ICStats.h: Added.
2913 * jit/JITOperations.cpp:
2914 * runtime/JSCJSValue.h:
2915 * runtime/JSCJSValueInlines.h:
2916 (JSC::JSValue::inherits):
2917 (JSC::JSValue::classInfoOrNull):
2918 (JSC::JSValue::toThis):
2919 * runtime/Options.h:
2921 2016-04-06 Filip Pizlo <fpizlo@apple.com>
2923 32-bit JSC stress/multi-put-by-offset-multiple-transitions.js failing
2924 https://bugs.webkit.org/show_bug.cgi?id=156292
2926 Reviewed by Benjamin Poulain.
2928 Make sure that we stash the callsite index before calling operationReallocateStorageAndFinishPut.
2930 * bytecode/PolymorphicAccess.cpp:
2931 (JSC::AccessCase::generate):
2933 2016-04-06 Filip Pizlo <fpizlo@apple.com>
2935 JSC test stress/arrowfunction-lexical-bind-superproperty.js failing
2936 https://bugs.webkit.org/show_bug.cgi?id=156309
2938 Reviewed by Saam Barati.
2940 Just be honest about the fact that the ArgumentCount and Callee parts of inline callframe runtime
2941 meta-data can be read at any time.
2943 We only have to say this for the inline callframe forms of ArgumentCount and Callee because we don't
2944 sink any part of the machine prologue. This change just prevents us from sinking the pseudoprologue
2945 of inlined varargs or closure calls.
2947 Shockingly, this is not a regression on anything.
2949 * dfg/DFGClobberize.h:
2950 (JSC::DFG::clobberize):
2952 2016-03-29 Keith Miller <keith_miller@apple.com>
2954 [ES6] Add support for Symbol.isConcatSpreadable.
2955 https://bugs.webkit.org/show_bug.cgi?id=155351
2957 Reviewed by Saam Barati.
2959 This patch adds support for Symbol.isConcatSpreadable. In order to do so it was necessary to move the
2960 Array.prototype.concat function to JS. A number of different optimizations were needed to make such the move to
2961 a builtin performant. First, four new DFG intrinsics were added.
2963 1) IsArrayObject (I would have called it IsArray but we use the same name for an IndexingType): an intrinsic of
2964 the Array.isArray function.
2965 2) IsJSArray: checks the first child is a JSArray object.
2966 3) IsArrayConstructor: checks the first child is an instance of ArrayConstructor.
2967 4) CallObjectConstructor: an intrinsic of the Object constructor.
2969 IsActualObject, IsJSArray, and CallObjectConstructor can all be converted into constants in the abstract interpreter if
2970 we are able to prove that the first child is an Array or for ToObject an Object.
2972 In order to further improve the perfomance we also now cover more indexing types in our fast path memcpy
2973 code. Before we would only memcpy Arrays if they had the same indexing type and did not have Array storage and
2974 were not undecided. Now the memcpy code covers the following additional two cases: One array is undecided and
2975 the other is a non-array storage and the case where one array is Int32 and the other is contiguous (we map this
2976 into a contiguous array).
2978 This patch also adds a new fast path for concat with more than one array argument by using memcpy to append
2979 values onto the result array. This works roughly the same as the two array fast path using the same methodology
2980 to decide if we can memcpy the other butterfly into the result butterfly.
2982 Two new debugging tools are also added to the jsc cli. One is a version of the print function with a private
2983 name so it can be used for debugging builtins. The other is dumpDataLog, which takes a JSValue and runs our
2984 dataLog function on it.
2986 Finally, this patch add a new constructor to JSValueRegsTemporary that allows it to reuse the the registers of a
2987 JSValueOperand if the operand's use count is one.
2989 * JavaScriptCore.xcodeproj/project.pbxproj:
2990 * builtins/ArrayPrototype.js:
2993 * bytecode/BytecodeIntrinsicRegistry.cpp:
2994 (JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
2995 * bytecode/BytecodeIntrinsicRegistry.h:
2996 * dfg/DFGAbstractInterpreterInlines.h:
2997 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
2998 * dfg/DFGByteCodeParser.cpp:
2999 (JSC::DFG::ByteCodeParser::handleIntrinsicCall):
3000 (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
3001 * dfg/DFGClobberize.h:
3002 (JSC::DFG::clobberize):
3003 * dfg/DFGDoesGC.cpp:
3005 * dfg/DFGFixupPhase.cpp:
3006 (JSC::DFG::FixupPhase::fixupNode):
3007 * dfg/DFGNodeType.h:
3008 * dfg/DFGOperations.cpp:
3009 * dfg/DFGOperations.h:
3010 * dfg/DFGPredictionPropagationPhase.cpp:
3011 (JSC::DFG::PredictionPropagationPhase::propagate):
3012 * dfg/DFGSafeToExecute.h:
3013 (JSC::DFG::safeToExecute):
3014 * dfg/DFGSpeculativeJIT.cpp:
3015 (JSC::DFG::SpeculativeJIT::compileCurrentBlock):
3016 (JSC::DFG::SpeculativeJIT::compileIsJSArray):
3017 (JSC::DFG::SpeculativeJIT::compileIsArrayObject):
3018 (JSC::DFG::SpeculativeJIT::compileIsArrayConstructor):
3019 (JSC::DFG::SpeculativeJIT::compileCallObjectConstructor):
3020 * dfg/DFGSpeculativeJIT.h:
3021 (JSC::DFG::SpeculativeJIT::callOperation):
3022 * dfg/DFGSpeculativeJIT32_64.cpp:
3023 (JSC::DFG::SpeculativeJIT::compile):
3024 * dfg/DFGSpeculativeJIT64.cpp:
3025 (JSC::DFG::SpeculativeJIT::compile):
3026 * ftl/FTLCapabilities.cpp:
3027 (JSC::FTL::canCompile):
3028 * ftl/FTLLowerDFGToB3.cpp:
3029 (JSC::FTL::DFG::LowerDFGToB3::compileNode):
3030 (JSC::FTL::DFG::LowerDFGToB3::compileCallObjectConstructor):
3031 (JSC::FTL::DFG::LowerDFGToB3::compileIsArrayObject):
3032 (JSC::FTL::DFG::LowerDFGToB3::compileIsJSArray):
3033 (JSC::FTL::DFG::LowerDFGToB3::compileIsArrayConstructor):
3034 (JSC::FTL::DFG::LowerDFGToB3::isArray):
3035 * jit/JITOperations.h:
3037 (WTF::RuntimeArray::createStructure):
3038 (GlobalObject::finishCreation):
3040 (functionDataLogValue):
3041 * runtime/ArrayConstructor.cpp:
3042 (JSC::ArrayConstructor::finishCreation):
3043 (JSC::arrayConstructorPrivateFuncIsArrayConstructor):
3044 * runtime/ArrayConstructor.h:
3045 (JSC::isArrayConstructor):
3046 * runtime/ArrayPrototype.cpp:
3047 (JSC::ArrayPrototype::finishCreation):
3048 (JSC::arrayProtoPrivateFuncIsJSArray):
3049 (JSC::moveElements):
3050 (JSC::arrayProtoPrivateFuncConcatMemcpy):
3051 (JSC::arrayProtoPrivateFuncAppendMemcpy):
3052 (JSC::arrayProtoFuncConcat): Deleted.
3053 * runtime/ArrayPrototype.h:
3054 (JSC::ArrayPrototype::createStructure):
3055 * runtime/CommonIdentifiers.h:
3056 * runtime/Intrinsic.h:
3057 * runtime/JSArray.cpp:
3058 (JSC::JSArray::appendMemcpy):
3059 (JSC::JSArray::fastConcatWith): Deleted.
3060 * runtime/JSArray.h:
3061 (JSC::JSArray::createStructure):
3062 (JSC::JSArray::fastConcatType): Deleted.
3063 * runtime/JSArrayInlines.h: Added.
3064 (JSC::JSArray::memCopyWithIndexingType):
3065 (JSC::JSArray::canFastCopy):
3066 * runtime/JSGlobalObject.cpp:
3067 (JSC::JSGlobalObject::init):
3069 * runtime/ObjectConstructor.h:
3070 (JSC::constructObject):
3072 * tests/stress/array-concat-spread-object.js: Added.
3074 * tests/stress/array-concat-spread-proxy-exception-check.js: Added.
3076 * tests/stress/array-concat-spread-proxy.js: Added.
3078 * tests/stress/array-concat-with-slow-indexingtypes.js: Added.
3080 * tests/stress/array-species-config-array-constructor.js:
3082 2016-04-06 Commit Queue <commit-queue@webkit.org>
3084 Unreviewed, rolling out r199070.
3085 https://bugs.webkit.org/show_bug.cgi?id=156324
3087 "It didn't fix the timeout" (Requested by saamyjoon on
3092 "jsc-layout-tests.yaml/js/script-tests/regress-141098.js
3093 failing on Yosemite Debug after r198989"
3094 https://bugs.webkit.org/show_bug.cgi?id=156187
3095 http://trac.webkit.org/changeset/199070
3097 2016-04-06 Geoffrey Garen <ggaren@apple.com>
3099 Unreviewed, rolling in r199016.
3100 https://bugs.webkit.org/show_bug.cgi?id=156140
3102 It might work this time without regression because 16kB aligned requests
3103 now take the allocation fast path.
3107 CopiedBlock should be 16kB
3108 https://bugs.webkit.org/show_bug.cgi?id=156168
3109 http://trac.webkit.org/changeset/199016
3111 2016-04-06 Mark Lam <mark.lam@apple.com>
3113 Update es6.yaml to expect es6/Proxy_internal_get_calls_RegExp_constructor.js to pass.
3114 https://bugs.webkit.org/show_bug.cgi?id=156314
3116 Reviewed by Saam Barati.
3120 2016-04-06 Commit Queue <commit-queue@webkit.org>
3122 Unreviewed, rolling out r199104.
3123 https://bugs.webkit.org/show_bug.cgi?id=156301
3125 Still breaks internal builds (Requested by keith_miller on
3130 "We should support the ability to do a non-effectful getById"
3131 https://bugs.webkit.org/show_bug.cgi?id=156116
3132 http://trac.webkit.org/changeset/199104
3134 2016-04-06 Keith Miller <keith_miller@apple.com>
3136 RegExp constructor should use Symbol.match and other properties
3137 https://bugs.webkit.org/show_bug.cgi?id=155873
3139 Reviewed by Michael Saboff.
3141 This patch updates the behavior of the RegExp constructor. Now the constructor
3142 should get the Symbol.match property and check if it exists to decide if something
3143 should be constructed like a regexp object.
3145 * runtime/RegExpConstructor.cpp:
3147 (JSC::constructRegExp):
3148 (JSC::constructWithRegExpConstructor):
3149 (JSC::callRegExpConstructor):
3150 * runtime/RegExpConstructor.h:
3151 * tests/stress/regexp-constructor.js: Added.
3153 (throw.new.Error.get let):
3155 (throw.new.Error.get re):
3157 2016-04-06 Keith Miller <keith_miller@apple.com>
3159 We should support the ability to do a non-effectful getById
3160 https://bugs.webkit.org/show_bug.cgi?id=156116
3162 Reviewed by Benjamin Poulain.
3164 Currently, there is no way in JS to do a non-effectful getById. A non-effectful getById is
3165 useful because it enables us to take different code paths based on values that we would
3166 otherwise not be able to have knowledge of. This patch adds this new feature called
3167 try_get_by_id that will attempt to do as much of a get_by_id as possible without performing
3168 an effectful behavior. Thus, try_get_by_id will return the value if the slot is a value, the
3169 GetterSetter object if the slot is a normal accessor (not a CustomGetterSetter) and
3170 undefined if the slot is unset. If the slot is proxied or any other cases then the result
3171 is null. In theory, if we ever wanted to check for null we could add a sentinal object to
3172 the global object that indicates we could not get the result.
3174 In order to implement this feature we add a new enum GetByIdKind that indicates what to do
3175 for accessor properties in PolymorphicAccess. If the GetByIdKind is pure then we treat the
3176 get_by_id the same way we would for load and return the value at the appropriate offset.
3177 Additionally, in order to make sure the we can properly compare the GetterSetter object
3178 with === GetterSetters are now JSObjects. This comes at the cost of eight extra bytes on the
3179 GetterSetter object but it vastly simplifies the patch. Additionally, the extra bytes are
3180 likely to have little to no impact on memory usage as normal accessors are generally rare.
3182 * builtins/BuiltinExecutables.cpp:
3183 (JSC::BuiltinExecutables::createDefaultConstructor):
3184 (JSC::BuiltinExecutables::createBuiltinExecutable):
3185 (JSC::createBuiltinExecutable):
3186 (JSC::BuiltinExecutables::createExecutable):
3187 (JSC::createExecutableInternal): Deleted.
3188 * builtins/BuiltinExecutables.h:
3189 * bytecode/BytecodeIntrinsicRegistry.h:
3190 * bytecode/BytecodeList.json:
3191 * bytecode/BytecodeUseDef.h:
3192 (JSC::computeUsesForBytecodeOffset):
3193 (JSC::computeDefsForBytecodeOffset):
3194 * bytecode/CodeBlock.cpp:
3195 (JSC::CodeBlock::dumpBytecode):
3196 * bytecode/PolymorphicAccess.cpp:
3197 (JSC::AccessCase::tryGet):
3198 (JSC::AccessCase::generate):
3199 (WTF::printInternal):
3200 * bytecode/PolymorphicAccess.h:
3201 (JSC::AccessCase::isGet): Deleted.
3202 (JSC::AccessCase::isPut): Deleted.
3203 (JSC::AccessCase::isIn): Deleted.
3204 * bytecode/StructureStubInfo.cpp:
3205 (JSC::StructureStubInfo::reset):
3206 * bytecode/StructureStubInfo.h:
3207 * bytecompiler/BytecodeGenerator.cpp:
3208 (JSC::BytecodeGenerator::emitTryGetById):
3209 * bytecompiler/BytecodeGenerator.h:
3210 * bytecompiler/NodesCodegen.cpp:
3211 (JSC::BytecodeIntrinsicNode::emit_intrinsic_tryGetById):
3212 * dfg/DFGSpeculativeJIT32_64.cpp:
3213 (JSC::DFG::SpeculativeJIT::cachedGetById):
3214 * dfg/DFGSpeculativeJIT64.cpp:
3215 (JSC::DFG::SpeculativeJIT::cachedGetById):
3216 * ftl/FTLLowerDFGToB3.cpp:
3217 (JSC::FTL::DFG::LowerDFGToB3::getById):
3219 (JSC::JIT::privateCompileMainPass):
3220 (JSC::JIT::privateCompileSlowCases):
3222 * jit/JITInlineCacheGenerator.cpp:
3223 (JSC::JITGetByIdGenerator::JITGetByIdGenerator):
3224 * jit/JITInlineCacheGenerator.h:
3226 (JSC::JIT::callOperation):
3227 * jit/JITOperations.cpp:
3228 * jit/JITOperations.h:
3229 * jit/JITPropertyAccess.cpp:
3230 (JSC::JIT::emitGetByValWithCachedId):
3231 (JSC::JIT::emit_op_try_get_by_id):
3232 (JSC::JIT::emitSlow_op_try_get_by_id):
3233 (JSC::JIT::emit_op_get_by_id):
3234 * jit/JITPropertyAccess32_64.cpp:
3235 (JSC::JIT::emitGetByValWithCachedId):
3236 (JSC::JIT::emit_op_try_get_by_id):
3237 (JSC::JIT::emitSlow_op_try_get_by_id):
3238 (JSC::JIT::emit_op_get_by_id):
3240 (JSC::repatchByIdSelfAccess):
3241 (JSC::appropriateOptimizingGetByIdFunction):
3242 (JSC::appropriateGenericGetByIdFunction):
3243 (JSC::tryCacheGetByID):
3244 (JSC::repatchGetByID):
3245 (JSC::resetGetByID):
3248 (GlobalObject::finishCreation):
3249 (functionGetGetterSetter):
3250 (functionCreateBuiltin):
3251 * llint/LLIntData.cpp:
3252 (JSC::LLInt::Data::performAssertions):
3253 * llint/LLIntSlowPaths.cpp:
3254 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
3255 * llint/LLIntSlowPaths.h:
3256 * llint/LowLevelInterpreter.asm:
3257 * runtime/GetterSetter.cpp:
3258 * runtime/GetterSetter.h:
3260 * runtime/PropertySlot.cpp:
3261 (JSC::PropertySlot::getPureResult):
3262 * runtime/PropertySlot.h:
3263 * runtime/ProxyObject.cpp:
3264 (JSC::ProxyObject::getOwnPropertySlotCommon):
3265 * tests/stress/try-get-by-id.js: Added.
3267 (getCaller.obj.1.throw.new.Error.let.func):
3268 (getCaller.obj.1.throw.new.Error):
3269 (throw.new.Error.get let):
3271 (throw.new.Error.let.get createBuiltin):
3273 (let.get createBuiltin):
3278 2016-04-05 Chris Dumez <cdumez@apple.com>
3280 Add support for [EnabledAtRuntime] operations on DOMWindow
3281 https://bugs.webkit.org/show_bug.cgi?id=156272
3283 Reviewed by Alex Christensen.
3285 Add identifier for 'fetch' so it can be used from the generated
3288 * runtime/CommonIdentifiers.h:
3290 2016-04-05 Alex Christensen <achristensen@webkit.org>
3292 Make CMake-generated binaries on Mac able to run
3293 https://bugs.webkit.org/show_bug.cgi?id=156268
3295 Reviewed by Daniel Bates.
3299 2016-04-05 Filip Pizlo <fpizlo@apple.com>
3301 Improve some other cases of context-sensitive inlining
3302 https://bugs.webkit.org/show_bug.cgi?id=156277
3304 Reviewed by Benjamin Poulain.
3306 This implements some improvements for inlining:
3308 - We no longer do guarded inlining when the profiling doesn't come from a stub. Doing so would have
3309 been risky, and according to benchmarks, it wasn't common enough to matter. I think it's better to
3310 err on the side of not inlining.
3312 - The jneq_ptr pattern for variadic calls no longer breaks the basic block. Not breaking the block
3313 increases the chances of the parser seeing the callee constant. While inlining doesn't require a
3314 callee constant, sometimes it makes a difference. Note that we were previously breaking the block
3315 for no reason at all: if the boundary after jneq_ptr is a jump target from some other jump, then
3316 the parser will automatically break the block for us. There is no reason to add any block breaking
3317 ourselves since we implement jneq_ptr by ignoring the affirmative jump destination and inserting a
3318 check and falling through.
3320 - get_by_id handling now tries to apply some common sense to its status object. In particular, if
3321 the source is a NewObject and there was no interfering operation that could clobber the structure,
3322 then we know which case of a polymorphic GetByIdStatus we would take. This arises in some
3323 constructor patterns.
3325 Long term, we should address all of these cases comprehensively by having a late inliner. The inliner
3326 being part of the bytecode parser means that there is a lot of complexity in the parser and it
3327 prevents us from inlining upon learning new information from static analysis. But for now, I think
3328 it's fine to experiment with one-off hacks, if only to learn what the possibilities are.
3330 This is a 14% speed-up on Octane/raytrace.
3332 * bytecode/CallLinkStatus.cpp:
3333 (JSC::CallLinkStatus::dump):
3334 * bytecode/CallLinkStatus.h:
3335 (JSC::CallLinkStatus::couldTakeSlowPath):
3336 (JSC::CallLinkStatus::setCouldTakeSlowPath):
3337 (JSC::CallLinkStatus::variants):
3338 (JSC::CallLinkStatus::size):
3339 (JSC::CallLinkStatus::at):
3340 * bytecode/GetByIdStatus.cpp:
3341 (JSC::GetByIdStatus::makesCalls):
3342 (JSC::GetByIdStatus::filter):
3343 (JSC::GetByIdStatus::dump):
3344 * bytecode/GetByIdStatus.h:
3345 (JSC::GetByIdStatus::wasSeenInJIT):
3346 * dfg/DFGByteCodeParser.cpp:
3347 (JSC::DFG::ByteCodeParser::handleCall):
3348 (JSC::DFG::ByteCodeParser::refineStatically):
3349 (JSC::DFG::ByteCodeParser::handleVarargsCall):
3350 (JSC::DFG::ByteCodeParser::handleInlining):
3351 (JSC::DFG::ByteCodeParser::handleGetById):
3352 (JSC::DFG::ByteCodeParser::parseBlock):
3353 * runtime/Options.h:
3355 2016-04-05 Saam barati <sbarati@apple.com>
3357 JSC SamplingProfiler: Use a thread + sleep loop instead of WTF::WorkQueue for taking samples
3358 https://bugs.webkit.org/show_bug.cgi?id=154017
3360 Reviewed by Geoffrey Garen.