Array and object allocations via 'new Object' or 'new Array' should be inlined in bytecode to allow allocation site profiling
https://bugs.webkit.org/show_bug.cgi?id=99557

Reviewed by Geoffrey Garen.

This uses the old jneq_ptr trick to allow for the bytecode to "see" that the
operation in question is what we almost certainly know it to be.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dump):
* bytecode/Opcode.h:
(JSC):
(JSC::padOpcodeName):
* bytecode/SpecialPointer.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitCall):
(JSC::BytecodeGenerator::emitCallEval):
(JSC::BytecodeGenerator::expectedFunctionForIdentifier):
(JSC):
(JSC::BytecodeGenerator::emitExpectedFunctionSnippet):
(JSC::BytecodeGenerator::emitConstruct):
* bytecompiler/BytecodeGenerator.h:
(BytecodeGenerator):
* bytecompiler/NodesCodegen.cpp:
(JSC::NewExprNode::emitBytecode):
(JSC::FunctionCallValueNode::emitBytecode):
(JSC::FunctionCallResolveNode::emitBytecode):
(JSC::FunctionCallBracketNode::emitBytecode):
(JSC::FunctionCallDotNode::emitBytecode):
(JSC::CallFunctionCallDotNode::emitBytecode):
(JSC::ApplyFunctionCallDotNode::emitBytecode):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.h:
(JSC::DFG::canCompileOpcode):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
(JIT):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_new_array_with_size):
(JSC):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
(JSC):
* jit/JITStubs.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(LLInt):
* llint/LLIntSlowPaths.h:
(LLInt):
* llint/LowLevelInterpreter.asm:
* runtime/ArrayConstructor.cpp:
(JSC::constructArrayWithSizeQuirk):
(JSC):
* runtime/ArrayConstructor.h:
(JSC):
* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::reset):
(JSC):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131644 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bytecode should not have responsibility for determining how to perform non-local resolves
https://bugs.webkit.org/show_bug.cgi?id=99349

Reviewed by Gavin Barraclough.

This patch removes lexical analysis from the bytecode generation.  This allows
us to delay lookup of a non-local variables until the lookup is actually necessary,
and simplifies a lot of the resolve logic in BytecodeGenerator.

Once a lookup is performed we cache the lookup information in a set of out-of-line
buffers in CodeBlock.  This allows subsequent lookups to avoid unnecessary hashing,
etc, and allows the respective JITs to recreated optimal lookup code.

This is currently still a performance regression in LLInt, but most of the remaining
regression is caused by a lot of indirection that I'll remove in future work, as well
as some work necessary to allow LLInt to perform in line instruction repatching.
We will also want to improve the behaviour of the baseline JIT for some of the lookup
operations, however this patch was getting quite large already so I'm landing it now
that we've reached the bar of "performance-neutral".

* GNUmakefile.list.am:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::printStructures):
(JSC::CodeBlock::dump):
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::visitStructures):
(JSC):
(JSC::CodeBlock::finalizeUnconditionally):
(JSC::CodeBlock::shrinkToFit):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::addResolve):
(JSC::CodeBlock::addPutToBase):
(CodeBlock):
(JSC::CodeBlock::resolveOperations):
(JSC::CodeBlock::putToBaseOperation):
(JSC::CodeBlock::numberOfResolveOperations):
(JSC::CodeBlock::numberOfPutToBaseOperations):
(JSC::CodeBlock::addPropertyAccessInstruction):
(JSC::CodeBlock::globalObjectConstant):
(JSC::CodeBlock::setGlobalObjectConstant):
* bytecode/GlobalResolveInfo.h: Removed.
* bytecode/Opcode.h:
(JSC):
(JSC::padOpcodeName):
* bytecode/ResolveGlobalStatus.cpp:
(JSC::computeForStructure):
(JSC::ResolveGlobalStatus::computeFor):
* bytecode/ResolveGlobalStatus.h:
(JSC):
(ResolveGlobalStatus):
* bytecode/ResolveOperation.h: Added.
  The new types and logic we use to perform the cached lookups.
(JSC):
(ResolveOperation):
(JSC::ResolveOperation::getAndReturnScopedVar):
(JSC::ResolveOperation::checkForDynamicEntriesBeforeGlobalScope):
(JSC::ResolveOperation::getAndReturnGlobalVar):
(JSC::ResolveOperation::getAndReturnGlobalProperty):
(JSC::ResolveOperation::resolveFail):
(JSC::ResolveOperation::skipTopScopeNode):
(JSC::ResolveOperation::skipScopes):
(JSC::ResolveOperation::returnGlobalObjectAsBase):
(JSC::ResolveOperation::setBaseToGlobal):
(JSC::ResolveOperation::setBaseToUndefined):
(JSC::ResolveOperation::setBaseToScope):
(JSC::ResolveOperation::returnScopeAsBase):
(JSC::PutToBaseOperation::PutToBaseOperation):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::ResolveResult::checkValidity):
(JSC):
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::resolve):
(JSC::BytecodeGenerator::resolveConstDecl):
(JSC::BytecodeGenerator::shouldAvoidResolveGlobal):
(JSC::BytecodeGenerator::emitResolve):
(JSC::BytecodeGenerator::emitResolveBase):
(JSC::BytecodeGenerator::emitResolveBaseForPut):
(JSC::BytecodeGenerator::emitResolveWithBaseForPut):
(JSC::BytecodeGenerator::emitResolveWithThis):
(JSC::BytecodeGenerator::emitGetLocalVar):
(JSC::BytecodeGenerator::emitInitGlobalConst):
(JSC::BytecodeGenerator::emitPutToBase):
* bytecompiler/BytecodeGenerator.h:
(JSC::ResolveResult::registerResolve):
(JSC::ResolveResult::dynamicResolve):
(ResolveResult):
(JSC::ResolveResult::ResolveResult):
(JSC):
(NonlocalResolveInfo):
(JSC::NonlocalResolveInfo::NonlocalResolveInfo):
(JSC::NonlocalResolveInfo::~NonlocalResolveInfo):
(JSC::NonlocalResolveInfo::resolved):
(JSC::NonlocalResolveInfo::put):
(BytecodeGenerator):
(JSC::BytecodeGenerator::getResolveOperations):
(JSC::BytecodeGenerator::getResolveWithThisOperations):
(JSC::BytecodeGenerator::getResolveBaseOperations):
(JSC::BytecodeGenerator::getResolveBaseForPutOperations):
(JSC::BytecodeGenerator::getResolveWithBaseForPutOperations):
(JSC::BytecodeGenerator::getPutToBaseOperation):
* bytecompiler/NodesCodegen.cpp:
(JSC::ResolveNode::isPure):
(JSC::FunctionCallResolveNode::emitBytecode):
(JSC::PostfixNode::emitResolve):
(JSC::PrefixNode::emitResolve):
(JSC::ReadModifyResolveNode::emitBytecode):
(JSC::AssignResolveNode::emitBytecode):
(JSC::ConstDeclNode::emitCodeSingle):
(JSC::ForInNode::emitBytecode):
* dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::execute):
* dfg/DFGByteCodeParser.cpp:
(ByteCodeParser):
(InlineStackEntry):
(JSC::DFG::ByteCodeParser::handleGetByOffset):
(DFG):
(JSC::DFG::ByteCodeParser::parseResolveOperations):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
* dfg/DFGCapabilities.h:
(JSC::DFG::canCompileResolveOperations):
(DFG):
(JSC::DFG::canCompilePutToBaseOperation):
(JSC::DFG::canCompileOpcode):
(JSC::DFG::canInlineOpcode):
* dfg/DFGGraph.h:
(ResolveGlobalData):
(ResolveOperationData):
(DFG):
(PutToBaseOperationData):
(Graph):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasIdentifier):
(JSC::DFG::Node::resolveOperationsDataIndex):
(Node):
* dfg/DFGNodeType.h:
(DFG):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::OSRExit):
* dfg/DFGOSRExit.h:
(OSRExit):
* dfg/DFGOSRExitCompiler.cpp:
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGRepatch.cpp:
(JSC::DFG::tryCacheGetByID):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::resolveOperations):
(SpeculativeJIT):
(JSC::DFG::SpeculativeJIT::putToBaseOperation):
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStructureCheckHoistingPhase.cpp:
(JSC::DFG::StructureCheckHoistingPhase::run):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
(JIT):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_put_to_base):
(JSC):
(JSC::JIT::emit_resolve_operations):
(JSC::JIT::emitSlow_link_resolve_operations):
(JSC::JIT::emit_op_resolve):
(JSC::JIT::emitSlow_op_resolve):
(JSC::JIT::emit_op_resolve_base):
(JSC::JIT::emitSlow_op_resolve_base):
(JSC::JIT::emit_op_resolve_with_base):
(JSC::JIT::emitSlow_op_resolve_with_base):
(JSC::JIT::emit_op_resolve_with_this):
(JSC::JIT::emitSlow_op_resolve_with_this):
(JSC::JIT::emitSlow_op_put_to_base):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_put_to_base):
(JSC):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_init_global_const):
(JSC::JIT::emit_op_init_global_const_check):
(JSC::JIT::emitSlow_op_init_global_const_check):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_init_global_const):
(JSC::JIT::emit_op_init_global_const_check):
(JSC::JIT::emitSlow_op_init_global_const_check):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
(JSC):
* jit/JITStubs.h:
* llint/LLIntSlowPaths.cpp:
(LLInt):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
(LLInt):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/JSScope.cpp:
(JSC::LookupResult::base):
(JSC::LookupResult::value):
(JSC::LookupResult::setBase):
(JSC::LookupResult::setValue):
(LookupResult):
(JSC):
(JSC::setPutPropertyAccessOffset):
(JSC::executeResolveOperations):
(JSC::JSScope::resolveContainingScopeInternal):
(JSC::JSScope::resolveContainingScope):
(JSC::JSScope::resolve):
(JSC::JSScope::resolveBase):
(JSC::JSScope::resolveWithBase):
(JSC::JSScope::resolveWithThis):
(JSC::JSScope::resolvePut):
(JSC::JSScope::resolveGlobal):
* runtime/JSScope.h:
(JSScope):
* runtime/JSVariableObject.cpp:
(JSC):
* runtime/JSVariableObject.h:
(JSVariableObject):
* runtime/Structure.h:
(JSC::Structure::propertyAccessesAreCacheable):
(Structure):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131645 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Array and object allocations via 'new Object' or 'new Array' should be inlined in bytecode to allow allocation site profiling
https://bugs.webkit.org/show_bug.cgi?id=99557

Reviewed by Geoffrey Garen.

Removed an inaccurate and misleading comment as per Geoff's review. (I forgot
to make this change as part of http://trac.webkit.org/changeset/131644).

* bytecompiler/NodesCodegen.cpp:
(JSC::FunctionCallResolveNode::emitBytecode):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, Qt baselines for shadow DOM changes to RenderSlider.
There are a couple unexplained failures that I'm still investigating.

* platform/chromium-mac/fast/dom/HTMLInputElement/input-slider-update-expected.txt: Removed.
* platform/chromium-mac/fast/forms/range/range-thumb-height-percentage-expected.txt: Removed.
* platform/chromium-mac/fast/forms/range/slider-padding-expected.txt: Removed.
* platform/chromium-mac/fast/repaint/slider-thumb-drag-release-expected.txt: Removed.
* platform/qt/TestExpectations:
* platform/qt/fast/dom/HTMLInputElement/input-slider-update-expected.txt:
* platform/qt/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt: Added.
* platform/qt/fast/forms/box-shadow-override-expected.txt:
* platform/qt/fast/forms/range/input-appearance-range-expected.txt:
* platform/qt/fast/forms/range/range-thumb-height-percentage-expected.txt:
* platform/qt/fast/forms/range/slider-padding-expected.txt:
* platform/qt/fast/multicol/client-rects-expected.txt:
* platform/qt/fast/repaint/slider-thumb-drag-release-expected.txt:
* platform/qt/fast/repaint/slider-thumb-float-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
StringPrototype::jsSpliceSubstringsWithSeparators() doesn't optimally handle 8 bit strings
https://bugs.webkit.org/show_bug.cgi?id=99230

Reviewed by Geoffrey Garen.

Added code to select characters8() or characters16() on the not all 8 bit path for both the
processing of the source and the separators.

* runtime/StringPrototype.cpp:
(JSC::jsSpliceSubstringsWithSeparators):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Committing new files is so overrated.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131649 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Use smart pointers inside Ewk_View
https://bugs.webkit.org/show_bug.cgi?id=99611

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-10-17
Reviewed by Kenneth Rohde Christiansen.

Use smart pointers instead of raw ones for several
Ewk_View members to avoid handling memory manually.

* PlatformEfl.cmake:
* UIProcess/API/efl/ewk_view.cpp:
(_Ewk_View_Private_Data):
(_Ewk_View_Private_Data::_Ewk_View_Private_Data):
(_Ewk_View_Private_Data::~_Ewk_View_Private_Data):
(ewk_view_cursor_set):
(ewk_view_color_picker_dismiss):
(ewk_view_color_picker_color_set):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131650 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename PerfTestRunner.runPerSecond to PerfTestRunner.measureRunsPerSecond for consistency
https://bugs.webkit.org/show_bug.cgi?id=99642

Reviewed by Dirk Pranke.

Renamed the method.

* Bindings/append-child.html:
* Bindings/create-element.html:
* Bindings/event-target-wrapper.html:
* Bindings/first-child.html:
* Bindings/get-attribute.html:
* Bindings/get-element-by-id.html:
* Bindings/get-elements-by-tag-name.html:
* Bindings/id-getter.html:
* Bindings/id-setter.html:
* Bindings/insert-before.html:
* Bindings/node-list-access.html:
* Bindings/scroll-top.html:
* Bindings/set-attribute.html:
* Bindings/typed-array-construct-from-array.html:
* Bindings/typed-array-construct-from-same-type.html:
* Bindings/typed-array-construct-from-typed.html:
* Bindings/typed-array-set-from-typed.html:
* Bindings/undefined-first-child.html:
* Bindings/undefined-get-element-by-id.html:
* Bindings/undefined-id-getter.html:
* CSS/CSSPropertySetterGetter.html:
* CSS/CSSPropertyUpdateValue.html:
* CSS/PseudoClassSelectors.html:
* DOM/textarea-dom.html:
* DOM/textarea-edit.html:
* Interactive/resources/window-resize.js:
* Layout/flexbox-column-nowrap.html:
* Layout/flexbox-column-wrap.html:
* Layout/flexbox-row-nowrap.html:
* Layout/flexbox-row-wrap.html:
* Layout/line-layout.html:
* Parser/css-parser-yui.html:
* Parser/innerHTML-setter.html:
* Parser/query-selector-deep.html:
* Parser/query-selector-first.html:
* Parser/query-selector-last.html:
* Parser/simple-url.html:
* Parser/textarea-parsing.html:
* Parser/tiny-innerHTML.html:
* Parser/url-parser.html:
* Parser/xml-parser.html:
* SVG/SvgNestedUse.html:
* resources/runner.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131651 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AtomicString::HashAndUTF8CharactersTranslator::equal() doesn't optimally handle 8 bit strings
https://bugs.webkit.org/show_bug.cgi?id=99223

Reviewed by Geoffrey Garen.

Added an 8 bit path.

* wtf/text/AtomicString.cpp:
(WTF::HashAndUTF8CharactersTranslator::equal):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Compilation warning in Ewk_View when accelerated compositing is disabled
https://bugs.webkit.org/show_bug.cgi?id=99613

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-10-17
Reviewed by Kenneth Rohde Christiansen.

Fix compilation warning in _ewk_view_smart_calculate() when
the ACCELERATED_COMPOSITING flag is not set.

* UIProcess/API/efl/ewk_view.cpp:
(_ewk_view_smart_calculate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Memory leak in ewk_download_job_response_set()
https://bugs.webkit.org/show_bug.cgi?id=99621

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-10-17
Reviewed by Kenneth Rohde Christiansen.

No longer call ewk_url_response_ref() on the response
object in ewk_download_job_response_set() since it will
be ref'd when assigning to the RefPtr member already.

* UIProcess/API/efl/ewk_context_download_client.cpp:
(didReceiveResponse):
* UIProcess/API/efl/ewk_download_job.cpp:
(ewk_download_job_response_set):
* UIProcess/API/efl/ewk_download_job_private.h: Remove several unimplemented functions.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131654 268f45cc-cd09-0410-ab3c-d52691b4dbfc
StringImpl::findIgnoringCase() and reverseFindIgnoringCase() don't optimally handle a mix of 8 and 16 bit strings
https://bugs.webkit.org/show_bug.cgi?id=99224

Reviewed by Geoffrey Garen.

Added helper templated functions and all four combinations similar to find() and reverseFind().

(WTF::findIgnoringCaseInner):
(WTF::StringImpl::findIgnoringCase):
(WTF::reverseFindIgnoringCaseInner):
(WTF::StringImpl::reverseFindIgnoringCase):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131655 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Creating a String from an NSString should check for all 8 bit strings
https://bugs.webkit.org/show_bug.cgi?id=99392

Reviewed by Geoffrey Garen.

Source/WebCore:

Use CFStringGetBytes() to try to get Latin1 data to create an 8 bit string.

No functional change, change covered by existing tests.

* platform/text/mac/StringMac.mm:
(WTF::String::String):

Source/WTF:

Exported the LChar* version of create().

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::create):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fast/forms/range/input-appearance-range-rtl.html off by one pixel
https://bugs.webkit.org/show_bug.cgi?id=99625

Reviewed by Ojan Vafai.

Source/WebCore:

Previously, we would assume that a vertical slider in RTL would render identically to
a vertical slider in LTR. Due to differing thumb sizes, there is an off by one.

This worked in deprecated flexbox because it doesn't adjust for RTL when applying
box-align: center.

Tests: fast/forms/range/input-appearance-range-rtl.html

* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderContainer::layout): Force LTR for flexbox layout when vertical. We have to restore the old value
just in case the user switches from vertical to horizontal.

LayoutTests:

Run test on GTK+ and Qt now that it is fixed.

* platform/gtk/TestExpectations:
* platform/qt/TestExpectations:


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