source: webkit/trunk/Source/JavaScriptCore/Target.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: 7.9 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
29wince* {
30 SOURCES += $$QT_SOURCE_TREE/src/3rdparty/ce-compat/ce_time.c
31}
32
33include(yarr/yarr.pri)
34
35INSTALLDEPS += all
36
37SOURCES += \
38 API/JSBase.cpp \
39 API/JSCallbackConstructor.cpp \
40 API/JSCallbackFunction.cpp \
41 API/JSCallbackObject.cpp \
42 API/JSClassRef.cpp \
43 API/JSContextRef.cpp \
44 API/JSObjectRef.cpp \
45 API/JSStringRef.cpp \
46 API/JSValueRef.cpp \
47 API/OpaqueJSString.cpp \
48 assembler/ARMAssembler.cpp \
49 assembler/ARMv7Assembler.cpp \
50 assembler/MacroAssemblerARM.cpp \
51 assembler/MacroAssemblerSH4.cpp \
52 bytecode/CallLinkInfo.cpp \
53 bytecode/CallLinkStatus.cpp \
54 bytecode/CodeBlock.cpp \
55 bytecode/DFGExitProfile.cpp \
56 bytecode/ExecutionCounter.cpp \
57 bytecode/GetByIdStatus.cpp \
58 bytecode/JumpTable.cpp \
59 bytecode/LazyOperandValueProfile.cpp \
60 bytecode/MethodCallLinkInfo.cpp \
61 bytecode/MethodCallLinkStatus.cpp \
62 bytecode/MethodOfGettingAValueProfile.cpp \
63 bytecode/Opcode.cpp \
64 bytecode/PolymorphicPutByIdList.cpp \
65 bytecode/PredictedType.cpp \
66 bytecode/PutByIdStatus.cpp \
67 bytecode/SamplingTool.cpp \
68 bytecode/StructureStubInfo.cpp \
69 bytecompiler/BytecodeGenerator.cpp \
70 bytecompiler/NodesCodegen.cpp \
71 heap/CopiedSpace.cpp \
72 heap/ConservativeRoots.cpp \
73 heap/DFGCodeBlocks.cpp \
74 heap/WeakSet.cpp \
75 heap/WeakHandleOwner.cpp \
76 heap/WeakBlock.cpp \
77 heap/HandleSet.cpp \
78 heap/HandleStack.cpp \
79 heap/BlockAllocator.cpp \
80 heap/Heap.cpp \
81 heap/MachineStackMarker.cpp \
82 heap/MarkStack.cpp \
83 heap/MarkedAllocator.cpp \
84 heap/MarkedBlock.cpp \
85 heap/MarkedSpace.cpp \
86 heap/VTableSpectrum.cpp \
87 heap/WriteBarrierSupport.cpp \
88 debugger/DebuggerActivation.cpp \
89 debugger/DebuggerCallFrame.cpp \
90 debugger/Debugger.cpp \
91 dfg/DFGAbstractState.cpp \
92 dfg/DFGAssemblyHelpers.cpp \
93 dfg/DFGByteCodeParser.cpp \
94 dfg/DFGCapabilities.cpp \
95 dfg/DFGCFAPhase.cpp \
96 dfg/DFGCFGSimplificationPhase.cpp \
97 dfg/DFGConstantFoldingPhase.cpp \
98 dfg/DFGCorrectableJumpPoint.cpp \
99 dfg/DFGCSEPhase.cpp \
100 dfg/DFGDriver.cpp \
101 dfg/DFGFixupPhase.cpp \
102 dfg/DFGGraph.cpp \
103 dfg/DFGJITCompiler.cpp \
104 dfg/DFGNodeFlags.cpp \
105 dfg/DFGOperations.cpp \
106 dfg/DFGOSREntry.cpp \
107 dfg/DFGOSRExit.cpp \
108 dfg/DFGOSRExitCompiler.cpp \
109 dfg/DFGOSRExitCompiler64.cpp \
110 dfg/DFGOSRExitCompiler32_64.cpp \
111 dfg/DFGPhase.cpp \
112 dfg/DFGPredictionPropagationPhase.cpp \
113 dfg/DFGRedundantPhiEliminationPhase.cpp \
114 dfg/DFGRepatch.cpp \
115 dfg/DFGSpeculativeJIT.cpp \
116 dfg/DFGSpeculativeJIT32_64.cpp \
117 dfg/DFGSpeculativeJIT64.cpp \
118 dfg/DFGThunks.cpp \
119 dfg/DFGValidate.cpp \
120 dfg/DFGVirtualRegisterAllocationPhase.cpp \
121 interpreter/AbstractPC.cpp \
122 interpreter/CallFrame.cpp \
123 interpreter/Interpreter.cpp \
124 interpreter/RegisterFile.cpp \
125 jit/ExecutableAllocatorFixedVMPool.cpp \
126 jit/ExecutableAllocator.cpp \
127 jit/HostCallReturnValue.cpp \
128 jit/JITArithmetic.cpp \
129 jit/JITArithmetic32_64.cpp \
130 jit/JITCall.cpp \
131 jit/JITCall32_64.cpp \
132 jit/JIT.cpp \
133 jit/JITExceptions.cpp \
134 jit/JITOpcodes.cpp \
135 jit/JITOpcodes32_64.cpp \
136 jit/JITPropertyAccess.cpp \
137 jit/JITPropertyAccess32_64.cpp \
138 jit/JITStubs.cpp \
139 jit/ThunkGenerators.cpp \
140 parser/Lexer.cpp \
141 parser/Nodes.cpp \
142 parser/ParserArena.cpp \
143 parser/Parser.cpp \
144 parser/SourceProviderCache.cpp \
145 profiler/Profile.cpp \
146 profiler/ProfileGenerator.cpp \
147 profiler/ProfileNode.cpp \
148 profiler/Profiler.cpp \
149 runtime/ArgList.cpp \
150 runtime/Arguments.cpp \
151 runtime/ArrayConstructor.cpp \
152 runtime/ArrayPrototype.cpp \
153 runtime/BooleanConstructor.cpp \
154 runtime/BooleanObject.cpp \
155 runtime/BooleanPrototype.cpp \
156 runtime/CallData.cpp \
157 runtime/CommonIdentifiers.cpp \
158 runtime/Completion.cpp \
159 runtime/ConstructData.cpp \
160 runtime/DateConstructor.cpp \
161 runtime/DateConversion.cpp \
162 runtime/DateInstance.cpp \
163 runtime/DatePrototype.cpp \
164 runtime/ErrorConstructor.cpp \
165 runtime/Error.cpp \
166 runtime/ErrorInstance.cpp \
167 runtime/ErrorPrototype.cpp \
168 runtime/ExceptionHelpers.cpp \
169 runtime/Executable.cpp \
170 runtime/FunctionConstructor.cpp \
171 runtime/FunctionPrototype.cpp \
172 runtime/GCActivityCallback.cpp \
173 runtime/GetterSetter.cpp \
174 runtime/Options.cpp \
175 runtime/Identifier.cpp \
176 runtime/InitializeThreading.cpp \
177 runtime/InternalFunction.cpp \
178 runtime/JSActivation.cpp \
179 runtime/JSAPIValueWrapper.cpp \
180 runtime/JSArray.cpp \
181 runtime/JSCell.cpp \
182 runtime/JSDateMath.cpp \
183 runtime/JSFunction.cpp \
184 runtime/JSBoundFunction.cpp \
185 runtime/JSGlobalData.cpp \
186 runtime/JSGlobalObject.cpp \
187 runtime/JSGlobalObjectFunctions.cpp \
188 runtime/JSGlobalThis.cpp \
189 runtime/JSLock.cpp \
190 runtime/JSNotAnObject.cpp \
191 runtime/JSObject.cpp \
192 runtime/JSONObject.cpp \
193 runtime/JSPropertyNameIterator.cpp \
194 runtime/JSStaticScopeObject.cpp \
195 runtime/JSString.cpp \
196 runtime/JSStringJoiner.cpp \
197 runtime/JSValue.cpp \
198 runtime/JSVariableObject.cpp \
199 runtime/JSWrapperObject.cpp \
200 runtime/LiteralParser.cpp \
201 runtime/Lookup.cpp \
202 runtime/MathObject.cpp \
203 runtime/NameConstructor.cpp \
204 runtime/NameInstance.cpp \
205 runtime/NamePrototype.cpp \
206 runtime/NativeErrorConstructor.cpp \
207 runtime/NativeErrorPrototype.cpp \
208 runtime/NumberConstructor.cpp \
209 runtime/NumberObject.cpp \
210 runtime/NumberPrototype.cpp \
211 runtime/ObjectConstructor.cpp \
212 runtime/ObjectPrototype.cpp \
213 runtime/Operations.cpp \
214 runtime/PropertyDescriptor.cpp \
215 runtime/PropertyNameArray.cpp \
216 runtime/PropertySlot.cpp \
217 runtime/RegExpConstructor.cpp \
218 runtime/RegExpCachedResult.cpp \
219 runtime/RegExpMatchesArray.cpp \
220 runtime/RegExp.cpp \
221 runtime/RegExpObject.cpp \
222 runtime/RegExpPrototype.cpp \
223 runtime/RegExpCache.cpp \
224 runtime/SamplingCounter.cpp \
225 runtime/ScopeChain.cpp \
226 runtime/SmallStrings.cpp \
227 runtime/StrictEvalActivation.cpp \
228 runtime/StringConstructor.cpp \
229 runtime/StringObject.cpp \
230 runtime/StringPrototype.cpp \
231 runtime/StringRecursionChecker.cpp \
232 runtime/StructureChain.cpp \
233 runtime/Structure.cpp \
234 runtime/TimeoutChecker.cpp \
235 runtime/UString.cpp \
236 tools/CodeProfile.cpp \
237 tools/CodeProfiling.cpp \
238 yarr/YarrJIT.cpp \
239
240*sh4* {
241 QMAKE_CXXFLAGS += -mieee -w
242 QMAKE_CFLAGS += -mieee -w
243}
244
245lessThan(QT_GCC_MAJOR_VERSION, 5) {
246 # GCC 4.5 and before
247 lessThan(QT_GCC_MINOR_VERSION, 6) {
248 # Disable C++0x mode in JSC for those who enabled it in their Qt's mkspec.
249 *-g++*:QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x
250 }
251
252 # GCC 4.6 and after.
253 greaterThan(QT_GCC_MINOR_VERSION, 5) {
254 if (!contains(QMAKE_CXXFLAGS, -std=c++0x) && !contains(QMAKE_CXXFLAGS, -std=gnu++0x)) {
255 # We need to deactivate those warnings because some names conflicts with upcoming c++0x types (e.g.nullptr).
256 QMAKE_CFLAGS_WARN_ON += -Wno-c++0x-compat
257 QMAKE_CXXFLAGS_WARN_ON += -Wno-c++0x-compat
258 QMAKE_CFLAGS += -Wno-c++0x-compat
259 QMAKE_CXXFLAGS += -Wno-c++0x-compat
260 }
261 }
262}
Note: See TracBrowser for help on using the repository browser.