Don't leak registers for redeclared variables
https://bugs.webkit.org/show_bug.cgi?id=120174

Reviewed by Geoff Garen.

We currently always allocate registers for new global variables, but these are wasted when the variable is being redeclared.
Only allocate new registers when necessary.

No performance impact.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
* runtime/Executable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):
    - Don't allocate the register here.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::addGlobalVar):
    - Allocate the register here instead.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/120180> Fix issues with OTHER_LDFLAGS in various .xcconfig files

Reviewed by David Kilzer.

Source/WebKit2:

Adding ld flags for ASAN overwrote the unexported symbol flags we were
previously specifying. Since the unexported symbol ld flags are only
needed for the framework target, move them to WebKit2.xcconfig where we
can add them to OTHER_LDFLAGS along with the ASAN values inherited from
DebugRelease.xcconfig (and other values).

* Configurations/Base.xcconfig: Removed the unexported symbol ld flags.
* Configurations/WebKit2.xcconfig: ... and moved them here.

Tools:

* TestWebKitAPI/Configurations/Base.xcconfig: Removed the definition of
OTHER_CPLUSPLUSFLAGS since -ftemplate-depth=256 is already set in
DebugRelease.xcconfig and TestWebKitAPI isn't built in Production.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update LLVM binary drops and scripts to the latest version from SVN
https://bugs.webkit.org/show_bug.cgi?id=120184

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore: 

* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):

Tools: 

* ReducedFTL/build.sh:
* Scripts/configure-llvm: Added.
* Scripts/copy-webkitlibraries-to-product-directory:
* Scripts/export-llvm-build:

WebKitLibraries: 

Updated binary drops to r189066.

* LLVMIncludesMountainLion.tar.bz2:
* LLVMLibrariesMountainLion.tar.bz2:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Repaint counters are sometimes not in the corner of the compositing layer
https://bugs.webkit.org/show_bug.cgi?id=120176

Reviewed by Beth Dakin.

Sometimes the repaint counters are not in the corner of the compositing layer;
they are either inset, or partially or entirely outside the layer.

Fix by making sure that we restore the CGContext before drawing
the counter, since the WebCore code may have translated the CTM.

The counter-painting code saves and restores the context itself,
so this is safe.

* platform/graphics/mac/WebLayer.mm:
(drawLayerContents):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154469 268f45cc-cd09-0410-ab3c-d52691b4dbfc
compositing/geometry/bounds-ignores-hidden-dynamic.html has incorrect initial rendering
https://bugs.webkit.org/show_bug.cgi?id=119825

Source/WebCore:

Reviewed by Tim Horton.

r137526 and some earlier commits attempted to avoid unconditionally
repainting layers when their size changes, because this was causing
TiledBacking layers to repaint when the document size changed.

However, the approach required that we have good information about
whether size changes require a repaint, which in some cases is hard
to determine, especially when RenderLayer changes affect our
decisions about which layers are composited.

Fix by pushing the decision about whether to repaint on size change
into GraphicsLayer. The default is to repaint on size change,
but GraphicsLayer provides a function that can be overridden to
modify this behavior; GraphicsLayerCA does so to avoid repaints
when layers with TiledBackings get resized.

Test: compositing/repaint/repaint-on-layer-grouping-change.html

* WebCore.exp.in: WebKit2 needs GraphicsLayer::setSize, which is no longer inline.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setOffsetFromRenderer):
(WebCore::GraphicsLayer::setSize):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::shouldRepaintOnSizeChange):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::shouldRepaintOnSizeChange):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerBacking.h: No longer need m_boundsConstrainedByClipping
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::RenderLayerBacking::updateCompositedBounds):
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): setSize takes
care of repainting for us now, so we can remove all the conditional code.

LayoutTests:

Reviewed by Tim Horton.

Test that dumps repaint rects on layers after visibility changes affect
the layer hierarchy.

* compositing/repaint/repaint-on-layer-grouping-change-expected.txt: Added.
* compositing/repaint/repaint-on-layer-grouping-change.html: Added.
* compositing/repaint/resize-repaint-expected.txt: Update result.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSObject and JSArray code shouldn't have to tiptoe around garbage collection
https://bugs.webkit.org/show_bug.cgi?id=120179

Reviewed by Geoffrey Garen.

There are many places in the code for JSObject and JSArray where they are manipulating their
Butterfly/Structure, e.g. after expanding their out-of-line backing storage via allocating. Within
these places there are certain "critical sections" where a GC would be disastrous. Gen GC looks
like it will make this dance even more intricate. To make everybody's lives easier we should use
the DeferGC mechanism in these functions to make these GC critical sections both obvious in the
code and trivially safe. Deferring collections will usually only last marginally longer, thus we
should not incur any additional overhead.

* heap/Heap.h:
* runtime/JSArray.cpp:
(JSC::JSArray::unshiftCountSlowCase):
* runtime/JSObject.cpp:
(JSC::JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists):
(JSC::JSObject::createInitialUndecided):
(JSC::JSObject::createInitialInt32):
(JSC::JSObject::createInitialDouble):
(JSC::JSObject::createInitialContiguous):
(JSC::JSObject::createArrayStorage):
(JSC::JSObject::convertUndecidedToArrayStorage):
(JSC::JSObject::convertInt32ToArrayStorage):
(JSC::JSObject::convertDoubleToArrayStorage):
(JSC::JSObject::convertContiguousToArrayStorage):
(JSC::JSObject::increaseVectorLength):
(JSC::JSObject::ensureLengthSlow):
* runtime/JSObject.h:
(JSC::JSObject::putDirectInternal):
(JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
(JSC::JSObject::putDirectWithoutTransition):


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