source: webkit/trunk/Source/JavaScriptCore/DerivedSources.make@ 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.
  • Property svn:eol-style set to native
File size: 3.1 KB
Line 
1# Copyright (C) 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions
5# are met:
6#
7# 1. Redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer.
9# 2. Redistributions in binary form must reproduce the above copyright
10# notice, this list of conditions and the following disclaimer in the
11# documentation and/or other materials provided with the distribution.
12# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
13# its contributors may be used to endorse or promote products derived
14# from this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
17# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
20# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27VPATH = \
28 $(JavaScriptCore) \
29 $(JavaScriptCore)/parser \
30 $(JavaScriptCore)/docs \
31 $(JavaScriptCore)/runtime \
32 $(JavaScriptCore)/interpreter \
33 $(JavaScriptCore)/jit \
34#
35
36.PHONY : all
37all : \
38 ArrayConstructor.lut.h \
39 ArrayPrototype.lut.h \
40 BooleanPrototype.lut.h \
41 DateConstructor.lut.h \
42 DatePrototype.lut.h \
43 ErrorPrototype.lut.h \
44 HeaderDetection.h \
45 JSONObject.lut.h \
46 JSGlobalObject.lut.h \
47 KeywordLookup.h \
48 Lexer.lut.h \
49 MathObject.lut.h \
50 NamePrototype.lut.h \
51 NumberConstructor.lut.h \
52 NumberPrototype.lut.h \
53 ObjectConstructor.lut.h \
54 ObjectPrototype.lut.h \
55 RegExpConstructor.lut.h \
56 RegExpPrototype.lut.h \
57 RegExpJitTables.h \
58 RegExpObject.lut.h \
59 StringConstructor.lut.h \
60 StringPrototype.lut.h \
61 docs/bytecode.html \
62#
63
64# lookup tables for classes
65
66%.lut.h: create_hash_table %.cpp
67 $^ -i > $@
68Lexer.lut.h: create_hash_table Keywords.table
69 $^ > $@
70
71docs/bytecode.html: make-bytecode-docs.pl Interpreter.cpp
72 perl $^ $@
73
74# character tables for Yarr
75
76RegExpJitTables.h: create_regex_tables
77 python $^ > $@
78
79KeywordLookup.h: KeywordLookupGenerator.py Keywords.table
80 python $^ > $@
81
82# header detection
83
84ifeq ($(OS),MACOS)
85
86HeaderDetection.h : DerivedSources.make /System/Library/CoreServices/SystemVersion.plist
87 rm -f $@
88 echo "/* This is a generated file. Do not edit. */" > $@
89 if [ -f $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/pthread_machdep.h ]; then echo "#define HAVE_PTHREAD_MACHDEP_H 1" >> $@; else echo >> $@; fi
90
91else
92
93HeaderDetection.h :
94 echo > $@
95
96endif
Note: See TracBrowser for help on using the repository browser.