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
      https://bugs.webkit.org/show_bug.cgi?id=121167
      
      Patch by Sam Weinig <sam@webkit.org> on 2013-09-11
      Reviewed by Geoffrey Garen.
      
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::reset):
      (JSC::JSGlobalObject::visitChildren):
      * runtime/JSGlobalObject.h:
      (JSC::JSGlobalObject::mapStructure):
      Remove MapData and WeakMapData structures (they moved to VM with other non-object Structures).
      
      * runtime/JSMap.cpp:
      (JSC::JSMap::finishCreation):
      * runtime/JSMap.h:
      (JSC::JSMap::create):
      * runtime/JSSet.cpp:
      (JSC::JSSet::finishCreation):
      * runtime/JSSet.h:
      (JSC::JSSet::create):
      * runtime/JSWeakMap.cpp:
      (JSC::JSWeakMap::finishCreation):
      * runtime/JSWeakMap.h:
      (JSC::JSWeakMap::create):
      Update to not pass a global object to the MapData or WeakMapData Structure.
      
      * runtime/MapData.cpp:
      (JSC::MapData::MapData):
      * runtime/MapData.h:
      (JSC::MapData::create):
      (JSC::MapData::createStructure):
      * runtime/WeakMapData.cpp:
      (JSC::WeakMapData::WeakMapData):
      (JSC::WeakMapData::set): Change to take a VM rather than a CallFrame, as that it all it needs.
      * runtime/WeakMapData.h:
      (JSC::WeakMapData::create):
      (JSC::WeakMapData::createStructure):
      Instead of inheriting from JSDestructibleObject, inherit from JSCell and mark self as needing destruction
      and having an immortal structure.
      
      * runtime/VM.cpp:
      (JSC::VM::VM):
      * runtime/VM.h:
      Add MapData and WeakMapData Structures.
      
      * runtime/WeakMapPrototype.cpp:
      (JSC::protoFuncWeakMapSet):
      Pass a VM rather than an ExecState.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b1511430
  2. 30 Aug, 2013 1 commit
    • oliver@apple.com's avatar
      Implement ES6 Set class · b8d80ed3
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120549
      
      Reviewed by Filip Pizlo.
      
      Source/JavaScriptCore:
      
      We simply reuse the MapData type from JSMap making the
      it much simpler.
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * runtime/CommonIdentifiers.h:
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::reset):
      (JSC::JSGlobalObject::visitChildren):
      * runtime/JSGlobalObject.h:
      (JSC::JSGlobalObject::setStructure):
      * runtime/JSSet.cpp: Added.
      (JSC::JSSet::visitChildren):
      (JSC::JSSet::finishCreation):
      * runtime/JSSet.h: Added.
      (JSC::JSSet::createStructure):
      (JSC::JSSet::create):
      (JSC::JSSet::mapData):
      (JSC::JSSet::JSSet):
      * runtime/SetConstructor.cpp: Added.
      (JSC::SetConstructor::finishCreation):
      (JSC::callSet):
      (JSC::constructSet):
      (JSC::SetConstructor::getConstructData):
      (JSC::SetConstructor::getCallData):
      * runtime/SetConstructor.h: Added.
      (JSC::SetConstructor::create):
      (JSC::SetConstructor::createStructure):
      (JSC::SetConstructor::SetConstructor):
      * runtime/SetPrototype.cpp: Added.
      (JSC::SetPrototype::finishCreation):
      (JSC::getMapData):
      (JSC::setProtoFuncAdd):
      (JSC::setProtoFuncClear):
      (JSC::setProtoFuncDelete):
      (JSC::setProtoFuncForEach):
      (JSC::setProtoFuncHas):
      (JSC::setProtoFuncSize):
      * runtime/SetPrototype.h: Added.
      (JSC::SetPrototype::create):
      (JSC::SetPrototype::createStructure):
      (JSC::SetPrototype::SetPrototype):
      
      LayoutTests:
      
      Add tests
      
      * fast/js/basic-set-expected.txt: Added.
      * fast/js/basic-set.html: Added.
      * fast/js/script-tests/basic-set.js: Added.
      (set new):
      (otherString.string_appeared_here.set add):
      (try.set forEach):
      (set forEach):
      (set gc):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b8d80ed3