1. 13 Apr, 2012 6 commits
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r114185. · 2e652d98
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/114185
      https://bugs.webkit.org/show_bug.cgi?id=83967
      
      Broke a bunch of JavaScript related tests (Requested by
      andersca on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-04-13
      
      * runtime/ArrayPrototype.cpp:
      (JSC::arrayProtoFuncToString):
      (JSC::arrayProtoFuncToLocaleString):
      * runtime/CommonIdentifiers.h:
      * tests/mozilla/ecma/Array/15.4.4.2.js:
      (getTestCases):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2e652d98
    • barraclough@apple.com's avatar
      Don't rely on fixed offsets to patch calls · 2c132def
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83966
      
      Rubber stamped by Oliver Hunt.
      
      These aren't being used anywhere!
      
      * jit/JIT.h:
      * jit/JITCall.cpp:
      (JSC::JIT::compileOpCall):
      * jit/JITCall32_64.cpp:
      (JSC::JIT::compileOpCall):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2c132def
    • commit-queue@webkit.org's avatar
      Array.prototype.toString and Array.prototype.toLocaleString should be generic · 502fb9f7
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=81588
      
      Patch by Hojong Han <hojong.han@samsung.com> on 2012-04-13
      Reviewed by Gavin Barraclough.
      
      * runtime/ArrayPrototype.cpp:
      (JSC::arrayProtoFuncToString):
      (JSC::arrayProtoFuncToLocaleString):
      * runtime/CommonIdentifiers.h:
      * tests/mozilla/ecma/Array/15.4.4.2.js:
      (getTestCases.array.item.new.TestCase):
      (getTestCases):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      502fb9f7
    • barraclough@apple.com's avatar
      Don't rely on fixed offsets to patch method checks · 26677c3d
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83958
      
      Reviewed by Oliver Hunt.
      
      * bytecode/StructureStubInfo.h:
          - Add fields for the method check info.
      * jit/JIT.cpp:
      (JSC::PropertyStubCompilationInfo::copyToStubInfo):
          - Store the offsets on the stub info, instead of asserting.
      * jit/JIT.h:
          - Delete all the method check related offsets.
      * jit/JITPropertyAccess.cpp:
      (JSC::JIT::patchMethodCallProto):
          - Use the offset from the stubInfo.
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
          - Pass the stubInfo to patchMethodCallProto.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      26677c3d
    • barraclough@apple.com's avatar
      Don't rely on fixed offsets to patch get_by_id/put_by_id · f14ef92f
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83924
      
      Reviewed by Oliver Hunt.
      
      Store offsets in the structure stub info, as we do for the DFG JIT.
      
      * assembler/AbstractMacroAssembler.h:
      (JSC::AbstractMacroAssembler::differenceBetween):
          - this method can be static (now used from PropertyStubCompilationInfo::copyToStubInfo, will be removed soon!)
      * bytecode/StructureStubInfo.h:
          - added new fields for baseline JIT offsets.
      * jit/JIT.cpp:
      (JSC::PropertyStubCompilationInfo::copyToStubInfo):
          - moved out from JIT::privateCompile.
      (JSC::JIT::privateCompile):
          - moved out code to PropertyStubCompilationInfo::copyToStubInfo.
      * jit/JIT.h:
      (PropertyStubCompilationInfo):
          - added helper functions to initializae PropertyStubCompilationInfo, state to store more offset info.
          - removed many offsets.
      * jit/JITPropertyAccess.cpp:
      (JSC::JIT::emit_op_method_check):
      (JSC::JIT::compileGetByIdHotPath):
      (JSC::JIT::compileGetByIdSlowCase):
      (JSC::JIT::emit_op_put_by_id):
      (JSC::JIT::emitSlow_op_put_by_id):
      (JSC::JIT::patchGetByIdSelf):
      (JSC::JIT::patchPutByIdReplace):
      (JSC::JIT::privateCompilePatchGetArrayLength):
      (JSC::JIT::privateCompileGetByIdProto):
      (JSC::JIT::privateCompileGetByIdSelfList):
      (JSC::JIT::privateCompileGetByIdProtoList):
      (JSC::JIT::privateCompileGetByIdChainList):
      (JSC::JIT::privateCompileGetByIdChain):
      (JSC::JIT::resetPatchGetById):
      (JSC::JIT::resetPatchPutById):
          - changed code generation to use new interface to store info on PropertyStubCompilationInfo.
          - changed repatch functions to read offsets from the structure stub info.
      * jit/JITPropertyAccess32_64.cpp:
      (JSC::JIT::emit_op_method_check):
      (JSC::JIT::compileGetByIdHotPath):
      (JSC::JIT::compileGetByIdSlowCase):
      (JSC::JIT::emit_op_put_by_id):
      (JSC::JIT::emitSlow_op_put_by_id):
      (JSC::JIT::patchGetByIdSelf):
      (JSC::JIT::patchPutByIdReplace):
      (JSC::JIT::privateCompilePatchGetArrayLength):
      (JSC::JIT::privateCompileGetByIdProto):
      (JSC::JIT::privateCompileGetByIdSelfList):
      (JSC::JIT::privateCompileGetByIdProtoList):
      (JSC::JIT::privateCompileGetByIdChainList):
      (JSC::JIT::privateCompileGetByIdChain):
      (JSC::JIT::resetPatchGetById):
      (JSC::JIT::resetPatchPutById):
          - changed code generation to use new interface to store info on PropertyStubCompilationInfo.
          - changed repatch functions to read offsets from the structure stub info.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f14ef92f
    • rwlbuis@webkit.org's avatar
      Fix some compiler warnings (miscellaneous) · f63e3099
      rwlbuis@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=80790
      
      Reviewed by Antonio Gomes.
      
      Fix signed/unsigned comparison warning.
      
      * parser/Lexer.cpp:
      (JSC::::record16):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f63e3099
  2. 12 Apr, 2012 6 commits
    • benjamin@webkit.org's avatar
      Improve replaceUsingStringSearch() for case of a single character searchValue · b1f2cdae
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=83738
      
      Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-04-12
      Reviewed by Geoffrey Garen.
      
      This patch improves replaceUsingStringSearch() with the following:
      -Add a special case for single character search, taking advantage of the faster WTF::find().
      -Inline replaceUsingStringSearch().
      -Use StringImpl::create() instead of UString::substringSharingImpl() since we know we are in the bounds
       by definition.
      
      This gives less than 1% improvement for the multicharacter replace.
      The single character search show about 9% improvement.
      
      * runtime/StringPrototype.cpp:
      (JSC::replaceUsingStringSearch):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b1f2cdae
    • msaboff@apple.com's avatar
      StructureStubInfo::reset() causes leaks of PolymorphicAccessStructureList and... · 1c4f2d91
      msaboff@apple.com authored
      StructureStubInfo::reset() causes leaks of PolymorphicAccessStructureList and ExecutableMemoryHandle objects
      https://bugs.webkit.org/show_bug.cgi?id=83823
      
      Reviewed by Gavin Barraclough.
      
      Put the clearing of the accessType to after the call to deref() so that
      deref() can use the accessType to delete referenced objects as needed.
      
      * bytecode/StructureStubInfo.h:
      (JSC::StructureStubInfo::reset):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114052 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1c4f2d91
    • kbalazs@webkit.org's avatar
      [Qt] Fix WebKit1 build with V8 · 768684d2
      kbalazs@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=83322
      
      Reviewed by Adam Barth.
      
      Source/JavaScriptCore:
      
      * yarr/yarr.pri:
      
      Source/WebCore:
      
      Make it possible to build WebKit1 with v8.
      WebKit2 is not covered yet so it need to be disabled.
      To build webkit with --v8 one need a qtjsbackend with
      an up-to-date copy of v8. Thanks to Peter Varga such
      a public repository is available on gitorious:
      https://qt.gitorious.org/~stampho/qt/stamphos-qtjsbackend.
      
      This patch contains some build fix with !ENABLE(INSPECTOR)
      from it's previous version. These are not necessary now
      but I kept them because they makes sense.
      
      No change in behaviour so no new tests.
      
      * DerivedSources.pri:
      * Target.pri:
      * WebCore.pri:
      * bindings/v8/ScriptController.cpp:
      * bindings/v8/ScriptControllerQt.cpp:
      * bindings/v8/ScriptProfiler.cpp:
      (WebCore::retainedDOMInfo):
      (WebCore::ScriptProfiler::initialize):
      * bindings/v8/ScriptState.cpp:
      (WebCore::evalEnabled):
      (WebCore::setEvalEnabled):
      * bindings/v8/V8Binding.cpp:
      (WebCore):
      * bindings/v8/V8Binding.h:
      (V8BindingPerIsolateData):
      * bindings/v8/V8DOMWindowShell.cpp:
      (WebCore::V8DOMWindowShell::initContextIfNeeded):
      * bindings/v8/V8GCForContextDispose.cpp:
      (WebCore::V8GCForContextDispose::pseudoIdleTimerFired):
      * bindings/v8/custom/V8InjectedScriptManager.cpp:
      * config.h:
      * editing/TextIterator.cpp:
      * html/MediaFragmentURIParser.cpp:
      * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
      * platform/qt/PlatformSupportQt.cpp:
      (WebCore::PlatformSupport::popupsAllowed):
      
      Source/WebKit/qt:
      
      * WebCoreSupport/FrameLoaderClientQt.cpp:
      (WebCore::FrameLoaderClientQt::didCreateScriptContext):
      * WebCoreSupport/FrameLoaderClientQt.h:
      (FrameLoaderClientQt):
      (WebCore::FrameLoaderClientQt::allowScriptExtension):
      * WebCoreSupport/InitWebCoreQt.cpp:
      
      Source/WTF:
      
      * wtf/StdLibExtras.h:
      (WTF):
      
      Tools:
      
      * DumpRenderTree/qt/DumpRenderTree.pro:
      * qmake/mkspecs/features/default_post.prf:
      * qmake/mkspecs/features/default_pre.prf:
      * qmake/mkspecs/features/features.prf:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114042 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      768684d2
    • barraclough@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=83821 · 6585a607
      barraclough@apple.com authored
      Move dfg repatching properties of structure stub info into a union
      
      Reviewed by Oliver Hunt.
      
      We want to be able to have similar properties for the baseline JIT, some restructuring to prepare for this.
      
      * bytecode/StructureStubInfo.h:
      (StructureStubInfo):
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::link):
      * dfg/DFGRepatch.cpp:
      (JSC::DFG::dfgRepatchByIdSelfAccess):
      (JSC::DFG::linkRestoreScratch):
      (JSC::DFG::generateProtoChainAccessStub):
      (JSC::DFG::tryCacheGetByID):
      (JSC::DFG::tryBuildGetByIDList):
      (JSC::DFG::tryBuildGetByIDProtoList):
      (JSC::DFG::emitPutReplaceStub):
      (JSC::DFG::emitPutTransitionStub):
      (JSC::DFG::tryCachePutByID):
      (JSC::DFG::tryBuildPutByIdList):
      (JSC::DFG::dfgResetGetByID):
      (JSC::DFG::dfgResetPutByID):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6585a607
    • barraclough@apple.com's avatar
      Delete a bunch of unused, copy & pasted values in JIT.h · a06f1cc5
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83822
      
      Reviewed by Oliver Hunt.
              
      The only architecture we support the JSVALUE64 JIT on is x86-64, all the patch offsets for other architectures are just nonsense.
      
      * jit/JIT.h:
      (JIT):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a06f1cc5
    • ossy@webkit.org's avatar
      [Qt][ARM] Buildfix after r113934. · d2b2b7f1
      ossy@webkit.org authored
      Reviewed by Zoltan Herczeg.
      
      * assembler/MacroAssemblerARM.h:
      (JSC::MacroAssemblerARM::compare8):
      (MacroAssemblerARM):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113955 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d2b2b7f1
  3. 11 Apr, 2012 9 commits
    • fpizlo@apple.com's avatar
      It is incorrect to short-circuit Branch(LogicalNot(@a)) if boolean speculations on @a may fail · a6c889be
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83744
      <rdar://problem/11206946>
      
      Source/JavaScriptCore: 
      
      Reviewed by Andy Estes.
              
      This does the conservative thing: it only short-circuits Branch(LogicalNot(@a)) if @a is a node
      that is statically known to return boolean results.
      
      * dfg/DFGFixupPhase.cpp:
      (JSC::DFG::FixupPhase::fixupNode):
      
      LayoutTests: 
      
      Rubber stamped by Andy Estes.
      
      * fast/js/dfg-branch-not-fail-expected.txt: Added.
      * fast/js/dfg-branch-not-fail.html: Added.
      * fast/js/script-tests/dfg-branch-not-fail.js: Added.
      (foo):
      (bar):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113941 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a6c889be
    • msaboff@apple.com's avatar
      Invalid Union Reference in StructureStubInfo.{cpp.h} · fc7e29f1
      msaboff@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83735
      
      Reviewed by Filip Pizlo.
      
      Changed the references to u.getByIdProtoList and u.getByIdSelfList
      to be consistent.
      
      * bytecode/StructureStubInfo.cpp:
      (JSC::StructureStubInfo::visitWeakReferences):
      * bytecode/StructureStubInfo.h:
      (JSC::StructureStubInfo::initGetByIdSelfList):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fc7e29f1
    • fpizlo@apple.com's avatar
      Unreviewed attempting to make Qt's eccentric hardware work. · 9c149ea1
      fpizlo@apple.com authored
      * assembler/MacroAssemblerARM.h:
      (JSC::MacroAssemblerARM::compare8):
      (MacroAssemblerARM):
      * assembler/MacroAssemblerMIPS.h:
      (JSC::MacroAssemblerMIPS::compare8):
      (MacroAssemblerMIPS):
      * assembler/MacroAssemblerSH4.h:
      (JSC::MacroAssemblerSH4::compare8):
      (MacroAssemblerSH4):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9c149ea1
    • fpizlo@apple.com's avatar
      op_is_foo should be optimized · 1d21689e
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83666
      
      Reviewed by Gavin Barraclough.
              
      This implements inlining of op_is_undefined, op_is_string, op_is_number,
      and op_is_boolean in LLInt and the baseline JIT. op_is_object and
      op_is_function are not inlined because they are quite a bit more complex.
              
      This also implements all of the op_is_foo opcodes in the DFG, but it does
      not do any type profiling based optimizations, yet.
      
      * assembler/MacroAssemblerARMv7.h:
      (JSC::MacroAssemblerARMv7::compare8):
      (MacroAssemblerARMv7):
      * assembler/MacroAssemblerX86Common.h:
      (JSC::MacroAssemblerX86Common::compare8):
      (MacroAssemblerX86Common):
      * assembler/MacroAssemblerX86_64.h:
      (MacroAssemblerX86_64):
      (JSC::MacroAssemblerX86_64::testPtr):
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::execute):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::parseBlock):
      * dfg/DFGCCallHelpers.h:
      (JSC::DFG::CCallHelpers::setupArguments):
      (CCallHelpers):
      * dfg/DFGCSEPhase.cpp:
      (JSC::DFG::CSEPhase::performNodeCSE):
      * dfg/DFGCapabilities.h:
      (JSC::DFG::canCompileOpcode):
      * dfg/DFGNodeType.h:
      (DFG):
      * dfg/DFGOperations.cpp:
      * dfg/DFGOperations.h:
      * dfg/DFGPredictionPropagationPhase.cpp:
      (JSC::DFG::PredictionPropagationPhase::propagate):
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::callOperation):
      (JSC::DFG::SpeculativeJIT::appendCallSetResult):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompileMainPass):
      * jit/JIT.h:
      (JIT):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::emit_op_is_undefined):
      (JSC):
      (JSC::JIT::emit_op_is_boolean):
      (JSC::JIT::emit_op_is_number):
      (JSC::JIT::emit_op_is_string):
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::emit_op_is_undefined):
      (JSC):
      (JSC::JIT::emit_op_is_boolean):
      (JSC::JIT::emit_op_is_number):
      (JSC::JIT::emit_op_is_string):
      * jit/JITStubs.cpp:
      (JSC):
      * llint/LLIntSlowPaths.cpp:
      (LLInt):
      * llint/LLIntSlowPaths.h:
      (LLInt):
      * llint/LowLevelInterpreter.asm:
      * llint/LowLevelInterpreter32_64.asm:
      * llint/LowLevelInterpreter64.asm:
      * offlineasm/armv7.rb:
      * offlineasm/instructions.rb:
      * offlineasm/x86.rb:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113930 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1d21689e
    • fpizlo@apple.com's avatar
      If you use an IntegerOperand and want to return it with integerResult, you need to · 3deedbc6
      fpizlo@apple.com authored
      zero extend to get rid of the box
      https://bugs.webkit.org/show_bug.cgi?id=83734
      <rdar://problem/11232296>
      
      Reviewed by Oliver Hunt.
      
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::fillInteger):
      (JSC::DFG::SpeculativeJIT::nonSpeculativeValueToInt32):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3deedbc6
    • fpizlo@apple.com's avatar
      SpeculativeJIT::fillStorage() should work with all the states that a cell may be in · be2b49e6
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83722
      
      Reviewed by Gavin Barraclough.
              
      It's now possible to do StorageOperand on a cell, in the case that the storage is
      inline. But this means that fillStorage() must be able to handle all of the states
      that a cell might be in. Previously it didn't.
              
      With this change, it now does handle all of the states, and moreover, it does so
      by preserving the DataFormat of cells and performing all of the cell speculations
      that should be performed if you're using a cell as storage. But if you use this on
      something that is known to be storage already then it behaves as it did before.
      
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::fillStorage):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      be2b49e6
    • fpizlo@apple.com's avatar
      Global variable predictions should not be coalesced unnecessarily · e9915ef4
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83678
      
      Reviewed by Geoff Garen.
              
      Removed the PredictionTracker and everyone who used it. Converted GetGlobalVar
      to have a heapPrediction like a civilized DFG opcode ought to.
              
      No performance effect.
      
      * GNUmakefile.list.am:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * bytecode/CodeBlock.h:
      * bytecode/PredictionTracker.h: Removed.
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::parseBlock):
      * dfg/DFGGenerationInfo.h:
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::dump):
      * dfg/DFGGraph.h:
      (Graph):
      * dfg/DFGNode.h:
      (JSC::DFG::Node::hasHeapPrediction):
      * dfg/DFGPredictionPropagationPhase.cpp:
      (JSC::DFG::PredictionPropagationPhase::propagate):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e9915ef4
    • benjamin@webkit.org's avatar
      Optimize String.split() for 1 character separator · 114b51cf
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=83546
      
      Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-04-11
      Reviewed by Gavin Barraclough.
      
      This patch adds a serie of optimizations to make stringProtoFuncSplit() faster in the common case
      where the separator is a single character.
      
      The two main gains are:
      -Use of the find() function with a single character instead of doing a full string matching.
      -Use of WTF::find() instead of UString::find() to avoid branching on is8Bit() and have a simpler inline
       function.
      
      The code is also changed to avoid making unnecessary allocations by converting the 8bit string to 16bits.
      
      This makes String.split() faster by about 13% in that particular case.
      
      * runtime/StringPrototype.cpp:
      (JSC):
      (JSC::splitStringByOneCharacterImpl):
      (JSC::stringProtoFuncSplit):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      114b51cf
    • carlosgc@webkit.org's avatar
      Unreviewed. Fix make distcheck issues. · f23ca47c
      carlosgc@webkit.org authored
      Source/JavaScriptCore:
      
      * GNUmakefile.list.am: Ad missing files.
      
      Source/WebCore:
      
      * GNUmakefile.list.am: Add missing header file.
      
      Source/WebKit2:
      
      * GNUmakefile.am: Add missing header file.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113831 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f23ca47c
  4. 10 Apr, 2012 7 commits
    • mrowe@apple.com's avatar
      Attempt to fix the Windows build. · 04264b5a
      mrowe@apple.com authored
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113814 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      04264b5a
    • paroga@webkit.org's avatar
      Cleanup wtf/Platform.h and config.h files · d37daa20
      paroga@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=83431
      
      Reviewed by Eric Seidel.
      
      The ENABLE() and USE() macros take care about the case when the flag
      isn't defined. So there is no need to define anything with 0.
      
      Also move duplicated code from the config.h files to Platform.h and
      merge a few preprocessor commands to make the file more readable.
      
      Source/JavaScriptCore:
      
      * config.h:
      
      Source/WebCore:
      
      * config.h:
      
      Source/WTF:
      
      * config.h:
      * wtf/Platform.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d37daa20
    • fpizlo@apple.com's avatar
      DFG should flush SetLocals to arguments · af8940bf
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83554
      
      Source/JavaScriptCore: 
      
      Reviewed by Gavin Barraclough.
              
      This is necessary to match baseline JIT argument capture behavior.
              
      But to make this work right we need to have a story for arguments into
      which we store values of different formats. This patch introduces the
      notion of an ArgumentPosition - i.e. an argument in a particular inline
      call frame - and forces unification of all data pertinent to selecting
      the argument's data format.
              
      Also fixed an amusing bug in the handling of OSR on SetLocals if there
      was any insertion/deletion of nodes in the basic block. This is benign
      for now but won't be eventually since the DFG is getting smarter. So
      better fix it now.
              
      Also fixed an amusing bug in the handling of OSR on SetLocals if they
      are immediately followed by a Flush. I think this bug might have always
      been there but now it'll happen more commonly, and it's covered by the
      run-javascriptcore-tests.
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::execute):
      * dfg/DFGArgumentPosition.h: Added.
      (DFG):
      (ArgumentPosition):
      (JSC::DFG::ArgumentPosition::ArgumentPosition):
      (JSC::DFG::ArgumentPosition::addVariable):
      (JSC::DFG::ArgumentPosition::mergeArgumentAwareness):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::setLocal):
      (JSC::DFG::ByteCodeParser::setArgument):
      (InlineStackEntry):
      (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
      * dfg/DFGDoubleFormatState.h: Added.
      (DFG):
      (JSC::DFG::mergeDoubleFormatStates):
      (JSC::DFG::mergeDoubleFormatState):
      (JSC::DFG::doubleFormatStateToString):
      * dfg/DFGGraph.h:
      (Graph):
      * dfg/DFGPredictionPropagationPhase.cpp:
      (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGVariableAccessData.h:
      (JSC::DFG::VariableAccessData::VariableAccessData):
      (JSC::DFG::VariableAccessData::predict):
      (JSC::DFG::VariableAccessData::argumentAwarePrediction):
      (VariableAccessData):
      (JSC::DFG::VariableAccessData::mergeArgumentAwarePrediction):
      (JSC::DFG::VariableAccessData::doubleFormatState):
      (JSC::DFG::VariableAccessData::shouldUseDoubleFormat):
      (JSC::DFG::VariableAccessData::tallyVotesForShouldUseDoubleFormat):
      (JSC::DFG::VariableAccessData::mergeDoubleFormatState):
      (JSC::DFG::VariableAccessData::makePredictionForDoubleFormat):
      
      Source/WTF: 
      
      Reviewed by Gavin Barraclough.
              
      Added an isRoot() method that is a faster shorthand for saying
      find() == this.
      
      * wtf/UnionFind.h:
      (WTF::UnionFind::isRoot):
      (UnionFind):
      
      LayoutTests: 
      
      Rubber stamped by Gavin Barraclough.
              
      Added a variety of tests for reassigning arguments prior to function.arguments
      retrieval.
      
      * fast/js/dfg-inline-arguments-become-double-expected.txt: Added.
      * fast/js/dfg-inline-arguments-become-double.html: Added.
      * fast/js/dfg-inline-arguments-become-int32-expected.txt: Added.
      * fast/js/dfg-inline-arguments-become-int32.html: Added.
      * fast/js/dfg-inline-arguments-reset-changetype-expected.txt: Added.
      * fast/js/dfg-inline-arguments-reset-changetype.html: Added.
      * fast/js/dfg-inline-arguments-reset-expected.txt: Added.
      * fast/js/dfg-inline-arguments-reset.html: Added.
      * fast/js/script-tests/dfg-inline-arguments-become-double.js: Added.
      (foo):
      (bar):
      (baz):
      (argsToStr):
      * fast/js/script-tests/dfg-inline-arguments-become-int32.js: Added.
      (foo):
      (bar):
      (baz):
      (argsToStr):
      * fast/js/script-tests/dfg-inline-arguments-reset-changetype.js: Added.
      (foo):
      (bar):
      (baz):
      (argsToStr):
      * fast/js/script-tests/dfg-inline-arguments-reset.js: Added.
      (foo):
      (bar):
      (baz):
      (argsToStr):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      af8940bf
    • adamk@chromium.org's avatar
      Remove unused NonNullPassRefPtr from WTF · 65562294
      adamk@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=82389
      
      Reviewed by Kentaro Hara.
      
      Source/JavaScriptCore:
      
      * JavaScriptCore.order: Remove nonexistent symbols referencing NonNullPassRefPtr.
      
      Source/WTF:
      
      NonNullPassRefPtr seems to be unused since JSC allocation was
      restructured in r84052.
      
      If someone decides they need this later, they can always revert this patch.
      
      * wtf/PassRefPtr.h:
      * wtf/RefPtr.h:
      (RefPtr):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113794 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      65562294
    • darin@apple.com's avatar
      Remove unused data member from Lexer class · aea9f2dd
      darin@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83429
      
      Reviewed by Kentaro Hara.
      
      I noticed that m_delimited was "write-only", so I deleted it.
      
      * parser/Lexer.cpp:
      (JSC::Lexer::setCode): Removed code to set m_delimited.
      (JSC::Lexer::parseIdentifier): Ditto.
      (JSC::Lexer::parseIdentifierSlowCase): Ditto.
      (JSC::Lexer::lex): Ditto.
      * parser/Lexer.h: Deleted m_delimited.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113765 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      aea9f2dd
    • paroga@webkit.org's avatar
      [CMake] Enable USE_FOLDERS property · 2fc0c72e
      paroga@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=83571
      
      Reviewed by Daniel Bates.
      
      .:
      
      Setting the FOLDER property on targets gives more structure
      to the generated Visual Studio solutions.
      This does not affect other CMake generators.
      
      * Source/cmake/OptionsCommon.cmake:
      
      Source/JavaScriptCore:
      
      Setting the FOLDER property on targets gives more structure
      to the generated Visual Studio solutions.
      This does not affect other CMake generators.
      
      * CMakeLists.txt:
      * shell/CMakeLists.txt:
      
      Source/WebCore:
      
      Setting the FOLDER property on targets gives more structure
      to the generated Visual Studio solutions.
      This does not affect other CMake generators.
      
      * CMakeLists.txt:
      
      Source/WebKit:
      
      Setting the FOLDER property on targets gives more structure
      to the generated Visual Studio solutions.
      This does not affect other CMake generators.
      
      * CMakeLists.txt:
      
      Source/WebKit2:
      
      Setting the FOLDER property on targets gives more structure
      to the generated Visual Studio solutions.
      This does not affect other CMake generators.
      
      * CMakeLists.txt:
      
      Source/WTF:
      
      Setting the FOLDER property on targets gives more structure
      to the generated Visual Studio solutions.
      This does not affect other CMake generators.
      
      * wtf/CMakeLists.txt:
      
      Tools:
      
      Setting the FOLDER property on targets gives more structure
      to the generated Visual Studio solutions.
      This does not affect other CMake generators.
      
      * DumpRenderTree/efl/CMakeLists.txt:
      * EWebLauncher/CMakeLists.txt:
      * WinCELauncher/CMakeLists.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2fc0c72e
    • fpizlo@apple.com's avatar
      It should be possible to see why a code block was not compiled by the DFG · 1fc1b8f7
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83553
      
      Reviewed by Geoff Garen.
              
      If DFG_ENABLE(DEBUG_VERBOSE) and a code block is rejected, then print the
      opcode that caused the rejection.
      
      * dfg/DFGCapabilities.cpp:
      (JSC::DFG::debugFail):
      (DFG):
      (JSC::DFG::canHandleOpcodes):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1fc1b8f7
  5. 09 Apr, 2012 6 commits
  6. 08 Apr, 2012 2 commits
    • fpizlo@apple.com's avatar
      Command-line jsc's exception handling should be rationalized · 64f7aa1a
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83437
      
      Reviewed by Dan Bernstein.
              
      - If an exception is thrown during run() execution, it is now propagated,
        so that it will terminate program execution unless it is caught.
                
      - If program execution terminates with an exception, the exception is now
        always printed.
                
      - When printing the exception, the backtrace is now also printed if one is
        available. It will only not be available if you use something akin to my
        favorite line of code, 'throw "error"', since primitives don't have
        properties and hence we cannot attach a "stack" property to them.
      
      * jsc.cpp:
      (functionRun):
      (runWithScripts):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      64f7aa1a
    • fpizlo@apple.com's avatar
      Forced OSR exits should lead to recompilation based on count, not rate · 3cb7e2c7
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83247
      <rdar://problem/10720925>
      
      Reviewed by Geoff Garen.
              
      Track which OSR exits happen because of inadequate coverage. Count them
      separately. If the count reaches a threshold, immediately trigger
      reoptimization.
              
      This is in contrast to the recompilation trigger for all other OSR exits.
      Normally recomp is triggered when the exit rate exceeds a certain ratio.
              
      Looks like a slight V8 speedup (sub 1%).
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::CodeBlock):
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::forcedOSRExitCounter):
      (JSC::CodeBlock::addressOfForcedOSRExitCounter):
      (JSC::CodeBlock::offsetOfForcedOSRExitCounter):
      (JSC::CodeBlock::shouldReoptimizeNow):
      (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
      (CodeBlock):
      * bytecode/DFGExitProfile.h:
      (JSC::DFG::exitKindToString):
      * dfg/DFGOSRExitCompiler.cpp:
      (JSC::DFG::OSRExitCompiler::handleExitCounts):
      (DFG):
      * dfg/DFGOSRExitCompiler.h:
      (OSRExitCompiler):
      * dfg/DFGOSRExitCompiler32_64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGOSRExitCompiler64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGOperations.cpp:
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * runtime/Options.cpp:
      (Options):
      (JSC::Options::initializeOptions):
      * runtime/Options.h:
      (Options):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113552 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3cb7e2c7
  7. 06 Apr, 2012 4 commits
    • benjamin@webkit.org's avatar
      Do not abuse ArrayStorage's m_length for testing array consistency · 83c15267
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=83403
      
      Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-04-06
      Reviewed by Geoffrey Garen.
      
      Array creation from a list of values is a 3 steps process:
      -JSArray::tryCreateUninitialized()
      -JSArray::initializeIndex() for each values
      -JSArray::completeInitialization()
      
      Previously, the attribute m_length was not set to the final size
      JSArray::tryCreateUninitialized() because it was used to test the array
      consistency JSArray::initializeIndex().
      
      This caused the initialization loop using JSArray::initializeIndex() maintain
      two counters:
      -index of the loop
      -storage->m_length++
      
      This patch fixes this by using the index of the initialization loop for the indinces of
      JSArray::initializeIndex(). For testing consistency, the variable m_initializationIndex
      is introduced if CHECK_ARRAY_CONSISTENCY is defined.
      
      The patch also fixes minor unrelated build issue when CHECK_ARRAY_CONSISTENCY is defined.
      
      This improves the performance of JSArray creation from literals by 8%.
      
      * runtime/JSArray.cpp:
      (JSC::JSArray::tryFinishCreationUninitialized):
      (JSC::JSArray::checkConsistency):
      * runtime/JSArray.h:
      (ArrayStorage):
      (JSC::JSArray::initializeIndex):
      (JSC::JSArray::completeInitialization):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      83c15267
    • jonlee@apple.com's avatar
      Build fix for Windows bots. · cdd36d09
      jonlee@apple.com authored
      Source/JavaScriptCore:
      
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: export missing symbol.
      
      Source/WebKit2:
      
      * win/WebKit2.def: Add missing export symbol.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113527 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cdd36d09
    • ggaren@apple.com's avatar
      Renamed · 61b97001
      ggaren@apple.com authored
              WeakHeap => WeakSet
              HandleHeap => HandleSet
      
      Reviewed by Sam Weinig.
      
      These sets do have internal allocators, but it's confusing to call them
      heaps because they're sub-objects of an object called "heap".
      
      * heap/HandleHeap.cpp: Removed.
      * heap/HandleHeap.h: Removed.
      * heap/HandleSet.cpp: Copied from JavaScriptCore/heap/HandleHeap.cpp.
      * heap/WeakHeap.cpp: Removed.
      * heap/WeakHeap.h: Removed.
      * heap/WeakSet.cpp: Copied from JavaScriptCore/heap/WeakHeap.cpp.
      * heap/WeakSet.h: Copied from JavaScriptCore/heap/WeakHeap.h.
      
      Plus global rename using grep.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113508 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      61b97001
    • mitz@apple.com's avatar
      <rdar://problem/10912476> HiDPI: Have canvas use a hidpi backing store, but downsample upon access · 8e0fbd32
      mitz@apple.com authored
      Reviewed by Sam Weinig.
      
      Source/JavaScriptCore: 
      
      * Configurations/FeatureDefines.xcconfig: Added ENABLE_HIGH_DPI_CANVAS.
      
      Source/WebCore: 
      
      * Configurations/FeatureDefines.xcconfig: Added ENABLE_HIGH_DPI_CANVAS.
      
      Source/WebKit/mac: 
      
      * Configurations/FeatureDefines.xcconfig: Added ENABLE_HIGH_DPI_CANVAS.
      
      Source/WebKit2: 
      
      * Configurations/FeatureDefines.xcconfig: Added ENABLE_HIGH_DPI_CANVAS.
      
      Tools: 
      
      * Scripts/build-webkit: Added high-dpi-canvas option to control ENABLE_HIGH_DPI_CANVAS.
      
      WebKitLibraries: 
      
      * win/tools/vsprops/FeatureDefines.vsprops: Added ENABLE_HIGH_DPI_CANVAS.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8e0fbd32