1 2016-06-02 Filip Pizlo <fpizlo@apple.com>
3 Make it easier to use NoLockingNecessary
4 https://bugs.webkit.org/show_bug.cgi?id=158306
6 Reviewed by Keith Miller.
8 An idiom that we borrowed from LLVM is that if a function requires a lock to be held, we
9 have it take a const Locker& as its first argument. This may not communicate which lock is
10 to be held, but it does help us to remember that some lock must be held. So far, it's been
11 relatively easy to then figure out which lock. We've had bugs where we forgot to hold a
12 lock but I don't remember the last time we had a bug where we grabbed the wrong lock.
14 But sometimes, we know at the point where we call such a method that we actually don't
15 need to hold any lock. This usually happens during object construction. If we're
16 constructing some object then we usually know that we have not escaped it yet, so we don't
17 need to waste time acquiring its lock. We could solve this by having a separate set of
18 methods that don't do or require locking. This would be cumbersome, since usually for
19 every variant that takes const Locker&, there is already one that doesn't, and that one
20 will grab the lock for you. So this means having a third variant, that also doesn't take a
21 const Locker&, but does no locking. That's pretty weird.
23 So, we introduced NoLockingNecessary for situations like this. The idiom went like so:
25 Locker<Whatever> locker(Locker<Whatever>::NoLockingNecessary)
28 Usually though, there would be some distance between where the locker is defined and where
29 it's used, so when you just look at stuff->foo(locker) in isolation you don't know if this
30 is a real locker or a NoLockingNecessary cast. Also, requiring two lines for this just
33 This change makes this easier. Now you can just do:
35 stuff->foo(NoLockingNecessary).
37 This is because NoLockingNecessary has been pulled out into the WTF namespace (and is
38 usinged from the global namespace) and the Locker<> constructor that takes
39 NoLockingNecessaryTag is now implicit.
41 The only possible downside of this change is that people might use this idiom more
42 frequently now that it's easier to use. I don't think that's a bad thing. I'm now
43 convinced that this is not a bad idiom. When I was fixing an unrelated bug, I almost went
44 the way of adding more locking to some core JSC data structures, and in the process, I
45 needed to use NoLockingNecessary. It's clear that this is a general-purpose idiom and we
46 should not impose artificial constraints on its use.
49 (WTF::Locker::Locker):
50 (WTF::Locker::~Locker):
52 2016-06-01 Brady Eidson <beidson@apple.com>
54 Get rid of StringCapture.
55 https://bugs.webkit.org/show_bug.cgi?id=158285
57 Reviewed by Chris Dumez.
59 * wtf/text/WTFString.h:
60 (WTF::StringCapture::StringCapture): Deleted.
61 (WTF::StringCapture::string): Deleted.
62 (WTF::StringCapture::releaseString): Deleted.
63 (WTF::StringCapture::operator=): Deleted.
65 2016-06-01 Benjamin Poulain <bpoulain@apple.com>
67 [JSC] Some setters for components of Date do not timeClip() their result
68 https://bugs.webkit.org/show_bug.cgi?id=158278
73 (WTF::equivalentYearForDST): Deleted.
74 The assertion is bogus.
75 As the comments above explains, the function is completely wrong for years
77 The tests passing large values for years are failing (year <= maxYear).
78 The weird NaN test is a mystery. The old changelog does not explain it.
80 2016-05-31 Commit Queue <commit-queue@webkit.org>
82 Unreviewed, rolling out r201363 and r201456.
83 https://bugs.webkit.org/show_bug.cgi?id=158240
85 "40% regression on date-format-xparb" (Requested by
86 keith_miller on #webkit).
90 "LLInt should be able to cache prototype loads for values in
92 https://bugs.webkit.org/show_bug.cgi?id=158032
93 http://trac.webkit.org/changeset/201363
95 "get_by_id should support caching unset properties in the
97 https://bugs.webkit.org/show_bug.cgi?id=158136
98 http://trac.webkit.org/changeset/201456
100 2016-05-31 Brady Eidson <beidson@apple.com>
102 Make createCrossThreadTask() functions return on the stack instead of the heap.
103 https://bugs.webkit.org/show_bug.cgi?id=158215
105 Reviewed by Darin Adler.
107 * WTF.xcodeproj/project.pbxproj:
109 * wtf/CrossThreadCopier.cpp:
111 * wtf/CrossThreadQueue.h: Added. A lightweight of MessageQueue that deals directly
112 in objects instead of in std::unique_ptrs.
113 (WTF::CrossThreadQueue::isKilled):
114 (WTF::CrossThreadQueue<DataType>::append):
115 (WTF::CrossThreadQueue<DataType>::waitForMessage):
116 (WTF::CrossThreadQueue<DataType>::tryGetMessage):
118 * wtf/CrossThreadTask.h:
119 (WTF::createCrossThreadTask):
120 (WTF::CrossThreadTask::CrossThreadTask): Deleted.
122 2016-05-30 Brady Eidson <beidson@apple.com>
124 Move CrossThreadCopier/CrossThreadTask to WTF.
125 https://bugs.webkit.org/show_bug.cgi?id=158207
127 Reviewed by Alex Christensen.
129 * WTF.xcodeproj/project.pbxproj:
130 * wtf/CMakeLists.txt:
132 * wtf/CrossThreadCopier.cpp: Renamed from Source/WebCore/platform/CrossThreadCopier.cpp.
133 * wtf/CrossThreadCopier.h: Renamed from Source/WebCore/platform/CrossThreadCopier.h.
134 (WTF::CrossThreadCopierPassThrough::copy):
136 * wtf/CrossThreadTask.h: Renamed from Source/WebCore/platform/CrossThreadTask.h.
137 (WTF::CrossThreadTask::CrossThreadTask):
138 (WTF::CrossThreadTask::performTask):
139 (WTF::createCrossThreadTask):
141 2016-05-28 Chris Dumez <cdumez@apple.com>
143 Templatize NoncopyableFunction class similarly to std::function
144 https://bugs.webkit.org/show_bug.cgi?id=158185
146 Reviewed by Darin Adler.
148 Templatize NoncopyableFunction class similarly to std::function, so
149 that it can be used as a std::function replacement in more places.
151 Previously, NoncopyableFunction could only support "void()" lambdas.
153 * wtf/FunctionDispatcher.h:
154 * wtf/MainThread.cpp:
155 (WTF::functionQueue):
156 (WTF::dispatchFunctionsFromMainThread):
157 (WTF::callOnMainThread):
159 * wtf/NoncopyableFunction.h:
161 (WTF::RunLoop::performWork):
162 (WTF::RunLoop::dispatch):
165 * wtf/cocoa/WorkQueueCocoa.cpp:
166 (WTF::WorkQueue::dispatch):
167 (WTF::WorkQueue::dispatchAfter):
168 * wtf/efl/DispatchQueueWorkItemEfl.h:
169 (WorkItem::WorkItem):
170 (TimerWorkItem::create):
171 (TimerWorkItem::TimerWorkItem):
172 * wtf/efl/WorkQueueEfl.cpp:
173 (WTF::WorkQueue::dispatch):
174 (WTF::WorkQueue::dispatchAfter):
175 * wtf/generic/RunLoopGeneric.cpp:
176 (WTF::RunLoop::TimerBase::ScheduledTask::create):
177 (WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask):
178 (WTF::RunLoop::dispatchAfter):
179 * wtf/generic/WorkQueueGeneric.cpp:
180 (WorkQueue::dispatch):
181 (WorkQueue::dispatchAfter):
182 * wtf/glib/RunLoopGLib.cpp:
183 (WTF::DispatchAfterContext::DispatchAfterContext):
184 (WTF::RunLoop::dispatchAfter):
185 * wtf/win/WorkItemWin.cpp:
186 (WTF::WorkItemWin::WorkItemWin):
187 (WTF::WorkItemWin::create):
188 (WTF::HandleWorkItem::HandleWorkItem):
189 (WTF::HandleWorkItem::createByAdoptingHandle):
190 * wtf/win/WorkItemWin.h:
191 (WTF::WorkItemWin::function):
192 * wtf/win/WorkQueueWin.cpp:
193 (WTF::WorkQueue::dispatch):
194 (WTF::WorkQueue::dispatchAfter):
196 2016-05-28 Dan Bernstein <mitz@apple.com>
198 Build fix for projects that include MainThread.h without including FastMalloc.h.
200 * wtf/NoncopyableFunction.h: Include FastMalloc.h from here.
202 2016-05-27 Chris Dumez <cdumez@apple.com>
204 callOnMainThread() should not copy captured lambda variables
205 https://bugs.webkit.org/show_bug.cgi?id=158166
207 Reviewed by Brady Eidson.
209 callOnMainThread() should not copy captured lambda variables. This
210 function is usually called cross-thread with a lambda and copying
211 the lambda (and its captured variables) can lead to thread-safety
214 This patch updates callOnMainThread() to take a NoncopyableFunction&&
215 in parameter instead of a std::function. The call sites of
216 callOnMainThread() have also been updated to use C++14's lambda
217 capture with initializer.
219 * WTF.xcodeproj/project.pbxproj:
221 * wtf/FunctionDispatcher.h:
222 * wtf/NoncopyableFunction.h:
223 - Moved NoncopyableFunction from FunctionDispatcher.h to
224 NoncopyableFunction.h.
225 - Add a new operator=(nullptr_t) operator to NoncopyableFunction to
226 match std::function, as one of the call sites needed it.
228 * wtf/MainThread.cpp:
229 (WTF::functionQueue):
230 (WTF::dispatchFunctionsFromMainThread):
231 (WTF::callOnMainThread):
234 2016-05-27 Yusuke Suzuki <utatane.tea@gmail.com>
236 Unreviewed, build fix for JSCOnly port.
237 https://bugs.webkit.org/show_bug.cgi?id=158111
239 Use NoncopyableFunction instead of std::function<>.
241 * wtf/generic/RunLoopGeneric.cpp:
242 (WTF::RunLoop::TimerBase::ScheduledTask::create):
243 (WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask):
245 2016-05-27 Chris Dumez <cdumez@apple.com>
247 WorkQueue::dispatch() / RunLoop::dispatch() should not copy captured lambda variables
248 https://bugs.webkit.org/show_bug.cgi?id=158111
250 Reviewed by Darin Adler.
252 WorkQueue::dispatch() / RunLoop::dispatch() should not copy captured lambda variables.
253 These are often used cross-thread and copying the captured lambda variables can be
254 dangerous (e.g. we do not want to copy a String after calling isolatedCopy() upon
257 This patch introduces a new NoncopyableFunction type that behaves similarly to
258 std::function but guarantees that the passed-in lambda (and its captured variables)
259 cannot be copied. This new NoncopyableFunction type is now used for
260 WorkQueue / RunLoop's dispatch() / dispatchAfter() which are commonly used
261 cross-thread. This should now allow us to call WorkQueue::dispatch() with a lambda
262 that captures a String like so:
263 [str = str.isolatedCopy()]() { }
265 Also note that even though this is not leveraged in this patch, NoncopyableFunction
266 would allow us to capture move-only types such as std::unique_ptr as so:
267 [p = WTFMove(p)]() { }
268 This does not work if we convert the lambda into an std::function because
269 std::function requires the lambda to be copyable, NoncopyableFunction does not.
271 * wtf/FunctionDispatcher.h:
272 (WTF::CallableWrapperBase::~CallableWrapperBase):
273 (WTF::NoncopyableFunction::NoncopyableFunction):
274 (WTF::NoncopyableFunction::operator()):
275 (WTF::NoncopyableFunction::operator bool):
276 (WTF::NoncopyableFunction::operator=):
278 (WTF::RunLoop::performWork):
279 (WTF::RunLoop::dispatch):
282 * wtf/cocoa/WorkQueueCocoa.cpp:
283 (WTF::WorkQueue::dispatch):
284 (WTF::WorkQueue::dispatchAfter):
285 * wtf/efl/DispatchQueueWorkItemEfl.h:
286 (WorkItem::WorkItem):
287 (TimerWorkItem::create):
288 (TimerWorkItem::TimerWorkItem):
289 * wtf/efl/WorkQueueEfl.cpp:
290 (WTF::WorkQueue::dispatch):
291 (WTF::WorkQueue::dispatchAfter):
292 * wtf/generic/RunLoopGeneric.cpp:
293 (WTF::RunLoop::dispatchAfter):
294 * wtf/generic/WorkQueueGeneric.cpp:
295 (WorkQueue::dispatch):
296 (WorkQueue::dispatchAfter):
297 * wtf/glib/RunLoopGLib.cpp:
298 (WTF::DispatchAfterContext::DispatchAfterContext):
299 (WTF::RunLoop::dispatchAfter):
300 * wtf/win/WorkItemWin.cpp:
301 (WTF::WorkItemWin::WorkItemWin):
302 (WTF::WorkItemWin::create):
303 (WTF::HandleWorkItem::HandleWorkItem):
304 (WTF::HandleWorkItem::createByAdoptingHandle):
305 * wtf/win/WorkItemWin.h:
306 (WTF::WorkItemWin::function):
307 * wtf/win/WorkQueueWin.cpp:
308 (WTF::WorkQueue::dispatch):
309 (WTF::WorkQueue::timerCallback):
310 (WTF::WorkQueue::dispatchAfter):
312 2016-05-26 Filip Pizlo <fpizlo@apple.com>
314 ScopedLambda should have a lifetime story that makes sense to the compiler
315 https://bugs.webkit.org/show_bug.cgi?id=158118
317 Reviewed by Mark Lam.
319 Prior to this change, there were two lifetime bugs in ScopedLambda:
321 - scopedLambda(Functor&&) would bind Functor to const lambda&, so the resulting ScopedLambdaFunctor
322 would hold a reference to the original lambda. This would have surprising behavior; for example
323 it meant that this code was wrong:
325 auto l = scopedLambda<things>([&] ...);
327 The solution is to have explicit copy/move versions of scopedLambda() rather than rely on perfect
330 - ScopedLambdaFunctor did not override its copy or move operations, so if the compiler did not RVO
331 scopedLambda(), it would return a ScopedLambdaFunctor whose m_arg points to a dead temporary
332 ScopedLambdaFunctor instance. The solution is to have explicit copy/move constructors and
333 operators, which preserve the invariant that ScopedLambda::m_arg points to this.
335 One nice side-effect of all of these constructors and operators being explicit is that we can rely
336 on WTFMove's excellent assertions, which helped catch the first issue.
338 This reverts ParkingLot to use ScopedLambda again.
340 * wtf/ParkingLot.cpp:
341 (WTF::ParkingLot::parkConditionallyImpl):
342 (WTF::ParkingLot::unparkOne):
343 (WTF::ParkingLot::unparkOneImpl):
345 (WTF::ParkingLot::parkConditionally):
346 (WTF::ParkingLot::unparkOne):
347 * wtf/ScopedLambda.h:
350 2016-05-25 Anders Carlsson <andersca@apple.com>
352 Get rid of WTF/Functional.h
353 https://bugs.webkit.org/show_bug.cgi?id=158081
355 Reviewed by Chris Dumez.
357 This is no longer used, and removing it will free up the name for a new Functional.h implementation.
359 * WTF.xcodeproj/project.pbxproj:
360 * wtf/Functional.h: Removed.
361 (WTF::RefAndDeref::ref): Deleted.
362 (WTF::RefAndDeref::deref): Deleted.
363 (WTF::ParamStorageTraits::wrap): Deleted.
364 (WTF::ParamStorageTraits::unwrap): Deleted.
365 (WTF::ParamStorageTraits<PassRefPtr<T>>::wrap): Deleted.
366 (WTF::ParamStorageTraits<PassRefPtr<T>>::unwrap): Deleted.
367 (WTF::ParamStorageTraits<RefPtr<T>>::wrap): Deleted.
368 (WTF::ParamStorageTraits<RefPtr<T>>::unwrap): Deleted.
369 (WTF::ParamStorageTraits<RetainPtr<T>>::wrap): Deleted.
370 (WTF::ParamStorageTraits<RetainPtr<T>>::unwrap): Deleted.
371 (WTF::FunctionImplBase::~FunctionImplBase): Deleted.
372 (WTF::FunctionBase::isNull): Deleted.
373 (WTF::FunctionBase::FunctionBase): Deleted.
374 (WTF::FunctionBase::impl): Deleted.
375 (WTF::bind): Deleted.
376 * wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
378 2016-05-24 Keith Miller <keith_miller@apple.com>
380 LLInt should be able to cache prototype loads for values in GetById
381 https://bugs.webkit.org/show_bug.cgi?id=158032
383 Reviewed by Filip Pizlo.
385 Add move constructors/initializers to Bags.
389 (WTF::Bag::operator=):
391 2016-05-24 Chris Dumez <cdumez@apple.com>
393 Use auto for some of our lambda function parameters
394 https://bugs.webkit.org/show_bug.cgi?id=158001
396 Reviewed by Darin Adler.
398 Use auto for some of our lambda function parameters now that we build with c++14.
403 2016-05-23 Chris Dumez <cdumez@apple.com>
405 Speed up move of vectors of POD types that have an inline buffer
406 https://bugs.webkit.org/show_bug.cgi?id=158003
408 Reviewed by Benjamin Poulain.
410 When moving a vector of POD types that have an inline buffer, we would
411 call std::swap() on the inline buffers. This unnecessarily slow because:
412 1. It does not consider the vector size, and therefore may end up doing
413 more work than necessary when the inline buffer is not full.
414 2. In the "move" case, the destination buffer is completely empty so
415 we don't really want a swap. We merely want the move the content of
416 the source's inline buffer into the destination's one.
418 Instead of calling std::swap(), we now call swapInlineBuffers() which
419 was already used for non-POD types. swapInlineBuffers() will do just
420 what we want in the "move" case because swapBound is going to be 0.
421 As a result, we will only move the content of the source buffer into
422 the destination one. Also swapInlineBuffers() is aware of the source
423 vector's size so it will only move what's strictly needed.
425 This seems to be a 2% progression on Dromaeo DOM attributes test.
428 (WTF::VectorBuffer::swapInlineBuffer):
430 2016-05-22 Dan Bernstein <mitz@apple.com>
432 Added NSEventMaskMouseMoved to AppKitCompatibilityDeclarations.h.
434 Rubber-stamped by Anders Carlsson.
436 * wtf/mac/AppKitCompatibilityDeclarations.h:
438 2016-05-22 Dan Bernstein <mitz@apple.com>
440 Another attempt to fix the GTK build after my previous changes.
442 * wtf/StdLibExtras.h:
444 2016-05-22 Dan Bernstein <mitz@apple.com>
446 Tried to fix the GTK build after r201257.
448 * wtf/StdLibExtras.h:
450 2016-05-22 Dan Bernstein <mitz@apple.com>
452 Additional fixes for non-C++14 Apple projects that use WTF.
454 * wtf/StdLibExtras.h:
457 2016-05-22 Dan Bernstein <mitz@apple.com>
459 Additional fixes for non-C++14 Apple projects that use WTF.
461 * wtf/StdLibExtras.h:
465 2016-05-22 Dan Bernstein <mitz@apple.com>
467 Correct the previous build fix attempt.
469 * wtf/StdLibExtras.h:
471 2016-05-22 Dan Bernstein <mitz@apple.com>
473 Build fix for non-C++14 Apple projects that use WTF.
475 Rubber-stamped by Anders.
477 * wtf/StdLibExtras.h:
479 2016-05-22 Brady Eidson <beidson@apple.com>
482 https://bugs.webkit.org/show_bug.cgi?id=157948
484 Reviewed by Michael Catanzaro.
486 * Configurations/Base.xcconfig:
488 Delete a lot of "stl additions until we can adopt C++14" code:
489 * wtf/StdLibExtras.h:
490 (std::make_unique): Deleted.
491 (std::index_sequence::size): Deleted.
492 (std::exchange): Deleted.
493 (std::literals::chrono_literals::operator _s): Deleted.
494 (std::literals::chrono_literals::operator _ms): Deleted.
496 2016-05-20 Rawinder Singh <rawinder.singh-webkit@cisra.canon.com.au>
498 Implement operator== for WeakPtr
499 https://bugs.webkit.org/show_bug.cgi?id=157883
501 Reviewed by Chris Dumez.
503 Implement operator== and operator!= for WeakPtr and update code to use the operators.
509 2016-05-19 Chris Dumez <cdumez@apple.com>
511 Improve compile-time assertions in is<>() / downcast<>()
512 https://bugs.webkit.org/show_bug.cgi?id=157817
514 Reviewed by Darin Adler.
518 Add is<>() overloads taking a Ref<>() so that is<>() keeps working when
519 passing a Ref<>(), despite the new static assertions on the input type.
520 Some call sites were already leveraging this as it was working by
521 implicitly converting the Ref<T> into a T&.
526 Make static assertions stricter in is<>() / downcast<>() to catch more
527 cases where those are either unnecessary or incorrect.
529 2016-05-19 Filip Pizlo <fpizlo@apple.com>
531 Unreviewed, fix all of the builds. I failed a second time.
533 * wtf/BackwardsGraph.h:
534 (WTF::BackwardsGraph::rootName):
536 2016-05-19 Filip Pizlo <fpizlo@apple.com>
538 Unreviewed, fix all of the builds. I had made an additional change that I did not mean to
539 commit. This fixes it.
541 * wtf/BackwardsGraph.h:
542 (WTF::BackwardsGraph::rootName):
543 (WTF::BackwardsGraph::Set::dump):
544 (WTF::BackwardsGraph::dump):
546 2016-05-18 Filip Pizlo <fpizlo@apple.com>
548 DFG::LICMPhase shouldn't hoist type checks unless it knows that the check will succeed at the loop pre-header
549 https://bugs.webkit.org/show_bug.cgi?id=144527
551 Reviewed by Saam Barati.
553 This adds an adaptor for graphs called BackwardsGraph. The WTF graph framework is based on
554 passing around a Graph template argument that follows the protocol shared by DFG::CFG,
555 B3::CFG, and Air::CFG. These graphs always have a single root node but may have many leaf
556 nodes. This new BackwardsGraph adaptor reverses the graph by creating a synthetic return
557 node that it uses as the root in the inverted graph. This currently may resort to some
558 heuristics in programs that have an infinite loop, but other than that, it'll work well in
561 This allows us to say Dominators<BackwardsGraph<some graph type>> as a way of computing
562 backwards dominators, which then allows us to easily answer control flow equivalence
566 * WTF.xcodeproj/project.pbxproj:
567 * wtf/BackwardsGraph.h: Added.
568 (WTF::BackwardsGraph::Node::Node):
569 (WTF::BackwardsGraph::Node::root):
570 (WTF::BackwardsGraph::Node::operator==):
571 (WTF::BackwardsGraph::Node::operator!=):
572 (WTF::BackwardsGraph::Node::operator bool):
573 (WTF::BackwardsGraph::Node::isRoot):
574 (WTF::BackwardsGraph::Node::node):
575 (WTF::BackwardsGraph::Set::Set):
576 (WTF::BackwardsGraph::Set::add):
577 (WTF::BackwardsGraph::Set::remove):
578 (WTF::BackwardsGraph::Set::contains):
579 (WTF::BackwardsGraph::Set::dump):
580 (WTF::BackwardsGraph::Map::Map):
581 (WTF::BackwardsGraph::Map::clear):
582 (WTF::BackwardsGraph::Map::size):
583 (WTF::BackwardsGraph::Map::operator[]):
584 (WTF::BackwardsGraph::BackwardsGraph):
585 (WTF::BackwardsGraph::root):
586 (WTF::BackwardsGraph::newMap):
587 (WTF::BackwardsGraph::successors):
588 (WTF::BackwardsGraph::predecessors):
589 (WTF::BackwardsGraph::index):
590 (WTF::BackwardsGraph::node):
591 (WTF::BackwardsGraph::numNodes):
592 (WTF::BackwardsGraph::dump):
594 (WTF::Dominators::Dominators):
595 (WTF::Dominators::dump):
596 (WTF::Dominators::LengauerTarjan::computeDepthFirstPreNumbering):
597 * wtf/GraphNodeWorklist.h:
598 (WTF::GraphNodeWith::GraphNodeWith):
599 (WTF::GraphNodeWith::operator bool):
600 * wtf/StdLibExtras.h:
601 (WTF::callStatelessLambda):
604 2016-05-18 Saam barati <sbarati@apple.com>
606 StringBuilder::appendQuotedJSONString doesn't properly protect against the math it's doing. Make the math fit the assertion.
607 https://bugs.webkit.org/show_bug.cgi?id=157868
609 Reviewed by Benjamin Poulain.
611 appendQuotedJSONString was rounding up to the next power of two when resizing
612 its buffer. Lets call the allocation size X. If X > 2^31, then
613 roundUpToPowerOfTwo(X) == 0. This patch fixes this by making the
614 assertion reflect what the code is doing. We now allocate to a size
615 of X = std::max(maximumCapacityRequired , roundUpToPowerOfTwo(maximumCapacityRequired))
617 * wtf/text/StringBuilder.cpp:
618 (WTF::StringBuilder::appendQuotedJSONString):
620 2016-05-17 Joseph Pecoraro <pecoraro@apple.com>
622 REGRESSION(r192855): Math.random() always produces the same first 7 decimal points the first two invocations
623 https://bugs.webkit.org/show_bug.cgi?id=157805
624 <rdar://problem/26327851>
626 Reviewed by Geoffrey Garen.
629 (WTF::WeakRandom::setSeed):
630 Advance once to randomize the 32bit seed across the 128bit state
631 and avoid re-using 64bits of state in the second advance.
633 2016-05-17 Dean Jackson <dino@apple.com>
635 Remove ES6_GENERATORS flag
636 https://bugs.webkit.org/show_bug.cgi?id=157815
637 <rdar://problem/26332894>
639 Reviewed by Geoffrey Garen.
641 This flag isn't needed. Generators are enabled everywhere and
642 part of a stable specification.
644 * wtf/FeatureDefines.h:
646 2016-05-17 Filip Pizlo <fpizlo@apple.com>
648 WTF should know about Language
649 https://bugs.webkit.org/show_bug.cgi?id=157756
651 Reviewed by Geoffrey Garen.
653 This contains two changes:
655 - Move everything that WebCore's logic for getting the platform user preferred language
656 depended on into WTF. This means CFBundleSPI.h and BlockObjCExceptions.h|cpp.
658 - Move WebCore::platformUserPreferredLanguages() to WTF::platformUserPreferredLanguages().
659 This is needed by https://bugs.webkit.org/show_bug.cgi?id=157755, which will make JSC
660 use this to detect the platform user preferred language when running standalone.
662 Moving the dependencies accounts for a huge chunk of this change, since we have to rewire
663 all of the references to those headers in all of WebKit.
665 Moving platformUserPreferredLanguages() is mostly easy except for the weird callback.
666 That function would call languageDidChange(), which needs to stay in WebCore. So, this
667 gives WebCore the ability to register a languageDidChange callback. Other than this new
668 logic, the code being added to WTF is just being lifted out of WebCore.
670 * WTF.xcodeproj/project.pbxproj:
671 * wtf/BlockObjCExceptions.h: Added.
672 * wtf/BlockObjCExceptions.mm: Added.
673 (ReportBlockedObjCException):
674 * wtf/PlatformEfl.cmake:
675 * wtf/PlatformGTK.cmake:
676 * wtf/PlatformJSCOnly.cmake:
677 * wtf/PlatformMac.cmake:
678 * wtf/PlatformUserPreferredLanguages.h: Added.
679 * wtf/PlatformUserPreferredLanguagesMac.mm: Added.
680 (WTF::setPlatformUserPreferredLanguagesChangedCallback):
681 (WTF::preferredLanguages):
682 (+[WTFLanguageChangeObserver languagePreferencesDidChange:]):
683 (WTF::httpStyleLanguageCode):
684 (WTF::isValidICUCountryCode):
685 (WTF::platformUserPreferredLanguages):
686 * wtf/PlatformUserPreferredLanguagesUnix.cpp: Added.
687 (WTF::setPlatformUserPreferredLanguagesChangedCallback):
688 (WTF::platformLanguage):
689 (WTF::platformUserPreferredLanguages):
690 * wtf/PlatformUserPreferredLanguagesWin.cpp: Added.
691 (WTF::setPlatformUserPreferredLanguagesChangedCallback):
693 (WTF::platformLanguage):
694 (WTF::platformUserPreferredLanguages):
695 * wtf/PlatformWin.cmake:
697 * wtf/spi/cf/CFBundleSPI.h: Added.
699 2016-05-17 Youenn Fablet <youenn.fablet@crf.canon.fr>
701 DOMPromise should only restrict the resolution type
702 https://bugs.webkit.org/show_bug.cgi?id=157307
704 Reviewed by Darin Adler.
706 * wtf/Ref.h: Adding static constexpr to ease detection of Ref for templates.
707 * wtf/RefPtr.h: Ditto.
709 2016-05-16 Michael Saboff <msaboff@apple.com>
711 ARMV7K: Crash at JavaScriptCore: WTF::ScopedLambdaFunctor<bool
712 https://bugs.webkit.org/show_bug.cgi?id=157781
714 Reviewed by Filip Pizlo.
716 Replaced use of ScopedLambda in locking code with std::function much as it was
717 before change set 199760 to work around what appears to be a clang compiler issue.
719 * wtf/ParkingLot.cpp:
720 (WTF::ParkingLot::parkConditionallyImpl):
721 (WTF::ParkingLot::unparkOne):
722 (WTF::ParkingLot::unparkAll):
723 (WTF::ParkingLot::forEach):
724 (WTF::ParkingLot::unparkOneImpl): Deleted.
725 (WTF::ParkingLot::forEachImpl): Deleted.
727 (WTF::ParkingLot::parkConditionally):
728 (WTF::ParkingLot::unparkOne): Deleted.
729 (WTF::ParkingLot::forEach): Deleted.
731 2016-05-15 Chris Dumez <cdumez@apple.com>
733 Use more references in JS wrappers related code
734 https://bugs.webkit.org/show_bug.cgi?id=157721
736 Reviewed by Darin Adler.
738 Add new static_reference_cast() overload that takes a Ref<U>&& in
739 in order to downcast Ref<> types without causing ref-counting
743 (WTF::static_reference_cast):
745 2016-05-13 Chris Dumez <cdumez@apple.com>
747 Unreviewed, rolling out r200837.
749 Seems to have regressed Speedometer and JetStream on iOS
753 "DOMPromise should only restrict the resolution type"
754 https://bugs.webkit.org/show_bug.cgi?id=157307
755 http://trac.webkit.org/changeset/200837
757 2016-05-13 Beth Dakin <bdakin@apple.com>
760 https://bugs.webkit.org/show_bug.cgi?id=157401
762 rdar://problem/26253396
764 Reviewed by Darin Adler.
766 New header for dyld spi.
767 * WTF.xcodeproj/project.pbxproj:
768 * wtf/spi/darwin/dyldSPI.h: Added.
770 2016-05-13 Youenn Fablet <youenn.fablet@crf.canon.fr>
772 DOMPromise should only restrict the resolution type
773 https://bugs.webkit.org/show_bug.cgi?id=157307
775 Reviewed by Darin Adler.
777 * wtf/Ref.h: Adding static constexpr to ease detection of Ref for templates.
778 * wtf/RefPtr.h: Ditto.
780 2016-05-12 Daniel Bates <dabates@apple.com>
782 Use SecTask SPI to retrieve code signing identifier for user directory suffix
783 https://bugs.webkit.org/show_bug.cgi?id=157570
785 Reviewed by Darin Adler.
786 <rdar://problem/25706517>
788 Forward declare SPI SecTaskCopySigningIdentifier().
790 * wtf/spi/cocoa/SecuritySPI.h:
792 2016-05-12 Csaba Osztrogonác <ossy@webkit.org>
794 Remove ENABLE(ES6_ARROWFUNCTION_SYNTAX) guards
795 https://bugs.webkit.org/show_bug.cgi?id=157564
797 Reviewed by Darin Adler.
799 * wtf/FeatureDefines.h:
801 2016-05-10 Filip Pizlo <fpizlo@apple.com>
803 Internal JSC profiler should have a timestamped log of events for each code block
804 https://bugs.webkit.org/show_bug.cgi?id=157538
806 Reviewed by Benjamin Poulain.
809 (WTF::PrintStream::print):
811 2016-05-10 Chris Dumez <cdumez@apple.com>
813 Get rid of a lot of calls to RefPtr::release()
814 https://bugs.webkit.org/show_bug.cgi?id=157505
816 Reviewed by Alex Christensen.
818 Get rid of a lot of calls to RefPtr::release() and use WTFMove() instead.
820 * wtf/text/AtomicStringImpl.cpp:
821 (WTF::HashAndUTF8CharactersTranslator::translate):
822 * wtf/text/CString.cpp:
823 (WTF::CString::copyBufferIfNeeded):
824 * wtf/text/StringBuilder.cpp:
825 (WTF::StringBuilder::allocateBuffer):
826 (WTF::StringBuilder::allocateBufferUpConvert):
827 (WTF::StringBuilder::shrinkToFit):
828 * wtf/text/WTFString.cpp:
829 (WTF::String::append):
830 (WTF::String::insert):
831 (WTF::String::removeInternal):
832 * wtf/text/WTFString.h:
833 (WTF::String::String):
834 (WTF::String::operator=):
835 (WTF::String::releaseImpl):
836 (WTF::String::isNull): Deleted.
838 2016-05-08 Chris Dumez <cdumez@apple.com>
840 [COCOA] Disable HAVE_DTRACE at build time
841 https://bugs.webkit.org/show_bug.cgi?id=157433
842 <rdar://problem/26148841>
844 Reviewed by Mark Lam.
846 Disable HAVE_DTRACE on COCOA since it is mostly unused and has a performance
847 impact, at least on iOS.
851 2016-05-08 Chris Dumez <cdumez@apple.com>
853 [Bindings] Simplify [RequiresExistingAtomicString] IDL extended attribute handling
854 https://bugs.webkit.org/show_bug.cgi?id=157465
856 Reviewed by Darin Adler.
858 Add an AtomicString(RefPtr<AtomicStringImpl>&&) constructor that is now
859 used by the bindings when [RequiresExistingAtomicString] is used. This
860 is more efficient than using AtomicString(AtomicStringImpl*) as the
861 caller has a RefPtr<AtomicStringImpl> and is consistent with the
862 pre-existing String(RefPtr<AtomicStringImpl>&&) constructor.
864 * wtf/text/AtomicString.h:
865 (WTF::AtomicString::AtomicString):
867 2016-05-08 Darin Adler <darin@apple.com>
869 * wtf/text/WTFString.h: Remove pragma once. Not working for some reason.
871 2016-05-08 Darin Adler <darin@apple.com>
873 Follow-up to that last patch (missed review comments).
875 * wtf/text/WTFString.h: Use nullptr instead of 0 as needed. Also use pragma once.
877 2016-05-08 Darin Adler <darin@apple.com>
879 Change EventSource constructor to take an IDL dictionary instead of a WebCore::Dictionary
880 https://bugs.webkit.org/show_bug.cgi?id=157459
882 Reviewed by Chris Dumez.
884 * wtf/text/WTFString.h: Export a symbol now used in WebCore.
886 2016-05-02 Sam Weinig <sam@webkit.org>
888 On platforms that support it, use a SecTrustRef as the basis of CertificateInfo instead of a chain of SecCertificateRefs.
889 https://bugs.webkit.org/show_bug.cgi?id=157220
891 Reviewed by Darin Adler.
894 Add support for HAVE(SEC_TRUST_SERIALIZATION).
896 * wtf/spi/cocoa/SecuritySPI.h:
897 Add SPI access to SecTrustSerialize and SecTrustDeserialize.
899 2016-05-04 Filip Pizlo <fpizlo@apple.com>
901 Add HLE locks and synchronic TTAS locks to the ToyLocks benchmark suite
902 https://bugs.webkit.org/show_bug.cgi?id=157367
904 Rubber stamped by Benjamin Poulain.
906 Turns out they are both a lot slower than WTF::Lock. The HLE lock is written according to Intel's
907 documentation. The synchronic lock follows the algorithm of the "ttas_lock" in the synchronic
910 * benchmarks/ToyLocks.h:
912 2016-05-04 Filip Pizlo <fpizlo@apple.com>
914 Add a few more WTF locking benchmarks
915 https://bugs.webkit.org/show_bug.cgi?id=157365
917 Rubber stamped by Benjamin Poulain.
919 Factors out our toy locks into ToyLocks.h and adds a new test (LockFairnessTest) that measures
920 the fairness of locks.
922 The result: WTF::Lock is pretty fair enough.
924 * benchmarks/LockFairnessTest.cpp: Added.
926 * benchmarks/LockSpeedTest.cpp:
928 * benchmarks/ToyLocks.h: Added.
930 2016-05-04 Filip Pizlo <fpizlo@apple.com>
932 Speed up JSGlobalObject initialization by making some properties lazy
933 https://bugs.webkit.org/show_bug.cgi?id=157045
935 Reviewed by Keith Miller.
937 This WTF change is at the heart of a large JSC change. In JSC I found myself wanting to
940 static void callback(Foo& foo) { ... }
942 foo.setCallback(callback);
944 But that's not very nice to write if many different setCallback() calls are inside of the
945 same very large function: you'll have to have a lot of static function definitions in
946 one part of the file, and then a bunch of setCallback() calls in another part. It's hard
947 to reason about what's going on with such code.
949 So what if you wrote this instead:
951 foo.setCallback([] (Foo& foo) { ... });
953 Much nicer! There is a standard way to do this: lambdas that are stateless are
954 convertible to function pointers. This change also offers another approach that is a bit
957 These additions to WTF help you do it:
959 isStatelessLambda<Func>(): tells you if Func is a stateless lambda. This uses is_empty to
960 test if the lambda is stateless. This turns out to be a stronger property than
961 convertibility to function pointers. For example, a function pointer is convertible to a
962 function pointer, but it is definitely stateful: you cannot successfully call it if you
963 only has its type. On the other hand, a stateless lambda is really stateless in the sense
964 that you only need its type to call it.
966 callStatelessLambda<ResultType, Func>(Arguments&&...): calls the given stateless lambda.
968 JSC uses these to build up some sophisticated lazy-initialization APIs. The use of
969 statelessness allows JSC to combine a lambda with other logic into a single function
972 * wtf/StdLibExtras.h:
973 (WTF::isStatelessLambda):
974 (WTF::callStatelessLambda):
976 2016-05-04 Per Arne Vollan <peavo@outlook.com>
978 [Win] Use NeverDestroyed template.
979 https://bugs.webkit.org/show_bug.cgi?id=157345
981 Reviewed by Darin Adler.
983 * wtf/ThreadingWin.cpp:
984 (WTF::threadMapMutex):
987 2016-05-04 Chris Dumez <cdumez@apple.com>
989 Unreviewed, rolling out r200383 and r200406.
991 Seems to have caused crashes on iOS / ARMv7s
995 "Speed up JSGlobalObject initialization by making some
997 https://bugs.webkit.org/show_bug.cgi?id=157045
998 http://trac.webkit.org/changeset/200383
1000 "REGRESSION(r200383): Setting lazily initialized properties
1001 across frame boundaries crashes"
1002 https://bugs.webkit.org/show_bug.cgi?id=157333
1003 http://trac.webkit.org/changeset/200406
1005 2016-05-03 Filip Pizlo <fpizlo@apple.com>
1007 Speed up JSGlobalObject initialization by making some properties lazy
1008 https://bugs.webkit.org/show_bug.cgi?id=157045
1010 Reviewed by Keith Miller.
1012 This WTF change is at the heart of a large JSC change. In JSC I found myself wanting to
1015 static void callback(Foo& foo) { ... }
1017 foo.setCallback(callback);
1019 But that's not very nice to write if many different setCallback() calls are inside of the
1020 same very large function: you'll have to have a lot of static function definitions in
1021 one part of the file, and then a bunch of setCallback() calls in another part. It's hard
1022 to reason about what's going on with such code.
1024 So what if you wrote this instead:
1026 foo.setCallback([] (Foo& foo) { ... });
1028 Much nicer! There is a standard way to do this: lambdas that are stateless are
1029 convertible to function pointers. This change also offers another approach that is a bit
1032 These additions to WTF help you do it:
1034 isStatelessLambda<Func>(): tells you if Func is a stateless lambda. This uses is_empty to
1035 test if the lambda is stateless. This turns out to be a stronger property than
1036 convertibility to function pointers. For example, a function pointer is convertible to a
1037 function pointer, but it is definitely stateful: you cannot successfully call it if you
1038 only has its type. On the other hand, a stateless lambda is really stateless in the sense
1039 that you only need its type to call it.
1041 callStatelessLambda<ResultType, Func>(Arguments&&...): calls the given stateless lambda.
1043 JSC uses these to build up some sophisticated lazy-initialization APIs. The use of
1044 statelessness allows JSC to combine a lambda with other logic into a single function
1047 * wtf/StdLibExtras.h:
1048 (WTF::isStatelessLambda):
1049 (WTF::callStatelessLambda):
1051 2016-05-03 Per Arne Vollan <peavo@outlook.com>
1053 [Win] Remove Windows XP Compatibility Requirements
1054 https://bugs.webkit.org/show_bug.cgi?id=152899
1056 Reviewed by Brent Fulgham.
1058 Windows XP is not supported anymore, we can remove workarounds.
1060 * wtf/Assertions.cpp:
1062 2016-05-03 Per Arne Vollan <peavo@outlook.com>
1065 https://bugs.webkit.org/show_bug.cgi?id=157309
1067 Reviewed by Darin Adler.
1069 MSVC gives a warning when converting from signed to unsigned.
1071 * wtf/SmallPtrSet.h:
1072 (WTF::SmallPtrSet::begin):
1074 2016-05-02 Brady Eidson <beidson@apple.com>
1076 Add the ability to accumulate logs for specific logging channels to help diagnose test timeouts.
1077 https://bugs.webkit.org/show_bug.cgi?id=157274
1079 Reviewed by Alex Christensen.
1081 This patch changes WTFLog to add the logging string to the logging accumulator if the logging channel says so.
1082 It also adds support for using this new accumulation mechanism.
1084 * WTF.xcodeproj/project.pbxproj:
1086 * wtf/Assertions.cpp:
1087 (WTF::resetAccumulatedLogs):
1088 (WTF::getAndResetAccumulatedLogs):
1091 * wtf/LoggingAccumulator.h: Added. Expose functions to get accumulated logs and to reset the accumulation.
1093 * wtf/text/WTFString.cpp:
1094 (WTF::String::format): Update to handle %@ on CF (Well, really ObjC) platforms.
1096 2016-05-02 Per Arne Vollan <peavo@outlook.com>
1098 [Win] Enable IndexedDB.
1099 https://bugs.webkit.org/show_bug.cgi?id=157192
1101 Reviewed by Brent Fulgham.
1103 Fix compile errors when format specifiers like PRIu64 is used, by defining
1104 __STDC_FORMAT_MACROS before inttypes.h is included.
1108 2016-04-27 Brady Eidson <beidson@apple.com>
1110 Modern IDB: Implement native IDBFactory.getAllDatabaseNames for WebInspector.
1111 https://bugs.webkit.org/show_bug.cgi?id=157072
1113 Reviewed by Alex Christensen.
1115 Moved these Hex Digit utilities from WebCore URL code (???),
1116 and add a checked version of getting the hex digit value.
1120 (WTF::uncheckedHexDigit):
1121 (WTF::hexDigitValue):
1122 (WTF::uncheckedHexDigitValue):
1124 2016-04-25 Ryosuke Niwa <rniwa@webkit.org>
1126 Remove the build flag for template elements
1127 https://bugs.webkit.org/show_bug.cgi?id=157022
1129 Reviewed by Daniel Bates.
1131 * wtf/FeatureDefines.h:
1133 2016-04-25 Fujii Hironori <Hironori.Fujii@sony.com>
1135 Heap corruption is detected when destructing JSGlobalObject
1136 https://bugs.webkit.org/show_bug.cgi?id=156831
1138 Reviewed by Mark Lam.
1140 WebKit uses CRT static library on Windows. Each copy of the CRT
1141 library has its own heap manager, allocating memory in one CRT
1142 library and passing the pointer across a DLL boundary to be freed
1143 by a different copy of the CRT library is a potential cause for
1146 Potential Errors Passing CRT Objects Across DLL Boundaries
1147 <https://msdn.microsoft.com/en-us/library/ms235460(v=vs.140).aspx>
1149 JSGlobalObject::createRareDataIfNeeded is inlined but
1150 JSGlobalObject::~JSGlobalObject is not. Then, the heap of
1151 allocating JSGlobalObjectRareData is WebKit.dll, but deallocating
1152 JavaScriptCore.dll. Adding WTF_MAKE_FAST_ALLOCATED to
1153 JSGlobalObjectRareData ensures heap consistency of it. WTF::Lock
1154 also needs WTF_MAKE_FAST_ALLOCATED because it is allocated from
1155 the inlined constructor of JSGlobalObjectRareData.
1157 * wtf/Lock.h: Add WTF_MAKE_FAST_ALLOCATED.
1159 2016-04-21 Saam barati <sbarati@apple.com>
1161 Lets do less locking of symbol tables in the BytecodeGenerator where we don't have race conditions
1162 https://bugs.webkit.org/show_bug.cgi?id=156821
1164 Reviewed by Filip Pizlo.
1166 This patch introduces a new constructor for Locker which implies no
1167 locking is necessary. You instantiate such a locker like so:
1168 `Locker<Lock> locker(Locker<Lock>::NoLockingNecessary);`
1170 This is useful to for very specific places when it is not yet
1171 required to engage in a specified locking protocol. As an example,
1172 we use this in JSC when we allocate a particular object that
1173 engages in a locking protocol with the concurrent compiler thread,
1174 but before a concurrent compiler thread that could have access
1175 to the object exists.
1178 (WTF::Locker::Locker):
1179 (WTF::Locker::~Locker):
1181 2016-04-19 Michael Saboff <msaboff@apple.com>
1183 iTunes crashing JavaScriptCore.dll
1184 https://bugs.webkit.org/show_bug.cgi?id=156647
1186 Reviewed by Filip Pizlo.
1188 If a thread was created without using the WTF thread apis and that thread uses
1189 a JavaScript VM and that thread exits with the VM still around, JSC won't know
1190 that the thread has exited. Currently, we use ThreadSpecificThreadExit() to
1191 clean up any thread specific keys. Cleaning up these keys is how JSC is
1192 notified of a thread exit. We only call ThreadSpecificThreadExit() from
1193 wtfThreadEntryPoint() when the thread entry point function returns.
1194 This mechanism was put in place for Windows because we layer the WTF::ThreadSpecific
1195 functionality on top of TLS (Thread Local Storage), but TLS doesn't have
1196 a thread exiting callback the way that pthread_create_key does.
1198 The fix is to change from using TLS to using FLS (Fiber Local Storage). Although
1199 Windows allows multiple fibers per thread, WebKit is not designed to work with a
1200 multiple fibers per thread. When there is only one fiber per thread, FLS works just
1201 like TLS, but it has the destroy callback.
1203 I restructured the Windows version of WTF::ThreadSpecific to be almost the same
1204 as the pthread version. Added THREAD_SPECIFIC_CALL to set the correct
1205 calling convenction for Windows 32 bit.
1207 * wtf/ThreadSpecific.h:
1208 (WTF::threadSpecificKeyCreate):
1209 (WTF::threadSpecificKeyDelete):
1210 (WTF::threadSpecificSet):
1211 (WTF::threadSpecificGet):
1212 (WTF::ThreadSpecific<T>::ThreadSpecific):
1213 (WTF::ThreadSpecific<T>::~ThreadSpecific):
1214 (WTF::ThreadSpecific<T>::get):
1215 (WTF::ThreadSpecific<T>::set):
1216 (WTF::ThreadSpecific<T>::destroy):
1217 Restructured to use FLS. Renamed TLS* to FLS*.
1219 * wtf/ThreadSpecificWin.cpp:
1222 Renamed from tlsKey*() to flsKey*().
1224 (WTF::destructorsList): Deleted.
1225 (WTF::destructorsMutex): Deleted.
1226 (WTF::PlatformThreadSpecificKey::PlatformThreadSpecificKey): Deleted.
1227 (WTF::PlatformThreadSpecificKey::~PlatformThreadSpecificKey): Deleted.
1228 (WTF::PlatformThreadSpecificKey::setValue): Deleted.
1229 (WTF::PlatformThreadSpecificKey::value): Deleted.
1230 (WTF::PlatformThreadSpecificKey::callDestructor): Deleted.
1231 (WTF::tlsKeyCount): Deleted.
1232 (WTF::tlsKeys): Deleted.
1233 (WTF::threadSpecificKeyCreate): Deleted.
1234 (WTF::threadSpecificKeyDelete): Deleted.
1235 (WTF::threadSpecificSet): Deleted.
1236 (WTF::threadSpecificGet): Deleted.
1237 (WTF::ThreadSpecificThreadExit): Deleted.
1239 * wtf/ThreadingWin.cpp:
1240 (WTF::wtfThreadEntryPoint): Eliminated call to ThreadSpecificThreadExit.
1242 2016-04-19 Filip Pizlo <fpizlo@apple.com>
1244 Add more locking algorithms to the LockSpeedTest.
1246 Rubber stamped by Saam Barati.
1248 * benchmarks/LockSpeedTest.cpp:
1251 2016-04-19 Filip Pizlo <fpizlo@apple.com>
1253 Clean up the ParkingLot uparking API a bit
1254 https://bugs.webkit.org/show_bug.cgi?id=156746
1256 Reviewed by Saam Barati and Geoffrey Garen.
1258 Previously, unparkOne() would either return a boolean to tell you if there are any more threads on
1259 the queue or it would pass your callback a pair of booleans - one to tell if a thread was unparked
1260 and another to tell if there are any more threads. This was an annoying inconsistency. What if you
1261 wanted to know if unparkOne() unparked a thread but you don't care to use callbacks?
1263 This fixes unparkOne() to use a struct called UnparkResult for both of its variants. This makes the
1266 * wtf/Atomics.h: Add some more atomic ops.
1267 (WTF::Atomic::exchangeAndAdd):
1268 (WTF::Atomic::exchange):
1269 * wtf/Condition.h: Change calls to unparkOne().
1270 (WTF::ConditionBase::notifyOne):
1271 * wtf/Lock.cpp: Change calls to unparkOne().
1272 (WTF::LockBase::unlockSlow):
1273 * wtf/ParkingLot.cpp:
1274 (WTF::ParkingLot::parkConditionally):
1275 (WTF::ParkingLot::unparkOne):
1276 * wtf/ParkingLot.h: Switch to using ScopedLambda and introduce UnparkResult.
1278 2016-04-19 Commit Queue <commit-queue@webkit.org>
1280 Unreviewed, rolling out r199726.
1281 https://bugs.webkit.org/show_bug.cgi?id=156748
1283 WebKit tests crash on Windows 32 (Requested by msaboff on
1288 "iTunes crashing JavaScriptCore.dll"
1289 https://bugs.webkit.org/show_bug.cgi?id=156647
1290 http://trac.webkit.org/changeset/199726
1292 2016-04-19 Michael Saboff <msaboff@apple.com>
1294 iTunes crashing JavaScriptCore.dll
1295 https://bugs.webkit.org/show_bug.cgi?id=156647
1297 Reviewed by Saam Barati.
1299 If a thread was created without using the WTF thread apis and that thread uses
1300 a JavaScript VM and that thread exits with the VM still around, JSC won't know
1301 that the thread has exited. Currently, we use ThreadSpecificThreadExit() to
1302 clean up any thread specific keys. Cleaning up these keys is how JSC is
1303 notified of a thread exit. We only call ThreadSpecificThreadExit() from
1304 wtfThreadEntryPoint() when the thread entry point function returns.
1305 This mechanism was put in place for Windows because we layer the WTF::ThreadSpecific
1306 functionality on top of TLS (Thread Local Storage), but TLS doesn't have
1307 a thread exiting callback the way that pthread_create_key.
1309 The fix is to change from using TLS to using FLS (Fiber Local Storage). Although
1310 Windows allows multiple fibers per thread, WebKit is not designed to work with a
1311 multiple fibers per thread. When there is only one fiber per thread, FLS works just
1312 like TLS, but it has the destroy callback.
1314 I restructured the Windows version of WTF::ThreadSpecific to be almost the same
1315 as the pthread version.
1317 * wtf/ThreadSpecific.h:
1318 (WTF::threadSpecificKeyCreate):
1319 (WTF::threadSpecificKeyDelete):
1320 (WTF::threadSpecificSet):
1321 (WTF::threadSpecificGet):
1322 (WTF::ThreadSpecific<T>::ThreadSpecific):
1323 (WTF::ThreadSpecific<T>::~ThreadSpecific):
1324 (WTF::ThreadSpecific<T>::get):
1325 (WTF::ThreadSpecific<T>::set):
1326 (WTF::ThreadSpecific<T>::destroy):
1327 Restructured to use FLS. Renamed TLS* to FLS*.
1329 * wtf/ThreadSpecificWin.cpp:
1332 Renamed from tlsKey*() to flsKey*().
1334 (WTF::destructorsList): Deleted.
1335 (WTF::destructorsMutex): Deleted.
1336 (WTF::PlatformThreadSpecificKey::PlatformThreadSpecificKey): Deleted.
1337 (WTF::PlatformThreadSpecificKey::~PlatformThreadSpecificKey): Deleted.
1338 (WTF::PlatformThreadSpecificKey::setValue): Deleted.
1339 (WTF::PlatformThreadSpecificKey::value): Deleted.
1340 (WTF::PlatformThreadSpecificKey::callDestructor): Deleted.
1341 (WTF::tlsKeyCount): Deleted.
1342 (WTF::tlsKeys): Deleted.
1343 (WTF::threadSpecificKeyCreate): Deleted.
1344 (WTF::threadSpecificKeyDelete): Deleted.
1345 (WTF::threadSpecificSet): Deleted.
1346 (WTF::threadSpecificGet): Deleted.
1347 (WTF::ThreadSpecificThreadExit): Deleted.
1349 * wtf/ThreadingWin.cpp:
1350 (WTF::wtfThreadEntryPoint): Eliminated call to ThreadSpecificThreadExit.
1352 2016-04-19 Yusuke Suzuki <utatane.tea@gmail.com>
1354 [GTK] Use Generic WorkQueue instead of WorkQueueGLib
1355 https://bugs.webkit.org/show_bug.cgi?id=156721
1357 Reviewed by Benjamin Poulain.
1359 WorkQueueGLib includes platform-dependent part only for WorkQueue::dispatchAfter.
1360 However, its code is related to RunLoopGLib rather than WorkQueueGLib.
1361 In this patch, we move the code from WorkQueueGLib to RunLoopGLib, drop WorkQueueGLib
1362 and use WorkQueueGeneric.
1364 * wtf/PlatformGTK.cmake:
1367 * wtf/glib/RunLoopGLib.cpp:
1368 (WTF::DispatchAfterContext::DispatchAfterContext):
1369 (WTF::DispatchAfterContext::dispatch):
1370 (WTF::RunLoop::dispatchAfter):
1371 * wtf/glib/WorkQueueGLib.cpp: Removed.
1372 (WTF::WorkQueue::platformInitialize): Deleted.
1373 (WTF::WorkQueue::platformInvalidate): Deleted.
1374 (WTF::WorkQueue::dispatch): Deleted.
1375 (WTF::DispatchAfterContext::DispatchAfterContext): Deleted.
1376 (WTF::DispatchAfterContext::~DispatchAfterContext): Deleted.
1377 (WTF::DispatchAfterContext::dispatch): Deleted.
1378 (WTF::WorkQueue::dispatchAfter): Deleted.
1380 2016-04-18 Yusuke Suzuki <utatane.tea@gmail.com>
1382 [JSCOnly] Implement RunLoop and remove glib dependency
1383 https://bugs.webkit.org/show_bug.cgi?id=155706
1385 Reviewed by Michael Catanzaro.
1387 Add missing RunLoop and WorkQueue platform code for JSCOnly port.
1388 The implementation does not use platform specific things. Instead, we
1389 implement them on WTF framework; using condition variables to construct
1390 the run loop and timers.
1392 Since the fallback is implemented, it is not necessary for JSCOnly port
1393 to depend on GLib's RunLoop abstraction. So this patch removes its
1394 dependency. As a result, now, JSCOnly port removes dependencies except for the system ICU.
1396 We clean up event loop ifdefs by introducing USE_XXX_EVENT_LOOP flags.
1397 USE(XXX_EVENT_LOOP) is exclusive to each other. So from now, we do not need to take care
1398 of the order of if-defs for the event loops. (For example, USE(GLIB) should have lead before
1399 OS(DARWIN) in WorkQueue.h for WebKitGTK on Darwin.)
1401 EVENT_LOOP determination is done in Platform.h. This follows the style of WTF PLATFORM.
1404 * wtf/PlatformJSCOnly.cmake:
1407 * wtf/generic/MainThreadGeneric.cpp: Renamed from Source/WTF/wtf/none/MainThreadNone.cpp.
1408 (WTF::initializeMainThreadPlatform):
1409 (WTF::scheduleDispatchFunctionsOnMainThread):
1410 * wtf/generic/RunLoopGeneric.cpp: Added.
1411 (WTF::RunLoop::TimerBase::ScheduledTask::create):
1412 (WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask):
1413 (WTF::RunLoop::TimerBase::ScheduledTask::fired):
1414 (WTF::RunLoop::TimerBase::ScheduledTask::scheduledTimePoint):
1415 (WTF::RunLoop::TimerBase::ScheduledTask::updateReadyTime):
1416 (WTF::RunLoop::TimerBase::ScheduledTask::EarliestSchedule::operator()):
1417 (WTF::RunLoop::TimerBase::ScheduledTask::isActive):
1418 (WTF::RunLoop::TimerBase::ScheduledTask::deactivate):
1419 (WTF::RunLoop::RunLoop):
1420 (WTF::RunLoop::~RunLoop):
1421 (WTF::RunLoop::populateTasks):
1422 (WTF::RunLoop::runImpl):
1423 (WTF::RunLoop::run):
1424 (WTF::RunLoop::iterate):
1425 (WTF::RunLoop::stop):
1426 (WTF::RunLoop::wakeUp):
1427 (WTF::RunLoop::schedule):
1428 (WTF::RunLoop::scheduleAndWakeUp):
1429 (WTF::RunLoop::dispatchAfter):
1430 (WTF::RunLoop::TimerBase::TimerBase):
1431 (WTF::RunLoop::TimerBase::~TimerBase):
1432 (WTF::RunLoop::TimerBase::start):
1433 (WTF::RunLoop::TimerBase::stop):
1434 (WTF::RunLoop::TimerBase::isActive):
1435 * wtf/generic/WorkQueueGeneric.cpp: Added.
1436 (WorkQueue::platformInitialize):
1437 (WorkQueue::platformInvalidate):
1438 (WorkQueue::dispatch):
1439 (WorkQueue::dispatchAfter):
1440 * wtf/none/MainThreadNone.cpp:
1441 (WTF::initializeMainThreadPlatform): Deleted.
1442 (WTF::scheduleDispatchFunctionsOnMainThread): Deleted.
1443 * wtf/none/RunLoopNone.cpp:
1444 (WTF::RunLoop::RunLoop): Deleted.
1445 (WTF::RunLoop::~RunLoop): Deleted.
1446 (WTF::RunLoop::run): Deleted.
1447 (WTF::RunLoop::stop): Deleted.
1448 (WTF::RunLoop::wakeUp): Deleted.
1449 (WTF::RunLoop::TimerBase::TimerBase): Deleted.
1450 (WTF::RunLoop::TimerBase::~TimerBase): Deleted.
1451 (WTF::RunLoop::TimerBase::start): Deleted.
1452 (WTF::RunLoop::TimerBase::stop): Deleted.
1453 (WTF::RunLoop::TimerBase::isActive): Deleted.
1454 * wtf/none/WorkQueueNone.cpp:
1455 (WorkQueue::platformInitialize): Deleted.
1456 (WorkQueue::platformInvalidate): Deleted.
1457 (WorkQueue::dispatch): Deleted.
1458 (WorkQueue::dispatchAfter): Deleted.
1460 2016-04-18 Commit Queue <commit-queue@webkit.org>
1462 Unreviewed, rolling out r199621.
1463 https://bugs.webkit.org/show_bug.cgi?id=156708
1465 made windows tests crash (Requested by alexchristensen on
1470 "iTunes crashing JavaScriptCore.dll"
1471 https://bugs.webkit.org/show_bug.cgi?id=156647
1472 http://trac.webkit.org/changeset/199621
1474 2016-04-15 Michael Saboff <msaboff@apple.com>
1476 iTunes crashing JavaScriptCore.dll
1477 https://bugs.webkit.org/show_bug.cgi?id=156647
1479 Reviewed by Geoffrey Garen.
1481 If a thread was created without using the WTF thread apis and that thread uses
1482 a JavaScript VM and that thread exits with the VM still around, JSC won't know
1483 that the thread has exited. Currently, we use ThreadSpecificThreadExit() to
1484 clean up any thread specific keys. Cleaning up these keys is how JSC is
1485 notified of a thread exit. We only call ThreadSpecificThreadExit() from
1486 wtfThreadEntryPoint() when the thread entry point function returns.
1487 This mechanism was put in place for Windos because we layer the WTF::ThreadSpecific
1488 functionality on top of TLS (Thread Local Storage), but TLS doesn't have
1489 a thread exiting callback the way that pthread_create_key.
1491 The fix is to change from using TLS to using FLS (Fiber Local Storage). Although
1492 Windows allows multiple fibers per thread, WebKit is not designed to work with a
1493 multiple fibers per thread. When ther is only one fiber per thread, FLS works just
1494 like TLS, but it has the destroy callback.
1496 I restructured the Windows version of WTF::ThreadSpecific to be almost the same
1497 as the pthread version.
1499 * wtf/ThreadSpecific.h:
1500 (WTF::threadSpecificKeyCreate):
1501 (WTF::threadSpecificKeyDelete):
1502 (WTF::threadSpecificSet):
1503 (WTF::threadSpecificGet):
1504 (WTF::ThreadSpecific<T>::ThreadSpecific):
1505 (WTF::ThreadSpecific<T>::~ThreadSpecific):
1506 (WTF::ThreadSpecific<T>::get):
1507 (WTF::ThreadSpecific<T>::set):
1508 (WTF::ThreadSpecific<T>::destroy):
1509 Restructured to use FLS. Renamed TLS* to FLS*.
1511 * wtf/ThreadSpecificWin.cpp:
1514 Renamed from tlsKey*() to flsKey*().
1516 (WTF::destructorsList): Deleted.
1517 (WTF::destructorsMutex): Deleted.
1518 (WTF::PlatformThreadSpecificKey::PlatformThreadSpecificKey): Deleted.
1519 (WTF::PlatformThreadSpecificKey::~PlatformThreadSpecificKey): Deleted.
1520 (WTF::PlatformThreadSpecificKey::setValue): Deleted.
1521 (WTF::PlatformThreadSpecificKey::value): Deleted.
1522 (WTF::PlatformThreadSpecificKey::callDestructor): Deleted.
1523 (WTF::tlsKeyCount): Deleted.
1524 (WTF::tlsKeys): Deleted.
1525 (WTF::threadSpecificKeyCreate): Deleted.
1526 (WTF::threadSpecificKeyDelete): Deleted.
1527 (WTF::threadSpecificSet): Deleted.
1528 (WTF::threadSpecificGet): Deleted.
1529 (WTF::ThreadSpecificThreadExit): Deleted.
1531 * wtf/ThreadingWin.cpp:
1532 (WTF::wtfThreadEntryPoint): Eliminated call to ThreadSpecificThreadExit.
1534 2016-04-12 Filip Pizlo <fpizlo@apple.com>
1536 PolymorphicAccess should buffer AccessCases before regenerating
1537 https://bugs.webkit.org/show_bug.cgi?id=156457
1539 Reviewed by Benjamin Poulain.
1542 (WTF::TinyPtrSet::add): Add a helpful comment because I had forgotten what the bool return meant.
1544 2016-04-12 Tomas Popela <tpopela@redhat.com>
1546 S390X and PPC64 architectures detection is wrong
1547 https://bugs.webkit.org/show_bug.cgi?id=156337
1549 Reviewed by Carlos Garcia Campos.
1551 After the http://trac.webkit.org/changeset/198919 was committed
1552 it showed that the PPC64 detection is wrong as the CPU(PPC) path was
1553 activated even for PPC64. The thing is that GCC defines __ppc__
1554 even on PPC64 and not just on PPC(32). The same applies for S390X.
1558 2016-04-05 Oliver Hunt <oliver@apple.com>
1560 Remove compile time define for SEPARATED_HEAP
1561 https://bugs.webkit.org/show_bug.cgi?id=155508
1563 Reviewed by Mark Lam.
1565 * wtf/FeatureDefines.h:
1568 2016-04-11 Fujii Hironori <Hironori.Fujii@jp.sony.com>
1570 [CMake] Make FOLDER property INHERITED
1571 https://bugs.webkit.org/show_bug.cgi?id=156460
1573 Reviewed by Brent Fulgham.
1576 Set FOLDER directory property
1578 2016-04-08 Alex Christensen <achristensen@webkit.org>
1580 Progress towards running CMake WebKit2 on Mac
1581 https://bugs.webkit.org/show_bug.cgi?id=156426
1583 Reviewed by Tim Horton.
1585 * wtf/PlatformMac.cmake:
1587 2016-04-08 Yusuke Suzuki <utatane.tea@gmail.com>
1589 [JSC] Enable Concurrent JIT by default
1590 https://bugs.webkit.org/show_bug.cgi?id=156341
1592 Reviewed by Filip Pizlo.
1594 We enable Concurrent JIT by default when DFG JIT and JSVALUE64 are enabled.
1595 This change offers Concurrent JIT to the JSCOnly port.
1599 2016-04-07 Joseph Pecoraro <pecoraro@apple.com>
1601 Remove ENABLE(ENABLE_ES6_CLASS_SYNTAX) guards
1602 https://bugs.webkit.org/show_bug.cgi?id=156384
1604 Reviewed by Ryosuke Niwa.
1606 * wtf/FeatureDefines.h:
1608 2016-04-06 Filip Pizlo <fpizlo@apple.com>
1610 JSC should have a simple way of gathering IC statistics
1611 https://bugs.webkit.org/show_bug.cgi?id=156317
1613 Reviewed by Benjamin Poulain.
1615 Make it easier to do relative sleeping on a condition. Previously you could do this using
1616 std::chrono. I now believe that std::chrono is just a bad decision, and I always want to
1617 use doubles instead. This makes it easier to do the right thing and use doubles.
1620 (WTF::ConditionBase::waitUntilMonotonicClockSeconds):
1621 (WTF::ConditionBase::waitForSeconds):
1623 2016-04-06 Simon Fraser <simon.fraser@apple.com>
1625 Fix Windows build by converting clampToInteger() into a template that only
1626 takes integral types.
1631 2016-04-06 Simon Fraser <simon.fraser@apple.com>
1633 Page tiles are missing when graphics acceleration is unavailable
1634 https://bugs.webkit.org/show_bug.cgi?id=156325
1636 Reviewed by Tim Horton.
1638 Add clampToInteger(size_t).
1643 2016-04-05 Simon Fraser <simon.fraser@apple.com>
1645 Implement operator== and operator!= for Optional<>
1646 https://bugs.webkit.org/show_bug.cgi?id=156266
1648 Reviewed by Anders Carlsson.
1650 Implement non-member operator== and operator!= variants for Optional<>.
1656 2016-03-19 Filip Pizlo <fpizlo@apple.com>
1658 DFG and FTL should constant-fold RegExpExec
1659 https://bugs.webkit.org/show_bug.cgi?id=155270
1661 Reviewed by Saam Barati.
1663 Make executeInsertions() return the amount by which the vector increased in size. This is a
1664 convenient feature that I use in DFG::InsertionSet.
1667 (WTF::executeInsertions):
1669 2016-04-05 Antoine Quint <graouts@apple.com>
1671 [WebGL2] Allow enabling WebGL2 with a runtime flag
1672 https://bugs.webkit.org/show_bug.cgi?id=156166
1673 <rdar://problem/25526929>
1675 Removed the manual overrides of ENABLE_WEBGL2.
1677 Reviewed by Dean Jackson.
1679 * wtf/FeatureDefines.h:
1681 2016-03-31 Konstantin Tokarev <annulen@yandex.ru>
1683 Removed leftovers of ENABLE(INSPECTOR) and ENABLE(VIEWPORT).
1684 https://bugs.webkit.org/show_bug.cgi?id=156064
1686 Reviewed by Csaba Osztrogonác.
1688 This ifdef guards were removed in r178820 and r147714, respectively.
1690 * wtf/FeatureDefines.h:
1692 2016-03-31 Brent Fulgham <bfulgham@apple.com>
1694 [WK2] Support download attribute feature
1695 https://bugs.webkit.org/show_bug.cgi?id=102914
1696 <rdar://problem/13177492>
1698 Reviewed by Darin Adler.
1700 * wtf/FeatureDefines.h: Turn the ENABLE_DOWNLOAD_ATTRIBUTE flag
1701 on to see what happens.
1703 2016-03-30 Brian Burg <bburg@apple.com>
1705 Web Automation: Add Automation.performKeyboardInteractions
1706 https://bugs.webkit.org/show_bug.cgi?id=155990
1707 <rdar://problem/25426408>
1709 Reviewed by Timothy Hatcher.
1711 Add a missing NSEventType declaration.
1713 * wtf/mac/AppKitCompatibilityDeclarations.h:
1715 2016-03-29 Benjamin Poulain <bpoulain@apple.com>
1717 [WTF] Removing a smart pointer from HashTable issues two stores to the same location
1718 https://bugs.webkit.org/show_bug.cgi?id=155676
1720 Reviewed by Darin Adler.
1722 While working on the hot loop of r198376, I noticed something
1724 Every time we removed a smart pointer from the hash table,
1725 the code generated was something like:
1726 Load([bucket]) -> Tmp
1727 Store(0 -> [bucket])
1728 JumpIfZero(Tmp, ->End)
1730 Store(-1 -> [bucket])
1733 The useless store before the branch is annoying, especially on ARM.
1735 Here is what happens:
1736 1) The destructor of the smart pointer swaps its internal value with nullptr.
1737 2) Since the smart pointer is not a local in-register value, that nullptr
1738 is stored in memory because it could be observable from fastFree().
1739 3) The destructor destroy the value if not zero (or deref for RefPtr).
1740 The "if-not-zero" may or may not be eliminated depending on what
1741 is between getting the iterator and the call to remove().
1742 4) fastFree() is called.
1743 5) The deleted value is set in the bucket.
1745 This patch adds custom deletion for those cases to avoid the useless
1746 store. The useless null check is still eliminated when we are lucky.
1748 I went this path instead of changing the destructor of RefPtr for two reasons:
1749 -I need this to work in unique_ptr for JSC.
1750 -Nulling the memory may have security advantages in the cases where we do not immediately
1751 write over that memory again.
1753 This patch removes 13kb out of x86_64 WebCore.
1756 (WTF::HashTable::deleteBucket):
1757 (WTF::KeyTraits>::removeIf):
1759 (WTF::HashTraits<RefPtr<P>>::customDeleteBucket):
1760 (WTF::hashTraitsDeleteBucket):
1761 (WTF::KeyValuePairHashTraits::customDeleteBucket):
1762 * wtf/text/AtomicStringHash.h:
1763 (WTF::HashTraits<WTF::AtomicString>::isEmptyValue):
1764 (WTF::HashTraits<WTF::AtomicString>::customDeleteBucket):
1765 * wtf/text/StringHash.h:
1766 (WTF::HashTraits<String>::customDeleteBucket):
1768 2016-03-28 Brian Burg <bburg@apple.com>
1770 Web Automation: implement Automation.performMouseInteraction
1771 https://bugs.webkit.org/show_bug.cgi?id=155606
1772 <rdar://problem/25227576>
1774 Reviewed by Timothy Hatcher.
1776 * wtf/mac/AppKitCompatibilityDeclarations.h: Add missing some NSEventTypes.
1778 2016-03-29 Yusuke Suzuki <utatane.tea@gmail.com>
1780 REGRESSION(r192914): 10% regression on Sunspider's date-format-tofte
1781 https://bugs.webkit.org/show_bug.cgi?id=155559
1783 Reviewed by Saam Barati.
1785 Add HashTable::inlineLookup and HashMap::fastGet.
1790 2016-03-25 Alex Christensen <achristensen@webkit.org>
1792 Add a compile time flag for using QTKit
1793 https://bugs.webkit.org/show_bug.cgi?id=155868
1795 Reviewed by Dan Bates.
1799 2016-03-24 Alex Christensen <achristensen@webkit.org>
1801 Fix iOS9 performance regression after r197572
1802 https://bugs.webkit.org/show_bug.cgi?id=155845
1803 <rdar://problem/25144924>
1805 Reviewed by Chris Dumez.
1808 Use CFURLConnection instead of NSURLConnection on internal iOS9 builds.
1810 2016-03-23 Saam Barati <sbarati@apple.com>
1812 SmallPtrSet leaks memory in its move assignment operator when !this->isSmall()
1813 https://bugs.webkit.org/show_bug.cgi?id=155701
1815 Reviewed by Darin Adler.
1817 * wtf/SmallPtrSet.h:
1818 (WTF::SmallPtrSet::SmallPtrSet):
1819 (WTF::SmallPtrSet::operator=):
1821 2016-03-22 Per Arne Vollan <peavo@outlook.com>
1823 [Win] [64-bit] Remove MSVC 2013 FMA3 Bug Workaround
1824 https://bugs.webkit.org/show_bug.cgi?id=141499
1826 Reviewed by Brent Fulgham.
1828 As we have moved on to VS2015, this workaround is no longer needed.
1830 * wtf/PlatformWin.cmake:
1831 * wtf/win/WTFDLL.cpp: Removed.
1833 2016-03-20 Dan Bernstein <mitz@apple.com>
1835 [Mac] Determine TARGET_MAC_OS_X_VERSION_MAJOR from MACOSX_DEPLOYMENT_TARGET rather than from MAC_OS_X_VERSION_MAJOR
1836 https://bugs.webkit.org/show_bug.cgi?id=155707
1837 <rdar://problem/24980691>
1839 Reviewed by Darin Adler.
1841 * Configurations/Base.xcconfig: Set TARGET_MAC_OS_X_VERSION_MAJOR based on the last
1842 component of MACOSX_DEPLOYMENT_TARGET.
1843 * Configurations/DebugRelease.xcconfig: For engineering builds, preserve the behavior of
1844 TARGET_MAC_OS_X_VERSION_MAJOR being the host’s OS version.
1846 2016-03-20 Dan Bernstein <mitz@apple.com>
1848 Update build settings
1850 Rubber-stamped by Andy Estes.
1852 * Configurations/DebugRelease.xcconfig:
1854 2016-03-17 Benjamin Poulain <bpoulain@apple.com>
1856 [JSC] Make CSE's ImpureData faster when dealing with large blocks
1857 https://bugs.webkit.org/show_bug.cgi?id=155594
1859 Reviewed by Filip Pizlo.
1862 (WTF::V>::removeIf):
1864 2016-03-17 Saam barati <sbarati@apple.com>
1866 Implement SmallPtrSet and integrate it into the Parser
1867 https://bugs.webkit.org/show_bug.cgi?id=155552
1869 Reviewed by Filip Pizlo.
1871 This patch implements the SmallPtrSet data struture.
1872 Inspired by the implementation in llvm:
1873 http://llvm.org/docs/doxygen/html/SmallPtrSet_8h_source.html
1875 The data structure uses an inline array for storage up until
1876 a fixed limit (8 entries in our implementation). If that storage
1877 fills up, we fall back to a simple hash table implementation.
1878 Crucially, this implementation doesn't support the remove
1879 operation. This is on purpose. The hash table will only ever
1882 Also, the implementation allows for it to be memcopied around.
1883 I.e, we can put SmallPtrSet inside a Vector and allow that
1884 Vector to use memcpy as its move operation (of course this
1885 is only valid if the SmallPtrSet in the old memory doesn't have
1886 its destructor called unless it is set back to its initial state.)
1888 For now, SmallPtrSet only supports pointer types that are trivially
1889 destructible. It's probably not too difficult to extend this to
1890 smart pointers, but it's not part of this original implementation.
1892 I've also implemented a pure forwarding varargs constructAndAppend
1893 method on Vector. This allows you to do:
1895 v.constructAndAppend(a1, a2, ...)
1896 as long as T has a constructor that accepts arguments (a1, a2, ...).
1898 * WTF.xcodeproj/project.pbxproj:
1899 * wtf/CMakeLists.txt:
1900 * wtf/SmallPtrSet.h: Added.
1901 (WTF::SmallPtrSet::SmallPtrSet):
1902 (WTF::SmallPtrSet::operator=):
1903 (WTF::SmallPtrSet::~SmallPtrSet):
1904 (WTF::SmallPtrSet::add):
1905 (WTF::SmallPtrSet::contains):
1906 (WTF::SmallPtrSet::iterator::operator++):
1907 (WTF::SmallPtrSet::iterator::operator*):
1908 (WTF::SmallPtrSet::iterator::operator==):
1909 (WTF::SmallPtrSet::iterator::operator!=):
1910 (WTF::SmallPtrSet::begin):
1911 (WTF::SmallPtrSet::end):
1912 (WTF::SmallPtrSet::size):
1913 (WTF::SmallPtrSet::emptyValue):
1914 (WTF::SmallPtrSet::isValidEntry):
1915 (WTF::SmallPtrSet::isSmall):
1916 (WTF::SmallPtrSet::initialize):
1917 (WTF::SmallPtrSet::grow):
1918 (WTF::SmallPtrSet::bucket):
1920 (WTF::Vector::append):
1921 (WTF::Vector::uncheckedAppend):
1922 (WTF::minCapacity>::append):
1923 (WTF::minCapacity>::constructAndAppend):
1924 (WTF::minCapacity>::appendSlowCase):
1925 (WTF::minCapacity>::constructAndAppendSlowCase):
1927 2016-03-16 Filip Pizlo <fpizlo@apple.com>
1929 Replace all of the various non-working and non-compiling sampling profiler hacks with a single super hack
1930 https://bugs.webkit.org/show_bug.cgi?id=155561
1932 Reviewed by Saam Barati.
1934 This patch replaces all of our various ad hoc profiling hacks with a single ad hoc profiling hack.
1935 That needs to be able to sleep a thread, so I added a portable way to do it.
1937 This also removes a bunch of ENABLE flags for all of the old non-working hacks.
1939 * wtf/CurrentTime.cpp:
1940 (WTF::currentCPUTime):
1942 * wtf/CurrentTime.h:
1946 2016-03-17 Chris Dumez <cdumez@apple.com>
1948 Set the WebContent process's main thread QoS to USER-INTERACTIVE
1949 https://bugs.webkit.org/show_bug.cgi?id=155595
1950 <rdar://problem/22534965>
1952 Reviewed by Antti Koivisto.
1954 Add a relativePriority parameter to setCurrentThreadIsUser*() so that
1955 we can do more fine-grained prioritization of threads that have the
1958 * wtf/Threading.cpp:
1959 (WTF::setCurrentThreadIsUserInteractive):
1960 (WTF::setCurrentThreadIsUserInitiated):
1961 (WTF::createThread): Deleted.
1964 2016-03-17 Filip Pizlo <fpizlo@apple.com>
1966 Silence leaks in ParkingLot
1967 https://bugs.webkit.org/show_bug.cgi?id=155510
1969 Reviewed by Alexey Proskuryakov.
1971 ParkingLot has a concurrent hashtable that it reallocates on demand. It will not reallocate
1972 it in steady state. The hashtable is sized to accommodate the high watermark of the number
1973 of active threads - so long as the program doesn't just keep starting an unbounded number
1974 of threads that are all active, the hashtable will stop resizing. Each resize operation is
1975 designed to stay out of the way of the data-access-parallel normal path, in which two
1976 threads operating on different lock addresses don't have to synchronize. To do this, it
1977 simply drops the old hashtable without deleting it, so that threads that were still using
1978 it don't crash. They will realize that they have the wrong hashtable before doing anything
1979 bad, but we don't have a way of proving when all of those threads are no longer going to
1980 read from the old hashtables. So, we just leak them.
1982 This is a bounded leak, since the hashtable resizes exponentially. Thus the total memory
1983 utilization of all hashtables, including the leaked ones, converges to a linear function of
1984 the current hashtable's size (it's 2 * size of current hashtable).
1986 But this leak is a problem for leaks tools, which will always report this leak. This is not
1987 useful. It's better to silence the leak. That's what this patch does by ensuring that all
1988 hashtables, including leaked ones, end up in a global vector. This is perf-neutral.
1990 This requires making a StaticWordLock variant of WordLock. That's probably the biggest part
1993 * wtf/ParkingLot.cpp:
1995 (WTF::WordLockBase::lockSlow):
1996 (WTF::WordLockBase::unlockSlow):
1997 (WTF::WordLock::lockSlow): Deleted.
1998 (WTF::WordLock::unlockSlow): Deleted.
2000 (WTF::WordLockBase::lock):
2001 (WTF::WordLockBase::isLocked):
2002 (WTF::WordLock::WordLock):
2003 (WTF::WordLock::lock): Deleted.
2004 (WTF::WordLock::isLocked): Deleted.
2006 2016-03-16 Chris Dumez <cdumez@apple.com>
2008 Unreviewed, rolling out r198235, r198240, r198241, and
2011 Causing crashes on ARM
2013 Reverted changesets:
2015 "Remove compile time define for SEPARATED_HEAP"
2016 https://bugs.webkit.org/show_bug.cgi?id=155508
2017 http://trac.webkit.org/changeset/198235
2019 "Gardening: build fix after r198235."
2020 http://trac.webkit.org/changeset/198240
2023 http://trac.webkit.org/changeset/198241
2025 "Rename performJITMemcpy to something more inline with our
2026 normal webkit function names"
2027 https://bugs.webkit.org/show_bug.cgi?id=155525
2028 http://trac.webkit.org/changeset/198252
2030 2016-03-15 Oliver Hunt <oliver@apple.com>
2032 Remove compile time define for SEPARATED_HEAP
2033 https://bugs.webkit.org/show_bug.cgi?id=155508
2035 Reviewed by Mark Lam.
2037 Remove the feature define.
2039 * wtf/FeatureDefines.h:
2042 2016-03-14 Mark Lam <mark.lam@apple.com>
2044 Need to distinguish between Symbol() and Symbol("").
2045 https://bugs.webkit.org/show_bug.cgi?id=155438
2047 Reviewed by Saam Barati.
2049 While toString of both Symbol() and Symbol("") yields "Symbol()", Function.name
2050 should yield "" and "[]" respectively. Hence, we need to tell between the two.
2051 This functionality will be needed later in https://bugs.webkit.org/show_bug.cgi?id=155437.
2053 We achieve this by creating another singleton instance like the empty StringImpl
2054 as the null StringImpl. isNullSymbol() tests if the Stringimpl instance is a
2055 symbol, and its substring is the null() singleton.
2057 * wtf/text/StringImpl.cpp:
2058 (WTF::StringImpl::createSymbol):
2059 (WTF::StringImpl::createNullSymbol):
2060 (WTF::StringImpl::containsOnlyWhitespace):
2061 (WTF::StringImpl::createSymbolEmpty): Deleted.
2062 * wtf/text/StringImpl.h:
2063 (WTF::StringImpl::tryCreateUninitialized):
2064 (WTF::StringImpl::stringKind):
2065 (WTF::StringImpl::isSymbol):
2066 (WTF::StringImpl::isAtomic):
2067 (WTF::StringImpl::isNullSymbol):
2068 * wtf/text/StringStatics.cpp:
2069 (WTF::StringImpl::null):
2071 2016-03-13 Joseph Pecoraro <pecoraro@apple.com>
2073 Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
2074 https://bugs.webkit.org/show_bug.cgi?id=155417
2076 Reviewed by Yusuke Suzuki.
2078 * wtf/FeatureDefines.h:
2080 2016-03-13 Konstantin Tokarev <annulen@yandex.ru>
2082 Added new port JSCOnly.
2083 https://bugs.webkit.org/show_bug.cgi?id=154512
2085 Reviewed by Michael Catanzaro.
2087 This port allows to build JavaScriptCore engine with minimal
2090 * wtf/PlatformJSCOnly.cmake: Added.
2091 * wtf/none/MainThreadNone.cpp: Added.
2092 * wtf/none/RunLoopNone.cpp: Added.
2093 * wtf/none/WorkQueueNone.cpp: Added.
2095 2016-03-13 David Kilzer <ddkilzer@apple.com>
2097 REGRESSION (r198079): Windows build broke because of "%PRId64" format specifier
2099 This fixes the following build failure in WebCore for Windows:
2100 C:\Source\WebCore\page\DOMTimer.cpp(396): error C2146: syntax error: missing ')' before identifier 'PRId64' [C:\WebKitBuild\Debug\Source\WebCore\WebCore.vcxproj]
2101 C:\Source\WebCore\page\DOMTimer.cpp(399): error C2146: syntax error: missing ')' before identifier 'PRId64' [C:\WebKitBuild\Debug\Source\WebCore\WebCore.vcxproj]
2103 * wtf/StdLibExtras.h: Define "PRId64" for Windows here so it may
2104 be shared. This should fix DOMTimer.cpp after r198079 since it
2105 already includes StdLibExtras.h.
2107 2016-03-11 Youenn Fablet <youenn.fablet@crf.canon.fr>
2109 WTF should have a similar function as equalLettersIgnoringASCIICase to match beginning of strings
2110 https://bugs.webkit.org/show_bug.cgi?id=153419
2112 Reviewed by Darin Adler.
2114 Introducing startsWithLettersIgnoringASCIICase, to check the beginning of a string.
2115 Moving some code from WTF::equalLettersIgnoringASCIICaseCommonWithoutLength in
2116 WTF::hasPrefixWithLettersIgnoringASCIICaseCommon to enable reuse in
2117 WTF::startsWithLettersIgnoringASCIICaseCommon.
2119 * wtf/text/StringCommon.h:
2120 (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon):
2121 (WTF::equalLettersIgnoringASCIICaseCommonWithoutLength):
2122 (WTF::startsWithLettersIgnoringASCIICaseCommonWithoutLength):
2123 (WTF::startsWithLettersIgnoringASCIICaseCommon):
2124 * wtf/text/StringImpl.h:
2125 (WTF::startsWithLettersIgnoringASCIICase):
2126 * wtf/text/WTFString.h:
2127 (WTF::startsWithLettersIgnoringASCIICase):
2129 2016-03-10 Frederic Wang <fwang@igalia.com>
2131 [GTK] Add support for WOFF2
2132 https://bugs.webkit.org/show_bug.cgi?id=152616
2134 Reviewed by Carlos Garcia Campos.
2136 * wtf/FeatureDefines.h: Enable USE_WOFF2 flag on GTK.
2138 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
2140 Add runtime flags for shadow DOM and custom elements
2141 https://bugs.webkit.org/show_bug.cgi?id=155213
2143 Reviewed by Dean Jackson.
2145 Removed the manual overrides of ENABLE_SHADOW_DOM and ENABLE_CUSTOM_ELEMENTS as they were
2146 making --no-shadow-dom and --no-custom-elements flags on build-webkit useless.
2148 * wtf/FeatureDefines.h:
2150 2016-03-09 Keith Rollin <krollin@apple.com>
2152 Add state dumping facility
2153 https://bugs.webkit.org/show_bug.cgi?id=154930
2154 <rdar://problem/24939135>
2156 Reviewed by Anders Carlsson.
2158 Add an OS_STATE flag to control the inclusion of process state dumping
2163 2016-03-09 Oliver Hunt <oliver@apple.com>
2169 2016-03-08 Filip Pizlo <fpizlo@apple.com>
2171 Remove failing assertion. There are strings that claim to be atomic but that the
2172 compiler thread can totally deal with, like the empty string.
2174 Rubber stamped by Mark Lam.
2176 * wtf/text/StringImpl.h:
2177 (WTF::StringImpl::ref):
2178 (WTF::StringImpl::deref):
2180 2016-03-08 Filip Pizlo <fpizlo@apple.com>
2182 DFG should be able to constant-fold strings
2183 https://bugs.webkit.org/show_bug.cgi?id=155200
2185 Reviewed by Geoffrey Garen.
2187 Also disable assertions about reference counting strings on the JIT thread. We will do
2188 that now and it's OK.
2190 * wtf/text/StringImpl.h:
2191 (WTF::StringImpl::ref):
2192 (WTF::StringImpl::deref):
2194 2016-03-08 Anders Carlsson <andersca@apple.com>
2196 Fix AppKitCompatibilityDeclarations build.
2198 * wtf/mac/AppKitCompatibilityDeclarations.h:
2199 Remove duplicate declarations, conditionally define NSTextAlignment and
2200 add a NSWindowStyleMask typedef.
2202 2016-03-08 Oliver Hunt <oliver@apple.com>
2204 Start moving to separated writable and executable mappings in the JIT
2205 https://bugs.webkit.org/show_bug.cgi?id=155178
2207 Reviewed by Fil Pizlo.
2209 Update feature defines.
2211 * wtf/FeatureDefines.h:
2212 * wtf/Platform.h: ARM64 for now.
2214 2016-03-08 Anders Carlsson <andersca@apple.com>
2216 Add AppKit compatibility header
2217 https://bugs.webkit.org/show_bug.cgi?id=155202
2219 Reviewed by Beth Dakin.
2221 * WTF.xcodeproj/project.pbxproj:
2222 * wtf/mac/AppKitCompatibilityDeclarations.h: Added.
2224 2016-03-08 Commit Queue <commit-queue@webkit.org>
2226 Unreviewed, rolling out r197793 and r197799.
2227 https://bugs.webkit.org/show_bug.cgi?id=155195
2229 something weird happened while landing this and everything
2230 broke (Requested by olliej on #webkit).
2232 Reverted changesets:
2234 "Start moving to separated writable and executable mappings in
2236 https://bugs.webkit.org/show_bug.cgi?id=155178
2237 http://trac.webkit.org/changeset/197793
2239 "arm64 build fix after r197793."
2240 http://trac.webkit.org/changeset/197799
2242 2016-03-08 Oliver Hunt <oliver@apple.com>
2244 Start moving to separated writable and executable mappings in the JIT
2245 https://bugs.webkit.org/show_bug.cgi?id=155178
2247 Reviewed by Filip Pizlo.
2249 Update feature defines.
2251 * wtf/FeatureDefines.h:
2252 * wtf/Platform.h: ARM64 for now.
2254 2016-03-08 Daniel Bates <dabates@apple.com>
2256 Support iterating over an OptionSet and checking if it is empty
2257 https://bugs.webkit.org/show_bug.cgi?id=154941
2258 <rdar://problem/24964187>
2260 Reviewed by Darin Adler.
2262 Implements support for iterating over the enumerators in an OptionSet as well as
2263 determining if the set is empty.
2265 Iterating over an OptionSet is in Big Theta(N) where N is the number of items in
2266 the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented
2267 by the bitwise OR-ing of all enumerators in the set.
2269 * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant -
2270 the enumerators must be positive powers of two.
2271 (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator.
2272 (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set.
2273 (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator.
2274 (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator.
2275 (WTF::OptionSet::Iterator::Iterator): Added.
2276 (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow
2277 instantiation with a raw value of 0.
2278 (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value
2279 is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED).
2280 (WTF::OptionSet::isEmpty): Returns whether the set is empty.
2281 (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set.
2282 (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set.
2284 2016-03-07 Keith Rollin <krollin@apple.com>
2286 Enhance logging: Use "always on" macros
2287 https://bugs.webkit.org/show_bug.cgi?id=154499
2288 <rdar://problem/24757730>
2290 Reviewed by Chris Dumez.
2292 Update LOG_ALWAYS and LOG_ALWAYS_ERROR macros to take an expression to
2293 be evaluated. If the expression evaluates to True, the associated
2294 message is logged. This facility is used to prevent logging from being
2295 performed in private sessions, but it could be extended to prevent
2296 logging under other circumstances as well.
2300 2016-03-04 Alex Christensen <achristensen@webkit.org>
2302 Remove vcxproj build system
2303 https://bugs.webkit.org/show_bug.cgi?id=154388
2305 Rubber-stamped by Brent Fulgham.
2307 * WTF.vcxproj/WTF.submit.sln: Removed.
2308 * WTF.vcxproj/WTF.vcxproj: Removed.
2309 * WTF.vcxproj/WTF.vcxproj.filters: Removed.
2310 * WTF.vcxproj/WTFCFLite.props: Removed.
2311 * WTF.vcxproj/WTFCommon.props: Removed.
2312 * WTF.vcxproj/WTFCoreFoundation.props: Removed.
2313 * WTF.vcxproj/WTFDebug.props: Removed.
2314 * WTF.vcxproj/WTFDebugWinCairo.props: Removed.
2315 * WTF.vcxproj/WTFGenerated.make: Removed.
2316 * WTF.vcxproj/WTFGenerated.vcxproj: Removed.
2317 * WTF.vcxproj/WTFGenerated.vcxproj.filters: Removed.
2318 * WTF.vcxproj/WTFGeneratedCommon.props: Removed.
2319 * WTF.vcxproj/WTFGeneratedDebug.props: Removed.
2320 * WTF.vcxproj/WTFGeneratedProduction.props: Removed.
2321 * WTF.vcxproj/WTFGeneratedRelease.props: Removed.
2322 * WTF.vcxproj/WTFPostBuild.cmd: Removed.
2323 * WTF.vcxproj/WTFPreBuild.cmd: Removed.
2324 * WTF.vcxproj/WTFProduction.props: Removed.
2325 * WTF.vcxproj/WTFRelease.props: Removed.
2326 * WTF.vcxproj/WTFReleaseWinCairo.props: Removed.
2327 * WTF.vcxproj/build-generated-files.pl: Removed.
2328 * WTF.vcxproj/copy-files.cmd: Removed.
2329 * WTF.vcxproj/work-around-vs-dependency-tracking-bugs.py: Removed.
2331 2016-03-04 Alex Christensen <achristensen@webkit.org>
2333 Use NSURLSession for loading in WebKit2
2334 https://bugs.webkit.org/show_bug.cgi?id=154993
2336 Reviewed by Sam Weinig.
2340 2016-03-03 Daniel Bates <dabates@apple.com>
2342 Add unit tests for WTF::OptionSet
2343 https://bugs.webkit.org/show_bug.cgi?id=154925
2344 <rdar://problem/24964211>
2346 Reviewed by Darin Adler.
2348 * wtf/CMakeLists.txt: Add header OptionSet.h to the list of WTF headers.
2349 * wtf/OptionSet.h: Use in-class initialization to initialize m_storage and declare
2350 the trivial constexpr constructor as default.
2351 (WTF::OptionSet::OptionSet): For convenience add a constructor that takes a std::initializer_list.
2352 This code was written by Anders Carlsson.
2354 2016-03-03 Andy Estes <aestes@apple.com>
2356 Adopt CFNetwork storage partitioning SPI
2357 https://bugs.webkit.org/show_bug.cgi?id=154957
2358 rdar://problem/23614620
2360 Reviewed by Darin Adler.
2362 * wtf/Platform.h: Defined HAVE_CFNETWORK_STORAGE_PARTITIONING.
2364 2016-03-02 Konstantin Tokarev <annulen@yandex.ru>
2366 [cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK.
2367 https://bugs.webkit.org/show_bug.cgi?id=154651
2369 Reviewed by Alex Christensen.
2371 * CMakeLists.txt: Moved shared code to WEBKIT_FRAMEWORK macro.
2373 2016-03-01 Commit Queue <commit-queue@webkit.org>
2375 Unreviewed, rolling out r197226 and r197256.
2376 https://bugs.webkit.org/show_bug.cgi?id=154910
2378 Caused crashes on Mac 32-bit and on ARM (Requested by ap on
2381 Reverted changesets:
2383 "Remove the on demand executable allocator"
2384 https://bugs.webkit.org/show_bug.cgi?id=154749
2385 http://trac.webkit.org/changeset/197226
2388 http://trac.webkit.org/changeset/197256
2390 2016-03-01 Alex Christensen <achristensen@webkit.org>
2392 Reduce size of internal windows build output
2393 https://bugs.webkit.org/show_bug.cgi?id=154763
2395 Reviewed by Brent Fulgham.
2397 * WTF.vcxproj/WTF.proj:
2399 2016-03-01 Commit Queue <commit-queue@webkit.org>
2401 Unreviewed, rolling out r197056.
2402 https://bugs.webkit.org/show_bug.cgi?id=154870
2404 broke win ews (Requested by alexchristensen on #webkit).
2408 "[cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK."
2409 https://bugs.webkit.org/show_bug.cgi?id=154651
2410 http://trac.webkit.org/changeset/197056
2412 2016-02-29 Gavin Barraclough <barraclough@apple.com>
2414 RefCounter<T>::Event -> RefCounterEvent
2415 https://bugs.webkit.org/show_bug.cgi?id=154767
2417 Reviewed by Darin Adler.
2419 RefCounter<T>::Event is kinda verbose to use, and there is no need for this
2420 to be specific to a particular typeof RefCounter. Move the enum class up to
2421 the top level & rename to RefCounterEvent.
2424 (WTF::RefCounter<T>::Count::ref):
2425 (WTF::RefCounter<T>::Count::deref):
2427 2016-02-26 Oliver Hunt <oliver@apple.com>
2429 Remove the on demand executable allocator
2430 https://bugs.webkit.org/show_bug.cgi?id=154749
2432 Reviewed by Geoffrey Garen.
2434 Remove the DeamndExecutableAllocator compile flags.
2438 2016-02-26 Keith Rollin <krollin@apple.com>
2440 Enhance logging: Add "always on" macros
2441 https://bugs.webkit.org/show_bug.cgi?id=154498
2442 <rdar://problem/24757759>
2444 Reviewed by Chris Dumez.
2446 Add support for efficient always-on logging (logging that is available
2447 in both debug and release builds). This is implemented in the form of
2450 - LOG_ALWAYS: Always log information-level statements.
2451 - LOG_ALWAYS_ERROR: Always log error-level statements. These can be
2452 filtered out of the normal logging so that they can be found more
2455 In cases where there is no efficient underlying facility for it to
2456 utilize, LOG_ALWAYS_ERROR is redirected to WTFReportError as a backup
2457 mechanism. LOG_ALWAYS is not given a similar treatment so that we
2458 don't overwhelm other logging systems that aren't prepared for "always
2464 2016-02-26 Anders Carlsson <andersca@apple.com>
2466 Add WTF::OptionSet and use it for the website data types enum
2467 https://bugs.webkit.org/show_bug.cgi?id=154733
2469 Reviewed by Geoffrey Garen.
2471 Add WTF::OptionSet which makes it easier to use strong enums as flags.
2473 * WTF.xcodeproj/project.pbxproj:
2475 * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h.
2476 (WTF::OptionSet::fromRaw):
2477 (WTF::OptionSet::OptionSet):
2478 (WTF::OptionSet::toRaw):
2479 (WTF::OptionSet::contains):
2480 (WTF::OptionSet::operator|=):
2482 2016-02-26 Commit Queue <commit-queue@webkit.org>
2484 Unreviewed, rolling out r197168.
2485 https://bugs.webkit.org/show_bug.cgi?id=154728
2487 crashing on some devices (Requested by kling on #webkit).
2491 "[Darwin] Use vm_kernel_page_size for WTF::pageSize()."
2492 https://bugs.webkit.org/show_bug.cgi?id=154726
2493 http://trac.webkit.org/changeset/197168
2495 2016-02-26 Andreas Kling <akling@apple.com>
2497 [Darwin] Use vm_kernel_page_size for WTF::pageSize().
2498 <https://webkit.org/b/154726>
2500 Reviewed by Antti Koivisto.
2502 Make sure we use the right VM page size on Darwin systems.
2503 On devices where the native page size is 4 KB, it's both
2504 possible and profitable to madvise in smaller chunks.
2506 * wtf/PageBlock.cpp:
2507 (WTF::systemPageSize):
2509 2016-02-25 Gavin Barraclough <barraclough@apple.com>
2511 RefCounter value changed callback should be called on all changes (not just zero edge).
2512 https://bugs.webkit.org/show_bug.cgi?id=154699
2514 Reviewed by Anders Carlsson.
2516 RefCounter currently only triggers a callback when the count goes from zero
2517 to non-zero and vice-versa. Change that, to be useful to more clients.
2520 (WTF::RefCounter::Count::Count):
2521 (WTF::RefCounter::RefCounter):
2522 - Removed superfluous WTF_EXPORT_PRIVATE.
2523 (WTF::RefCounter::value):
2524 - Changed value() to a size_t.
2525 (WTF::RefCounter<T>::Count::ref):
2526 (WTF::RefCounter<T>::Count::deref):
2527 - Trigger the callback on all increments/decrements.
2528 (WTF::RefCounter<T>::RefCounter):
2529 - Changed siganture of callback.
2531 2016-02-25 Gavin Barraclough <barraclough@apple.com>
2533 Replace RefCounter::Token implementation with RefPtr
2534 https://bugs.webkit.org/show_bug.cgi?id=154698
2536 Reviewed by Anders Carlsson.
2539 (WTF::RefCounter::RefCounter):
2540 (WTF::RefCounter::count):
2541 (WTF::RefCounter::value):
2542 (WTF::RefCounter<T>::~RefCounter):
2543 (WTF::RefCounter::Token::Token): Deleted.
2544 (WTF::RefCounter::Token::operator bool): Deleted.
2545 (WTF::RefCounter<T>::Token::Token): Deleted.
2549 2016-02-25 Gavin Barraclough <barraclough@apple.com>
2551 Should template RefCounter instead of RefCounter::Token
2552 https://bugs.webkit.org/show_bug.cgi?id=154691
2554 Speculative windows build fix.
2557 (WTF::RefCounter::RefCounter):
2558 (WTF::RefCounter::count):
2560 2016-02-25 Commit Queue <commit-queue@webkit.org>
2562 Unreviewed, rolling out r197137.
2563 https://bugs.webkit.org/show_bug.cgi?id=154700
2565 broke windows build (Requested by alexchristensen on #webkit).
2569 "Replace RefCounter::Token implementation with RefPtr"
2570 https://bugs.webkit.org/show_bug.cgi?id=154698
2571 http://trac.webkit.org/changeset/197137
2573 2016-02-25 Gavin Barraclough <barraclough@apple.com>
2575 Replace RefCounter::Token implementation with RefPtr
2576 https://bugs.webkit.org/show_bug.cgi?id=154698
2578 Reviewed by Anders Carlsson.
2581 (WTF::RefCounter::RefCounter):
2582 (WTF::RefCounter::count):
2583 (WTF::RefCounter::value):
2584 (WTF::RefCounter<T>::~RefCounter):
2585 (WTF::RefCounter::Token::Token): Deleted.
2586 (WTF::RefCounter::Token::operator bool): Deleted.
2587 (WTF::RefCounter<T>::Token::Token): Deleted.
2591 2016-02-25 Gavin Barraclough <barraclough@apple.com>
2593 Should template RefCounter instead of RefCounter::Token
2594 https://bugs.webkit.org/show_bug.cgi?id=154691
2596 Reviewed by Anders Carlsson.
2598 My real goal here is to make the counter accurate. Currently returning a Token from token<>()
2599 results in ref-count churn. Fixing this either means changing the return value, or improving
2600 Token (which will probably mean replacing it with RefPtr). Either way would break the current
2601 type checking. Move type tag to RefCount so this can still be enforced.
2603 * WTF.vcxproj/WTF.vcxproj:
2604 * WTF.vcxproj/WTF.vcxproj.filters:
2605 * WTF.xcodeproj/project.pbxproj:
2606 * wtf/CMakeLists.txt:
2607 * wtf/RefCounter.cpp: Removed.
2608 - Removed RefCounter.cpp.
2610 (WTF::RefCounter::Token::Token):
2611 (WTF::RefCounter::Token::operator bool):
2612 (WTF::RefCounter::RefCounter):
2613 (WTF::RefCounter::count):
2614 (WTF::RefCounter::value):
2615 (WTF::RefCounter<T>::Count::ref):
2616 (WTF::RefCounter<T>::Count::deref):
2617 (WTF::RefCounter<T>::RefCounter):
2618 (WTF::RefCounter<T>::~RefCounter):
2619 (WTF::RefCounter<T>::Token::Token):
2621 (WTF::RefCounter::token): Deleted.
2622 (WTF::RefCounter::Token<T>::Token): Deleted.
2623 - RefCounter -> RefCounter<T>,
2624 - Token<T> -> Token,
2625 - renamed token<>() -> count().
2627 2016-02-25 Sam Weinig <sam@webkit.org>
2629 HashMap::ensure() should return an AddResult like all the other add-like functions.
2630 https://bugs.webkit.org/show_bug.cgi?id=154680
2632 Reviewed by Anders Carlsson.
2634 While adopting HashMap::ensure(), I found it was useful in some circumstances to know
2635 if the value was added or not. While I could discern this information by setting a bool
2636 in the passed in lambda, it seemed clearer and more idiomatic to just have ensure return
2637 an AddResult like all the other add-like functions do.
2640 Change return type of HashMap::ensure() to be an AddResult.
2642 2016-02-24 Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au>
2644 [web-animations] Add AnimationTimeline, DocumentTimeline and add extensions to Document interface
2645 https://bugs.webkit.org/show_bug.cgi?id=151688
2647 Reviewed by Dean Jackson.
2649 Enables the WEB_ANIMATIONS compiler switch.
2651 * wtf/FeatureDefines.h:
2653 2016-02-24 Konstantin Tokarev <annulen@yandex.ru>
2655 [cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK.
2656 https://bugs.webkit.org/show_bug.cgi?id=154651
2658 Reviewed by Alex Christensen.
2660 * CMakeLists.txt: Moved shared code to WEBKIT_FRAMEWORK macro.
2662 2016-02-23 Dan Bernstein <mitz@apple.com>
2664 [Xcode] Linker errors display mangled names, but no longer should
2665 https://bugs.webkit.org/show_bug.cgi?id=154632
2667 Reviewed by Sam Weinig.
2669 * Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.
2671 2016-02-23 Gavin Barraclough <barraclough@apple.com>
2673 Remove HIDDEN_PAGE_DOM_TIMER_THROTTLING feature define
2674 https://bugs.webkit.org/show_bug.cgi?id=112323
2676 Reviewed by Chris Dumez.
2678 This feature is controlled by a runtime switch, and defaults off.
2680 * wtf/FeatureDefines.h:
2682 2016-02-22 Konstantin Tokarev <annulen@yandex.ru>
2684 [cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
2685 https://bugs.webkit.org/show_bug.cgi?id=154450
2687 Reviewed by Alex Christensen.
2689 * wtf/CMakeLists.txt:
2691 2016-02-20 Mark Lam <mark.lam@apple.com>
2693 Use of inlined asm statements causes problems for -std=c99 builds.
2694 https://bugs.webkit.org/show_bug.cgi?id=154507
2696 Reviewed by Dan Bernstein.
2698 WTF's Assertions.h may inadvertantly get included by other projects that are built
2699 with -std=c99. The use of the inlined asm statements with the keyword "asm" is
2700 not recognized when the -std compiler flag is used.
2702 https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html says "When writing code that
2703 can be compiled with -ansi and the various -std options, use __asm__ instead of
2704 asm (see Alternate Keywords)."
2706 So, to be a good citizen, we can change the use of "asm" in CRASH() to "__asm__"
2707 so that we don't break the build of such other projects.
2711 2016-02-18 Brent Fulgham <bfulgham@apple.com>
2713 Extend HashCountedSet with a method to efficiently set the count of an entry
2714 https://bugs.webkit.org/show_bug.cgi?id=154352
2716 Reviewed by Geoffrey Garen.
2718 Tested by new TestWebKitAPI tests.
2720 Update the HashCountedSet class with a new 'add' method to support efficient initialization of
2721 the count of a given key. Also provide move and pointer template specializations to expand the
2722 types of data that can be used as 'keys' in the HashCountedSet to match the underlying HashMap
2725 * wtf/HashCountedSet.h:
2726 (WTF::Traits>::add): Added new overload supporting a supplied count.
2728 2016-02-18 Commit Queue <commit-queue@webkit.org>
2730 Unreviewed, rolling out r196791.
2731 https://bugs.webkit.org/show_bug.cgi?id=154438
2733 broke windows build (Requested by alexchristensen on #webkit).
2737 "Extend HashCountedSet with a method to efficiently set the
2739 https://bugs.webkit.org/show_bug.cgi?id=154352
2740 http://trac.webkit.org/changeset/196791
2742 2016-02-18 Brent Fulgham <bfulgham@apple.com>
2744 Extend HashCountedSet with a method to efficiently set the count of an entry
2745 https://bugs.webkit.org/show_bug.cgi?id=154352
2747 Reviewed by Geoffrey Garen.
2749 Tested by new TestWebKitAPI tests.
2751 Update the HashCountedSet class with a new 'add' method to support efficient initialization of
2752 the count of a given key. Also provide move and pointer template specializations to expand the
2753 types of data that can be used as 'keys' in the HashCountedSet to match the underlying HashMap
2756 * wtf/HashCountedSet.h:
2757 (WTF::Traits>::add): Added new overload supporting a supplied count.
2759 2016-02-17 Filip Pizlo <fpizlo@apple.com>
2761 Remove LLVM dependencies from WebKit
2762 https://bugs.webkit.org/show_bug.cgi?id=154323
2764 Reviewed by Antti Koivisto and Benjamin Poulain.
2768 2016-02-16 Sam Weinig <sam@webkit.org>
2770 Add an ensure function on HashMap that takes a key and a function to make the lazy value initialization idiom easier
2771 https://bugs.webkit.org/show_bug.cgi?id=134857
2773 Reviewed by Geoffrey Garen.
2775 The current idiom for adding a value to a HashMap if the key is not already present, to allow for not
2776 unnecessarily constructing the new value if it won't be used, is:
2779 auto result = map.add(key, Value());
2780 if (!result.isNewEntry)
2781 return result.iterator->value;
2783 result.iterator->value = createNewValue();
2784 return result.iterator->value;
2790 auto& value = map.add(key, Value()).iterator->value;
2792 value = createNewValue();
2796 With this patch, you can now use the new function HashMap::ensure(key, functor). This will allow us to
2797 change to using the following idiom:
2800 return map.ensure(key, [] { return createNewValue(); });
2803 The passed in functor will only be called if the key is not already present in the HashMap.
2806 (WTF::HashMapTranslator::translate):
2807 (WTF::HashMapEnsureTranslator::hash):
2808 (WTF::HashMapEnsureTranslator::equal):
2809 (WTF::HashMapEnsureTranslator::translate):
2810 (WTF::HashMapTranslatorAdapter::hash):
2812 2016-02-16 Filip Pizlo <fpizlo@apple.com>
2814 FTL_USES_B3 should be unconditionally true
2815 https://bugs.webkit.org/show_bug.cgi?id=154324
2817 Reviewed by Benjamin Poulain.
2821 2016-02-13 Mark Lam <mark.lam@apple.com>
2823 Eliminate the need for WTFCrashImpl().
2824 https://bugs.webkit.org/show_bug.cgi?id=154202
2826 Reviewed by Alexey Proskuryakov.
2828 * wtf/Assertions.cpp:
2831 2016-02-12 Sukolsak Sakshuwong <sukolsak@gmail.com>
2833 Update ICU header files to version 52
2834 https://bugs.webkit.org/show_bug.cgi?id=154160
2836 Reviewed by Alex Christensen.
2838 Update ICU header files to version 52 to allow the use of newer APIs.
2840 * icu/unicode/bytestream.h:
2841 * icu/unicode/localpointer.h:
2842 * icu/unicode/platform.h:
2843 * icu/unicode/ptypes.h:
2844 * icu/unicode/putil.h:
2845 * icu/unicode/rep.h:
2846 (Replaceable::Replaceable):
2847 * icu/unicode/std_string.h:
2848 * icu/unicode/strenum.h:
2849 * icu/unicode/stringpiece.h:
2850 * icu/unicode/uchar.h:
2851 * icu/unicode/ucnv.h:
2852 * icu/unicode/ucol.h:
2853 * icu/unicode/uconfig.h:
2854 * icu/unicode/uenum.h:
2855 * icu/unicode/uiter.h:
2856 * icu/unicode/uloc.h:
2857 * icu/unicode/umachine.h:
2858 * icu/unicode/unistr.h:
2859 (UnicodeString::UnicodeString):
2860 (UnicodeString::operator== ):
2861 (UnicodeString::startsWith):
2862 (UnicodeString::setTo):
2863 (UnicodeString::remove):
2864 (UnicodeString::replace): Deleted.
2865 (UnicodeString::extract): Deleted.
2866 (UnicodeString::char32At): Deleted.
2867 (UnicodeString::getChar32Start): Deleted.
2868 (UnicodeString::getChar32Limit): Deleted.
2869 (UnicodeString::getTerminatedBuffer): Deleted.
2870 (UnicodeString::append): Deleted.
2871 (UnicodeString::truncate): Deleted.
2872 * icu/unicode/unorm2.h:
2873 * icu/unicode/uobject.h:
2874 * icu/unicode/urename.h:
2875 * icu/unicode/uscript.h:
2876 * icu/unicode/uset.h:
2877 * icu/unicode/ustring.h:
2878 * icu/unicode/utf.h:
2879 * icu/unicode/utf16.h:
2880 * icu/unicode/utf8.h:
2881 * icu/unicode/utf_old.h:
2882 * icu/unicode/utypes.h:
2883 * icu/unicode/uvernum.h:
2884 * icu/unicode/uversion.h:
2886 2016-02-11 Mark Lam <mark.lam@apple.com>
2888 Need WTFCrash workaround for shipping SafariForWebKitDevelopment binaries.
2889 https://bugs.webkit.org/show_bug.cgi?id=154125
2891 Reviewed by Joseph Pecoraro.
2893 Presently shipping SafariForWebKitDevelopment binaries still expect to link to a
2894 WTFCrash function. We need to provide this function as a workaround until we can
2895 update SafariForWebKitDevelopment to use the new inlined version.
2897 We do this by doing:
2898 1. Make WTFCrashImpl() the sole function for implementing a crash.
2899 The CRASH() macro is now defined to be WTFCrashImpl() instead of WTFCrash().
2900 2. Renamed the legacy WTFCrash() to WTFCrashImpl() for debug or non-Darwin builds.
2901 For (non-debug && OS(DARWIN)) builds, WTFCrashImpl() will be an inlined
2902 function with an asm statement that issues a breakpoint trap.
2903 3. Implement WTFCrash() as a function that calls CRASH().
2904 This satisfies the need of shipping SafariForWebKitDevelopment binaries.
2905 4. Change WTFCrashWithSecurityImplication() to call CRASH().
2906 This ensures that we have a consistent implementation of how we crash.
2907 5. Changed WTFLogAlwaysAndCrash() to call CRASH() instead of WTFCrash().
2908 This is just to have consistency in that all code in the WebKit project
2909 now crashes by calling CRASH(), not WTFCrash().
2911 * wtf/Assertions.cpp:
2914 2016-02-09 Mark Lam <mark.lam@apple.com>
2916 Changed WTFCrash to not trash the crash site register state.
2917 https://bugs.webkit.org/show_bug.cgi?id=153996
2919 Reviewed by Geoffrey Garen.
2921 When doing post-mortem crash site analysis using data from crash reports, it is
2922 immensely valuable to be able to infer the crashing program's state from the
2923 register values at crash time. However, for RELEASE_ASSERT failures, we crash
2924 using WTFCrash(), and WTFCrash() is currently implemented as a function call
2925 that, in turn, calls a lot of other functions to do crash handling before
2926 actually crashing. As a result, the register values captured in the crash
2927 reports are not likely to still contain the values used by the caller function
2928 that failed the RELEASE_ASSERT.
2930 This patch aims to remedy this issue for non-debug builds on OS(DARWIN) ports.
2931 It does so by changing WTFCrash() into an inlined function that has an inlined
2932 asm statement to issues the CPU specific breakpoint trap instruction. As a
2933 result, for non-debug OS(DARWIN) builds, crashes due to failed RELEASE_ASSERTs
2934 will now show up in crash reports as crashing due to EXC_BREAKPOINT (SIGTRAP)
2935 instead of a EXC_BAD_ACCESS (SIGSEGV) on address 0xbbadbeef.
2937 For debug and non-DARWIN builds, WTFCrash() behavior currently remains unchanged.
2939 * wtf/Assertions.cpp:
2942 2016-02-09 Csaba Osztrogonác <ossy@webkit.org>
2944 [GTK][EFL] Fix several build configuration related to SamplingProfiler after r196245
2945 https://bugs.webkit.org/show_bug.cgi?id=154033
2947 Reviewed by Michael Catanzaro.
2951 2016-02-08 Filip Pizlo <fpizlo@apple.com>
2953 Make sure that locking code that relies on module boundaries for compiler fences uses NEVER_INLINE
2954 https://bugs.webkit.org/show_bug.cgi?id=153972
2956 Reviewed by Andreas Kling.
2958 When this code was written, we assumed that module boundaries were compiler fences. That might
2959 not be the case if we ever do LTO.
2962 (WTF::LockBase::lockSlow):
2963 (WTF::LockBase::unlockSlow):
2964 * wtf/ParkingLot.cpp:
2965 (WTF::ParkingLot::parkConditionally):
2966 (WTF::ParkingLot::unparkOne):
2967 (WTF::ParkingLot::unparkAll):
2968 (WTF::ParkingLot::forEach):
2970 (WTF::WordLock::lockSlow):
2971 (WTF::WordLock::unlockSlow):
2973 2016-02-07 Yusuke Suzuki <utatane.tea@gmail.com>
2975 [GTK][EFL] Enable SamplingProfiler
2976 https://bugs.webkit.org/show_bug.cgi?id=153638
2978 Reviewed by Michael Catanzaro.
2982 2016-02-07 Dan Bernstein <mitz@apple.com>
2984 [Cocoa] Replace __has_include guards around inclusion of Apple-internal-SDK headers with USE(APPLE_INTERNAL_SDK)
2985 https://bugs.webkit.org/show_bug.cgi?id=153963
2987 Reviewed by Sam Weinig.
2989 * wtf/SystemTracing.h:
2990 * wtf/WTFThreadData.h:
2991 * wtf/spi/darwin/CommonCryptoSPI.h:
2993 2016-02-06 Darin Adler <darin@apple.com>
2995 Finish auditing call sites of upper() and lower(), eliminate many, and rename the functions
2996 https://bugs.webkit.org/show_bug.cgi?id=153905
2998 Reviewed by Sam Weinig.
3000 * wtf/text/AtomicString.cpp:
3001 (WTF::AtomicString::lower): Deleted.
3002 * wtf/text/AtomicString.h: Deleted the lower function.
3004 * wtf/text/StringImpl.cpp:
3005 (WTF::StringImpl::convertToLowercaseWithoutLocale): Renamed from lower.
3006 (WTF::StringImpl::convertToUppercaseWithoutLocale): Renamed from upper.
3007 (WTF::StringImpl::convertToLowercaseWithLocale): Renamed from lower.
3008 (WTF::StringImpl::convertToUppercaseWithLocale): Renamed from upper.
3009 (WTF::StringImpl::foldCase): Added fast cases for ASCII since this is
3010 now used in some more-performance-critical code.
3011 * wtf/text/StringImpl.h: Renamed lower and upper.
3013 * wtf/text/WTFString.cpp:
3014 (WTF::String::convertToLowercaseWithoutLocale): Renamed from lower.
3015 (WTF::String::convertToUppercaseWithoutLocale): Renamed from upper.
3016 (WTF::String::convertToLowercaseWithLocale): Renamed from lower.
3017 (WTF::String::convertToUppercaseWithLocale): Renamed from upper.
3018 * wtf/text/WTFString.h: Renamed lower and upper. Removed unneeded comment.
3020 2016-02-03 Darin Adler <darin@apple.com>
3022 Convert another batch of String::lower callsites to something better, typically convertToASCIILowercase
3023 https://bugs.webkit.org/show_bug.cgi?id=153789
3025 Reviewed by Sam Weinig.
3027 * wtf/text/StringView.h:
3028 (WTF::StringView::toInt): Added an overload without the out parameter.
3030 2016-02-03 Michael Catanzaro <mcatanzaro@igalia.com>
3032 [GTK][EFL] Switch FTL to B3
3033 https://bugs.webkit.org/show_bug.cgi?id=153478
3035 Reviewed by Csaba Osztrogonác.
3037 Enable B3 by default on all x86.
3041 2016-02-03 Anders Carlsson <andersca@apple.com>
3043 Fix BlockPtr's call operator
3044 https://bugs.webkit.org/show_bug.cgi?id=153836
3046 Reviewed by Enrica Casucci.
3050 2016-02-01 Said Abou-Hallawa <sabouhallawa@apple.com>
3052 Cache the Path instead of creating it every time it is required
3053 https://bugs.webkit.org/show_bug.cgi?id=152939
3055 Reviewed by Darin Adler.
3057 If the key type of an LRU cache can't to be strongly tided to a specific
3058 data type; e.g. FloatRect -> Path, we need to be able to pass the policy
3059 type to the TinyLRUCache template instead of just specializing it. This
3060 will make the code more readable and will allow different caches for the
3063 * wtf/TinyLRUCache.h:
3064 (WebCore::TinyLRUCache::get):
3066 2016-02-01 Alex Christensen <achristensen@webkit.org>
3068 [Win] WTFHeaderDetection.h no longer needed
3069 https://bugs.webkit.org/show_bug.cgi?id=153753
3070 rdar://problem/24434627
3072 Reviewed by Darin Adler.
3075 * wtf/PlatformWin.cmake:
3077 2016-01-31 Darin Adler <darin@apple.com>
3079 Cut down on calls to String::lower; mostly replace with convertToASCIILowercase
3080 https://bugs.webkit.org/show_bug.cgi?id=153732
3082 Reviewed by Dean Jackson.
3084 * wtf/text/StringView.h: Added toIntStrict. Not thrilled about the name of this
3085 function, but generally it seems likely to be useful more often than toInt.
3086 And it's needed for one call site in WebCore that was using String::lower.
3088 2016-01-31 Darin Adler <darin@apple.com>
3090 Get rid of most calls to String::upper; mostly replace them with convertToASCIIUppercase
3091 https://bugs.webkit.org/show_bug.cgi?id=153715
3093 Reviewed by Gyuyoung Kim.
3095 * wtf/text/AtomicString.h:
3096 (WTF::AtomicString::upper): Deleted.
3098 2016-01-31 Dan Bernstein <mitz@apple.com>
3100 [Cocoa] Remove unused definition of HAVE_HEADER_DETECTION_H
3101 https://bugs.webkit.org/show_bug.cgi?id=153729
3103 Reviewed by Sam Weinig.
3105 After r141700, HAVE_HEADER_DETECTION_H is no longer used.
3107 * Configurations/Base.xcconfig:
3109 2016-01-31 Darin Adler <darin@apple.com>
3111 Replace CaseFoldingHash with ASCIICaseInsensitiveHash
3112 https://bugs.webkit.org/show_bug.cgi?id=153639
3114 Reviewed by Filip Pizlo.
3116 * wtf/text/StringHash.h: Renamed CaseFoldingHash to ASCIICaseInsensitiveHash.
3117 (WTF::ASCIICaseInsensitiveHash::foldCase): Use toASCIILower.
3118 (WTF::ASCIICaseInsensitiveHash::equal): Use equalIgnoringASCIICase.
3119 Also added some assertions.
3121 * wtf/text/StringImpl.cpp: Made the latin1CaseFoldTable private to this file,
3122 since it's no longer needed by CaseFoldingHash. Moved it up before its first use.
3123 (WTF::equalCompatibilityCaseless): Fixed typo in the name of this function.
3124 (WTF::equalCompatibiltyCaselessNonNull): Deleted.
3126 * wtf/text/StringImpl.h: Removed declarations of latin1CaseFoldTable and
3127 equalCompatibiltyCaselessNonNull
3129 2016-01-30 Commit Queue <commit-queue@webkit.org>
3131 Unreviewed, rolling out r195911.
3132 https://bugs.webkit.org/show_bug.cgi?id=153723
3134 Caused frequent assertion failures on bots (Requested by ap on
3139 "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
3140 https://bugs.webkit.org/show_bug.cgi?id=153639
3141 http://trac.webkit.org/changeset/195911
3143 2016-01-30 Darin Adler <darin@apple.com>
3145 Replace CaseFoldingHash with ASCIICaseInsensitiveHash
3146 https://bugs.webkit.org/show_bug.cgi?id=153639
3148 Reviewed by Filip Pizlo.
3150 * wtf/text/StringHash.h: Renamed CaseFoldingHash to ASCIICaseInsensitiveHash.
3151 (WTF::ASCIICaseInsensitiveHash::foldCase): Use toASCIILower.
3152 (WTF::ASCIICaseInsensitiveHash::equal): Use equalIgnoringASCIICase.
3153 Also added some assertions.
3155 * wtf/text/StringImpl.cpp: Made the latin1CaseFoldTable private to this file,
3156 since it's no longer needed by CaseFoldingHash. Moved it up before its first use.
3157 (WTF::equalCompatibilityCaseless): Fixed typo in the name of this function.
3158 (WTF::equalCompatibiltyCaselessNonNull): Deleted.
3160 * wtf/text/StringImpl.h: Removed declarations of latin1CaseFoldTable and
3161 equalCompatibiltyCaselessNonNull
3163 2016-01-29 Ada Chan <adachan@apple.com>
3165 Enable VIDEO_PRESENTATION_MODE only in Debug and Release builds on Mac
3166 https://bugs.webkit.org/show_bug.cgi?id=153665
3168 Reviewed by Dan Bernstein.
3171 Remove this as the flag is already defined in FeatureDefines.xcconfig files.
3173 2016-01-30 Yusuke Suzuki <utatane.tea@gmail.com>
3175 Enable SamplingProfiler on POSIX environment
3176 https://bugs.webkit.org/show_bug.cgi?id=153584
3178 Reviewed by Michael Saboff.
3180 Use __GLIBC__ since mcontext_t layout depends on it.
3184 2016-01-28 Darin Adler <darin@apple.com>
3186 Remove equalIgnoringCase since all callers really wanted equalIgnoringASCIICase
3187 https://bugs.webkit.org/show_bug.cgi?id=153411
3189 Reviewed by Ryosuke Niwa.
3191 * wtf/text/AtomicString.h: Removed equalIgnoringCase.
3192 Added some overloads for equalIgnoringASCIICase and moved the function bodies to
3193 bottom of the file to make the function declarations easier to read and scan through.
3194 I plan to do this for more of the functions in this class in the future.
3196 * wtf/text/StringCommon.h: Added overloads for equalIgnoringASCIICase,
3197 equalPossiblyIgnoringASCIICase, and a helper named equalIgnoringASCIICaseCommon.
3198 Added an overload for equalLettersIgnoringASCIICase.
3200 * wtf/text/StringImpl.cpp:
3201 (WTF::equalIgnoringCase): Made the few remaining versions of this function private
3202 to this file. Once we get done moving every client that should be using ASCII case
3203 instead to new functions, these will almost certainly be deleted.
3204 (WTF::equalIgnoringASCIICaseNonNull): Tweaked implementation a tiny bit.
3206 * wtf/text/StringImpl.h: Sorted forward declarations at the top of the file.
3207 Fixed some small formatting mistakes. Removed equalIgnoringCase, but left
3208 equalIgnoringCaseNonNull behind for use by CaseFoldingHash until it is replaced
3209 with ASCIICaseFoldingHash. Improved equalIgnoringASCIICase implementation.
3210 Removed unneeded using for equalIgnoringASCIICase now that StringCommon.h takes
3213 * wtf/text/StringView.cpp:
3214 (WTF::equalIgnoringASCIICase): Deleted. We no longer pass in the length for this,
3215 so the arguments have changed and the implementation is also now in ASCIICommon.h
3216 so it's an inline in the header file.
3218 * wtf/text/StringView.h: Added an overload of equalIgnoringASCIICase,while
3221 * wtf/text/WTFString.h: Removed some unneeded forward delcarations. Fixed formatting
3222 of the type name NSString *. Improved some comments. Removed equalIgnoringCase.
3223 Separated declaration from implementation in a few cases to start making the
3224 function declarations easier to read and scan through. I plan to do more in the future.
3226 2016-01-27 Chris Dumez <cdumez@apple.com>
3228 window.atob() should ignore spaces in input
3229 https://bugs.webkit.org/show_bug.cgi?id=153522
3230 <rdar://problem/24357822>
3232 Reviewed by Benjamin Poulain.
3234 Turn Base64DecodePolicy enum into flags so that the caller can indicate
3235 to both validate padding AND ignore spaces.
3237 Also make sure that the output Vector size is properly shrunk when
3240 * wtf/text/Base64.cpp:
3241 (WTF::base64DecodeInternal):
3242 (WTF::base64Decode):
3243 (WTF::base64URLDecode):
3244 * wtf/text/Base64.h:
3246 2016-01-27 Alexey Proskuryakov <ap@apple.com>
3248 Remove ENABLE_CURRENTSRC
3249 https://bugs.webkit.org/show_bug.cgi?id=153545
3251 Reviewed by Simon Fraser.
3253 * wtf/FeatureDefines.h:
3255 2016-01-26 I-Ting Liu <iting_liu@apple.com>
3257 Implement wildcard matching for plug-in policy host.
3258 https://bugs.webkit.org/show_bug.cgi?id=153090
3260 Reviewed by Darin Adler.
3262 * wtf/text/AtomicString.h:
3263 (WTF::AtomicString::AtomicString):
3264 Add __bridge to allow compilation.
3266 2016-01-26 Joseph Pecoraro <pecoraro@apple.com>
3268 Generalize ResourceUsageData gathering to be used outside of ResourceUsageOverlay
3269 https://bugs.webkit.org/show_bug.cgi?id=153509
3270 <rdar://problem/24354291>
3272 Reviewed by Andreas Kling.
3275 Rename the ENABLE flag.
3277 2016-01-26 Yusuke Suzuki <utatane.tea@gmail.com>
3279 Make HashTable iterators STL iterators compatible
3280 https://bugs.webkit.org/show_bug.cgi?id=153512
3282 Reviewed by Alex Christensen.
3284 While r178581 makes many hash table iterators STL compatible, still several iterators are not.
3285 This patch fixes that; inheriting std::iterator correctly to meet STL iterator requirements (like iterator_category etc.)
3286 It could recover Windows build failure.
3290 2016-01-26 Anders Carlsson <andersca@apple.com>
3292 BlockPtr needs boolean operators
3293 https://bugs.webkit.org/show_bug.cgi?id=153506
3295 Reviewed by Tim Horton.
3299 2016-01-25 Filip Pizlo <fpizlo@apple.com>
3301 FTLB3Output should maintain good block order like the LLVM one does
3302 https://bugs.webkit.org/show_bug.cgi?id=152222
3304 Reviewed by Geoffrey Garen.
3306 In the FTL we need to be able to construct a list by inserting elements before other
3307 specific elements. We didn't already have a scalable way to do this, so this adds such a
3308 data structure to WTF. This also has changes to SentinelLinkedList to make it support
3309 these kinds of insertions.
3311 * WTF.xcodeproj/project.pbxproj:
3312 * wtf/OrderMaker.h: Added.
3313 (WTF::OrderMaker::Node::Node):
3314 (WTF::OrderMaker::OrderMaker):
3315 (WTF::OrderMaker::prepend):
3316 (WTF::OrderMaker::append):
3317 (WTF::OrderMaker::insertBefore):
3318 (WTF::OrderMaker::insertAfter):
3319 (WTF::OrderMaker::iterator::iterator):
3320 (WTF::OrderMaker::iterator::operator*):
3321 (WTF::OrderMaker::iterator::operator++):
3322 (WTF::OrderMaker::iterator::operator==):
3323 (WTF::OrderMaker::iterator::operator!=):
3324 (WTF::OrderMaker::begin):
3325 (WTF::OrderMaker::end):
3326 (WTF::OrderMaker::newNode):
3327 * wtf/SentinelLinkedList.h:
3328 (WTF::BasicRawSentinelNode::isOnList):
3329 (WTF::BasicRawSentinelNode<T>::remove):
3330 (WTF::BasicRawSentinelNode<T>::prepend):
3331 (WTF::BasicRawSentinelNode<T>::append):
3332 (WTF::RawNode>::SentinelLinkedList):
3333 (WTF::RawNode>::push):
3334 (WTF::RawNode>::append):
3335 (WTF::RawNode>::remove):
3336 (WTF::RawNode>::prepend):
3337 (WTF::RawNode>::isOnList):
3339 2016-01-25 Alex Christensen <achristensen@webkit.org>
3341 [Win] Copy forwarding headers before building a project
3342 https://bugs.webkit.org/show_bug.cgi?id=153434
3344 Reviewed by Brent Fulgham.
3346 * wtf/CMakeLists.txt:
3347 * wtf/PlatformWin.cmake:
3349 2016-01-20 Ryosuke Niwa <rniwa@webkit.org>
3351 HTMLElement::nodeName should not upper case non-ASCII characters
3352 https://bugs.webkit.org/show_bug.cgi?id=153231
3354 Reviewed by Darin Adler.
3356 Added convertToASCIIUppercase to AtomicString, String, and StringImpl.
3358 * wtf/text/AtomicString.cpp:
3359 (WTF::AtomicString::convertASCIICase): Generalized from convertToASCIILowercase.
3360 (WTF::AtomicString::convertToASCIILowercase):
3361 (WTF::AtomicString::convertToASCIIUppercase):
3362 * wtf/text/AtomicString.h:
3363 * wtf/text/StringImpl.cpp:
3364 (WTF::StringImpl::convertASCIICase): Generalized from convertToASCIILowercase.
3365 (WTF::StringImpl::convertToASCIILowercase):
3366 (WTF::StringImpl::convertToASCIIUppercase):
3367 * wtf/text/StringImpl.h:
3368 * wtf/text/WTFString.cpp:
3369 (WTF::String::convertToASCIIUppercase): Added.
3370 * wtf/text/WTFString.h:
3372 2016-01-22 Chris Dumez <cdumez@apple.com>
3374 Unreviewed attempt to fix the Windows build after r195452.
3376 * wtf/text/WTFString.h:
3378 2016-01-22 Darin Adler <darin@apple.com>
3380 Reduce use of equalIgnoringCase to just ignore ASCII case
3381 https://bugs.webkit.org/show_bug.cgi?id=153266
3383 Reviewed by Ryosuke Niwa.
3386 (WTF::isASCIIAlphaCaselessEqual): Loosened the assertion in this function
3387 so it can work with ASCII spaces, numeric digits, and some punctuation.
3388 Commented that we might want to change its name later.
3390 * wtf/Assertions.cpp:
3391 (WTFInitializeLogChannelStatesFromString): Use equalLettersIgnoringASCIICase.
3393 * wtf/text/AtomicString.h:
3394 (WTF::equalLettersIgnoringASCIICase): Added. Calls the version that takes a String.
3396 * wtf/text/StringCommon.h:
3397 (WTF::equalLettersIgnoringASCIICase): Added. Takes a pointer to characters.
3398 (WTF::equalLettersIgnoringASCIICaseCommonWithoutLength): Added.
3399 (WTF::equalLettersIgnoringASCIICaseCommon): Added.
3401 * wtf/text/StringImpl.h:
3402 (WTF::equalLettersIgnoringASCIICase): Added. Calls equalLettersIgnoringASCIICaseCommon.
3404 * wtf/text/StringView.h:
3405 (WTF::equalLettersIgnoringASCIICase): Added. Calls equalLettersIgnoringASCIICaseCommon.
3407 * wtf/text/WTFString.h: Reordered/reformatted a little.
3408 (WTF::equalIgnoringASCIICase): Added. Calls the version that takes a StringImpl.
3410 2016-01-22 Csaba Osztrogonác <ossy@webkit.org>
3412 Buildfix for older GCCs after r195142
3413 https://bugs.webkit.org/show_bug.cgi?id=153351
3415 Unreviewed buildfix.
3417 * wtf/SystemTracing.h:
3419 2016-01-21 Filip Pizlo <fpizlo@apple.com>
3421 REGRESSION(r195417): many tests crash
3422 https://bugs.webkit.org/show_bug.cgi?id=153316
3424 Reviewed by Saam Barati.
3426 This rolls out the StdLibExtras.h change, and simplifies RangeSet to not use binary search.
3427 That's fine for now, since B3 doesn't stress RangeSet enough right now.
3430 (WTF::RangeSet::contains):
3431 (WTF::RangeSet::overlaps):
3432 (WTF::RangeSet::clear):
3433 (WTF::RangeSet::findRange):
3434 * wtf/StdLibExtras.h:
3435 (WTF::binarySearchImpl):
3436 (WTF::binarySearch):
3437 (WTF::tryBinarySearch):
3438 (WTF::approximateBinarySearch):
3440 2016-01-21 Filip Pizlo <fpizlo@apple.com>
3442 B3 should have load elimination
3443 https://bugs.webkit.org/show_bug.cgi?id=153288
3445 Reviewed by Geoffrey Garen.
3447 I needed a way to track sets of ranges, where there is a high likelihood that all of the
3448 ranges overlap. So I created RangeSet. It's a usually-sorted list of coalesced ranges.
3449 Practically this means that right now, FTL B3 will end up with two kinds of range sets: a set
3450 that just contains top and a set that contains nothing. In the future, most sets will either
3451 be top of empty but some of them will contain a handful of other things.
3453 * WTF.xcodeproj/project.pbxproj:
3454 * wtf/CMakeLists.txt:
3456 (WTF::leftShiftWithSaturation):
3457 (WTF::nonEmptyRangesOverlap):
3458 (WTF::rangesOverlap):
3459 * wtf/RangeSet.h: Added.
3460 (WTF::RangeSet::RangeSet):
3461 (WTF::RangeSet::~RangeSet):
3462 (WTF::RangeSet::add):
3463 (WTF::RangeSet::contains):
3464 (WTF::RangeSet::overlaps):
3465 (WTF::RangeSet::clear):
3466 (WTF::RangeSet::dump):
3467 (WTF::RangeSet::dumpRaw):
3468 (WTF::RangeSet::compact):
3469 (WTF::RangeSet::overlapsNonEmpty):
3470 (WTF::RangeSet::subsumesNonEmpty):
3471 (WTF::RangeSet::findRange):
3472 * wtf/StdLibExtras.h:
3473 (WTF::binarySearchImpl):
3474 (WTF::binarySearch):
3475 (WTF::tryBinarySearch):
3476 (WTF::approximateBinarySearch):
3478 2016-01-19 Ada Chan <adachan@apple.com>
3480 Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
3481 https://bugs.webkit.org/show_bug.cgi?id=153218
3483 Reviewed by Eric Carlson.
3487 2016-01-19 Filip Pizlo <fpizlo@apple.com>
3489 B3 should have basic path specialization
3490 https://bugs.webkit.org/show_bug.cgi?id=153200
3492 Reviewed by Benjamin Poulain.
3494 * wtf/GraphNodeWorklist.h:
3495 (WTF::GraphNodeWorklist::push):
3496 (WTF::GraphNodeWorklist::pushAll):
3497 (WTF::GraphNodeWorklist::isEmpty):
3498 (WTF::GraphNodeWorklist::notEmpty):
3500 2016-01-20 Said Abou-Hallawa <sabouhallawa@apple.com>
3502 Refactor AtomicStringKeyedMRUCache to be a generic LRU cache
3503 https://bugs.webkit.org/show_bug.cgi?id=153109
3505 Reviewed by Darin Adler.
3507 Refactor AtomicStringKeyedMRUCache, move it to WTF project and rename it
3508 to be TinyLRUCache. Define another template and call it TinyLRUCachePolicy.
3509 This one can be overridden for different keys and values. Its function is
3510 creating the cached values.
3512 * WTF.xcodeproj/project.pbxproj:
3513 * wtf/TinyLRUCache.h: Added.
3514 (WebCore::TinyLRUCachePolicy::isKeyNull):
3515 (WebCore::TinyLRUCachePolicy::createValueForNullKey):
3516 (WebCore::TinyLRUCachePolicy::createValueForKey):
3517 (WebCore::TinyLRUCache::get):
3519 2016-01-19 Saam barati <sbarati@apple.com>
3521 WTF::Bag should be non-copyable
3522 https://bugs.webkit.org/show_bug.cgi?id=153253
3524 Reviewed by Filip Pizlo.
3527 * wtf/SegmentedVector.h:
3528 (WTF::SegmentedVector::append):
3529 (WTF::SegmentedVector::alloc):
3531 2016-01-19 Enrica Casucci <enrica@apple.com>
3533 Add support for DataDetectors in WK (iOS).
3534 https://bugs.webkit.org/show_bug.cgi?id=152989
3535 rdar://problem/22855960
3537 Reviewed by Tim Horton.
3539 Adding feature definition for data detection.
3541 * wtf/FeatureDefines.h:
3543 2016-01-19 Commit Queue <commit-queue@webkit.org>
3545 Unreviewed, rolling out r195300.
3546 https://bugs.webkit.org/show_bug.cgi?id=153244
3548 enrica wants more time to fix Windows (Requested by thorton on
3553 "Add support for DataDetectors in WK (iOS)."
3554 https://bugs.webkit.org/show_bug.cgi?id=152989
3555 http://trac.webkit.org/changeset/195300
3557 2016-01-19 Chris Dumez <cdumez@apple.com>
3559 Unreviewed, rolling out r195141.
3561 Seems to cause crashes on iOS9 64bit
3565 "Fragmentation-free allocator for timeless and/or coupled
3567 https://bugs.webkit.org/show_bug.cgi?id=152696
3568 http://trac.webkit.org/changeset/195141
3570 2016-01-19 Enrica Casucci <enrica@apple.com>
3572 Add support for DataDetectors in WK (iOS).
3573 https://bugs.webkit.org/show_bug.cgi?id=152989
3574 rdar://problem/22855960
3576 Reviewed by Tim Horton.
3578 Adding feature definition for data detection.
3580 * wtf/FeatureDefines.h:
3582 2016-01-17 Filip Pizlo <fpizlo@apple.com>
3584 FTL B3 should be just as fast as FTL LLVM on Octane/crypto
3585 https://bugs.webkit.org/show_bug.cgi?id=153113
3587 Reviewed by Saam Barati.