Changeset 173541 in webkit
- Timestamp:
- Sep 11, 2014, 2:52:33 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 added
- 10 edited
-
JavaScriptCore/CMakeLists.txt (modified) (3 diffs)
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (modified) (2 diffs)
-
JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (modified) (2 diffs)
-
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (modified) (6 diffs)
-
JavaScriptCore/runtime/JSCallee.cpp (added)
-
JavaScriptCore/runtime/JSCallee.h (added)
-
JavaScriptCore/runtime/JSFunction.cpp (modified) (3 diffs)
-
JavaScriptCore/runtime/JSFunction.h (modified) (6 diffs)
-
JavaScriptCore/runtime/JSFunctionInlines.h (modified) (1 diff)
-
JavaScriptCore/runtime/JSType.h (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/ForwardingHeaders/runtime/JSCallee.h (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r173517 r173541 439 439 runtime/JSGlobalObjectDebuggable.cpp 440 440 runtime/JSCJSValue.cpp 441 runtime/JSCallee.cpp 441 442 runtime/JSCell.cpp 442 443 runtime/JSConsole.cpp … … 444 445 runtime/JSDataViewPrototype.cpp 445 446 runtime/JSDateMath.cpp 447 runtime/JSEnvironmentRecord.cpp 446 448 runtime/JSFunction.cpp 447 449 runtime/JSGlobalObject.cpp … … 472 474 runtime/JSTypedArrayPrototypes.cpp 473 475 runtime/JSTypedArrays.cpp 474 runtime/JSEnvironmentRecord.cpp475 476 runtime/JSWeakMap.cpp 476 477 runtime/JSWithScope.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r173534 r173541 1 2014-09-10 Michael Saboff <msaboff@apple.com> 2 3 Move JSScope out of JSFunction into separate JSCallee class 4 https://bugs.webkit.org/show_bug.cgi?id=136725 5 6 Reviewed by Oliver Hunt. 7 8 Created new JSCallee class that contains a JSScope*. Changed JSFunction to inherit from 9 JSCallee. 10 11 * CMakeLists.txt: 12 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: 13 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: 14 * JavaScriptCore.xcodeproj/project.pbxproj: 15 Build changes. Added JSCallee.cpp and JSCallee.h. 16 17 * runtime/JSCallee.cpp: Added. 18 (JSC::JSCallee::create): 19 (JSC::JSCallee::destroy): 20 (JSC::JSCallee::JSCallee): 21 (JSC::JSCallee::finishCreation): 22 (JSC::JSCallee::visitChildren): 23 (JSC::JSCallee::getOwnPropertySlot): Pass through wrapper function. 24 (JSC::JSCallee::getOwnNonIndexPropertyNames): Pass through wrapper function. 25 (JSC::JSCallee::put): Pass through wrapper function. 26 (JSC::JSCallee::deleteProperty): Pass through wrapper function. 27 (JSC::JSCallee::defineOwnProperty): Pass through wrapper function. 28 29 * runtime/JSCallee.h: Added. 30 (JSC::JSCallee::scope): 31 (JSC::JSCallee::scopeUnchecked): 32 (JSC::JSCallee::setScope): 33 (JSC::JSCallee::createStructure): 34 (JSC::JSCallee::offsetOfScopeChain): 35 36 * runtime/JSFunction.cpp: 37 (JSC::JSFunction::JSFunction): 38 (JSC::JSFunction::addNameScopeIfNeeded): 39 (JSC::JSFunction::visitChildren): 40 * runtime/JSFunction.h: 41 (JSC::JSFunction::scope): Deleted. 42 (JSC::JSFunction::scopeUnchecked): Deleted. 43 (JSC::JSFunction::setScope): Deleted. 44 (JSC::JSFunction::offsetOfScopeChain): Deleted. 45 * runtime/JSFunctionInlines.h: 46 (JSC::JSFunction::JSFunction): 47 Changed to reference JSCallee and its methods. 48 49 * runtime/JSType.h: Added JSCallee as a TypeEnum. 50 1 51 2014-09-11 Filip Pizlo <fpizlo@apple.com> 2 52 -
trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
r173517 r173541 712 712 <ClCompile Include="..\runtime\JSBoundFunction.cpp" /> 713 713 <ClCompile Include="..\runtime\JSCJSValue.cpp" /> 714 <ClCompile Include="..\runtime\JSCallee.cpp" /> 714 715 <ClCompile Include="..\runtime\JSCell.cpp" /> 715 716 <ClCompile Include="..\runtime\JSConsole.cpp" /> … … 1468 1469 <ClInclude Include="..\runtime\JSCJSValue.h" /> 1469 1470 <ClInclude Include="..\runtime\JSCJSValueInlines.h" /> 1471 <ClInclude Include="..\runtime\JSCallee.h" /> 1470 1472 <ClInclude Include="..\runtime\JSCell.h" /> 1471 1473 <ClInclude Include="..\runtime\JSConsole.h" /> -
trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
r173517 r173541 634 634 <Filter>runtime</Filter> 635 635 </ClCompile> 636 <ClCompile Include="..\runtime\JSCallee.cpp"> 637 <Filter>runtime</Filter> 638 </ClCompile> 636 639 <ClCompile Include="..\runtime\JSCell.cpp"> 637 640 <Filter>runtime</Filter> … … 2587 2590 </ClInclude> 2588 2591 <ClInclude Include="..\runtime\JSBoundFunction.h"> 2592 <Filter>runtime</Filter> 2593 </ClInclude> 2594 <ClInclude Include="..\runtime\JSCallee.h"> 2589 2595 <Filter>runtime</Filter> 2590 2596 </ClInclude> -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r173517 r173541 1170 1170 6553A33217A1F1EE008CF6F3 /* CommonSlowPathsExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6553A33017A1F1EE008CF6F3 /* CommonSlowPathsExceptions.h */; }; 1171 1171 655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 655EB29A10CE2581001A990E /* NodesCodegen.cpp */; }; 1172 657CF45819BF6662004ACBF2 /* JSCallee.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 657CF45619BF6662004ACBF2 /* JSCallee.cpp */; }; 1173 657CF45919BF6662004ACBF2 /* JSCallee.h in Headers */ = {isa = PBXBuildFile; fileRef = 657CF45719BF6662004ACBF2 /* JSCallee.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1174 657CF45A19C11390004ACBF2 /* JSCallee.h in Headers */ = {isa = PBXBuildFile; fileRef = 657CF45719BF6662004ACBF2 /* JSCallee.h */; }; 1172 1175 658D3A5619638268003C45D6 /* VMEntryRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 658D3A5519638268003C45D6 /* VMEntryRecord.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1173 1176 65C02850171795E200351E35 /* ARMv7Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65C0284F171795E200351E35 /* ARMv7Disassembler.cpp */; }; … … 2799 2802 65621E6B089E859700760F35 /* PropertySlot.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PropertySlot.cpp; sourceTree = "<group>"; tabWidth = 8; }; 2800 2803 65621E6C089E859700760F35 /* PropertySlot.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = PropertySlot.h; sourceTree = "<group>"; tabWidth = 8; }; 2804 657CF45619BF6662004ACBF2 /* JSCallee.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCallee.cpp; sourceTree = "<group>"; }; 2805 657CF45719BF6662004ACBF2 /* JSCallee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCallee.h; sourceTree = "<group>"; }; 2801 2806 65860177185A8F5E00030EEE /* MaxFrameExtentForSlowPathCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MaxFrameExtentForSlowPathCall.h; sourceTree = "<group>"; }; 2802 2807 658D3A5519638268003C45D6 /* VMEntryRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = VMEntryRecord.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; … … 4499 4504 86FA9E8F142BBB2D001773B7 /* JSBoundFunction.cpp */, 4500 4505 86FA9E90142BBB2E001773B7 /* JSBoundFunction.h */, 4506 657CF45619BF6662004ACBF2 /* JSCallee.cpp */, 4507 657CF45719BF6662004ACBF2 /* JSCallee.h */, 4501 4508 BC7F8FBA0E19D1EF008632C0 /* JSCell.cpp */, 4502 4509 BC1167D80E19BCC9008066DD /* JSCell.h */, … … 5529 5536 5540771B18DA58AD00EFF7F2 /* JSArgumentsIterator.h in Headers */, 5530 5537 5540772218DA58AD00EFF7F2 /* JSArrayIterator.h in Headers */, 5538 657CF45A19C11390004ACBF2 /* JSCallee.h in Headers */, 5531 5539 5540774818DA58AD00EFF7F2 /* JSGlobalObjectDebuggable.h in Headers */, 5532 5540 5540774A18DA58AD00EFF7F2 /* JSGlobalObjectFunctions.h in Headers */, … … 6222 6230 140D17D70E8AD4A9000CD17D /* JSBasePrivate.h in Headers */, 6223 6231 86FA9E92142BBB2E001773B7 /* JSBoundFunction.h in Headers */, 6232 657CF45919BF6662004ACBF2 /* JSCallee.h in Headers */, 6224 6233 BC18C4190E16F5CD00B34460 /* JSCallbackConstructor.h in Headers */, 6225 6234 BC18C41A0E16F5CD00B34460 /* JSCallbackFunction.h in Headers */, … … 7491 7500 14ABDF600A437FEF00ECCA01 /* JSCallbackObject.cpp in Sources */, 7492 7501 A7D801A81880D6A80026C39B /* JSCBuiltins.cpp in Sources */, 7502 657CF45819BF6662004ACBF2 /* JSCallee.cpp in Sources */, 7493 7503 147F39D1107EC37600427A48 /* JSCell.cpp in Sources */, 7494 7504 147F39D6107EC37600427A48 /* JSCJSValue.cpp in Sources */, -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r172176 r173541 86 86 87 87 JSFunction::JSFunction(VM& vm, JSGlobalObject* globalObject, Structure* structure) 88 : Base(vm, structure)88 : Base(vm, globalObject, structure) 89 89 , m_executable() 90 , m_scope(vm, this, globalObject)91 90 // We initialize blind so that changes to the prototype after function creation but before 92 91 // the optimizer kicks in don't disable optimizations. Once the optimizer kicks in, the … … 118 117 if (!functionNameScopeIsDynamic(executable->usesEval(), executable->isStrictMode())) 119 118 return; 120 m_scope.set(vm, this, JSNameScope::create(vm, m_scope->globalObject(), executable->name(), this, ReadOnly | DontDelete, m_scope.get()));119 setScope(vm, JSNameScope::create(vm, scope()->globalObject(), executable->name(), this, ReadOnly | DontDelete, scope())); 121 120 } 122 121 … … 181 180 Base::visitChildren(thisObject, visitor); 182 181 183 visitor.append(&thisObject->m_scope);184 182 visitor.append(&thisObject->m_executable); 185 183 thisObject->m_allocationProfile.visitAggregate(visitor); -
trunk/Source/JavaScriptCore/runtime/JSFunction.h
r173517 r173541 26 26 27 27 #include "InternalFunction.h" 28 #include "JS DestructibleObject.h"28 #include "JSCallee.h" 29 29 #include "JSScope.h" 30 30 #include "ObjectAllocationProfile.h" … … 50 50 JS_EXPORT_PRIVATE String getCalculatedDisplayName(CallFrame*, JSObject*); 51 51 52 class JSFunction : public JS DestructibleObject{52 class JSFunction : public JSCallee { 53 53 friend class JIT; 54 54 friend class DFG::SpeculativeJIT; … … 57 57 58 58 public: 59 typedef JS DestructibleObjectBase;59 typedef JSCallee Base; 60 60 61 61 JS_EXPORT_PRIVATE static JSFunction* create(VM&, JSGlobalObject*, int length, const String& name, NativeFunction, Intrinsic = NoIntrinsic, NativeFunction nativeConstructor = callHostFunctionAsConstructor); … … 77 77 const String calculatedDisplayName(ExecState*); 78 78 79 JSScope* scope()80 {81 ASSERT(!isHostFunctionNonInline());82 return m_scope.get();83 }84 // This method may be called for host functins, in which case it85 // will return an arbitrary value. This should only be used for86 // optimized paths in which the return value does not matter for87 // host functions, and checking whether the function is a host88 // function is deemed too expensive.89 JSScope* scopeUnchecked()90 {91 return m_scope.get();92 }93 void setScope(VM& vm, JSScope* scope)94 {95 ASSERT(!isHostFunctionNonInline());96 m_scope.set(vm, this, scope);97 }98 79 void addNameScopeIfNeeded(VM&); 99 80 … … 119 100 static ConstructType getConstructData(JSCell*, ConstructData&); 120 101 static CallType getCallData(JSCell*, CallData&); 121 122 static inline ptrdiff_t offsetOfScopeChain()123 {124 return OBJECT_OFFSETOF(JSFunction, m_scope);125 }126 102 127 103 static inline ptrdiff_t offsetOfExecutable() … … 183 159 184 160 WriteBarrier<ExecutableBase> m_executable; 185 WriteBarrier<JSScope> m_scope;186 161 ObjectAllocationProfile m_allocationProfile; 187 162 InlineWatchpointSet m_allocationProfileWatchpoint; -
trunk/Source/JavaScriptCore/runtime/JSFunctionInlines.h
r169703 r173541 33 33 34 34 inline JSFunction::JSFunction(VM& vm, FunctionExecutable* executable, JSScope* scope) 35 : Base(vm, scope ->globalObject()->functionStructure())35 : Base(vm, scope, scope->globalObject()->functionStructure()) 36 36 , m_executable(vm, this, executable) 37 , m_scope(vm, this, scope)38 37 , m_allocationProfileWatchpoint(ClearWatchpoint) // See comment in JSFunction.cpp concerning the reason for using ClearWatchpoint as opposed to IsWatched. 39 38 { -
trunk/Source/JavaScriptCore/runtime/JSType.h
r171660 r173541 51 51 ObjectType, 52 52 FinalObjectType, 53 JSCalleeType, 53 54 JSFunctionType, 54 55 NameInstanceType, -
trunk/Source/WebCore/ChangeLog
r173539 r173541 1 2014-09-10 Michael Saboff <msaboff@apple.com> 2 3 Move JSScope out of JSFunction into separate JSCallee class 4 https://bugs.webkit.org/show_bug.cgi?id=136725 5 6 Reviewed by Oliver Hunt. 7 8 Created new JSCallee class that contains a JSScope*. Changed JSFunction to inherit from 9 JSCallee. 10 11 * ForwardingHeaders/runtime/JSCallee.h: New forwarding header. 12 1 13 2014-09-11 Roger Fong <roger_fong@apple.com> 2 14
Note:
See TracChangeset
for help on using the changeset viewer.