Add tracking of endColumn for Executables.
https://bugs.webkit.org/show_bug.cgi?id=124245.

Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

1. Fixed computation of columns to take into account the startColumn from
   <script> tags. Previously, we were only computing the column relative
   to the char after the <script> tag. Now, the column number that JSC
   computes is always the column number you'll see when viewing the source
   in a text editor (assuming the first column position is 1, not 0).

2. Previously, unlinkedExecutables kept the a base-1 startColumn for
   ProgramExecutables and EvalExecutables, but uses base-0 columns for
   FunctionExecutables. This has been fixed so that they all use base-0
   columns. When the executable gets linked, the column is adjusted into
   a base-1 value.

3. In the UnlinkedFunctionExecutable, renamed m_functionStartOffset to
   m_unlinkedFunctionNameStart because it actually points to the start
   column in the name part of the function declaration.

   Similarly, renamed m_functionStartColumn to m_unlinkedBodyStartColumn
   because it points to the first character in the function body. This is
   usually '{' except for functions created from "global code" which
   excludes its braces. See FunctionExecutable::fromGlobalCode().

       The exclusion of braces for the global code case is needed so that
   computed start and end columns will more readily map to what a JS
   developer would expect them to be. Otherwise, the first column of the
   function source will not be 1 (includes prepended characters added in
   constructFunctionSkippingEvalEnabledCheck()).

   Also, similarly, a m_unlinkedBodyEndColumn has been added to track the
   end column of the UnlinkedFunctionExecutable.

4. For unlinked executables, end column values are either:
   a. Relative to the start of the last line if (last line != first line).
   b. Relative to the start column position if (last line == first line).

   The second case is needed so that we can add an appropriate adjustment
   to the end column value (just like we do for the start column) when we
   link the executable.

5. This is not new to this patch, but it worth noting that the lineCount
   values used through this patch has the following meaning:
   - a lineCount of 0 means the source for this code block is on 1 line.
   - a lineCount of N means there are N + l lines of source.

   This interpretation is janky, but was present before this patch. We can
   clean that up later in another patch.


* JavaScriptCore.xcodeproj/project.pbxproj:
- In order to implement WebCore::Internals::parserMetaData(), we need to
  move some seemingly unrelated header files from the Project section to
  the Private section so that they can be #include'd by the forwarding
  CodeBlock.h from WebCore.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::sourceCodeForTools):
(JSC::CodeBlock::CodeBlock):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::generateFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
- m_isFromGlobalCode is needed to support the exclusion of the open brace /
  prepended code for functions created from "global code".
(JSC::UnlinkedFunctionExecutable::link):
(JSC::UnlinkedFunctionExecutable::fromGlobalCode):
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedFunctionExecutable::create):
(JSC::UnlinkedFunctionExecutable::unlinkedFunctionNameStart):
(JSC::UnlinkedFunctionExecutable::unlinkedBodyStartColumn):
(JSC::UnlinkedFunctionExecutable::unlinkedBodyEndColumn):
(JSC::UnlinkedFunctionExecutable::recordParse):
(JSC::UnlinkedCodeBlock::recordParse):
(JSC::UnlinkedCodeBlock::endColumn):
* bytecompiler/NodesCodegen.cpp:
(JSC::FunctionBodyNode::emitBytecode):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createFunctionBody):
(JSC::ASTBuilder::setFunctionNameStart):
* parser/Lexer.cpp:
(JSC::::shiftLineTerminator):
- Removed an unused SourceCode Lexer<T>::sourceCode() function.
* parser/Lexer.h:
(JSC::Lexer::positionBeforeLastNewline):
(JSC::Lexer::prevTerminator):
- Added tracking of m_positionBeforeLastNewline in the Lexer to enable us
  to exclude the close brace / appended code for functions created from "global
  code".
* parser/Nodes.cpp:
(JSC::ProgramNode::ProgramNode):
(JSC::ProgramNode::create):
(JSC::EvalNode::EvalNode):
(JSC::EvalNode::create):
(JSC::FunctionBodyNode::FunctionBodyNode):
(JSC::FunctionBodyNode::create):
(JSC::FunctionBodyNode::setEndPosition):
- setEndPosition() is needed to fixed up the end position so that we can
  exclude the close brace / appended code for functions created from "global
  code".
* parser/Nodes.h:
(JSC::ProgramNode::startColumn):
(JSC::ProgramNode::endColumn):
(JSC::EvalNode::startColumn):
(JSC::EvalNode::endColumn):
(JSC::FunctionBodyNode::setFunctionNameStart):
(JSC::FunctionBodyNode::functionNameStart):
(JSC::FunctionBodyNode::endColumn):
* parser/Parser.cpp:
(JSC::::parseFunctionBody):
(JSC::::parseFunctionInfo):
* parser/Parser.h:
(JSC::Parser::positionBeforeLastNewline):
(JSC::::parse):
- Subtracted 1 from startColumn here to keep the node column values consistently
  base-0. See note 2 above.
(JSC::parse):
* parser/SourceProviderCacheItem.h:
(JSC::SourceProviderCacheItem::SourceProviderCacheItem):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createFunctionBody):
(JSC::SyntaxChecker::setFunctionNameStart):
* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
(JSC::CodeCache::getProgramCodeBlock):
(JSC::CodeCache::getEvalCodeBlock):
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):
* runtime/CodeCache.h:
* runtime/Executable.cpp:
(JSC::ScriptExecutable::newCodeBlockFor):
(JSC::FunctionExecutable::FunctionExecutable):
(JSC::ProgramExecutable::initializeGlobalProperties):
(JSC::FunctionExecutable::fromGlobalCode):
* runtime/Executable.h:
(JSC::ExecutableBase::isEvalExecutable):
(JSC::ExecutableBase::isProgramExecutable):
(JSC::ScriptExecutable::ScriptExecutable):
(JSC::ScriptExecutable::endColumn):
(JSC::ScriptExecutable::recordParse):
(JSC::FunctionExecutable::create):
(JSC::FunctionExecutable::bodyIncludesBraces):
* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):
* runtime/FunctionPrototype.cpp:
(JSC::insertSemicolonIfNeeded):
(JSC::functionProtoFuncToString):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::createProgramCodeBlock):
(JSC::JSGlobalObject::createEvalCodeBlock):

Source/WebCore: 

Test: js/dom/script-start-end-locations.html

* ForwardingHeaders/bytecode: Added.
* ForwardingHeaders/bytecode/CodeBlock.h: Added.
* WebCore.exp.in:
* testing/Internals.cpp:
(WebCore::GetCallerCodeBlockFunctor::GetCallerCodeBlockFunctor):
(WebCore::GetCallerCodeBlockFunctor::operator()):
(WebCore::GetCallerCodeBlockFunctor::codeBlock):
(WebCore::Internals::parserMetaData):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit: 

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
- Added an exported symbol to make the Win32 build happy. The Win64 symbol
  is currently a copy of the Win32 one. It'll need to be updated if the
  mangled symbol is different for Win64.

LayoutTests: 

* fast/events/window-onerror2-expected.txt:
* inspector-protocol/debugger/setBreakpoint-actions-expected.txt:
* js/dom/script-start-end-locations-expected.txt: Added.
* js/dom/script-start-end-locations.html: Added.
* js/dom/script-tests/script-start-end-locations.js: Added.
* js/dom/stack-trace-expected.txt:
* js/dom/stack-trace.html:
- Changed tabs to spaces. The tabs were making it hard to visually confirm
  the exected column values for 2 functions.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r159395): Error compiling for ARMv7
https://bugs.webkit.org/show_bug.cgi?id=124552

Reviewed by Geoffrey Garen.

Fixed the implementation of branch8(RelationalCondition cond, AbsoluteAddress address, TrustedImm32 right)
to materialize and use address similar to other ARMv7 branchXX() functions.

* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::branch8):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/15139479> Reenable the JSC Objective-C API tests on Mountain Lion once the bots are running Xcode 5

Rubber-stamped by Mark Rowe.

Reverted r156840.

* TestWebKitAPI/Tests/mac/WebViewDidCreateJavaScriptContext.mm:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Speech API crashes onboundary event handling with reload
https://bugs.webkit.org/show_bug.cgi?id=124607

Reviewed by Tim Horton.

If the page goes away, we need to cleanup the Mac platform synthesizer object, because
NSSpeechSynthesizer is retained elsewhere to handle the callbacks (so it doesn't automatically
get torn down).

The layout tests for speech rely on a Mock synthesizer, so there is no good way to test this
Mac platform specific behavior.       

* platform/mac/PlatformSpeechSynthesizerMac.mm:
(-[WebSpeechSynthesisWrapper invalidate]):
(WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] 9 WebGL conformance failures after r159518.
https://bugs.webkit.org/show_bug.cgi?id=124608

Reviewed by Dean Jackson.

Once we removed the CIImage drawing path, there was no longer any reason to flip the
CGImageRef before drawing to the provided GraphicsContext.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159525 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Parse [<box> || <shape>] values
https://bugs.webkit.org/show_bug.cgi?id=124426

Reviewed by Dirk Schulze.

Source/WebCore:

Shape values can now have an optional box specifying the coordinate sytem to use
for sizing and positioning the shape. This patch adds the functionality to support
parsing these new values.

* css/BasicShapeFunctions.cpp:
(WebCore::valueForBox): Added function to convert between BasicShape::ReferenceBox
and CSSPrimitiveValue (which wraps a CSSValueID).
(WebCore::boxForValue): Ditto.
(WebCore::valueForBasicShape): Translations between CSSBasicShape and BasicShape
must now include the reference box.
(WebCore::basicShapeForValue): Ditto.
* css/BasicShapeFunctions.h:
* css/CSSBasicShapes.cpp:
(WebCore::buildRectangleString): Include the box in the built CSS string.
(WebCore::CSSBasicShapeRectangle::cssText): Ditto.
(WebCore::CSSBasicShapeRectangle::equals): Include the box in comparisions.
(WebCore::buildCircleString):
(WebCore::CSSBasicShapeCircle::cssText):
(WebCore::CSSBasicShapeCircle::equals):
(WebCore::buildEllipseString):
(WebCore::CSSBasicShapeEllipse::cssText):
(WebCore::CSSBasicShapeEllipse::equals):
(WebCore::buildPolygonString):
(WebCore::CSSBasicShapePolygon::cssText):
(WebCore::CSSBasicShapePolygon::equals):
(WebCore::buildInsetRectangleString):
(WebCore::CSSBasicShapeInsetRectangle::cssText):
(WebCore::CSSBasicShapeInsetRectangle::equals):
* css/CSSBasicShapes.h:
(WebCore::CSSBasicShape::box): BasicShapes now have an reference box.
(WebCore::CSSBasicShape::setBox): Ditto.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue): Shape-inside can also
parse the box values.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): The shape properties use parseShapeProperty,
while minor adjustments were made to parseBasicShape's return type.
(WebCore::isBoxValue): Is the CSSValueID one of  the box values.
(WebCore::CSSParser::parseShapeProperty): Parse one of the shape properties
and return an appropriate CSSValue.
(WebCore::CSSParser::parseBasicShape): Return a CSSBasicShape rather than
adding a ShapeValue to the style.
* css/CSSParser.h:
* rendering/style/BasicShapes.h:
(WebCore::BasicShape::box): Add a box to BasicShape and getters/setters.
(WebCore::BasicShape::setBox): Ditto.
(WebCore::BasicShape::BasicShape): Ditto.

LayoutTests:

Test that <box> <shape> and <shape> <box> values are both supported and successfully parsed.
Currently, we order the parsed result as <shape> <box> when the value is output through
the CSSOM. Also test that other combinations with shapes and boxes are not parsed.

* fast/shapes/parsing/parsing-shape-inside-expected.txt:
* fast/shapes/parsing/parsing-shape-inside.html:
* fast/shapes/parsing/parsing-shape-outside-expected.txt:
* fast/shapes/parsing/parsing-shape-outside.html:
* fast/shapes/parsing/parsing-test-utils.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159526 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename WatchpointSet::notifyWrite() should be renamed to WatchpointSet::fireAll()
https://bugs.webkit.org/show_bug.cgi?id=124609

Source/JavaScriptCore: 

Rubber stamped by Mark Lam.
        
notifyWrite() is a thing that SymbolTable does. WatchpointSet uses that terminology
because it was original designed to match exactly SymbolTable's semantics. But now
it's a confusing term.

* bytecode/Watchpoint.cpp:
(JSC::WatchpointSet::fireAllSlow):
* bytecode/Watchpoint.h:
(JSC::WatchpointSet::fireAll):
(JSC::InlineWatchpointSet::fireAll):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
* runtime/JSFunction.cpp:
(JSC::JSFunction::put):
(JSC::JSFunction::defineOwnProperty):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::haveABadTime):
* runtime/Structure.h:
(JSC::Structure::notifyTransitionFromThisStructure):
* runtime/SymbolTable.cpp:
(JSC::SymbolTableEntry::notifyWriteSlow):

Source/WebCore: 

Rubber stamped by Mark Lam.

No new tests because no new behavior.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bindings/scripts/test/JS/JSTestEventTarget.h:
(WebCore::JSTestEventTarget::create):



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