source: webkit/trunk/Source/JavaScriptCore/Target.pri@ 128558

Last change on this file since 128558 was 128400, checked in by [email protected], 13 years ago

JSC should have property butterflies
https://bugs.webkit.org/show_bug.cgi?id=91933

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This changes the JSC object model. Previously, all objects had fast lookup for
named properties. Integer indexed properties were only fast if you used a
JSArray. With this change, all objects have fast indexed properties. This is
accomplished without any space overhead by using a bidirectional object layout,
aka butterflies. Each JSObject has a m_butterfly pointer where previously it
had a m_outOfLineStorage pointer. To the left of the location pointed to by
m_butterfly, we place all named out-of-line properties. To the right, we place
all indexed properties along with indexing meta-data. Though, some indexing
meta-data is placed in the 8-byte word immediately left of the pointed-to
location; this is in anticipation of the indexing meta-data being small enough
in the common case that m_butterfly always points to the first indexed
property.

This is performance neutral, except on tests that use indexed properties on
plain objects, where the speed-up is in excess of an order of magnitude.

One notable aspect of what this change brings is that it allows indexing
storage to morph over time. Currently this is only used to allow all non-array
objects to start out without any indexed storage. But it could be used for
some kinds of array type inference in the future.

  • API/JSCallbackObject.h:

(JSCallbackObject):

  • API/JSCallbackObjectFunctions.h:

(JSC::::getOwnPropertySlotByIndex):
(JSC):
(JSC::::getOwnNonIndexPropertyNames):

  • API/JSObjectRef.cpp:
  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Target.pri:
  • bytecode/ArrayProfile.h:

(JSC):
(JSC::arrayModeFromStructure):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitDirectPutById):

  • dfg/DFGAbstractState.cpp:

(JSC::DFG::AbstractState::execute):

  • dfg/DFGAdjacencyList.h:

(JSC::DFG::AdjacencyList::AdjacencyList):
(AdjacencyList):

  • dfg/DFGArrayMode.cpp:

(JSC::DFG::fromObserved):
(JSC::DFG::modeAlreadyChecked):
(JSC::DFG::modeToString):

  • dfg/DFGArrayMode.h:

(DFG):
(JSC::DFG::modeUsesButterfly):
(JSC::DFG::modeIsJSArray):
(JSC::DFG::isInBoundsAccess):
(JSC::DFG::modeSupportsLength):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::handleGetByOffset):
(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGCSEPhase.cpp:

(JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
(JSC::DFG::CSEPhase::performNodeCSE):

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::addNode):
(FixupPhase):
(JSC::DFG::FixupPhase::checkArray):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::byValIsPure):

  • dfg/DFGNode.h:

(JSC::DFG::Node::Node):
(Node):

  • dfg/DFGNodeType.h:

(DFG):

  • dfg/DFGOperations.cpp:

(JSC::DFG::putByVal):

  • dfg/DFGOperations.h:
  • dfg/DFGPredictionPropagationPhase.cpp:

(JSC::DFG::PredictionPropagationPhase::propagate):

  • dfg/DFGRepatch.cpp:

(JSC::DFG::generateProtoChainAccessStub):
(JSC::DFG::tryCacheGetByID):
(JSC::DFG::tryBuildGetByIDList):
(JSC::DFG::emitPutReplaceStub):
(JSC::DFG::emitPutTransitionStub):
(JSC::DFG::tryBuildPutByIdList):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::checkArray):
(JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
(JSC::DFG::SpeculativeJIT::compileGetArrayLength):
(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::callOperation):
(JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGStructureCheckHoistingPhase.cpp:

(JSC::DFG::StructureCheckHoistingPhase::run):

  • heap/CopiedSpace.h:

(CopiedSpace):

  • jit/JIT.h:
  • jit/JITInlineMethods.h:

(JSC::JIT::emitAllocateBasicJSObject):
(JSC::JIT::emitAllocateBasicStorage):
(JSC::JIT::emitAllocateJSArray):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_new_array):
(JSC::JIT::emitSlow_op_new_array):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::compileGetDirectOffset):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::compileGetByIdHotPath):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::compilePutDirectOffset):
(JSC::JIT::privateCompilePatchGetArrayLength):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::compileGetByIdHotPath):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::compilePutDirectOffset):
(JSC::JIT::compileGetDirectOffset):
(JSC::JIT::privateCompilePatchGetArrayLength):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • jsc.cpp:
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • runtime/Arguments.cpp:

(JSC::Arguments::deletePropertyByIndex):
(JSC::Arguments::defineOwnProperty):

  • runtime/ArrayConstructor.cpp:
  • runtime/ArrayConventions.h: Added.

(JSC):
(JSC::isDenseEnoughForVector):
(JSC::indexingHeaderForArray):
(JSC::baseIndexingHeaderForArray):

  • runtime/ArrayPrototype.cpp:

(JSC::ArrayPrototype::create):
(JSC):
(JSC::ArrayPrototype::ArrayPrototype):
(JSC::arrayProtoFuncToString):
(JSC::arrayProtoFuncJoin):
(JSC::arrayProtoFuncSort):
(JSC::arrayProtoFuncFilter):
(JSC::arrayProtoFuncMap):
(JSC::arrayProtoFuncEvery):
(JSC::arrayProtoFuncForEach):
(JSC::arrayProtoFuncSome):
(JSC::arrayProtoFuncReduce):
(JSC::arrayProtoFuncReduceRight):

  • runtime/ArrayPrototype.h:

(ArrayPrototype):
(JSC::ArrayPrototype::createStructure):

  • runtime/ArrayStorage.h: Added.

(JSC):
(ArrayStorage):
(JSC::ArrayStorage::ArrayStorage):
(JSC::ArrayStorage::from):
(JSC::ArrayStorage::butterfly):
(JSC::ArrayStorage::indexingHeader):
(JSC::ArrayStorage::length):
(JSC::ArrayStorage::setLength):
(JSC::ArrayStorage::vectorLength):
(JSC::ArrayStorage::setVectorLength):
(JSC::ArrayStorage::copyHeaderFromDuringGC):
(JSC::ArrayStorage::inSparseMode):
(JSC::ArrayStorage::lengthOffset):
(JSC::ArrayStorage::vectorLengthOffset):
(JSC::ArrayStorage::numValuesInVectorOffset):
(JSC::ArrayStorage::vectorOffset):
(JSC::ArrayStorage::indexBiasOffset):
(JSC::ArrayStorage::sparseMapOffset):
(JSC::ArrayStorage::sizeFor):

  • runtime/Butterfly.h: Added.

(JSC):
(Butterfly):
(JSC::Butterfly::Butterfly):
(JSC::Butterfly::totalSize):
(JSC::Butterfly::fromBase):
(JSC::Butterfly::offsetOfIndexingHeader):
(JSC::Butterfly::offsetOfPublicLength):
(JSC::Butterfly::offsetOfVectorLength):
(JSC::Butterfly::indexingHeader):
(JSC::Butterfly::propertyStorage):
(JSC::Butterfly::indexingPayload):
(JSC::Butterfly::arrayStorage):
(JSC::Butterfly::offsetOfPropertyStorage):
(JSC::Butterfly::indexOfPropertyStorage):
(JSC::Butterfly::base):

  • runtime/ButterflyInlineMethods.h: Added.

(JSC):
(JSC::Butterfly::createUninitialized):
(JSC::Butterfly::create):
(JSC::Butterfly::createUninitializedDuringCollection):
(JSC::Butterfly::base):
(JSC::Butterfly::growPropertyStorage):
(JSC::Butterfly::growArrayRight):
(JSC::Butterfly::resizeArray):
(JSC::Butterfly::unshift):
(JSC::Butterfly::shift):

  • runtime/ClassInfo.h:

(MethodTable):
(JSC):

  • runtime/IndexingHeader.h: Added.

(JSC):
(IndexingHeader):
(JSC::IndexingHeader::offsetOfIndexingHeader):
(JSC::IndexingHeader::offsetOfPublicLength):
(JSC::IndexingHeader::offsetOfVectorLength):
(JSC::IndexingHeader::IndexingHeader):
(JSC::IndexingHeader::vectorLength):
(JSC::IndexingHeader::setVectorLength):
(JSC::IndexingHeader::publicLength):
(JSC::IndexingHeader::setPublicLength):
(JSC::IndexingHeader::from):
(JSC::IndexingHeader::fromEndOf):
(JSC::IndexingHeader::propertyStorage):
(JSC::IndexingHeader::arrayStorage):
(JSC::IndexingHeader::butterfly):

  • runtime/IndexingHeaderInlineMethods.h: Added.

(JSC):
(JSC::IndexingHeader::preCapacity):
(JSC::IndexingHeader::indexingPayloadSizeInBytes):

  • runtime/IndexingType.h: Added.

(JSC):
(JSC::hasIndexingHeader):

  • runtime/JSActivation.cpp:

(JSC::JSActivation::JSActivation):
(JSC::JSActivation::visitChildren):
(JSC::JSActivation::getOwnNonIndexPropertyNames):

  • runtime/JSActivation.h:

(JSActivation):
(JSC::JSActivation::tearOff):

  • runtime/JSArray.cpp:

(JSC):
(JSC::createArrayButterflyInDictionaryIndexingMode):
(JSC::JSArray::setLengthWritable):
(JSC::JSArray::defineOwnProperty):
(JSC::JSArray::getOwnPropertySlot):
(JSC::JSArray::getOwnPropertyDescriptor):
(JSC::JSArray::put):
(JSC::JSArray::deleteProperty):
(JSC::JSArray::getOwnNonIndexPropertyNames):
(JSC::JSArray::unshiftCountSlowCase):
(JSC::JSArray::setLength):
(JSC::JSArray::pop):
(JSC::JSArray::push):
(JSC::JSArray::shiftCount):
(JSC::JSArray::unshiftCount):
(JSC::JSArray::sortNumeric):
(JSC::JSArray::sort):
(JSC::JSArray::fillArgList):
(JSC::JSArray::copyToArguments):
(JSC::JSArray::compactForSorting):

  • runtime/JSArray.h:

(JSC):
(JSArray):
(JSC::JSArray::JSArray):
(JSC::JSArray::length):
(JSC::JSArray::createStructure):
(JSC::JSArray::isLengthWritable):
(JSC::createArrayButterfly):
(JSC::JSArray::create):
(JSC::JSArray::tryCreateUninitialized):

  • runtime/JSBoundFunction.cpp:

(JSC::boundFunctionCall):
(JSC::boundFunctionConstruct):
(JSC::JSBoundFunction::finishCreation):

  • runtime/JSCell.cpp:

(JSC::JSCell::getOwnNonIndexPropertyNames):
(JSC):

  • runtime/JSCell.h:

(JSCell):

  • runtime/JSFunction.cpp:

(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnPropertyDescriptor):
(JSC::JSFunction::getOwnNonIndexPropertyNames):
(JSC::JSFunction::defineOwnProperty):

  • runtime/JSFunction.h:

(JSFunction):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::JSGlobalData):

  • runtime/JSGlobalData.h:

(JSGlobalData):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::reset):

  • runtime/JSONObject.cpp:

(JSC::Stringifier::Holder::appendNextProperty):
(JSC::Walker::walk):

  • runtime/JSObject.cpp:

(JSC):
(JSC::JSObject::visitButterfly):
(JSC::JSObject::visitChildren):
(JSC::JSFinalObject::visitChildren):
(JSC::JSObject::getOwnPropertySlotByIndex):
(JSC::JSObject::put):
(JSC::JSObject::putByIndex):
(JSC::JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists):
(JSC::JSObject::enterDictionaryIndexingMode):
(JSC::JSObject::createArrayStorage):
(JSC::JSObject::createInitialArrayStorage):
(JSC::JSObject::ensureArrayStorageExistsAndEnterDictionaryIndexingMode):
(JSC::JSObject::putDirectAccessor):
(JSC::JSObject::deleteProperty):
(JSC::JSObject::deletePropertyByIndex):
(JSC::JSObject::getOwnPropertyNames):
(JSC::JSObject::getOwnNonIndexPropertyNames):
(JSC::JSObject::preventExtensions):
(JSC::JSObject::fillGetterPropertySlot):
(JSC::JSObject::putIndexedDescriptor):
(JSC::JSObject::defineOwnIndexedProperty):
(JSC::JSObject::allocateSparseIndexMap):
(JSC::JSObject::deallocateSparseIndexMap):
(JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage):
(JSC::JSObject::putByIndexBeyondVectorLength):
(JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage):
(JSC::JSObject::putDirectIndexBeyondVectorLength):
(JSC::JSObject::getNewVectorLength):
(JSC::JSObject::increaseVectorLength):
(JSC::JSObject::checkIndexingConsistency):
(JSC::JSObject::growOutOfLineStorage):
(JSC::JSObject::getOwnPropertyDescriptor):
(JSC::putDescriptor):
(JSC::JSObject::putDirectMayBeIndex):
(JSC::JSObject::defineOwnNonIndexProperty):
(JSC::JSObject::defineOwnProperty):
(JSC::JSObject::getOwnPropertySlotSlow):

  • runtime/JSObject.h:

(JSC::JSObject::getArrayLength):
(JSObject):
(JSC::JSObject::getVectorLength):
(JSC::JSObject::putDirectIndex):
(JSC::JSObject::canGetIndexQuickly):
(JSC::JSObject::getIndexQuickly):
(JSC::JSObject::canSetIndexQuickly):
(JSC::JSObject::setIndexQuickly):
(JSC::JSObject::initializeIndex):
(JSC::JSObject::completeInitialization):
(JSC::JSObject::inSparseIndexingMode):
(JSC::JSObject::butterfly):
(JSC::JSObject::outOfLineStorage):
(JSC::JSObject::offsetForLocation):
(JSC::JSObject::indexingShouldBeSparse):
(JSC::JSObject::butterflyOffset):
(JSC::JSObject::butterflyAddress):
(JSC::JSObject::arrayStorage):
(JSC::JSObject::arrayStorageOrZero):
(JSC::JSObject::ensureArrayStorage):
(JSC::JSObject::checkIndexingConsistency):
(JSC::JSNonFinalObject::JSNonFinalObject):
(JSC):
(JSC::JSObject::setButterfly):
(JSC::JSObject::setButterflyWithoutChangingStructure):
(JSC::JSObject::JSObject):
(JSC::JSObject::inlineGetOwnPropertySlot):
(JSC::JSObject::putDirectInternal):
(JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
(JSC::JSObject::putDirectWithoutTransition):
(JSC::offsetInButterfly):
(JSC::offsetRelativeToPatchedStorage):
(JSC::indexRelativeToBase):
(JSC::offsetRelativeToBase):

  • runtime/JSPropertyNameIterator.cpp:

(JSC::JSPropertyNameIterator::create):

  • runtime/JSSymbolTableObject.cpp:

(JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames):

  • runtime/JSSymbolTableObject.h:

(JSSymbolTableObject):

  • runtime/JSTypeInfo.h:

(JSC):
(JSC::TypeInfo::interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero):
(JSC::TypeInfo::overridesGetPropertyNames):

  • runtime/LiteralParser.cpp:

(JSC::::parse):

  • runtime/ObjectConstructor.cpp:
  • runtime/ObjectPrototype.cpp:

(JSC::ObjectPrototype::ObjectPrototype):
(JSC):

  • runtime/ObjectPrototype.h:

(ObjectPrototype):

  • runtime/PropertyOffset.h:

(JSC::offsetInOutOfLineStorage):

  • runtime/PropertyStorage.h: Added.

(JSC):

  • runtime/PutDirectIndexMode.h: Added.

(JSC):

  • runtime/RegExpMatchesArray.cpp:

(JSC::RegExpMatchesArray::RegExpMatchesArray):
(JSC):
(JSC::RegExpMatchesArray::create):
(JSC::RegExpMatchesArray::finishCreation):

  • runtime/RegExpMatchesArray.h:

(RegExpMatchesArray):
(JSC::RegExpMatchesArray::createStructure):

  • runtime/RegExpObject.cpp:

(JSC::RegExpObject::getOwnNonIndexPropertyNames):

  • runtime/RegExpObject.h:

(RegExpObject):

  • runtime/Reject.h: Added.

(JSC):
(JSC::reject):

  • runtime/SparseArrayValueMap.cpp: Added.

(JSC):

  • runtime/SparseArrayValueMap.h: Added.

(JSC):
(SparseArrayEntry):
(JSC::SparseArrayEntry::SparseArrayEntry):
(SparseArrayValueMap):
(JSC::SparseArrayValueMap::sparseMode):
(JSC::SparseArrayValueMap::setSparseMode):
(JSC::SparseArrayValueMap::lengthIsReadOnly):
(JSC::SparseArrayValueMap::setLengthIsReadOnly):
(JSC::SparseArrayValueMap::find):
(JSC::SparseArrayValueMap::remove):
(JSC::SparseArrayValueMap::notFound):
(JSC::SparseArrayValueMap::isEmpty):
(JSC::SparseArrayValueMap::contains):
(JSC::SparseArrayValueMap::size):
(JSC::SparseArrayValueMap::begin):
(JSC::SparseArrayValueMap::end):

  • runtime/SparseArrayValueMapInlineMethods.h: Added.

(JSC):
(JSC::SparseArrayValueMap::SparseArrayValueMap):
(JSC::SparseArrayValueMap::~SparseArrayValueMap):
(JSC::SparseArrayValueMap::finishCreation):
(JSC::SparseArrayValueMap::create):
(JSC::SparseArrayValueMap::destroy):
(JSC::SparseArrayValueMap::createStructure):
(JSC::SparseArrayValueMap::add):
(JSC::SparseArrayValueMap::putEntry):
(JSC::SparseArrayValueMap::putDirect):
(JSC::SparseArrayEntry::get):
(JSC::SparseArrayEntry::getNonSparseMode):
(JSC::SparseArrayValueMap::visitChildren):

  • runtime/StorageBarrier.h: Removed.
  • runtime/StringObject.cpp:

(JSC::StringObject::putByIndex):
(JSC):
(JSC::StringObject::deletePropertyByIndex):

  • runtime/StringObject.h:

(StringObject):

  • runtime/StringPrototype.cpp:
  • runtime/Structure.cpp:

(JSC::Structure::Structure):
(JSC::Structure::materializePropertyMap):
(JSC::Structure::nonPropertyTransition):
(JSC):

  • runtime/Structure.h:

(Structure):
(JSC::Structure::indexingType):
(JSC::Structure::indexingTypeIncludingHistory):
(JSC::Structure::indexingTypeOffset):
(JSC::Structure::create):

  • runtime/StructureTransitionTable.h:

(JSC):
(JSC::toAttributes):
(JSC::newIndexingType):
(JSC::StructureTransitionTable::Hash::hash):

  • tests/mozilla/js1_6/Array/regress-304828.js:

Source/WebCore:

Teach the DOM that to intercept get/put on indexed properties, you now have
to override getOwnPropertySlotByIndex and putByIndex.

No new tests because no new behavior. One test was rebased because indexed
property iteration order now matches other engines (indexed properties always
come first).

  • bindings/js/ArrayValue.cpp:

(WebCore::ArrayValue::get):

  • bindings/js/JSBlobCustom.cpp:

(WebCore::JSBlobConstructor::constructJSBlob):

  • bindings/js/JSCanvasRenderingContext2DCustom.cpp:

(WebCore::JSCanvasRenderingContext2D::setWebkitLineDash):

  • bindings/js/JSDOMStringListCustom.cpp:

(WebCore::toDOMStringList):

  • bindings/js/JSDOMStringMapCustom.cpp:

(WebCore::JSDOMStringMap::deletePropertyByIndex):
(WebCore):

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore):
(WebCore::JSDOMWindow::putByIndex):
(WebCore::JSDOMWindow::deletePropertyByIndex):

  • bindings/js/JSDOMWindowShell.cpp:

(WebCore::JSDOMWindowShell::getOwnPropertySlotByIndex):
(WebCore):
(WebCore::JSDOMWindowShell::putByIndex):
(WebCore::JSDOMWindowShell::deletePropertyByIndex):

  • bindings/js/JSDOMWindowShell.h:

(JSDOMWindowShell):

  • bindings/js/JSHistoryCustom.cpp:

(WebCore::JSHistory::deletePropertyByIndex):
(WebCore):

  • bindings/js/JSInspectorFrontendHostCustom.cpp:

(WebCore::populateContextMenuItems):

  • bindings/js/JSLocationCustom.cpp:

(WebCore::JSLocation::deletePropertyByIndex):
(WebCore):

  • bindings/js/JSStorageCustom.cpp:

(WebCore::JSStorage::deletePropertyByIndex):
(WebCore):

  • bindings/js/JSWebSocketCustom.cpp:

(WebCore::JSWebSocketConstructor::constructJSWebSocket):

  • bindings/js/ScriptValue.cpp:

(WebCore::jsToInspectorValue):

  • bindings/js/SerializedScriptValue.cpp:

(WebCore::CloneSerializer::serialize):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateHeader):
(GenerateImplementation):

  • bridge/runtime_array.cpp:

(JSC::RuntimeArray::RuntimeArray):

  • bridge/runtime_array.h:

(JSC::RuntimeArray::createStructure):
(RuntimeArray):

LayoutTests:

Modify the JSON test to indicate that iterating over properties now returns
indexed properties first. This is a behavior change that makes us more
compliant with other implementations.

Also check in new expected file for the edge cases of indexed property access
with prototype accessors. This changeset introduces a known regression in that
department, which is tracked here: https://bugs.webkit.org/show_bug.cgi?id=96596

  • fast/js/resources/JSON-stringify.js:
  • platform/mac/fast/js/primitive-property-access-edge-cases-expected.txt: Added.
File size: 8.2 KB
Line 
1# -------------------------------------------------------------------
2# Target file for the JavaScriptSource library
3#
4# See 'Tools/qmake/README' for an overview of the build system
5# -------------------------------------------------------------------
6
7TEMPLATE = lib
8TARGET = JavaScriptCore
9
10include(JavaScriptCore.pri)
11
12WEBKIT += wtf
13QT += core
14QT -= gui
15
16CONFIG += staticlib
17
18*-g++*:QMAKE_CXXFLAGS_RELEASE -= -O2
19*-g++*:QMAKE_CXXFLAGS_RELEASE += -O3
20
21# Rules when JIT enabled (not disabled)
22!contains(DEFINES, ENABLE_JIT=0) {
23 linux*-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) {
24 QMAKE_CXXFLAGS += -fno-stack-protector
25 QMAKE_CFLAGS += -fno-stack-protector
26 }
27}
28
29include(yarr/yarr.pri)
30
31INSTALLDEPS += all
32
33SOURCES += \
34 API/JSBase.cpp \
35 API/JSCallbackConstructor.cpp \
36 API/JSCallbackFunction.cpp \
37 API/JSCallbackObject.cpp \
38 API/JSClassRef.cpp \
39 API/JSContextRef.cpp \
40 API/JSObjectRef.cpp \
41 API/JSStringRef.cpp \
42 API/JSValueRef.cpp \
43 API/JSWeakObjectMapRefPrivate.cpp \
44 API/OpaqueJSString.cpp \
45 assembler/ARMAssembler.cpp \
46 assembler/ARMv7Assembler.cpp \
47 assembler/LinkBuffer.cpp \
48 assembler/MacroAssemblerARM.cpp \
49 assembler/MacroAssemblerSH4.cpp \
50 bytecode/ArrayProfile.cpp \
51 bytecode/CallLinkInfo.cpp \
52 bytecode/CallLinkStatus.cpp \
53 bytecode/CodeBlock.cpp \
54 bytecode/DFGExitProfile.cpp \
55 bytecode/ExecutionCounter.cpp \
56 bytecode/GetByIdStatus.cpp \
57 bytecode/JumpTable.cpp \
58 bytecode/LazyOperandValueProfile.cpp \
59 bytecode/MethodCallLinkInfo.cpp \
60 bytecode/MethodCallLinkStatus.cpp \
61 bytecode/MethodOfGettingAValueProfile.cpp \
62 bytecode/Opcode.cpp \
63 bytecode/PolymorphicPutByIdList.cpp \
64 bytecode/PutByIdStatus.cpp \
65 bytecode/ResolveGlobalStatus.cpp \
66 bytecode/SamplingTool.cpp \
67 bytecode/SpeculatedType.cpp \
68 bytecode/StructureStubClearingWatchpoint.cpp \
69 bytecode/StructureStubInfo.cpp \
70 bytecode/Watchpoint.cpp \
71 bytecompiler/BytecodeGenerator.cpp \
72 bytecompiler/NodesCodegen.cpp \
73 heap/CopiedSpace.cpp \
74 heap/ConservativeRoots.cpp \
75 heap/DFGCodeBlocks.cpp \
76 heap/WeakSet.cpp \
77 heap/WeakHandleOwner.cpp \
78 heap/WeakBlock.cpp \
79 heap/HandleSet.cpp \
80 heap/HandleStack.cpp \
81 heap/BlockAllocator.cpp \
82 heap/GCThreadSharedData.cpp \
83 heap/Heap.cpp \
84 heap/HeapTimer.cpp \
85 heap/IncrementalSweeper.cpp \
86 heap/JITStubRoutineSet.cpp \
87 heap/MachineStackMarker.cpp \
88 heap/MarkStack.cpp \
89 heap/MarkedAllocator.cpp \
90 heap/MarkedBlock.cpp \
91 heap/MarkedSpace.cpp \
92 heap/SlotVisitor.cpp \
93 heap/VTableSpectrum.cpp \
94 heap/WriteBarrierSupport.cpp \
95 debugger/DebuggerActivation.cpp \
96 debugger/DebuggerCallFrame.cpp \
97 debugger/Debugger.cpp \
98 dfg/DFGAbstractState.cpp \
99 dfg/DFGArgumentsSimplificationPhase.cpp \
100 dfg/DFGArrayMode.cpp \
101 dfg/DFGAssemblyHelpers.cpp \
102 dfg/DFGByteCodeParser.cpp \
103 dfg/DFGCapabilities.cpp \
104 dfg/DFGCFAPhase.cpp \
105 dfg/DFGCFGSimplificationPhase.cpp \
106 dfg/DFGConstantFoldingPhase.cpp \
107 dfg/DFGCorrectableJumpPoint.cpp \
108 dfg/DFGCSEPhase.cpp \
109 dfg/DFGDisassembler.cpp \
110 dfg/DFGDominators.cpp \
111 dfg/DFGDriver.cpp \
112 dfg/DFGFixupPhase.cpp \
113 dfg/DFGGraph.cpp \
114 dfg/DFGJITCompiler.cpp \
115 dfg/DFGMinifiedNode.cpp \
116 dfg/DFGNodeFlags.cpp \
117 dfg/DFGOperations.cpp \
118 dfg/DFGOSREntry.cpp \
119 dfg/DFGOSRExit.cpp \
120 dfg/DFGOSRExitCompiler.cpp \
121 dfg/DFGOSRExitCompiler64.cpp \
122 dfg/DFGOSRExitCompiler32_64.cpp \
123 dfg/DFGPhase.cpp \
124 dfg/DFGPredictionPropagationPhase.cpp \
125 dfg/DFGRepatch.cpp \
126 dfg/DFGSpeculativeJIT.cpp \
127 dfg/DFGSpeculativeJIT32_64.cpp \
128 dfg/DFGSpeculativeJIT64.cpp \
129 dfg/DFGStructureCheckHoistingPhase.cpp \
130 dfg/DFGThunks.cpp \
131 dfg/DFGValueSource.cpp \
132 dfg/DFGVariableEvent.cpp \
133 dfg/DFGVariableEventStream.cpp \
134 dfg/DFGValidate.cpp \
135 dfg/DFGVirtualRegisterAllocationPhase.cpp \
136 interpreter/AbstractPC.cpp \
137 interpreter/CallFrame.cpp \
138 interpreter/Interpreter.cpp \
139 interpreter/RegisterFile.cpp \
140 jit/ExecutableAllocatorFixedVMPool.cpp \
141 jit/ExecutableAllocator.cpp \
142 jit/HostCallReturnValue.cpp \
143 jit/GCAwareJITStubRoutine.cpp \
144 jit/JITArithmetic.cpp \
145 jit/JITArithmetic32_64.cpp \
146 jit/JITCall.cpp \
147 jit/JITCall32_64.cpp \
148 jit/JIT.cpp \
149 jit/JITExceptions.cpp \
150 jit/JITOpcodes.cpp \
151 jit/JITOpcodes32_64.cpp \
152 jit/JITPropertyAccess.cpp \
153 jit/JITPropertyAccess32_64.cpp \
154 jit/JITStubRoutine.cpp \
155 jit/JITStubs.cpp \
156 jit/JumpReplacementWatchpoint.cpp \
157 jit/ThunkGenerators.cpp \
158 parser/Lexer.cpp \
159 parser/Nodes.cpp \
160 parser/ParserArena.cpp \
161 parser/Parser.cpp \
162 parser/SourceProviderCache.cpp \
163 profiler/Profile.cpp \
164 profiler/ProfileGenerator.cpp \
165 profiler/ProfileNode.cpp \
166 profiler/Profiler.cpp \
167 runtime/ArgList.cpp \
168 runtime/Arguments.cpp \
169 runtime/ArrayConstructor.cpp \
170 runtime/ArrayPrototype.cpp \
171 runtime/BooleanConstructor.cpp \
172 runtime/BooleanObject.cpp \
173 runtime/BooleanPrototype.cpp \
174 runtime/CallData.cpp \
175 runtime/CommonIdentifiers.cpp \
176 runtime/Completion.cpp \
177 runtime/ConstructData.cpp \
178 runtime/DateConstructor.cpp \
179 runtime/DateConversion.cpp \
180 runtime/DateInstance.cpp \
181 runtime/DatePrototype.cpp \
182 runtime/ErrorConstructor.cpp \
183 runtime/Error.cpp \
184 runtime/ErrorInstance.cpp \
185 runtime/ErrorPrototype.cpp \
186 runtime/ExceptionHelpers.cpp \
187 runtime/Executable.cpp \
188 runtime/FunctionConstructor.cpp \
189 runtime/FunctionPrototype.cpp \
190 runtime/GCActivityCallback.cpp \
191 runtime/GetterSetter.cpp \
192 runtime/Options.cpp \
193 runtime/Identifier.cpp \
194 runtime/InitializeThreading.cpp \
195 runtime/InternalFunction.cpp \
196 runtime/JSActivation.cpp \
197 runtime/JSAPIValueWrapper.cpp \
198 runtime/JSArray.cpp \
199 runtime/JSCell.cpp \
200 runtime/JSDateMath.cpp \
201 runtime/JSFunction.cpp \
202 runtime/JSBoundFunction.cpp \
203 runtime/JSGlobalData.cpp \
204 runtime/JSGlobalObject.cpp \
205 runtime/JSGlobalObjectFunctions.cpp \
206 runtime/JSGlobalThis.cpp \
207 runtime/JSLock.cpp \
208 runtime/JSNotAnObject.cpp \
209 runtime/JSObject.cpp \
210 runtime/JSONObject.cpp \
211 runtime/JSPropertyNameIterator.cpp \
212 runtime/JSSegmentedVariableObject.cpp \
213 runtime/JSWithScope.cpp \
214 runtime/JSNameScope.cpp \
215 runtime/JSScope.cpp \
216 runtime/JSString.cpp \
217 runtime/JSStringJoiner.cpp \
218 runtime/JSSymbolTableObject.cpp \
219 runtime/JSValue.cpp \
220 runtime/JSVariableObject.cpp \
221 runtime/JSWrapperObject.cpp \
222 runtime/LiteralParser.cpp \
223 runtime/Lookup.cpp \
224 runtime/MathObject.cpp \
225 runtime/MemoryStatistics.cpp \
226 runtime/NameConstructor.cpp \
227 runtime/NameInstance.cpp \
228 runtime/NamePrototype.cpp \
229 runtime/NativeErrorConstructor.cpp \
230 runtime/NativeErrorPrototype.cpp \
231 runtime/NumberConstructor.cpp \
232 runtime/NumberObject.cpp \
233 runtime/NumberPrototype.cpp \
234 runtime/ObjectConstructor.cpp \
235 runtime/ObjectPrototype.cpp \
236 runtime/Operations.cpp \
237 runtime/PropertyDescriptor.cpp \
238 runtime/PropertyNameArray.cpp \
239 runtime/PropertySlot.cpp \
240 runtime/RegExpConstructor.cpp \
241 runtime/RegExpCachedResult.cpp \
242 runtime/RegExpMatchesArray.cpp \
243 runtime/RegExp.cpp \
244 runtime/RegExpObject.cpp \
245 runtime/RegExpPrototype.cpp \
246 runtime/RegExpCache.cpp \
247 runtime/SamplingCounter.cpp \
248 runtime/SmallStrings.cpp \
249 runtime/SparseArrayValueMap.cpp \
250 runtime/StrictEvalActivation.cpp \
251 runtime/StringConstructor.cpp \
252 runtime/StringObject.cpp \
253 runtime/StringPrototype.cpp \
254 runtime/StringRecursionChecker.cpp \
255 runtime/StructureChain.cpp \
256 runtime/Structure.cpp \
257 runtime/SymbolTable.cpp \
258 runtime/TimeoutChecker.cpp \
259 tools/CodeProfile.cpp \
260 tools/CodeProfiling.cpp \
261 yarr/YarrJIT.cpp \
262
263HEADERS += $$files(*.h, true)
264
265*sh4* {
266 QMAKE_CXXFLAGS += -mieee -w
267 QMAKE_CFLAGS += -mieee -w
268}
269
270lessThan(QT_GCC_MAJOR_VERSION, 5) {
271 # GCC 4.5 and before
272 lessThan(QT_GCC_MINOR_VERSION, 6) {
273 # Disable C++0x mode in JSC for those who enabled it in their Qt's mkspec.
274 *-g++*:QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x
275 }
276}
Note: See TracBrowser for help on using the repository browser.