source: webkit/trunk/Source/JavaScriptCore/DerivedSources.pri@ 117859

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

Add support for private names
https://bugs.webkit.org/show_bug.cgi?id=86509

Reviewed by Oliver Hunt.

The spec isn't final, but we can start adding support to allow property maps
to contain keys that aren't identifiers.

Source/JavaScriptCore:

  • API/JSCallbackObjectFunctions.h:

(JSC::::getOwnPropertySlot):
(JSC::::put):
(JSC::::deleteProperty):
(JSC::::getStaticValue):
(JSC::::staticFunctionGetter):
(JSC::::callbackGetter):

  • Only expose public named properties over the JSC API.
  • CMakeLists.txt:
  • DerivedSources.make:
  • DerivedSources.pri:
  • GNUmakefile.list.am:
  • JavaScriptCore.gypi:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Target.pri:
    • Added new files to build system.
  • dfg/DFGOperations.cpp:

(JSC::DFG::operationPutByValInternal):

  • Added support for property access with name objects.
  • interpreter/CallFrame.h:

(JSC::ExecState::privateNamePrototypeTable):

  • Added hash table for NamePrototype
  • interpreter/Interpreter.cpp:

(JSC::Interpreter::privateExecute):

  • Added support for property access with name objects.
  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • Added support for property access with name objects.
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::getByVal):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • runtime/CommonSlowPaths.h:

(JSC::CommonSlowPaths::opIn):

  • runtime/JSActivation.cpp:

(JSC::JSActivation::symbolTableGet):
(JSC::JSActivation::symbolTablePut):
(JSC::JSActivation::symbolTablePutWithAttributes):

  • Added support for property access with name objects.
  • runtime/JSGlobalData.cpp:

(JSC):
(JSC::JSGlobalData::JSGlobalData):
(JSC::JSGlobalData::~JSGlobalData):

  • runtime/JSGlobalData.h:

(JSGlobalData):

  • Added hash table for NamePrototype
  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::reset):

  • runtime/JSGlobalObject.h:

(JSGlobalObject):
(JSC::JSGlobalObject::privateNameStructure):
(JSC::JSGlobalObject::symbolTableHasProperty):

  • Added new global properties.
  • runtime/JSType.h:
  • runtime/JSTypeInfo.h:

(JSC::TypeInfo::isName):

  • Added type for NameInstances, for fast isName check.
  • runtime/JSVariableObject.cpp:

(JSC::JSVariableObject::deleteProperty):
(JSC::JSVariableObject::symbolTableGet):

  • runtime/JSVariableObject.h:

(JSC::JSVariableObject::symbolTableGet):
(JSC::JSVariableObject::symbolTablePut):
(JSC::JSVariableObject::symbolTablePutWithAttributes):

  • symbol table lookup should take a PropertyName.
  • runtime/Lookup.cpp:

(JSC::setUpStaticFunctionSlot):

  • runtime/Lookup.h:

(JSC::HashTable::entry):

  • entry lookup should take a PropertyName.
  • runtime/NameConstructor.cpp: Added.

(JSC):
(JSC::NameConstructor::NameConstructor):
(JSC::NameConstructor::finishCreation):
(JSC::constructPrivateName):
(JSC::NameConstructor::getConstructData):
(JSC::NameConstructor::getCallData):

  • runtime/NameConstructor.h: Added.

(JSC):
(NameConstructor):
(JSC::NameConstructor::create):
(JSC::NameConstructor::createStructure):

  • Added constructor.
  • runtime/NameInstance.cpp: Added.

(JSC):
(JSC::NameInstance::NameInstance):
(JSC::NameInstance::destroy):

  • runtime/NameInstance.h: Added.

(JSC):
(NameInstance):
(JSC::NameInstance::createStructure):
(JSC::NameInstance::create):
(JSC::NameInstance::privateName):
(JSC::NameInstance::nameString):
(JSC::NameInstance::finishCreation):
(JSC::isName):

  • Added instance.
  • runtime/NamePrototype.cpp: Added.

(JSC):
(JSC::NamePrototype::NamePrototype):
(JSC::NamePrototype::finishCreation):
(JSC::NamePrototype::getOwnPropertySlot):
(JSC::NamePrototype::getOwnPropertyDescriptor):
(JSC::privateNameProtoFuncToString):

  • runtime/NamePrototype.h: Added.

(JSC):
(NamePrototype):
(JSC::NamePrototype::create):
(JSC::NamePrototype::createStructure):

  • Added prototype.
  • runtime/PrivateName.h: Added.

(JSC):
(PrivateName):
(JSC::PrivateName::PrivateName):
(JSC::PrivateName::uid):

  • A private name object holds a StringImpl that can be used as a unique key in a property map.
  • runtime/PropertyMapHashTable.h:

(JSC::PropertyTable::find):
(JSC::PropertyTable::findWithString):

  • Strings should only match keys in the table that are identifiers.
  • runtime/PropertyName.h:

(JSC::PropertyName::PropertyName):
(PropertyName):
(JSC::PropertyName::uid):
(JSC::PropertyName::publicName):
(JSC::PropertyName::asIndex):
(JSC::operator==):
(JSC::operator!=):

  • replaced impl() & ustring() with uid() [to get the raw impl] and publicName() [impl or null, if not an identifier].
  • runtime/Structure.cpp:

(JSC::Structure::despecifyDictionaryFunction):
(JSC::Structure::addPropertyTransitionToExistingStructure):
(JSC::Structure::addPropertyTransition):
(JSC::Structure::attributeChangeTransition):
(JSC::Structure::get):
(JSC::Structure::despecifyFunction):
(JSC::Structure::putSpecificValue):
(JSC::Structure::remove):
(JSC::Structure::getPropertyNamesFromStructure):

  • runtime/Structure.h:

(JSC::Structure::get):

  • call uid() to get a PropertyName raw impl, for use as a key.

Source/WebCore:

Test: fast/js/names.html

  • bindings/js/JSCSSStyleDeclarationCustom.cpp:

(WebCore::cssPropertyIDForJSCSSPropertyName):

  • bindings/js/JSDOMBinding.cpp:

(WebCore::findAtomicString):
(WebCore::objectToStringFunctionGetter):

  • bindings/js/JSDOMBinding.h:

(WebCore::propertyNameToString):
(WebCore::propertyNameToAtomicString):

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::nonCachingStaticFunctionGetter):

  • bindings/js/JSHistoryCustom.cpp:

(WebCore::nonCachingStaticBackFunctionGetter):
(WebCore::nonCachingStaticForwardFunctionGetter):
(WebCore::nonCachingStaticGoFunctionGetter):

  • bindings/js/JSLocationCustom.cpp:

(WebCore::nonCachingStaticReplaceFunctionGetter):
(WebCore::nonCachingStaticReloadFunctionGetter):
(WebCore::nonCachingStaticAssignFunctionGetter):

  • bridge/c/c_class.cpp:

(JSC::Bindings::CClass::methodsNamed):
(JSC::Bindings::CClass::fieldNamed):

  • bridge/c/c_instance.cpp:

(JSC::Bindings::CInstance::getMethod):

  • bridge/jni/jsc/JavaClassJSC.cpp:

(JavaClass::methodsNamed):
(JavaClass::fieldNamed):

  • bridge/jni/jsc/JavaInstanceJSC.cpp:
  • bridge/objc/objc_class.mm:

(JSC::Bindings::ObjcClass::methodsNamed):
(JSC::Bindings::ObjcClass::fieldNamed):
(JSC::Bindings::ObjcClass::fallbackObject):

  • bridge/objc/objc_instance.mm:

(ObjcInstance::setValueOfUndefinedField):
(ObjcInstance::getValueOfUndefinedField):

  • Removed PropertyName::impl(), call publicName() to get the string associated with a name.

Source/WebKit/mac:

  • Plugins/Hosted/ProxyInstance.mm:

(WebKit::ProxyClass::methodsNamed):
(WebKit::ProxyClass::fieldNamed):
(WebKit::ProxyInstance::getMethod):
(WebKit::ProxyInstance::methodsNamed):
(WebKit::ProxyInstance::fieldNamed):

  • Removed PropertyName::impl(), call publicName() to get the string associated with a name.

Source/WebKit2:

  • WebProcess/Plugins/Netscape/JSNPObject.cpp:

(WebKit::npIdentifierFromIdentifier):
(WebKit::JSNPObject::methodGetter):

  • Removed PropertyName::impl(), call publicName() to get the string associated with a name.

Source/WTF:

  • wtf/text/StringImpl.h:

(WTF::StringImpl::StringImpl):
(StringImpl):
(WTF::StringImpl::createEmptyUnique):
(WTF::StringImpl::isEmptyUnique):

  • Allow empty string impls to be allocated, which can be used as unique keys.

LayoutTests:

  • fast/js/names-expected.txt: Added.
  • fast/js/names.html: Added.
  • fast/js/script-tests/names.js: Added.
    • Added test cases.
File size: 2.8 KB
Line 
1# -------------------------------------------------------------------
2# Derived sources for JavaScriptSource
3#
4# See 'Tools/qmake/README' for an overview of the build system
5# -------------------------------------------------------------------
6
7TEMPLATE = derived
8
9LUT_FILES += \
10 runtime/ArrayConstructor.cpp \
11 runtime/ArrayPrototype.cpp \
12 runtime/BooleanPrototype.cpp \
13 runtime/DateConstructor.cpp \
14 runtime/DatePrototype.cpp \
15 runtime/ErrorPrototype.cpp \
16 runtime/JSGlobalObject.cpp \
17 runtime/JSONObject.cpp \
18 runtime/MathObject.cpp \
19 runtime/NamePrototype.cpp \
20 runtime/NumberConstructor.cpp \
21 runtime/NumberPrototype.cpp \
22 runtime/ObjectConstructor.cpp \
23 runtime/ObjectPrototype.cpp \
24 runtime/RegExpConstructor.cpp \
25 runtime/RegExpObject.cpp \
26 runtime/RegExpPrototype.cpp \
27 runtime/StringConstructor.cpp \
28 runtime/StringPrototype.cpp \
29
30KEYWORDLUT_FILES += \
31 parser/Keywords.table
32
33JIT_STUB_FILES += \
34 jit/JITStubs.cpp
35
36# GENERATOR 1-A: LUT creator
37lut.output = ${QMAKE_FILE_BASE}.lut.h
38lut.input = LUT_FILES
39lut.script = $$PWD/create_hash_table
40lut.commands = perl $$lut.script ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
41lut.depends = ${QMAKE_FILE_NAME}
42GENERATORS += lut
43
44# GENERATOR 1-B: particular LUT creator (for 1 file only)
45keywordlut.output = Lexer.lut.h
46keywordlut.input = KEYWORDLUT_FILES
47keywordlut.script = $$PWD/create_hash_table
48keywordlut.commands = perl $$keywordlut.script ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
49keywordlut.depends = ${QMAKE_FILE_NAME}
50GENERATORS += keywordlut
51
52# GENERATOR 2-A: JIT Stub functions for RVCT
53rvctstubs.output = Generated${QMAKE_FILE_BASE}_RVCT.h
54rvctstubs.script = $$PWD/create_jit_stubs
55rvctstubs.commands = perl -i $$rvctstubs.script --prefix RVCT ${QMAKE_FILE_NAME} > ${QMAKE_FILE_OUT}
56rvctstubs.depends = ${QMAKE_FILE_NAME}
57rvctstubs.input = JIT_STUB_FILES
58rvctstubs.CONFIG += no_link
59GENERATORS += rvctstubs
60
61# GENERATOR 2-B: JIT Stub functions for MSVC
62msvcstubs.output = Generated${QMAKE_FILE_BASE}_MSVC.asm
63msvcstubs.script = $$PWD/create_jit_stubs
64msvcstubs.commands = perl -i $$msvcstubs.script --prefix MSVC ${QMAKE_FILE_NAME} > ${QMAKE_FILE_OUT}
65msvcstubs.depends = ${QMAKE_FILE_NAME}
66msvcstubs.input = JIT_STUB_FILES
67msvcstubs.CONFIG += no_link
68GENERATORS += msvcstubs
69
70#GENERATOR: "RegExpJitTables.h": tables used by Yarr
71retgen.output = RegExpJitTables.h
72retgen.script = $$PWD/create_regex_tables
73retgen.input = retgen.script
74retgen.commands = python $$retgen.script > ${QMAKE_FILE_OUT}
75GENERATORS += retgen
76
77#GENERATOR: "KeywordLookup.h": decision tree used by the lexer
78klgen.output = KeywordLookup.h
79klgen.script = $$PWD/KeywordLookupGenerator.py
80klgen.input = KEYWORDLUT_FILES
81klgen.commands = python $$klgen.script ${QMAKE_FILE_NAME} > ${QMAKE_FILE_OUT}
82GENERATORS += klgen
Note: See TracBrowser for help on using the repository browser.