1. 08 Apr, 2011 1 commit
    • ggaren@apple.com's avatar
      2011-04-07 Geoffrey Garen <ggaren@apple.com> · 264f9e28
      ggaren@apple.com authored
              Reviewed by Maciej Stachowiak.
      
              Some Handle<T> cleanup
              https://bugs.webkit.org/show_bug.cgi?id=58109
      
              * bytecode/SamplingTool.h: Sorted alphabetically because that's the
              WebKit style. Added a Global.h #include that was previously missing
              but harmless.
      
              * collector/handles/Global.h:
              (JSC::Global::Global): Added a null constructor. No need for a special
              tag, and the tag is incompatible with some data structures.
              
              (JSC::Global::isHashTableDeletedValue):
              (JSC::Global::~Global):
              (JSC::Global::set):
              (JSC::Global::operator=):
              (JSC::Global::clear):
              (JSC::Global::hashTableDeletedValue): Reordered constructors to be near
              each other.
      
              (JSC::Global::setWithWriteBarrier): Renamed internalSet to
              setWithWriteBarrier for clarity, and funneled more code into using set
              and setWithWriteBarrier to reduce duplication.
      
              * collector/handles/Handle.h:
              (JSC::HandleBase::operator!):
              (JSC::HandleBase::HandleBase): Removed isEmpty(), since we already have
              boolean and ! operators.
      
              (JSC::HandleBase::slot):
              (JSC::HandleBase::setSlot):
              (JSC::Handle::Handle): Added general support for null Handles. This was
              previously outlawed by ASSERTs, but our code has grown to support and
              rely on null Handles.
              
              * collector/handles/HandleHeap.cpp:
              (JSC::HandleHeap::markWeakHandles):
              (JSC::HandleHeap::finalizeWeakHandles):
              (JSC::HandleHeap::isValidWeakNode): Migrated from isValidWeakHandle,
              and beefed this up a bit.
      
              * collector/handles/HandleHeap.h:
              (JSC::HandleHeap::globalData): Added accessor, used by some new set functions.
      
              * collector/handles/Local.h: Moved hash traits to the bottom of the file,
              since this file is about the Local class, not the traits.
      
              (JSC::::Local): Updated for removal of invalidate().
      
              (JSC::::operator): Deployed "using" to avoid a lot of this->
              template funny business.
      
              (JSC::::setWithSlotCheck): Renamed from internalSet, more specific now.
      
              * interpreter/RegisterFile.h:
              (JSC::RegisterFile::RegisterFile): Updated to use null constructor.
      
              * jit/JITStubs.cpp:
              (JSC::JITThunks::hostFunctionStub):
      
              * runtime/JSPropertyNameIterator.h:
              (JSC::Structure::setEnumerationCache):
              * runtime/Structure.h: Removed clearEnumerationCache
              because it was an unused holdover from when the enumeration cache was
              not a handle.
      
              * runtime/WeakGCMap.h:
              (JSC::WeakGCMap::set): Finish initializing our handle before putting it
              in the table. This seemed more logical, and at one point was required
              to avoid triggering an ASSERT.
      
              * runtime/WeakGCPtr.h: Inherit from Handle instead of rolling our own
              handle-like behavior, to avoid duplication.
      
              (JSC::WeakGCPtr::WeakGCPtr):
              (JSC::WeakGCPtr::~WeakGCPtr):
              (JSC::WeakGCPtr::get):
              (JSC::WeakGCPtr::clear):
              (JSC::WeakGCPtr::set):
              (JSC::WeakGCPtr::setWithWriteBarrier): Removed duplicate code and
              standardized on Handle idioms.
      2011-04-07  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Maciej Stachowiak.
      
              Some Handle<T> cleanup
              https://bugs.webkit.org/show_bug.cgi?id=58109
      
              * JSRun.h:
              * JSValueWrapper.h: #include a file that was missing before, but was
              harmlessly so until now.
      2011-04-07  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Maciej Stachowiak.
      
              Some Handle<T> cleanup
              https://bugs.webkit.org/show_bug.cgi?id=58109
      
              * bindings/js/ScriptValue.h:
              (WebCore::ScriptValue::ScriptValue): Updated for new null constructor.
              (WebCore::ScriptValue::hasNoValue): Updated for removal of isEmpty().
      2011-04-07  Geoffrey Garen  <ggaren@apple.com>
      
              Some Handle<T> cleanup
              https://bugs.webkit.org/show_bug.cgi?id=58109
      
              * WebProcess/Plugins/Netscape/NPJSObject.cpp:
              (WebKit::NPJSObject::NPJSObject): Updated for new null constructor.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      264f9e28
  2. 04 Apr, 2011 2 commits
    • ggaren@apple.com's avatar
      2011-04-04 Geoffrey Garen <ggaren@apple.com> · 6ac69d8e
      ggaren@apple.com authored
              Reviewed by Oliver Hunt.
      
              Fixed a weak-handle-related leak in RegisterFile
              https://bugs.webkit.org/show_bug.cgi?id=57793
      
              * interpreter/RegisterFile.cpp: Nixed leaky GlobalObjectNotifier.
              * interpreter/RegisterFile.h:
              (JSC::RegisterFile::GlobalObjectOwner::finalize):
              (JSC::RegisterFile::RegisterFile): Replaced GlobalObjectNotifier with
              a per-RegisterFile weak handle owner, which does not leak.
      
              * runtime/WeakGCPtr.h:
              (JSC::WeakGCPtr::set): Allow set() to take a context argument, since
              RegisterFile now needs this. (Seems like it was an accidental omission
              all along.)
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6ac69d8e
    • ggaren@apple.com's avatar
      2011-04-04 Geoffrey Garen <ggaren@apple.com> · 9e273681
      ggaren@apple.com authored
              Reviewed by Oliver Hunt.
      
              Renamed Finalizer => WeakHandleOwner (in preparation for adding a reachability callback)
              https://bugs.webkit.org/show_bug.cgi?id=57775
              
              Also renamed noFinalizer => emptyWeakOwner, since this is really an
              optimization for a weak owner with empty callbacks.
      
              * collector/handles/HandleHeap.cpp:
              (JSC::HandleHeap::clearWeakPointers): Updated for renames. Removed
              redundant initialization of m_nextToFinalize. Moved deletion check inside
              weak owner check, since the weak owner can't delete the node if there is
              no weak owner!
      
              * collector/handles/HandleHeap.h:
              (JSC::WeakHandleOwner::~WeakHandleOwner):
              (JSC::HandleHeap::makeWeak): Updated for renames.
      
              (JSC::HandleHeap::hasWeakOwner): Changed getFinalizer to hasWeakOwner,
              to clarify this function's role in assertions.
      
              (JSC::HandleHeap::Node::Node):
              (JSC::HandleHeap::Node::makeWeak):
              (JSC::HandleHeap::Node::isWeak):
              (JSC::HandleHeap::Node::weakOwner):
              (JSC::HandleHeap::Node::weakOwnerContext):
              (JSC::HandleHeap::Node::emptyWeakOwner):
              * interpreter/RegisterFile.cpp:
              (JSC::RegisterFile::globalObjectCollectedNotifier):
              * interpreter/RegisterFile.h:
              * runtime/WeakGCMap.h:
              * runtime/WeakGCPtr.h:
              (JSC::WeakGCPtr::WeakGCPtr):
              (JSC::WeakGCPtr::set): Updated for renames.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82866 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9e273681
  3. 16 Mar, 2011 1 commit
    • ggaren@apple.com's avatar
      2011-03-16 Geoffrey Garen <ggaren@apple.com> · 02bf0404
      ggaren@apple.com authored
              Reviewed by Oliver Hunt.
      
              Some conservative root gathering cleanup
              https://bugs.webkit.org/show_bug.cgi?id=56447
              
              SunSpider says 0.5% - 1.8% faster.
      
              * interpreter/RegisterFile.cpp:
              (JSC::RegisterFile::gatherConservativeRoots):
              * interpreter/RegisterFile.h: New helper function for doing the
              conservative gathering of the register file. It's still conservative,
              since the register file may contain uninitialized values, but it's
              moving-safe, because it only visits values tagged as pointers, so there's
              no risk of mistaking an integer for a pointer and accidentally changing it.
      
              * runtime/ConservativeSet.cpp:
              (JSC::ConservativeRoots::add):
              * runtime/ConservativeSet.h: Added a single-value add function, used above.
      
              * runtime/Heap.cpp:
              (JSC::Heap::markRoots): Separated machine stack conservative roots from
              register file conservative roots because machine stack roots must be
              pinned, but register file roots need not be pinned.
              
              Adopted new interface for passing the current stack extent to the machine
              stack root gathering routine. This allows us to exclude marking-related
              data structures on the stack, and thus avoid double-marking the set of
              machine roots.
      
              * runtime/MachineStackMarker.cpp:
              (JSC::MachineThreads::gatherFromCurrentThread):
              (JSC::MachineThreads::gatherConservativeRoots):
              * runtime/MachineStackMarker.h: Added new interface, described above.
      
              * runtime/MarkedBlock.h:
              (JSC::MarkedBlock::firstAtom):
              * wtf/StdLibExtras.h:
              (WTF::roundUpToMultipleOf): Moved roundUpToMultipleOf so it could be used
              by MachineStacks.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81262 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      02bf0404
  4. 13 Mar, 2011 1 commit
    • barraclough@apple.com's avatar
      Bug 56270 - The JIT 'friend's many classes in JSC; start unwinding this. · 66184e2c
      barraclough@apple.com authored
      Reviewed by Sam Weinig.
      
      The JIT need to 'friend' other classes in order to be able to calculate offsets
      of various properties, or the absolute addresses of members within specific objects,
      in order to JIT generate code that will access members within the class when run.
      
      Instead of using friends in these cases, switch to providing specific accessor
      methods to provide this information.  In the case of offsets, these can be static
      functions, and in the case of pointers to members within a specific object these can
      be const methods returning pointers to const values, to prevent clients from
      modifying values otherwise encapsulated within classes.
      
      * bytecode/SamplingTool.h:
      * interpreter/Register.h:
      * interpreter/RegisterFile.h:
      * runtime/JSArray.h:
      * runtime/JSCell.h:
      * runtime/JSTypeInfo.h:
      * runtime/JSVariableObject.h:
      * runtime/Structure.h:
      * wtf/RefCounted.h:
          - Change these classes to no longer friend the JIT, add accessors for member offsets.
      * jit/JIT.cpp:
      * jit/JITCall32_64.cpp:
      * jit/JITInlineMethods.h:
      * jit/JITOpcodes.cpp:
      * jit/JITOpcodes32_64.cpp:
      * jit/JITPropertyAccess.cpp:
      * jit/JITPropertyAccess32_64.cpp:
          - Change the JIT to use class accessors, rather than taking object ofsets directly.
      * assembler/AbstractMacroAssembler.h:
      * assembler/MacroAssemblerX86_64.h:
      * assembler/X86Assembler.h:
          - Since the accessors for objects members return const pointers to retain encapsulation,
            methods generating code with absolute addresses must be able to handle const pointers
            (the JIT doesn't write to these values, do dies treat the pointer to value as const
            from within the C++ code of the JIT, if not at runtime!).
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      66184e2c
  5. 24 Feb, 2011 1 commit
    • oliver@apple.com's avatar
      2011-02-24 Oliver Hunt <oliver@apple.com> · 6acb3ba3
      oliver@apple.com authored
              Reviewed by Gavin Barraclough.
      
              Make weaklist processing deal with weak handles being removed during the iteration
              https://bugs.webkit.org/show_bug.cgi?id=55105
      
              It is possible for the handle heap to end up in a broken state if
              a handle's finalizer removes either the current or next handle
              to be visited during the post-gc cleanup.  This patch removes that
              problem by allowing the deallocate(Node*) routine to update the
              iterator if it is called during finalization.
      
              * collector/handles/HandleHeap.cpp:
              (JSC::HandleHeap::HandleHeap):
              (JSC::HandleHeap::updateAfterMark):
              (JSC::HandleHeap::clearWeakPointers):
              (JSC::HandleHeap::writeBarrier):
              (JSC::HandleHeap::protectedGlobalObjectCount):
              * collector/handles/HandleHeap.h:
              (JSC::Finalizer::~Finalizer):
              (JSC::HandleHeap::getFinalizer):
              (JSC::HandleHeap::deallocate):
              (JSC::HandleHeap::makeWeak):
              (JSC::HandleHeap::makeSelfDestroying):
              (JSC::HandleHeap::Node::Node):
              (JSC::HandleHeap::Node::setFinalizer):
              (JSC::HandleHeap::Node::finalizer):
              (JSC::HandleHeap::Node::finalizerContext):
              * interpreter/RegisterFile.cpp:
              (JSC::RegisterFile::setGlobalObject):
              (JSC::GlobalObjectNotifier::finalize):
              (JSC::RegisterFile::globalObjectCollectedNotifier):
              * interpreter/RegisterFile.h:
              (JSC::RegisterFile::RegisterFile):
              * runtime/Heap.cpp:
              (JSC::Heap::destroy):
              * runtime/WeakGCPtr.h:
              (JSC::WeakGCPtr::WeakGCPtr):
              (JSC::WeakGCPtr::set):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6acb3ba3
  6. 15 Feb, 2011 1 commit
    • oliver@apple.com's avatar
      2011-02-14 Oliver Hunt <oliver@apple.com> · 8d85705e
      oliver@apple.com authored
              Reviewed by Gavin Barraclough and Geoff Garen.
      
              Refactor handles and weak pointers to become nicer and more automatic
              https://bugs.webkit.org/show_bug.cgi?id=54415
      
              Move to a true handle based mechanism for GC value protection.  This
              also allows us to switch to a more sensible behaviour for weak pointers
              in which weak pointers are automatically updated.
      
              This allows us to remove the old (and convoluted) that required all
              objects that may be held by a weak reference to be aware of the reference
              and manually clear them in their destructors.
      
              This also adds a few new data types to JSC that we use to efficiently
              allocate and return the underlying handle storage.
      
              This patch is largely renaming and removing now unnecessary destructors
              from objects.
      
              * API/JSClassRef.cpp:
              (OpaqueJSClass::create):
              (OpaqueJSClassContextData::OpaqueJSClassContextData):
              (OpaqueJSClass::contextData):
              (OpaqueJSClass::prototype):
              * API/JSClassRef.h:
              * CMakeLists.txt:
              * GNUmakefile.am:
              * JavaScriptCore.exp:
              * JavaScriptCore.gypi:
              * JavaScriptCore.pro:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
              * JavaScriptCore.vcproj/WTF/WTF.vcproj:
              * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * collector/handles/Global.h: Added.
                  New Global handle type used to keep gc objects live, even if they're not
                  marked.
              (JSC::Global::Global):
              (JSC::Global::~Global):
              (JSC::Global::set):
                  We can only assign directly to a global from another global.
                  In all other cases we need the JSGlobalData to be provided
                  explicitly so we use a set function.
              (JSC::Global::operator=):
              (JSC::Global::clear):
              (JSC::Global::isHashTableDeletedValue):
              (JSC::Global::internalSet):
              * collector/handles/Handle.h: Added.
                  Root "Handle" type used for immutable handles and to provide the basic
                  APIs needed for pointer-like behaviour.
              (JSC::HandleBase::operator!):
              (JSC::HandleBase::operator UnspecifiedBoolType*):
              (JSC::HandleBase::isEmpty):
              (JSC::HandleBase::HandleBase):
              (JSC::HandleBase::slot):
              (JSC::HandleBase::invalidate):
              (JSC::HandleBase::setSlot):
              (JSC::HandleTypes::getFromSlot):
              (JSC::HandleTypes::toJSValue):
              (JSC::HandleTypes::validateUpcast):
              (JSC::HandleConverter::operator->):
              (JSC::HandleConverter::operator*):
              (JSC::Handle::Handle):
              (JSC::Handle::get):
              (JSC::Handle::wrapSlot):
              (JSC::operator==):
              (JSC::operator!=):
              * collector/handles/HandleHeap.cpp: Added.
                  New heap for global handles.
              (JSC::HandleHeap::HandleHeap):
              (JSC::HandleHeap::grow):
              (JSC::HandleHeap::markStrongHandles):
              (JSC::HandleHeap::updateAfterMark):
              (JSC::HandleHeap::clearWeakPointers):
              (JSC::HandleHeap::writeBarrier):
              * collector/handles/HandleHeap.h: Added.
              (JSC::HandleHeap::heapFor):
              (JSC::HandleHeap::toHandle):
              (JSC::HandleHeap::toNode):
              (JSC::HandleHeap::allocate):
              (JSC::HandleHeap::deallocate):
              (JSC::HandleHeap::makeWeak):
                  Convert a hard handle into weak handle that does not
                  protect the object it points to.
              (JSC::HandleHeap::makeSelfDestroying):
                  Converts a handle to a weak handle that will be returned
                  to the free list when the referenced object dies.
              (JSC::HandleHeap::Node::Node):
              (JSC::HandleHeap::Node::slot):
              (JSC::HandleHeap::Node::handleHeap):
              (JSC::HandleHeap::Node::setFinalizer):
              (JSC::HandleHeap::Node::makeWeak):
              (JSC::HandleHeap::Node::isWeak):
              (JSC::HandleHeap::Node::makeSelfDestroying):
              (JSC::HandleHeap::Node::isSelfDestroying):
              (JSC::HandleHeap::Node::finalizer):
              (JSC::HandleHeap::Node::setPrev):
              (JSC::HandleHeap::Node::prev):
              (JSC::HandleHeap::Node::setNext):
              (JSC::HandleHeap::Node::next):
              * interpreter/Interpreter.cpp:
              (JSC::Interpreter::Interpreter):
              * interpreter/Interpreter.h:
              * interpreter/RegisterFile.cpp:
              (JSC::RegisterFile::globalObjectCollected):
              * interpreter/RegisterFile.h:
              (JSC::RegisterFile::RegisterFile):
              * runtime/GCHandle.cpp: Removed.
              * runtime/GCHandle.h: Removed.
              * runtime/Heap.cpp:
              (JSC::Heap::Heap):
              (JSC::Heap::destroy):
              (JSC::Heap::markRoots):
              * runtime/Heap.h:
              (JSC::Heap::allocateGlobalHandle):
              (JSC::Heap::reportExtraMemoryCost):
              * runtime/JSGlobalData.cpp:
              (JSC::JSGlobalData::JSGlobalData):
              * runtime/JSGlobalData.h:
              (JSC::JSGlobalData::allocateGlobalHandle):
              * runtime/JSGlobalObject.cpp:
              (JSC::JSGlobalObject::~JSGlobalObject):
              * runtime/JSPropertyNameIterator.cpp:
              (JSC::JSPropertyNameIterator::create):
              (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
              * runtime/JSPropertyNameIterator.h:
              (JSC::JSPropertyNameIterator::createStructure):
              (JSC::Structure::setEnumerationCache):
              (JSC::Structure::clearEnumerationCache):
              * runtime/Protect.h:
              * runtime/Structure.cpp:
              (JSC::Structure::~Structure):
              * runtime/Structure.h:
              * runtime/WeakGCPtr.h:
              (JSC::WeakGCPtrBase::get):
              (JSC::WeakGCPtrBase::clear):
              (JSC::WeakGCPtrBase::operator!):
              (JSC::WeakGCPtrBase::operator UnspecifiedBoolType*):
              (JSC::WeakGCPtrBase::~WeakGCPtrBase):
              (JSC::WeakGCPtrBase::WeakGCPtrBase):
              (JSC::WeakGCPtrBase::internalSet):
              (JSC::LazyWeakGCPtr::LazyWeakGCPtr):
              (JSC::LazyWeakGCPtr::set):
              (JSC::WeakGCPtr::WeakGCPtr):
              (JSC::WeakGCPtr::operator=):
              * runtime/WriteBarrier.h:
              * wtf/BlockStack.h: Added.
              (WTF::::BlockStack):
              (WTF::::~BlockStack):
              (WTF::::blocks):
              (WTF::::grow):
              (WTF::::shrink):
              * wtf/SentinelLinkedList.h: Added.
              (WTF::::SentinelLinkedList):
              (WTF::::begin):
              (WTF::::end):
              (WTF::::push):
              (WTF::::remove):
              * wtf/SinglyLinkedList.h: Added.
              (WTF::::SinglyLinkedList):
              (WTF::::isEmpty):
              (WTF::::push):
              (WTF::::pop):
      2011-02-14  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Gavin Barraclough and Geoff Garen.
      
              Refactor handles and weak pointers to become nicer and more automatic
              https://bugs.webkit.org/show_bug.cgi?id=54415
      
              Update to use new Global<> type
      
              * JSRun.cpp:
              (JSRun::JSRun):
              (JSRun::GlobalObject):
              * JSRun.h:
              * JSValueWrapper.cpp:
              (JSValueWrapper::JSValueWrapper):
              * JSValueWrapper.h:
      2011-02-14  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Gavin Barraclough and Geoff Garen.
      
              Refactor handles and weak pointers to become nicer and more automatic
              https://bugs.webkit.org/show_bug.cgi?id=54415
      
              Update WebCore to use the new Global<> type rather than ProtectedJSValue
              and gc[Un]Protect.  Also update to use new WeakGCPtr APIs, and remove now
              unnecessary destructors.
      
              * ForwardingHeaders/collector/handles/Global.h: Added.
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.vcproj/copyForwardingHeaders.cmd:
              * bindings/js/JSCallbackData.h:
              (WebCore::JSCallbackData::JSCallbackData):
              * bindings/js/JSCustomVoidCallback.h:
              * bindings/js/JSDOMBinding.cpp:
              (WebCore::forgetDOMNode):
              (WebCore::cacheDOMNodeWrapper):
              * bindings/js/JSDOMWindowBase.h:
              * bindings/js/JSDOMWindowShell.cpp:
              (WebCore::JSDOMWindowShell::setWindow):
              * bindings/js/JSDataGridDataSource.h:
              * bindings/js/JSEventListener.cpp:
              (WebCore::JSEventListener::JSEventListener):
              * bindings/js/JSEventListener.h:
              (WebCore::JSEventListener::setWrapper):
              * bindings/js/JSLazyEventListener.cpp:
              (WebCore::JSLazyEventListener::initializeJSFunction):
              * bindings/js/ScheduledAction.cpp:
              (WebCore::ScheduledAction::ScheduledAction):
              (WebCore::ScheduledAction::executeFunctionInContext):
              * bindings/js/ScheduledAction.h:
              (WebCore::ScheduledAction::ScheduledAction):
              * bindings/js/ScriptCachedFrameData.cpp:
              (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
              (WebCore::ScriptCachedFrameData::restore):
              * bindings/js/ScriptCachedFrameData.h:
              * bindings/js/ScriptCallStackFactory.cpp:
              (WebCore::createScriptArguments):
              * bindings/js/ScriptController.cpp:
              (WebCore::ScriptController::createWindowShell):
              (WebCore::ScriptController::evaluateInWorld):
              (WebCore::ScriptController::clearWindowShell):
              (WebCore::ScriptController::attachDebugger):
              * bindings/js/ScriptController.h:
              * bindings/js/ScriptFunctionCall.cpp:
              (WebCore::ScriptFunctionCall::call):
              (WebCore::ScriptCallback::call):
              * bindings/js/ScriptObject.cpp:
              (WebCore::ScriptObject::ScriptObject):
              * bindings/js/ScriptObject.h:
              * bindings/js/ScriptState.cpp:
              (WebCore::ScriptStateProtectedPtr::ScriptStateProtectedPtr):
              (WebCore::ScriptStateProtectedPtr::get):
              * bindings/js/ScriptState.h:
              * bindings/js/ScriptValue.cpp:
              (WebCore::ScriptValue::isFunction):
              (WebCore::ScriptValue::deserialize):
              * bindings/js/ScriptValue.h:
              (WebCore::ScriptValue::ScriptValue):
              (WebCore::ScriptValue::hasNoValue):
              * bindings/js/ScriptWrappable.h:
              (WebCore::ScriptWrappable::ScriptWrappable):
              (WebCore::ScriptWrappable::setWrapper):
              * bindings/js/WorkerScriptController.cpp:
              (WebCore::WorkerScriptController::WorkerScriptController):
              (WebCore::WorkerScriptController::~WorkerScriptController):
              (WebCore::WorkerScriptController::initScript):
              (WebCore::WorkerScriptController::evaluate):
              * bindings/js/WorkerScriptController.h:
              (WebCore::WorkerScriptController::workerContextWrapper):
              * bindings/scripts/CodeGeneratorJS.pm:
              * bridge/NP_jsobject.cpp:
              (_NPN_InvokeDefault):
              (_NPN_Invoke):
              (_NPN_Evaluate):
              (_NPN_Construct):
              * bridge/jsc/BridgeJSC.cpp:
              (JSC::Bindings::Instance::Instance):
              (JSC::Bindings::Instance::~Instance):
              (JSC::Bindings::Instance::willDestroyRuntimeObject):
              (JSC::Bindings::Instance::willInvalidateRuntimeObject):
              * bridge/jsc/BridgeJSC.h:
              * bridge/runtime_object.cpp:
              (JSC::Bindings::RuntimeObject::invalidate):
              * bridge/runtime_root.cpp:
              (JSC::Bindings::RootObject::RootObject):
              (JSC::Bindings::RootObject::invalidate):
              (JSC::Bindings::RootObject::globalObject):
              (JSC::Bindings::RootObject::updateGlobalObject):
              * bridge/runtime_root.h:
              * dom/EventListener.h:
              * dom/EventTarget.h:
              (WebCore::EventTarget::markJSEventListeners):
              * xml/XMLHttpRequest.cpp:
      
              Qt bindings courtesy of Csaba Osztrogonác
              * bridge/qt/qt_runtime.cpp:
              (JSC::Bindings::QtRuntimeConnectionMethod::call):
              (JSC::Bindings::QtConnectionObject::QtConnectionObject):
              (JSC::Bindings::QtConnectionObject::execute):
              (JSC::Bindings::QtConnectionObject::match):
              * bridge/qt/qt_runtime.h:
      2011-02-14  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Gavin Barraclough and Geoff Garen.
      
              Refactor handles and weak pointers to become nicer and more automatic
              https://bugs.webkit.org/show_bug.cgi?id=54415
      
              Update to use Global<> instead of ProtectedPtr, and refactored slightly
              to get global data to places it's needed for when we're assigning to
              Global<>s
      
              * ForwardingHeaders/collector/handles/Global.h: Added.
              * Plugins/Hosted/NetscapePluginInstanceProxy.h:
              * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
              (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::get):
              (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::idForObject):
              (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::forget):
              (WebKit::NetscapePluginInstanceProxy::getWindowNPObject):
              (WebKit::NetscapePluginInstanceProxy::getPluginElementNPObject):
              (WebKit::NetscapePluginInstanceProxy::evaluate):
              (WebKit::NetscapePluginInstanceProxy::invoke):
              (WebKit::NetscapePluginInstanceProxy::invokeDefault):
              (WebKit::NetscapePluginInstanceProxy::construct):
              (WebKit::NetscapePluginInstanceProxy::addValueToArray):
              * WebView/WebScriptDebugger.h:
              * WebView/WebScriptDebugger.mm:
              (WebScriptDebugger::WebScriptDebugger):
      2011-02-14  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Gavin Barraclough and Geoff Garen.
      
              Refactor handles and weak pointers to become nicer and more automatic
              https://bugs.webkit.org/show_bug.cgi?id=54415
      
              Update code to new Global<> API, and refactor to get global data to
              necessary points.
      
              * WebProcess/Plugins/Netscape/NPJSObject.cpp:
              (WebKit::NPJSObject::create):
              (WebKit::NPJSObject::NPJSObject):
              (WebKit::NPJSObject::initialize):
              (WebKit::NPJSObject::invokeDefault):
              (WebKit::NPJSObject::construct):
              (WebKit::NPJSObject::invoke):
              * WebProcess/Plugins/Netscape/NPJSObject.h:
              * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
              (WebKit::NPRuntimeObjectMap::getOrCreateNPObject):
              (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
              (WebKit::NPRuntimeObjectMap::evaluate):
              * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
              * WebProcess/Plugins/PluginView.cpp:
              (WebKit::PluginView::windowScriptNPObject):
              (WebKit::PluginView::pluginElementNPObject):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78634 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8d85705e
  7. 21 Jan, 2011 1 commit
    • ggaren@apple.com's avatar
      2011-01-21 Geoffrey Garen <ggaren@apple.com> · 86f21951
      ggaren@apple.com authored
              Reviewed by Maciej Stachowiak.
      
              Cleaned up some conservative marking code.
              https://bugs.webkit.org/show_bug.cgi?id=52946
              
              SunSpider reports no change.
      
              * interpreter/RegisterFile.h: No need for a special marking function,
              since we already expose a start() and end().
      
              * runtime/Heap.cpp:
              (JSC::Heap::registerFile):
              (JSC::Heap::markRoots):
              * runtime/Heap.h:
              (JSC::Heap::contains): Migrated markConservatively() to the machine stack
              marker class. Now, Heap just provides a contains() function, which the
              machine stack marker uses for checking whether a pointer points into the heap.
      
              * runtime/MachineStackMarker.cpp:
              (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
              (JSC::MachineStackMarker::markOtherThreadConservatively):
              (JSC::isPointerAligned):
              (JSC::MachineStackMarker::markConservatively):
              * runtime/MachineStackMarker.h: Move the conservative marking code here.
      
              * runtime/MarkStack.h:
              (JSC::ConservativeSet::add):
              (JSC::ConservativeSet::mark): Changed to using a vector instead of hash
              set. Vector seems to be a bit faster, and it generates smaller code.
      
              * runtime/MarkedSpace.cpp:
              (JSC::MarkedSpace::containsSlowCase):
              * runtime/MarkedSpace.h:
              (JSC::MarkedSpace::isCellAligned):
              (JSC::MarkedSpace::isPossibleCell):
              (JSC::MarkedSpace::contains): Kept the code for determining whether a
              pointer pointed into marked space, and moved the code for marking
              a set of conservative pointers into the machine stack marker.
      
              * wtf/HashSet.h:
              (WTF::::add): Added two missing inlines that I noticed while testing
              vector vs hash set.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      86f21951
  8. 20 Jan, 2011 2 commits
    • ggaren@apple.com's avatar
      2011-01-20 Geoffrey Garen <ggaren@apple.com> · 7c9ff4d4
      ggaren@apple.com authored
              Reviewed by Oliver Hunt.
      
              When marking conservatively, guard against reviving dead objects.
              https://bugs.webkit.org/show_bug.cgi?id=52840
              
              SunSpider and v8 say no change.
      
              * interpreter/RegisterFile.h:
              (JSC::RegisterFile::markCallFrames): Updated to use the ConservativeSet API.
      
              * runtime/Heap.cpp:
              (JSC::Heap::recordExtraCost): No need to guard against conservative
              marking reviving dead objects anymore, since the conservative marking
              mechanism guards against this now.
      
              (JSC::Heap::markConservatively):
              (JSC::Heap::markProtectedObjects):
              (JSC::Heap::markTempSortVectors): Don't drain the mark stack inside a
              marking function. We want to establish a separation of concerns between
              visiting roots and draining the mark stack.
      
              (JSC::Heap::markRoots): Gather the set of conservative references before
              clearning mark bits, because conservative marking now uses the mark bits
              to determine if a reference is valid, and avoid reviving dead objects.
      
              (JSC::Heap::collectAllGarbage): No need to guard against conservative
              marking reviving dead objects anymore, since the conservative marking
              mechanism guards against this now.
      
              * runtime/Heap.h: Updated to use the ConservativeSet API.
      
              * runtime/MachineStackMarker.cpp:
              (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
              (JSC::MachineStackMarker::markCurrentThreadConservatively):
              (JSC::MachineStackMarker::markOtherThreadConservatively):
              (JSC::MachineStackMarker::markMachineStackConservatively):
              * runtime/MachineStackMarker.h: Ditto.
      
              * runtime/MarkStack.h:
              (JSC::ConservativeSet::add):
              (JSC::ConservativeSet::mark): Added ConservativeSet, for gathering the
              set of conservative references. This is different from MarkStack, since
              we don't mark the set until it is completely gathered.
      
              * runtime/MarkedSpace.cpp:
              (JSC::MarkedSpace::freeBlock):
              (JSC::MarkedSpace::resizeBlocks):
              (JSC::MarkedSpace::markConservatively):
              * runtime/MarkedSpace.h: When marking conservatively, guard against
              reviving dead objects.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7c9ff4d4
    • ossy@webkit.org's avatar
      Refactoring of the custom allocation framework · 95c1bc42
      ossy@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=49897
      
      Patch by Zoltan Horvath <zoltan@webkit.org> on 2011-01-20
      Reviewed by Csaba Osztrogonác.
      
      Source/JavaScriptCore:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      * wtf/FastAllocBase.h: Turn FastAllocBase's implementation into a macro.
      
      Source/WebCore:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Source/WebKit:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Source/WebKit2:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Tools:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      95c1bc42
  9. 19 Jan, 2011 1 commit
  10. 18 Jan, 2011 2 commits
  11. 10 Jan, 2011 1 commit
    • ggaren@apple.com's avatar
      Moved Collector.* => Heap.*, since the file contains a class named "Heap". · a8b3854a
      ggaren@apple.com authored
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore: 
      
      * API/JSCallbackObject.cpp:
      * Android.mk:
      * CMakeLists.txt:
      * GNUmakefile.am:
      * JavaScriptCore.gypi:
      * JavaScriptCore.pro:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * interpreter/Interpreter.cpp:
      * interpreter/RegisterFile.h:
      * jit/JITStubs.cpp:
      * runtime/Collector.cpp: Removed.
      * runtime/Collector.h: Removed.
      * runtime/CollectorHeapIterator.h:
      * runtime/GCActivityCallbackCF.cpp:
      * runtime/Heap.cpp: Copied from JavaScriptCore/runtime/Collector.cpp.
      * runtime/Heap.h: Copied from JavaScriptCore/runtime/Collector.h.
      * runtime/InitializeThreading.cpp:
      * runtime/JSCell.h:
      * runtime/JSGlobalData.cpp:
      * runtime/JSGlobalData.h:
      * runtime/JSLock.cpp:
      * runtime/JSNumberCell.h:
      * runtime/MachineStackMarker.cpp:
      * runtime/MemoryStatistics.h:
      * runtime/Protect.h:
      * runtime/UString.cpp:
      * runtime/WeakGCMap.h:
      * runtime/WeakGCPtr.h:
      
      Source/JavaScriptGlue: 
      
      * JSUtils.h:
      
      Source/WebCore: 
      
      * ForwardingHeaders/runtime/Collector.h: Removed.
      * ForwardingHeaders/runtime/Heap.h: Copied from WebCore/ForwardingHeaders/runtime/Collector.h.
      * WebCore.vcproj/WebCore.vcproj:
      * bindings/js/GCController.cpp:
      * bindings/js/ScriptGCEvent.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a8b3854a
  12. 01 Jan, 2011 1 commit
    • abarth@webkit.org's avatar
      Move JavaScriptCore to Source · 76da8fc1
      abarth@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=51604
      
      Reviewed by Eric Seidel.
      
      Update references to JavaScriptCore to point to the new location.
      
      * Android.mk:
      * CMakeLists.txt:
      * DerivedSources.pro:
      * GNUmakefile.am:
      * Makefile:
      * WebKit.pri:
      * WebKit.pro:
      * wscript:
      
      Tools: 
      
      Update references to JavaScriptCore to point to the new location.
      
      * BuildSlaveSupport/build.webkit.org-config/master.cfg:
      * DumpRenderTree/qt/DumpRenderTree.pro:
      * DumpRenderTree/qt/ImageDiff.pro:
      * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
      * DumpRenderTree/wscript:
      * Scripts/build-jsc:
      * Scripts/build-webkit:
      * Scripts/do-file-rename:
      * Scripts/do-webcore-rename:
      * Scripts/run-javascriptcore-tests:
      * Scripts/update-javascriptcore-test-results:
      * Scripts/webkitdirs.pm:
      * Scripts/webkitpy/common/config/build_unittest.py:
      * Scripts/webkitpy/style/checker.py:
      * Scripts/webkitpy/style/checker_unittest.py:
      * Scripts/webkitpy/style/checkers/cpp_unittest.py:
      * WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro:
      * WebKitTestRunner/qt/WebKitTestRunner.pro:
      * wx/build/settings.py:
      
      WebCore: 
      
      Update references to JavaScriptCore.
      
      * Android.derived.jscbindings.mk:
      * Android.v8bindings.mk:
      * CMakeLists.txt:
      * WebCore.gyp/WebCore.gyp:
      * WebCore.pro:
        - These changes are subtle and might not be 100% correct.
      * move-js-headers.sh:
      
      WebKit/chromium: 
      
      * WebKit.gyp:
        - Point to JavaScriptCore in its new location.
      
      WebKit/gtk: 
      
      * GNUmakefile.am:
      * docs/GNUmakefile.am:
        - Point to JavaScriptCore in its new location.
      
      WebKit/qt: 
      
      * WebKit_pch.h:
      * docs/qtwebkit.qdocconf:
        - Point to JavaScriptCore in its new location.
      
      WebKit/win: 
      
      * WebKit.vcproj/WebKit.sln:
        - Point to JavaScriptCore in its new location.
      
      WebKit/wx: 
      
      * bindings/python/wscript:
      * wscript:
        - Point to JavaScriptCore in its new location.
      
      WebKit2: 
      
      * WebKit2.pro:
        - Point to JavaScriptCore in its new location.
      
      Websites/bugs.webkit.org: 
      
      * PrettyPatch/PrettyPatch.rb:
        - Remove reference to JavaScriptCore as a source directory.
      
      Websites/webkit.org: 
      
      * coding/assertion-guidelines.html:
        - Update documentation to point to the new location of
          JavaScriptCore.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      76da8fc1
  13. 20 Dec, 2010 1 commit
    • ggaren@apple.com's avatar
      2010-12-17 Geoffrey Garen <ggaren@apple.com> · 18a081c2
      ggaren@apple.com authored
              Reviewed by Sam Weinig.
      
              Factored common page set management into a new PageBlock base class
              https://bugs.webkit.org/show_bug.cgi?id=51285
      
              * Android.mk:
              * CMakeLists.txt:
              * GNUmakefile.am:
              * JavaScriptCore.gypi:
              * JavaScriptCore.vcproj/WTF/WTF.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * interpreter/RegisterFile.h:
              (JSC::RegisterFile::RegisterFile):
              * jit/ExecutableAllocator.cpp:
              (JSC::ExecutableAllocator::intializePageSize):
              * wtf/PageAllocation.cpp: Removed.
              * wtf/PageAllocation.h:
              (WTF::PageAllocation::deallocate):
              (WTF::PageAllocation::PageAllocation):
              * wtf/PageReservation.h:
              (WTF::PageReservation::commit):
              (WTF::PageReservation::decommit):
              (WTF::PageReservation::deallocate):
              (WTF::PageReservation::PageReservation):
              * wtf/wtf.pri:
      2010-12-20  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Sam Weinig.
      
              Factored common page set management into a new PageBlock base class
              https://bugs.webkit.org/show_bug.cgi?id=51285
      
              * ForwardingHeaders/wtf/PageBlock.h: Added.
      2010-12-20  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Sam Weinig.
      
              Factored common page set management into a new PageBlock base class
              https://bugs.webkit.org/show_bug.cgi?id=51285
      
              * ForwardingHeaders/wtf/PageBlock.h: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      18a081c2
  14. 08 Dec, 2010 1 commit
    • ggaren@apple.com's avatar
      Migrated OS-specific allocation code from PageReservation and PageAllocation to OSAllocator · 05fad660
      ggaren@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=50653
      
      Reviewed by Sam Weinig.
      
      * JavaScriptCore.exp: Updated for new function signature.
      
      * interpreter/RegisterFile.h:
      (JSC::RegisterFile::RegisterFile):
      (JSC::RegisterFile::grow):
      * jit/ExecutableAllocatorFixedVMPool.cpp:
      (JSC::FixedVMPoolAllocator::reuse):
      (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator): Removed checkAllocatedOkay.
      OSAllocator is now the central location for verifying that allocation succeeds.
      This allowed me to remove some complicating cross-platform cruft.
      
      * runtime/AlignedMemoryAllocator.h:
      (JSC::::allocate): Updated for code motion.
      
      * wtf/OSAllocator.h: Added Usage, writable, and executable parameters, to
      support VM features required by clients of PageAllocation and PageReservation.
      
      * wtf/OSAllocatorPosix.cpp:
      (WTF::OSAllocator::reserve):
      (WTF::OSAllocator::reserveAndCommit):
      (WTF::OSAllocator::commit): Moved PageAllocation support for randomizing
      executable memory here.
      
      * wtf/OSAllocatorSymbian.cpp:
      (WTF::OSAllocator::reserve):
      (WTF::OSAllocator::reserveAndCommit):
      (WTF::OSAllocator::commit): Updated for new function signatures.
      
      * wtf/OSAllocatorWin.cpp:
      (WTF::protection):
      (WTF::OSAllocator::reserve):
      (WTF::OSAllocator::reserveAndCommit):
      (WTF::OSAllocator::commit):
      (WTF::OSAllocator::release): Updated for new function signatures. Moved
      some protection-related and WINCE-related code from PageAllocation here.
      
      * wtf/PageAllocation.cpp: Nixed cross-platform lastError abstraction, since
      it was only used by checkAllocatedOkay, which is now gone.
      
      * wtf/PageAllocation.h:
      (WTF::PageAllocation::allocate):
      (WTF::PageAllocation::allocateAligned):
      (WTF::PageAllocation::deallocate):
      (WTF::PageAllocation::isPowerOfTwo):
      (WTF::PageAllocation::systemAllocateAligned): Removed system* functions,
      and replaced calls to them with calls to OSAllocator.
      
      * wtf/PageReservation.h:
      (WTF::PageReservation::commit):
      (WTF::PageReservation::decommit):
      (WTF::PageReservation::reserve):
      (WTF::PageReservation::deallocate):
      (WTF::PageReservation::PageReservation): Ditto. Added m_writable and
      m_executable because these flags are now required when committing memory.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      05fad660
  15. 09 Sep, 2010 1 commit
    • slewis@apple.com's avatar
      Added statistics sampling and reporting for JavaScriptCore's RegisterFile and... · b2725f7a
      slewis@apple.com authored
      Added statistics sampling and reporting for JavaScriptCore's RegisterFile and ExecutableAllocator classes
      https://bugs.webkit.org/show_bug.cgi?id=45134
      
      Reviewed by Alexey Proskuryakov.
      
      JavaScriptCore: 
      
      Added thread-safe committed byte counting and reporting functionality to RegisterFile and 
      ExecutableAllocator.
      
      * JavaScriptCore.exp:
      Exported new symbols to allow for WebKit to get statistics from JavaScriptCore classes.
              
      * interpreter/RegisterFile.cpp:
      (JSC::registerFileStatisticsMutex):
      Added function which returns a static Mutex used for locking during read/write access to
      static committed byte count variable.
      (JSC::RegisterFile::~RegisterFile):
      Added call to addToStatistics since memory is decommitted here.
      (JSC::RegisterFile::releaseExcessCapacity):
      Added call to addToStatistics since memory is decommitted here.
      (JSC::RegisterFile::initializeThreading):
      Added function which calls registerFileStatisticsMutex().
      (JSC::RegisterFile::committedByteCount):
      Added function which returns the current committed byte count for RegisterFile.
      (JSC::RegisterFile::addToCommittedByteCount):
      Added function which updates committed byte count.
              
      * interpreter/RegisterFile.h:
      (JSC::RegisterFile::RegisterFile):
      Added call to addToStatistics since memory is committed here.
      (JSC::RegisterFile::grow):
      Added call to addToStatistics since memory is committed here.
              
      * jit/ExecutableAllocator.h:
      Added function prototype for public static function committedByteCount().
              
      * jit/ExecutableAllocatorFixedVMPool.cpp:
      (JSC::FixedVMPoolAllocator::release):
      Added call to addToStatistics since memory is decommitted here.
      (JSC::FixedVMPoolAllocator::reuse):
      Added call to addToStatistics since memory is committed here.
      (JSC::FixedVMPoolAllocator::addToCommittedByteCount):
      Added function which updates committed byte count.
      (JSC::ExecutableAllocator::committedByteCount):
      Added function which returns the current committed byte count for ExecutableAllocator.
              
      * runtime/InitializeThreading.cpp:
      (JSC::initializeThreadingOnce):
      Added call to RegisterFile::initializeThreading.
      
      WebKit/mac: 
      
      Added ability to enable new JavaScriptCore statistics sampling and reporting for RegisterFile 
      and ExecutableAllocator classes. Added reporting of JavaScriptCore's stack committed memory 
      and JIT code committed memory statistics to WebCoreStatistics memoryStatistics.
      
      * Misc/WebCoreStatistics.mm:
      (+[WebCoreStatistics memoryStatistics]):
      Added statistics reporting for JSC RegisterFile and ExecutableAllocator.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67130 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b2725f7a
  16. 13 Aug, 2010 1 commit
    • loki@webkit.org's avatar
      Avoid increasing required alignment of target type warning on ARM · 7534a3fa
      loki@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=38045
      
      Reviewed by Gavin Barraclough.
      
      The reinterpret_cast<Type1*>([pointer to Type2]) expressions - where
      sizeof(Type1) > sizeof(Type2) - cause the following warning on ARM:
      increases required alignment of target type warnings.
      Casting the type of [pointer to Type2] object to void* bypasses the
      warning.
      
      * JavaScriptCore/assembler/ARMAssembler.cpp:
      (JSC::ARMAssembler::executableCopy):
      * JavaScriptCore/assembler/AssemblerBuffer.h:
      (JSC::AssemblerBuffer::putShortUnchecked):
      (JSC::AssemblerBuffer::putIntUnchecked):
      (JSC::AssemblerBuffer::putInt64Unchecked):
      * JavaScriptCore/interpreter/RegisterFile.h:
      (JSC::RegisterFile::RegisterFile):
      (JSC::RegisterFile::grow):
      * JavaScriptCore/jit/JITStubs.cpp:
      * JavaScriptCore/pcre/pcre_compile.cpp:
      (jsRegExpCompile):
      * JavaScriptCore/runtime/JSArray.cpp:
      (JSC::JSArray::putSlowCase):
      (JSC::JSArray::increaseVectorLength):
      (JSC::JSArray::increaseVectorPrefixLength):
      (JSC::JSArray::shiftCount):
      (JSC::JSArray::unshiftCount):
      * JavaScriptCore/wtf/FastMalloc.cpp:
      (WTF::PageHeapAllocator::New):
      (WTF::TCMalloc_Central_FreeList::Populate):
      * wtf/MD5.cpp:
      (WTF::reverseBytes):
      (WTF::MD5::addBytes):
      (WTF::MD5::checksum):
      * JavaScriptCore/wtf/StdLibExtras.h:
      (isPointerTypeAlignmentOkay):
      (reinterpret_cast_ptr):
      * JavaScriptCore/wtf/Vector.h:
      (WTF::VectorBuffer::inlineBuffer):
      * JavaScriptCore/wtf/qt/StringQt.cpp:
      (WTF::String::String):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65311 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7534a3fa
  17. 05 Aug, 2010 1 commit
    • barraclough@apple.com's avatar
      Bug 43185 - Switch RegisterFile over to use PageAllocation · 792303e1
      barraclough@apple.com authored
      Reviewed by Sam Weinig.
      
      Remove platform-specific memory allocation code.
      
      * interpreter/RegisterFile.cpp:
      (JSC::RegisterFile::~RegisterFile):
      (JSC::RegisterFile::releaseExcessCapacity):
      * interpreter/RegisterFile.h:
      (JSC::RegisterFile::RegisterFile):
      (JSC::RegisterFile::grow):
      (JSC::RegisterFile::checkAllocatedOkay):
      * wtf/PageAllocation.cpp:
      (WTF::PageAllocation::lastError):
      * wtf/PageAllocation.h:
      (WTF::PageAllocation::allocate):
      (WTF::PageAllocation::allocateAt):
      (WTF::PageAllocation::allocateAligned):
      (WTF::PageAllocation::pageSize):
      (WTF::PageAllocation::isPageAligned):
      (WTF::PageAllocation::isPowerOfTwo):
      * wtf/PageReservation.h:
      (WTF::PageReservation::commit):
      (WTF::PageReservation::decommit):
      (WTF::PageReservation::reserve):
      (WTF::PageReservation::reserveAt):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64782 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      792303e1
  18. 21 May, 2010 1 commit
  19. 20 May, 2010 1 commit
    • barraclough@apple.com's avatar
      Bug 39408 - Unify JIT/interpreter return behaviour. · c73ede7f
      barraclough@apple.com authored
      Reviewed by Oliver Hunt.
      
      Presently the JIT and the interpreter have differing implementations in how
      they handle storing the result of a function call back to the register file.
      In both cases the op_call ( / _eval / _varargs / op_construct) opcode has an
      operand indicating the VM register in which the result should be stored.
      The JIT plants code after the call to store the result, so the value will be
      stored as soon as the callee has returned.  In the interpreter the call
      passes the return value register id into the callee via the callee callframe,
      and the callee is responsible for writing the result back into its callers
      register file after it has restored the parents callframe pointer, but before
      returning.
      
      Instead, move the task of writing the call result to the register file into a
      new opcode (op_call_put_result), and after returning the callee should leave
      the return value in a canonical location.  In the case of the interpreter,
      this canonical location is a local variable in privateExecute
      (functionReturnValue), in the case of the JIT this is the normal return value
      registers (regT0, or regT1:regT0 in JSVALUE32_64).  op_call_put_result stores
      the result from the canonical location to the registerfile.
      
      In addition to unifying JIT & interpreter behaviour this change allows us to
      remove a slot from the callframe, omit the write of the result where the
      return value from the call is not used, and provides a 2% speedup on sunspider
      in the interpreter.
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::dump):
      * bytecode/Opcode.h:
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::emitCall):
      (JSC::BytecodeGenerator::emitCallVarargs):
      (JSC::BytecodeGenerator::emitConstruct):
      * bytecompiler/BytecodeGenerator.h:
      (JSC::BytecodeGenerator::finalDestinationOrIgnored):
      * bytecompiler/NodesCodegen.cpp:
      (JSC::NewExprNode::emitBytecode):
      (JSC::FunctionCallValueNode::emitBytecode):
      (JSC::FunctionCallResolveNode::emitBytecode):
      (JSC::FunctionCallBracketNode::emitBytecode):
      (JSC::FunctionCallDotNode::emitBytecode):
      (JSC::CallFunctionCallDotNode::emitBytecode):
      (JSC::ApplyFunctionCallDotNode::emitBytecode):
      * interpreter/CallFrame.h:
      (JSC::ExecState::init):
      (JSC::ExecState::noCaller):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::dumpRegisters):
      (JSC::Interpreter::throwException):
      (JSC::Interpreter::privateExecute):
      * interpreter/RegisterFile.h:
      (JSC::RegisterFile::):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompileMainPass):
      * jit/JIT.h:
      * jit/JITCall.cpp:
      (JSC::JIT::compileOpCallSetupArgs):
      (JSC::JIT::compileOpConstructSetupArgs):
      (JSC::JIT::emit_op_call_put_result):
      (JSC::JIT::compileOpCallVarargs):
      (JSC::JIT::compileOpCallVarargsSlowCase):
      (JSC::JIT::compileOpCall):
      (JSC::JIT::compileOpCallSlowCase):
      (JSC::JIT::compileOpCallVarargsSetupArgs):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59860 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c73ede7f
  20. 18 May, 2010 1 commit
    • ggaren@apple.com's avatar
      JavaScriptCore: Simplified handling of 'arguments' -- 1.2% SunSpider speedup · 83ce11ca
      ggaren@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=39200
              
      Reviewed by Darin Adler.
      
      Removed the reserved OptionalCalleeArguments slot from the CallFrame.
      Now, slots for 'arguments' are allocated and initialized only by
      functions that might need them.
              
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::dump): Updated for new bytecode operands.
      
      (JSC::CodeBlock::CodeBlock):
      * bytecode/CodeBlock.h:
      (JSC::unmodifiedArgumentsRegister): Added a helper function for mapping
      from the arguments register to its unmodified counterpart.
      
      (JSC::CodeBlock::setArgumentsRegister):
      (JSC::CodeBlock::argumentsRegister):
      (JSC::CodeBlock::usesArguments):  Changed from a "usesArguments" bool to
      an optional int index representing the arguments register.
      
      * bytecode/Opcode.h: Updated for new bytecode operands.
      
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::addVar): Factored out a helper function for
      allocating an anonymous var.
      
      (JSC::BytecodeGenerator::BytecodeGenerator): Merged / simplified some
      arguments vs activation logic, and added code to allocate the arguments
      registers when needed.
      
      (JSC::BytecodeGenerator::createArgumentsIfNecessary): Updated for new bytecode operands.
      
      (JSC::BytecodeGenerator::emitCallEval): No need to create the arguments
      object before calling eval; the activation object will lazily create the
      arguments object if eval resolves it.
      
      (JSC::BytecodeGenerator::emitReturn): Updated for new bytecode operands.
      
      (JSC::BytecodeGenerator::emitPushScope):
      (JSC::BytecodeGenerator::emitPushNewScope): Ditto emitCallEval.
      
      * bytecompiler/BytecodeGenerator.h:
      (JSC::BytecodeGenerator::addVar): Factored out a helper function for
      allocating an anonymous var.
      
      (JSC::BytecodeGenerator::registerFor): No more need for special handling
      of the arguments registers; they're allocated just like normal registers
      now.
      
      * interpreter/CallFrame.h:
      (JSC::ExecState::callerFrame):
      (JSC::ExecState::init):
      * interpreter/CallFrameClosure.h:
      (JSC::CallFrameClosure::resetCallFrame): Nixed optionalCalleeArguments.
      
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::dumpRegisters):
      (JSC::Interpreter::unwindCallFrame):
      (JSC::Interpreter::privateExecute):
      (JSC::Interpreter::retrieveArguments): Opcodes accessing 'arguments' now
      take operands specifying registers, just like all other opcodes.
      JSActivation::copyRegisters is no longer responsible for tearing off the
      arguments object; instead, the VM is responsible for both.
      
      Also, a behavior change: Each access to f.arguments creates a new object,
      unless f itself uses 'arguments'. This matches Chrome, and is necessary
      for the optimization. f.arguments is a nonstandard, deprecated feature,
      so high fidelity to a given implementation is not necessarily a goal.
      Also, as illustrated by the new test case, the identity of f.arguments
      has been broken since 2008, except in the case where f itself accesses
      f.arguments -- but nobody seemed to notice. So, hopefully this change won't
      break the web.
              
      * interpreter/Register.h: Nixed the special arguments accessor. It's no
      longer needed.
      
      * interpreter/RegisterFile.h:
      (JSC::RegisterFile::):
      * jit/JITCall.cpp:
      (JSC::JIT::compileOpCallInitializeCallFrame):
      (JSC::JIT::compileOpCall):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::emit_op_tear_off_activation):
      (JSC::JIT::emit_op_tear_off_arguments):
      (JSC::JIT::emit_op_create_arguments):
      (JSC::JIT::emit_op_init_arguments):
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::emit_op_tear_off_activation):
      (JSC::JIT::emit_op_tear_off_arguments):
      (JSC::JIT::emit_op_create_arguments):
      (JSC::JIT::emit_op_init_arguments): The actual optimization: Removed
      OptionalCalleeArguments from the callframe slot. Now, it doesn't need
      to be initialized for most calls.
      
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      * jit/JITStubs.h:
      (JSC::): Updated stubs to support arbitrary 'arguments' registers,
      instead of hard-coding something in the call frame.
      
      * runtime/Arguments.h:
      (JSC::JSActivation::copyRegisters): Removed some obfuscatory abstraction.
      
      * runtime/Executable.h:
      (JSC::FunctionExecutable::generatedByteCode): Added a helper for accessing
      the 'arguments' register. In a future patch, that kind of data should
      probably move out of CodeBlock and into Executable.
      
      * runtime/JSActivation.cpp:
      (JSC::JSActivation::getOwnPropertySlot):
      (JSC::JSActivation::argumentsGetter):
      * runtime/JSActivation.h: Simplified / fixed access to 'arguments' via
      the activation object. It now implements the same behavior implemented
      by optimized variable access in the VM. This simplifies some other
      things, too -- like eval code generation.
      
      LayoutTests: Simplified handling of 'arguments' -- 1.2% SunSpider speedup
      https://bugs.webkit.org/show_bug.cgi?id=39200
      
      Reviewed by Darin Adler.
      
      * fast/js/function-dot-arguments-expected.txt:
      * fast/js/script-tests/function-dot-arguments.js:
      (argumentsIdentity): Updated to match new behavior.
      
      * fast/js/function-dot-arguments2-expected.txt:
      * fast/js/function-dot-arguments2.html: New tests for some things that
      weren't covered before.
      
      * fast/js/global-recursion-on-full-stack.html: Rejiggered the stack
      usage in this test. Since stack usage is more efficient now, you
      need a slightly different usage pattern to hit the exact thing this
      test wanted to test.
      
      * fast/js/kde/script-tests/function_arguments.js:
      (f): Updated to more specifically test what this was trying to test,
      to avoid just testing the identity of f.arguments.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      83ce11ca
  21. 26 Apr, 2010 1 commit
    • ggaren@apple.com's avatar
      <rdar://problem/7766413> · b5bd5904
      ggaren@apple.com authored
              
      Reviewed by Sam Weinig.
      
      Fixed a crash seen when using the JavaScriptCore API with WebKit.
              
      No layout test because DumpRenderTree doesn't use the JavaScriptCore API
      in this way.
      
      JavaScriptCore: 
      
      * interpreter/RegisterFile.cpp:
      (JSC::RegisterFile::setGlobalObject):
      (JSC::RegisterFile::clearGlobalObject):
      (JSC::RegisterFile::globalObject):
      * interpreter/RegisterFile.h:
      (JSC::RegisterFile::RegisterFile): Use WeakGCPtr for managing m_globalObject,
      since it's a weak pointer. (We never noticed this error before because,
      in WebKit, global objects always have a self-reference in a global variable,
      so marking the register file's global variables would keep m_globalObject
      alive. In the JavaScriptCore API, you can allocate a global object with
      no self-reference.)
      
      * runtime/JSActivation.h: Removed unneeded #include.
      
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::~JSGlobalObject): Don't use ==, since a weak
      pointer is 0 when the object it points to runs its destructor.
      
      * runtime/WeakGCPtr.h:
      (JSC::WeakGCPtr::clear): Changed to return a bool indicating whether the
      clear actually happened.
      (JSC::WeakGCPtr::assign): Changed to forbid assignment of 0 as a shorthand
      for calling clear(). A client should never clear by assigning 0, since
      clear() should be conditional on whether the object doing the clearing
      is still pointed to by the weak pointer. (Otherwise, a zombie object might
      clear a pointer to a new, valid object.)
      
      WebCore: 
      
      * bindings/js/JSEventListener.cpp:
      (WebCore::JSEventListener::JSEventListener): Don't assign 0 to a WeakGCPtr.
      JavaScriptCore no longer allows this.
      
      * bindings/js/ScriptWrappable.h:
      (WebCore::ScriptWrappable::setWrapper): No need to initialize a WeakGCPtr
      to 0, or ASSERT a non-0 value before assigning to a WeakGCPtr -- both are
      default behaviors.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b5bd5904
  22. 05 Jan, 2010 1 commit
    • mjs@apple.com's avatar
      2010-01-04 Maciej Stachowiak <mjs@apple.com> · acbcc283
      mjs@apple.com authored
              Reviewed by Darin Fisher.
      
              Reorganize, document and rename OS() platform macros.
              https://bugs.webkit.org/show_bug.cgi?id=33198
      
              * wtf/Platform.h: Rename, reorganize and document OS() macros.
      
              Adapt to name changes. Also fixed a few incorrect OS checks.
      
              * API/JSContextRef.cpp:
              * assembler/MacroAssemblerARM.cpp:
              (JSC::isVFPPresent):
              * assembler/MacroAssemblerX86Common.h:
              * bytecode/SamplingTool.cpp:
              * config.h:
              * interpreter/RegisterFile.cpp:
              (JSC::RegisterFile::~RegisterFile):
              * interpreter/RegisterFile.h:
              (JSC::RegisterFile::RegisterFile):
              (JSC::RegisterFile::grow):
              * jit/ExecutableAllocator.h:
              * jit/ExecutableAllocatorFixedVMPool.cpp:
              * jit/ExecutableAllocatorPosix.cpp:
              * jit/ExecutableAllocatorSymbian.cpp:
              * jit/ExecutableAllocatorWin.cpp:
              * jit/JITOpcodes.cpp:
              (JSC::JIT::privateCompileCTIMachineTrampolines):
              * jit/JITStubs.cpp:
              * jsc.cpp:
              (main):
              * parser/Grammar.y:
              * profiler/ProfileNode.cpp:
              (JSC::getCount):
              * runtime/Collector.cpp:
              (JSC::Heap::Heap):
              (JSC::Heap::allocateBlock):
              (JSC::Heap::freeBlockPtr):
              (JSC::currentThreadStackBase):
              (JSC::getCurrentPlatformThread):
              (JSC::suspendThread):
              (JSC::resumeThread):
              (JSC::getPlatformThreadRegisters):
              (JSC::otherThreadStackPointer):
              * runtime/Collector.h:
              * runtime/DateConstructor.cpp:
              * runtime/DatePrototype.cpp:
              (JSC::formatLocaleDate):
              * runtime/InitializeThreading.cpp:
              (JSC::initializeThreading):
              * runtime/MarkStack.h:
              (JSC::MarkStack::MarkStackArray::shrinkAllocation):
              * runtime/MarkStackPosix.cpp:
              * runtime/MarkStackSymbian.cpp:
              * runtime/MarkStackWin.cpp:
              * runtime/StringPrototype.cpp:
              (JSC::stringProtoFuncLastIndexOf):
              * runtime/TimeoutChecker.cpp:
              (JSC::getCPUTime):
              * runtime/UString.cpp:
              (JSC::UString::from):
              * wtf/Assertions.cpp:
              * wtf/Assertions.h:
              * wtf/CurrentTime.cpp:
              (WTF::lowResUTCTime):
              * wtf/CurrentTime.h:
              (WTF::getLocalTime):
              * wtf/DateMath.cpp:
              * wtf/FastMalloc.cpp:
              (WTF::TCMalloc_ThreadCache::InitModule):
              (WTF::TCMallocStats::):
              * wtf/FastMalloc.h:
              * wtf/MathExtras.h:
              * wtf/RandomNumber.cpp:
              (WTF::randomNumber):
              * wtf/RandomNumberSeed.h:
              (WTF::initializeRandomNumberGenerator):
              * wtf/StringExtras.h:
              * wtf/TCSpinLock.h:
              (TCMalloc_SpinLock::Unlock):
              (TCMalloc_SlowLock):
              * wtf/TCSystemAlloc.cpp:
              * wtf/ThreadSpecific.h:
              (WTF::::destroy):
              * wtf/Threading.h:
              * wtf/ThreadingPthreads.cpp:
              (WTF::initializeThreading):
              (WTF::isMainThread):
              * wtf/ThreadingWin.cpp:
              (WTF::wtfThreadEntryPoint):
              (WTF::createThreadInternal):
              * wtf/VMTags.h:
              * wtf/unicode/icu/CollatorICU.cpp:
              (WTF::Collator::userDefault):
              * wtf/win/MainThreadWin.cpp:
              (WTF::initializeMainThreadPlatform):
      2010-01-04  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Darin Fisher.
      
              Reorganize, document and rename OS() platform macros.
              https://bugs.webkit.org/show_bug.cgi?id=33198
      
              Adapt to name changes.
      
              * src/ChromiumBridge.cpp:
              * src/EditorClientImpl.cpp:
              (WebKit::EditorClientImpl::isSelectTrailingWhitespaceEnabled):
              (WebKit::):
              (WebKit::EditorClientImpl::handleEditingKeyboardEvent):
              * src/FrameLoaderClientImpl.cpp:
              (WebKit::FrameLoaderClientImpl::createPlugin):
              * src/GraphicsContext3D.cpp:
              (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal):
              (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal):
              (WebCore::GraphicsContext3DInternal::makeContextCurrent):
              * src/WebFrameImpl.cpp:
              (WebKit::WebFrameImpl::selectionAsText):
              (WebKit::WebFrameImpl::printPage):
              * src/WebPluginContainerImpl.cpp:
              (WebKit::WebPluginContainerImpl::handleMouseEvent):
              (WebKit::WebPluginContainerImpl::handleKeyboardEvent):
              * src/WebViewImpl.cpp:
              (WebKit::WebViewImpl::mouseDown):
              (WebKit::WebViewImpl::mouseContextMenu):
              (WebKit::WebViewImpl::mouseUp):
              (WebKit::WebViewImpl::keyEvent):
              (WebKit::WebViewImpl::sendContextMenuEvent):
              (WebKit::WebViewImpl::setScrollbarColors):
              (WebKit::WebViewImpl::navigationPolicyFromMouseEvent):
      2010-01-04  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Darin Fisher.
      
              Reorganize, document and rename OS() platform macros.
              https://bugs.webkit.org/show_bug.cgi?id=33198
      
              Adapt to name changes.
      
              * webkit/webkitwebsettings.cpp:
              (webkit_get_user_agent):
      2010-01-04  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Darin Fisher.
      
              Reorganize, document and rename OS() platform macros.
              https://bugs.webkit.org/show_bug.cgi?id=33198
      
              Adapt to name changes. Also fixed a few incorrect OS checks.
      
              * accessibility/AccessibilityObject.h:
              * config.h:
              * dom/SelectElement.cpp:
              (WebCore::SelectElement::listBoxDefaultEventHandler):
              * inspector/InspectorFrontendHost.cpp:
              (WebCore::InspectorFrontendHost::platform):
              * loader/CachedFont.cpp:
              * loader/FTPDirectoryDocument.cpp:
              * loader/FTPDirectoryParser.cpp:
              * page/EventHandler.cpp:
              * page/Frame.cpp:
              (WebCore::Frame::setUseSecureKeyboardEntry):
              * page/NavigatorBase.cpp:
              (WebCore::NavigatorBase::platform):
              * page/Page.h:
              * page/Settings.cpp:
              (WebCore::Settings::Settings):
              * page/Settings.h:
              * page/chromium/DragControllerChromium.cpp:
              (WebCore::DragController::isCopyKeyDown):
              * page/chromium/EventHandlerChromium.cpp:
              (WebCore::EventHandler::accessKeyModifiers):
              * page/win/EventHandlerWin.cpp:
              (WebCore::EventHandler::createDraggingClipboard):
              * platform/FileSystem.h:
              * platform/KeyboardCodes.h:
              * platform/PurgeableBuffer.h:
              * platform/chromium/ChromiumBridge.h:
              * platform/chromium/ClipboardChromium.cpp:
              (WebCore::ClipboardChromium::writeRange):
              * platform/chromium/ClipboardUtilitiesChromium.cpp:
              * platform/chromium/ClipboardUtilitiesChromium.h:
              * platform/chromium/PasteboardChromium.cpp:
              (WebCore::Pasteboard::writeSelection):
              (WebCore::Pasteboard::writePlainText):
              (WebCore::Pasteboard::documentFragment):
              * platform/chromium/PlatformKeyboardEventChromium.cpp:
              (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
              (WebCore::PlatformKeyboardEvent::currentCapsLockState):
              * platform/chromium/PopupMenuChromium.cpp:
              (WebCore::PopupListBox::layout):
              (WebCore::PopupMenu::show):
              * platform/graphics/BitmapImage.h:
              (WebCore::BitmapImage::mayFillWithSolidColor):
              * platform/graphics/FloatPoint.h:
              * platform/graphics/FloatRect.h:
              * platform/graphics/FloatSize.h:
              * platform/graphics/FontCache.cpp:
              (WebCore::alternateFamilyName):
              * platform/graphics/FontCache.h:
              * platform/graphics/FontFastPath.cpp:
              (WebCore::Font::glyphDataForCharacter):
              * platform/graphics/GlyphBuffer.h:
              (WebCore::GlyphBuffer::advanceAt):
              (WebCore::GlyphBuffer::add):
              * platform/graphics/Gradient.h:
              * platform/graphics/GraphicsContext.cpp:
              * platform/graphics/GraphicsContext.h:
              * platform/graphics/GraphicsContext3D.h:
              * platform/graphics/ImageSource.h:
              * platform/graphics/IntRect.h:
              * platform/graphics/MediaPlayer.cpp:
              * platform/graphics/Path.h:
              * platform/graphics/Pattern.h:
              * platform/graphics/SimpleFontData.h:
              * platform/graphics/cg/ColorCG.cpp:
              * platform/graphics/cg/GraphicsContextCG.cpp:
              * platform/graphics/chromium/FontCustomPlatformData.cpp:
              (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
              (WebCore::FontCustomPlatformData::fontPlatformData):
              (WebCore::createFontCustomPlatformData):
              * platform/graphics/chromium/FontCustomPlatformData.h:
              * platform/graphics/chromium/FontPlatformData.h:
              * platform/graphics/opentype/OpenTypeUtilities.cpp:
              * platform/graphics/opentype/OpenTypeUtilities.h:
              * platform/graphics/qt/GraphicsContextQt.cpp:
              (WebCore::GraphicsContext::getWindowsContext):
              * platform/graphics/qt/ImageQt.cpp:
              * platform/graphics/skia/GraphicsContextSkia.cpp:
              (WebCore::GraphicsContext::clipToImageBuffer):
              * platform/graphics/skia/ImageBufferSkia.cpp:
              (WebCore::ImageBuffer::ImageBuffer):
              * platform/graphics/skia/PlatformContextSkia.cpp:
              (PlatformContextSkia::State::State):
              (PlatformContextSkia::PlatformContextSkia):
              (PlatformContextSkia::save):
              (PlatformContextSkia::restore):
              * platform/graphics/skia/PlatformContextSkia.h:
              * platform/graphics/win/IconWin.cpp:
              (WebCore::Icon::createIconForFiles):
              (WebCore::Icon::paint):
              * platform/graphics/wx/GraphicsContextWx.cpp:
              * platform/gtk/FileSystemGtk.cpp:
              (WebCore::filenameToString):
              (WebCore::filenameFromString):
              (WebCore::filenameForDisplay):
              * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
              * platform/network/curl/ResourceHandleManager.cpp:
              * platform/network/soup/ResourceHandleSoup.cpp:
              (WebCore::):
              * platform/text/String.cpp:
              (WebCore::String::format):
              (WebCore::String::number):
              * platform/text/TextEncoding.cpp:
              (WebCore::TextEncoding::encode):
              * platform/text/TextEncodingRegistry.cpp:
              (WebCore::buildBaseTextCodecMaps):
              (WebCore::extendTextCodecMaps):
              * platform/text/TextStream.cpp:
              * platform/text/TextStream.h:
              * platform/text/qt/TextCodecQt.cpp:
              (WebCore::TextCodecQt::decode):
              * platform/win/PlatformMouseEventWin.cpp:
              (WebCore::messageToEventType):
              (WebCore::PlatformMouseEvent::PlatformMouseEvent):
              * platform/win/PlatformScreenWin.cpp:
              (WebCore::deviceInfoForWidget):
              (WebCore::screenIsMonochrome):
              * platform/win/PopupMenuWin.cpp:
              (WebCore::PopupMenu::show):
              (WebCore::PopupMenu::paint):
              (WebCore::PopupMenu::registerClass):
              (WebCore::PopupMenu::PopupMenuWndProc):
              (WebCore::PopupMenu::wndProc):
              * platform/win/SystemTimeWin.cpp:
              (WebCore::userIdleTime):
              * platform/wx/FileSystemWx.cpp:
              (WebCore::unloadModule):
              * plugins/PluginDatabase.cpp:
              * plugins/PluginPackage.cpp:
              (WebCore::PluginPackage::compareFileVersion):
              * plugins/PluginPackage.h:
              * plugins/PluginView.cpp:
              (WebCore::PluginView::setFrameRect):
              (WebCore::PluginView::stop):
              (WebCore::PluginView::PluginView):
              * plugins/PluginView.h:
              * plugins/win/PluginDatabaseWin.cpp:
              (WebCore::addWindowsMediaPlayerPluginDirectory):
              (WebCore::addMacromediaPluginDirectories):
              * plugins/win/PluginPackageWin.cpp:
              (WebCore::PluginPackage::load):
              * plugins/win/PluginViewWin.cpp:
              (WebCore::registerPluginView):
              (WebCore::PluginView::wndProc):
              (WebCore::PluginView::updatePluginWidget):
              (WebCore::PluginView::paintIntoTransformedContext):
              (WebCore::PluginView::paintWindowedPluginIntoContext):
              (WebCore::PluginView::paint):
              (WebCore::PluginView::handleMouseEvent):
              (WebCore::PluginView::setParent):
              (WebCore::PluginView::setNPWindowRect):
              (WebCore::PluginView::platformStart):
      2010-01-04  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Darin Fisher.
      
              Reorganize, document and rename OS() platform macros.
              https://bugs.webkit.org/show_bug.cgi?id=33198
      
              Adapt to name changes.
              
              * DumpRenderTree/DumpRenderTree.h:
              * DumpRenderTree/config.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      acbcc283
  23. 02 Sep, 2009 1 commit
    • eric@webkit.org's avatar
      2009-09-02 Norbert Leser <norbert.leser@nokia.com> · 6175c1f2
      eric@webkit.org authored
              Reviewed by Eric Seidel.
      
              Use fastMalloc when neither MMAP nor VIRTUALALLOC are enabled
      
              RegisterFile constructor currently throws #error when both
              MMAP and VIRTUALALLOC conditions fail.
              On any platform that does not provide these features
              (for instance, Symbian),
              the fallback should be regular malloc (or fastMalloc).
              It is functionally equivalent in this case, even though it may
              have certain drawbacks such as lack of dynamic pre-allocation.
      
              * interpreter/RegisterFile.cpp:
              (JSC::RegisterFile::~RegisterFile):
              * interpreter/RegisterFile.h:
              (JSC::RegisterFile::RegisterFile):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6175c1f2
  24. 10 Aug, 2009 1 commit
    • oliver@apple.com's avatar
      Stack overflow crash in JavaScript garbage collector mark pass · 5fca29f7
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=12216
      
      Reviewed by Gavin Barraclough and Sam Weinig
      
      Make the GC mark phase iterative by using an explicit mark stack.
      To do this marking any single object is performed in multiple stages
        * The object is appended to the MarkStack, this sets the marked
          bit for the object using the new markDirect() function, and then
          returns
        * When the MarkStack is drain()ed the object is popped off the stack
          and markChildren(MarkStack&) is called on the object to collect
          all of its children.  drain() then repeats until the stack is empty.
      
      Additionally I renamed a number of methods from 'mark' to 'markAggregate'
      in order to make it more clear that marking of those object was not
      going to result in an actual recursive mark.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5fca29f7
  25. 17 Jul, 2009 1 commit
  26. 14 Jul, 2009 1 commit
    • bfulgham@webkit.org's avatar
      JavaScriptCore: · 8a8a2f45
      bfulgham@webkit.org authored
      2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
      
              Reviewed by Darin Adler.
      
              Change all Noncopyable inheriting visibility to public.
              https://bugs.webkit.org/show_bug.cgi?id=27225
      
              Change all Noncopyable inheriting visibility to public because
              it is needed to the custom allocation framework (bug #20422).
      
              * bytecode/SamplingTool.h:
              * bytecompiler/RegisterID.h:
              * interpreter/CachedCall.h:
              * interpreter/RegisterFile.h:
              * parser/Lexer.h:
              * parser/Parser.h:
              * runtime/ArgList.h:
              * runtime/BatchedTransitionOptimizer.h:
              * runtime/Collector.h:
              * runtime/CommonIdentifiers.h:
              * runtime/JSCell.h:
              * runtime/JSGlobalObject.h:
              * runtime/JSLock.h:
              * runtime/JSONObject.cpp:
              * runtime/SmallStrings.cpp:
              * runtime/SmallStrings.h:
              * wtf/CrossThreadRefCounted.h:
              * wtf/GOwnPtr.h:
              * wtf/Locker.h:
              * wtf/MessageQueue.h:
              * wtf/OwnArrayPtr.h:
              * wtf/OwnFastMallocPtr.h:
              * wtf/OwnPtr.h:
              * wtf/RefCounted.h:
              * wtf/ThreadSpecific.h:
              * wtf/Threading.h:
              * wtf/Vector.h:
              * wtf/unicode/Collator.h:
      
      WebCore:
      
      2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
      
              Reviewed by Darin Adler.
      
              Change all Noncopyable inheriting visibility to public.
              https://bugs.webkit.org/show_bug.cgi?id=27225
      
              Change all Noncopyable inheriting visibility to public because
              it is needed to the custom allocation framework (bug #20422).
      
              * bindings/js/GCController.h:
              * bindings/js/WorkerScriptController.h:
              * bindings/v8/V8DOMMap.cpp:
              (WebCore::):
              * bridge/runtime.h:
              * css/CSSSelector.h:
              * css/CSSSelectorList.h:
              * css/CSSStyleSelector.h:
              * dom/ClassNames.h:
              * dom/MessagePortChannel.h:
              * dom/XMLTokenizerLibxml2.cpp:
              * dom/XMLTokenizerScope.h:
              * editing/ReplaceSelectionCommand.cpp:
              * editing/SelectionController.h:
              * editing/TextIterator.cpp:
              * history/PageCache.h:
              * html/CanvasRenderingContext2D.h:
              * html/HTMLParser.h:
              * html/HTMLParserQuirks.h:
              * html/PreloadScanner.h:
              * loader/Cache.h:
              * loader/CrossOriginPreflightResultCache.h:
              * loader/FrameLoader.h:
              * loader/ProgressTracker.h:
              * loader/ThreadableLoader.h:
              * loader/appcache/ApplicationCacheGroup.h:
              * loader/archive/ArchiveResourceCollection.h:
              * loader/icon/IconDatabase.h:
              * loader/icon/IconLoader.h:
              * loader/icon/PageURLRecord.h:
              * loader/loader.h:
              * page/ContextMenuController.h:
              * page/EventHandler.h:
              * page/FrameTree.h:
              * page/Page.h:
              * page/PageGroup.h:
              * page/PageGroupLoadDeferrer.h:
              * page/mac/EventHandlerMac.mm:
              * platform/AutodrainedPool.h:
              * platform/ContextMenu.h:
              * platform/EventLoop.h:
              * platform/HostWindow.h:
              * platform/Pasteboard.h:
              * platform/PurgeableBuffer.h:
              * platform/RunLoopTimer.h:
              * platform/ThreadGlobalData.h:
              * platform/ThreadTimers.h:
              * platform/Timer.h:
              * platform/TreeShared.h:
              * platform/graphics/FontData.h:
              * platform/graphics/GlyphWidthMap.h:
              * platform/graphics/GraphicsContext.h:
              * platform/graphics/ImageBuffer.h:
              * platform/graphics/ImageSource.h:
              * platform/graphics/MediaPlayer.h:
              * platform/graphics/skia/GraphicsContextPlatformPrivate.h:
              * platform/graphics/skia/PlatformContextSkia.h:
              * platform/graphics/win/QTMovieWin.cpp:
              * platform/mac/LocalCurrentGraphicsContext.h:
              * platform/network/FormDataBuilder.h:
              * platform/network/ResourceHandleInternal.h:
              * platform/network/soup/ResourceHandleSoup.cpp:
              * platform/text/StringBuffer.h:
              * platform/text/TextCodec.h:
              * platform/win/WindowMessageBroadcaster.h:
              * rendering/CounterNode.h:
              * rendering/LayoutState.h:
              * rendering/RenderFrameSet.h:
              * rendering/RenderView.h:
              * rendering/TransformState.h:
              * svg/SVGAnimatedProperty.h:
              * svg/SynchronizableTypeWrapper.h:
              * workers/WorkerMessagingProxy.h:
              * workers/WorkerRunLoop.cpp:
              * xml/XPathExpressionNode.h:
              * xml/XPathParser.h:
              * xml/XPathPredicate.h:
              * xml/XPathStep.h:
      
      WebKit/gtk:
      
      2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
      
              Reviewed by Darin Adler.
      
              Change all Noncopyable inheriting visibility to public.
              https://bugs.webkit.org/show_bug.cgi?id=27225
      
              Change all Noncopyable inheriting visibility to public because
              it is needed to the custom allocation framework (bug #20422).
      
              * webkit/webkitdownload.cpp:
      
      WebKit/win:
      
      2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
      
              Reviewed by Darin Adler.
      
              Change all Noncopyable inheriting visibility to public.
              https://bugs.webkit.org/show_bug.cgi?id=27225
      
              Change all Noncopyable inheriting visibility to public because
              it is needed to the custom allocation framework (bug #20422).
      
              * COMEnumVariant.h:
              * WebDatabaseManager.cpp:
              * WebInspector.h:
              * WebLocalizableStrings.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@45891 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8a8a2f45
  27. 19 Jun, 2009 1 commit
  28. 19 May, 2009 1 commit
    • ggaren@apple.com's avatar
      2009-05-19 Geoffrey Garen <ggaren@apple.com> · 7d6713cd
      ggaren@apple.com authored
              Reviewed by Sam Weinig.
              
              Fixed <rdar://problem/6885680> CrashTracer: [USER] 1 crash in Install
              Mac OS X at <unknown binary> • 0x9274241c
              
              (Original patch by Joe Sokol and Ronnie Misra.)
              
              SunSpider says 1.004x faster.
      
              * interpreter/RegisterFile.cpp:
              (JSC::RegisterFile::releaseExcessCapacity): Instead of doing complicated
              math that sometimes used to overflow, just release the full range of the
              register file.
      
              * interpreter/RegisterFile.h:
              (JSC::isPageAligned):
              (JSC::RegisterFile::RegisterFile): Added ASSERTs to verify that it's
              safe to release the full range of the register file.
      
              (JSC::RegisterFile::shrink): No need to releaseExcessCapacity() if the
              new end is not smaller than the old end. (Also, doing so used to cause
              numeric overflow, unmapping basically the whole process from memory.)
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7d6713cd
  29. 24 Apr, 2009 1 commit
  30. 21 Apr, 2009 1 commit
    • ggaren@apple.com's avatar
      JavaScriptCore: · 41f3d950
      ggaren@apple.com authored
      2009-04-20  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Mark Rowe.
              
              Tiger crash fix: Put VM tags in their own header file, and fixed up the
              #ifdefs so they're not used on Tiger.
      
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * interpreter/RegisterFile.h:
              (JSC::RegisterFile::RegisterFile):
              * jit/ExecutableAllocatorFixedVMPool.cpp:
              (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
              * jit/ExecutableAllocatorPosix.cpp:
              (JSC::ExecutablePool::systemAlloc):
              * runtime/Collector.cpp:
              (JSC::allocateBlock):
              * wtf/VMTags.h: Added.
      
      JavaScriptGlue:
      
      2009-04-20  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Mark Rowe.
      
              Tiger crash fix: Put VM tags in their own header file, and fixed up the
              #ifdefs so they're not used on Tiger.
      
              * ForwardingHeaders/wtf/VMTags.h: Copied from JavaScriptGlue/ForwardingHeaders/wtf/HashTraits.h.
      
      WebCore:
      
      2009-04-20  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Mark Rowe.
      
              Tiger crash fix: Put VM tags in their own header file, and fixed up the
              #ifdefs so they're not used on Tiger.
      
              * ForwardingHeaders/wtf/VMTags.h: Copied from WebCore/ForwardingHeaders/wtf/HashTraits.h.
      
      WebKit/mac:
      
      2009-04-20  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Mark Rowe.
      
              Tiger crash fix: Put VM tags in their own header file, and fixed up the
              #ifdefs so they're not used on Tiger.
      
              * ForwardingHeaders/wtf/VMTags.h: Copied from ForwardingHeaders/wtf/HashTraits.h.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      41f3d950
  31. 20 Apr, 2009 1 commit
    • weinig@apple.com's avatar
      2009-04-20 Sam Weinig <sam@webkit.org> · 5f068cf5
      weinig@apple.com authored
              Reviewed by Kevin McCullough.
      
              Always tag mmaped memory on darwin and clean up #defines
              now that they are a little bigger.
      
              * interpreter/RegisterFile.h:
              (JSC::RegisterFile::RegisterFile):
              * jit/ExecutableAllocatorFixedVMPool.cpp:
              (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
              * jit/ExecutableAllocatorPosix.cpp:
              (JSC::ExecutablePool::systemAlloc):
              * runtime/Collector.cpp:
              (JSC::allocateBlock):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5f068cf5
  32. 18 Apr, 2009 1 commit
  33. 20 Mar, 2009 1 commit
    • ggaren@apple.com's avatar
      2009-03-20 Geoffrey Garen <ggaren@apple.com> · cd169898
      ggaren@apple.com authored
              Reviewed by Oliver Hunt.
              
              A little cleanup in the RegisterFile code.
              
              Moved large inline functions out of the class declaration, to make it
              more readable.
              
              Switched over to using the roundUpAllocationSize function to avoid
              duplicate code and subtle bugs.
              
              Renamed m_maxCommitted to m_commitEnd, to match m_end.
              
              Renamed allocationSize to commitSize because it's the chunk size for
              committing memory, not allocating memory.
              
              SunSpider reports no change.
      
              * interpreter/RegisterFile.h:
              (JSC::RegisterFile::RegisterFile):
              (JSC::RegisterFile::shrink):
              (JSC::RegisterFile::grow):
              * jit/ExecutableAllocator.h:
              (JSC::roundUpAllocationSize):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@41872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cd169898
  34. 07 Jan, 2009 1 commit
  35. 16 Dec, 2008 1 commit
    • weinig@apple.com's avatar
      2008-12-16 Sam Weinig <sam@webkit.org> · 2f06dbac
      weinig@apple.com authored
              Reviewed by Gavin Barraclough.
      
              Fix for https://bugs.webkit.org/show_bug.cgi?id=22837
              Remove dependency on the bytecode Instruction buffer in Interpreter::cti_op_call_NotJSFunction
              Part of <rdar://problem/6428342>
      
              * interpreter/CallFrame.h: Added comment regarding returnPC storing a void*.
              * interpreter/Interpreter.cpp:
              (JSC::bytecodeOffsetForPC): We no longer have any cases of the PC
              being in the instruction stream for JIT, so we can remove the check.
              (JSC::Interpreter::cti_op_call_NotJSFunction): Use the CTI_RETURN_ADDRESS
              as the call frame returnPC as it is only necessary for looking up when
              throwing an exception.
              * interpreter/RegisterFile.h:
              (JSC::RegisterFile::): Added comment regarding returnPC storing a void*.
              * jit/JIT.h: Remove ARG_instr4.
              * jit/JITCall.cpp:
              (JSC::JIT::compileOpCallSetupArgs): Don't pass the instruction pointer.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2f06dbac
  36. 15 Dec, 2008 2 commits