Use preallocated stack reference to store adjacentBacktrackingStart
https://bugs.webkit.org/show_bug.cgi?id=131237

Patch by Yusuke Suzuki <utatane.tea@gmail.com> on 2014-04-05
Reviewed by Benjamin Poulain.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
(WebCore::SelectorCompiler::SelectorCodeGenerator::computeBacktrackingInformation):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateDirectAdjacentTreeWalker):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateAdjacentBacktrackingTail):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateBacktrackingTailsIfNeeded):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacent): Deleted.
(WebCore::SelectorCompiler::SelectorCodeGenerator::linkFailures): Deleted.
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateDescendantBacktrackingTail): Deleted.
* cssjit/StackAllocator.h:
(WebCore::StackAllocator::allocateUninitialized):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove bogus ASSERT in -JSVirtualMachine scanObjectGraph
https://bugs.webkit.org/show_bug.cgi?id=131251

Reviewed by Geoffrey Garen.

* API/JSVirtualMachine.mm:
(scanExternalObjectGraph):
* API/tests/testapi.mm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166835 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Canvas stroke and strokeRect with SourceIn, DestinationIn, SourceOut, DestinationAtop and Copy have errors
https://bugs.webkit.org/show_bug.cgi?id=66762

Reviewed by Andreas Kling.

Source/WebCore:

For fill operations we create a new ImageBuffer to ensure that the results are composited
correctly according to the Canvas spec. This patch creates a new transparency layer
for stroking on certain compositing operators to archive the same. This makes WebKit's
behavior interoperable with Firefox and IE as well.

Test: fast/fast/canvas/canvas-composite-stroke-alpha.html

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::strokeInternal):
(WebCore::CanvasRenderingContext2D::strokeRect):

LayoutTests:

330 tests based on canvas-composite-alpha to test correct compositing behavior with
strokeRect() and stroke().

* fast/canvas/canvas-composite-stroke-alpha-expected.txt: Added.
* fast/canvas/canvas-composite-stroke-alpha.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166836 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Enhanced GC logging
https://bugs.webkit.org/show_bug.cgi?id=131246

Reviewed by Geoff Garen.

Source/JavaScriptCore: 

Getting data on the state of the JSC Heap at runtime is currently in a sad state. 
The OBJECT_MARK_LOGGING macro enables some basic GC logging, but it requires a full 
recompile to turn it on. It would be nice if we could runtime enable our GC logging 
infrastructure while incurring minimal cost when it is disabled. 

It would also be nice to get a complete view of the Heap. Currently OBJECT_MARK_LOGGING 
provides us with the discovered roots along with parent-child relationships as objects 
are scanned. However, once an object is scanned it will never be declared as the child 
of another object during that collection. This gives us a tree-like view of the 
Heap (i.e. each scanned node only reports having a single parent), where the actual 
Heap can be an arbitrary graph.

This patch replaces OBJECT_MARK_LOGGING and gives us these nice to haves. First it enhances 
our logGC() runtime Option by changing it to be a tri-state value of None, Basic, or Verbose 
logging levels. None means no logging is done, Basic is what logGC() = true would have done 
prior to this patch, and Verbose logs all object relationships.

JSCell has new dump/dumpToStream methods, the latter of which is "virtual" to allow 
subclasses to override the default string representation that will be dumped. These 
methods allow JSCells to be dumped using the standard dataLog() calls similar to much of
the logging infrastructure in our compilers.

This patch also adds a GCLogging class that handles dumping the relationships between objects.
It does this by using the pre-existing visitChildren virtual methods to obtain the immediate
children of each live cell at the end of garbage collection.

This change meets our goal of being neutral on the benchmarks we track.

* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/GCLogging.cpp: Added.
(JSC::GCLogging::levelAsString):
(JSC::LoggingFunctor::LoggingFunctor):
(JSC::LoggingFunctor::operator()):
(JSC::LoggingFunctor::log):
(JSC::LoggingFunctor::reviveCells):
(JSC::LoggingFunctor::returnValue):
(JSC::GCLogging::dumpObjectGraph):
* heap/GCLogging.h: Added.
* heap/GCSegmentedArray.h:
(JSC::GCSegmentedArray::begin):
(JSC::GCSegmentedArray::end):
* heap/Heap.cpp:
(JSC::Heap::markRoots):
(JSC::Heap::visitSmallStrings):
(JSC::Heap::visitConservativeRoots):
(JSC::Heap::visitCompilerWorklists):
(JSC::Heap::visitProtectedObjects):
(JSC::Heap::visitTempSortVectors):
(JSC::Heap::visitArgumentBuffers):
(JSC::Heap::visitException):
(JSC::Heap::visitStrongHandles):
(JSC::Heap::visitHandleStack):
(JSC::Heap::traceCodeBlocksAndJITStubRoutines):
(JSC::Heap::visitWeakHandles):
(JSC::Heap::updateObjectCounts):
(JSC::Heap::collect):
(JSC::Heap::didFinishCollection):
* heap/Heap.h:
* heap/MarkStack.h:
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::dump):
* heap/SlotVisitor.h:
(JSC::SlotVisitor::markStack):
* heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::internalAppend):
* runtime/ClassInfo.h:
* runtime/JSCell.cpp:
(JSC::JSCell::dump):
(JSC::JSCell::dumpToStream):
(JSC::JSCell::className):
* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::visitChildren):
* runtime/JSString.cpp:
(JSC::JSString::dumpToStream):
(JSC::JSString::visitChildren):
* runtime/JSString.h:
(JSC::JSString::length):
(JSC::JSRopeString::RopeBuilder::length):
* runtime/Options.cpp:
(JSC::parse):
(JSC::Options::setOption):
(JSC::Options::dumpOption):
* runtime/Options.h:

Source/WTF: 

Remove OBJECT_MARK_LOGGING

* wtf/FeatureDefines.h:
* wtf/Platform.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add missing files from r166837

* heap/GCLogging.cpp: Added.
(JSC::GCLogging::levelAsString):
(JSC::LoggingFunctor::LoggingFunctor):
(JSC::LoggingFunctor::~LoggingFunctor):
(JSC::LoggingFunctor::operator()):
(JSC::LoggingFunctor::log):
(JSC::LoggingFunctor::reviveCells):
(JSC::LoggingFunctor::returnValue):
(JSC::GCLogging::dumpObjectGraph):
* heap/GCLogging.h: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166838 268f45cc-cd09-0410-ab3c-d52691b4dbfc