1. 11 Sep, 2013 1 commit
    • commit-queue@webkit.org's avatar
      MapData and WeakMapData don't need to be objects · b1511430
      commit-queue@webkit.org authored
      Patch by Sam Weinig <sam@webkit.org> on 2013-09-11
      Reviewed by Geoffrey Garen.
      * runtime/JSGlobalObject.cpp:
      * runtime/JSGlobalObject.h:
      Remove MapData and WeakMapData structures (they moved to VM with other non-object Structures).
      * runtime/JSMap.cpp:
      * runtime/JSMap.h:
      * runtime/JSSet.cpp:
      * runtime/JSSet.h:
      * runtime/JSWeakMap.cpp:
      * runtime/JSWeakMap.h:
      Update to not pass a global object to the MapData or WeakMapData Structure.
      * runtime/MapData.cpp:
      * runtime/MapData.h:
      * runtime/WeakMapData.cpp:
      (JSC::WeakMapData::set): Change to take a VM rather than a CallFrame, as that it all it needs.
      * runtime/WeakMapData.h:
      Instead of inheriting from JSDestructibleObject, inherit from JSCell and mark self as needing destruction
      and having an immortal structure.
      * runtime/VM.cpp:
      * runtime/VM.h:
      Add MapData and WeakMapData Structures.
      * runtime/WeakMapPrototype.cpp:
      Pass a VM rather than an ExecState.
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  2. 10 Sep, 2013 1 commit
    • mhahnenberg@apple.com's avatar
      MapData has some issues · ff9e657e
      mhahnenberg@apple.com authored
      Reviewed by Geoffrey Garen.
      * heap/CopiedBlock.h: Added some debug-only consistency checking logic. We now make sure that
      m_liveBytes is consistent with another field, m_liveObjects. m_liveObjects is the number of
      "objects" that currently reside in the CopiedBlock. If we have zero live bytes then we should have
      zero live objects. The converse and the inverse should also be true.
      * heap/CopiedBlockInlines.h:
      * heap/CopyVisitorInlines.h:
      * runtime/MapData.cpp:
      (JSC::MapData::replaceAndPackBackingStore): Renamed parameter to be consistent with its meaning.
      (JSC::MapData::replaceBackingStore): Ditto. Also removed an unnecessary local variable.
      (JSC::MapData::visitChildren): Before we passed the size of the MapData to copyLater(), which
      was wrong. Now we pass capacity * sizeof(Entry).
      (JSC::MapData::copyBackingStore): Before when we reassigned the newly copied backing store, we
      set the capacity (in elements) to the size (in bytes) of the backing store. This made us think
      we're way bigger than we actually are. Now we just pass the old capacity in.
      * runtime/MapData.h:
      (JSC::MapData::capacityInBytes): Helper function to calculate the size of the backing store.
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  3. 03 Sep, 2013 1 commit
    • oliver@apple.com's avatar
      Support structured clone of Map and Set · 901740c2
      oliver@apple.com authored
      Reviewed by Simon Fraser.
      Make xcode copy the required headers, and add appropriate export attributes
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * runtime/JSMap.h:
      * runtime/JSSet.h:
      * runtime/MapData.h:
      Add support for cloning Map and Set.  Fairly self explanatory change.
      Needed to add Forwarding headers for the JSMap, JSSet and MapData classes.
      * ForwardingHeaders/runtime/JSMap.h: Added.
      * ForwardingHeaders/runtime/JSSet.h: Added.
      * ForwardingHeaders/runtime/MapData.h: Added.
      * bindings/js/SerializedScriptValue.cpp:
      * fast/dom/Window/script-tests/postmessage-clone.js:
      (set new):
      (set add.set add):
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155008 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  4. 29 Aug, 2013 3 commits
    • ryuan.choi@samsung.com's avatar
      Fix build break after r154861 · 639d4f6b
      ryuan.choi@samsung.com authored
      Reviewed by Geoffrey Garen.
      Unreviewed build fix attempt for GTK, Qt Windows and CMake based ports.
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
      * Target.pri:
      * runtime/MapData.h:
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    • oliver@apple.com's avatar
    • oliver@apple.com's avatar
      Implement ES6 Map object · 005f9e8f
      oliver@apple.com authored
      Reviewed by Geoffrey Garen.
      Implement support for the ES6 Map type and related classes.
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * heap/CopyToken.h: Add a new token to track copying the backing store
      * runtime/CommonIdentifiers.h: Add new identifiers
      * runtime/JSGlobalObject.cpp:
      * runtime/JSGlobalObject.h:
          Add new structures and prototypes
      * runtime/JSMap.cpp: Added.
      * runtime/JSMap.h: Added.
          New JSMap class to represent a Map instance
      * runtime/MapConstructor.cpp: Added.
      * runtime/MapConstructor.h: Added.
          The Map constructor
      * runtime/MapData.cpp: Added.
      * runtime/MapData.h: Added.
          The most interesting data structure.  The roughly corresponds
          to the ES6 notion of MapData.  It provides the core JSValue->JSValue
          map implementation.  We implement it using 2 hashtables and a flat
          table.  Due to the different semantics of string comparisons vs.
          all others we need have one map keyed by String and the other by
          generic JSValue.  The actual table is represented more or less
          exactly as described in the ES6 draft - a single contiguous list of
          key/value pairs.  The entire map could be achieved with just this
          table, however we need the HashMaps in order to maintain O(1) lookup.
          Deleted values are simply cleared as the draft says, however the
          implementation compacts the storage on copy as long as the are no
          active iterators.
      * runtime/MapPrototype.cpp: Added.
      * runtime/MapPrototype.h: Added.
          Implement Map prototype functions
      * runtime/VM.cpp:
          Add new structures.
      * fast/js/basic-map-expected.txt: Added.
      * fast/js/basic-map.html: Added.
      * fast/js/script-tests/basic-map.js: Added.
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154861 268f45cc-cd09-0410-ab3c-d52691b4dbfc