Changeset 182899 in webkit
- Timestamp:
- Apr 16, 2015 12:15:09 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r182885 r182899 1 2015-04-16 Basile Clement <basile_clement@apple.com> 2 3 Extract the allocation profile from JSFunction into a rare object 4 https://bugs.webkit.org/show_bug.cgi?id=143807 5 6 Reviewed by Filip Pizlo. 7 8 * WebKit.xcworkspace/contents.xcworkspacedata: 9 1 10 2015-04-16 Csaba Osztrogonác <ossy@webkit.org> 2 11 -
trunk/Source/JavaScriptCore/CMakeLists.txt
r182871 r182899 449 449 runtime/FunctionHasExecutedCache.cpp 450 450 runtime/FunctionPrototype.cpp 451 runtime/FunctionRareData.cpp 451 452 runtime/GetterSetter.cpp 452 453 runtime/Identifier.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r182890 r182899 1 2015-04-16 Basile Clement <basile_clement@apple.com> 2 3 Extract the allocation profile from JSFunction into a rare object 4 https://bugs.webkit.org/show_bug.cgi?id=143807 5 6 Reviewed by Filip Pizlo. 7 8 The allocation profile is only needed for those functions that are used 9 to create objects with [new]. 10 Extracting it into its own JSCell removes the need for JSFunction and 11 JSCallee to be JSDestructibleObjects, which should improve performances in most 12 cases at the cost of an extra pointer dereference when the allocation profile 13 is actually needed. 14 15 * CMakeLists.txt: 16 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: 17 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: 18 * JavaScriptCore.xcodeproj/project.pbxproj: 19 * dfg/DFGOperations.cpp: 20 * dfg/DFGSpeculativeJIT32_64.cpp: 21 (JSC::DFG::SpeculativeJIT::compile): 22 * dfg/DFGSpeculativeJIT64.cpp: 23 (JSC::DFG::SpeculativeJIT::compile): 24 * jit/JITOpcodes.cpp: 25 (JSC::JIT::emit_op_create_this): 26 * jit/JITOpcodes32_64.cpp: 27 (JSC::JIT::emit_op_create_this): 28 * llint/LowLevelInterpreter32_64.asm: 29 * llint/LowLevelInterpreter64.asm: 30 * runtime/CommonSlowPaths.cpp: 31 (JSC::SLOW_PATH_DECL): 32 * runtime/FunctionRareData.cpp: Added. 33 (JSC::FunctionRareData::create): 34 (JSC::FunctionRareData::destroy): 35 (JSC::FunctionRareData::createStructure): 36 (JSC::FunctionRareData::visitChildren): 37 (JSC::FunctionRareData::FunctionRareData): 38 (JSC::FunctionRareData::~FunctionRareData): 39 (JSC::FunctionRareData::finishCreation): 40 * runtime/FunctionRareData.h: Added. 41 (JSC::FunctionRareData::offsetOfAllocationProfile): 42 (JSC::FunctionRareData::allocationProfile): 43 (JSC::FunctionRareData::allocationStructure): 44 (JSC::FunctionRareData::allocationProfileWatchpointSet): 45 * runtime/JSBoundFunction.cpp: 46 (JSC::JSBoundFunction::destroy): Deleted. 47 * runtime/JSBoundFunction.h: 48 * runtime/JSCallee.cpp: 49 (JSC::JSCallee::destroy): Deleted. 50 * runtime/JSCallee.h: 51 * runtime/JSFunction.cpp: 52 (JSC::JSFunction::JSFunction): 53 (JSC::JSFunction::createRareData): 54 (JSC::JSFunction::visitChildren): 55 (JSC::JSFunction::put): 56 (JSC::JSFunction::defineOwnProperty): 57 (JSC::JSFunction::destroy): Deleted. 58 (JSC::JSFunction::createAllocationProfile): Deleted. 59 * runtime/JSFunction.h: 60 (JSC::JSFunction::offsetOfRareData): 61 (JSC::JSFunction::rareData): 62 (JSC::JSFunction::allocationStructure): 63 (JSC::JSFunction::allocationProfileWatchpointSet): 64 (JSC::JSFunction::offsetOfAllocationProfile): Deleted. 65 (JSC::JSFunction::allocationProfile): Deleted. 66 * runtime/JSFunctionInlines.h: 67 (JSC::JSFunction::JSFunction): 68 * runtime/VM.cpp: 69 (JSC::VM::VM): 70 * runtime/VM.h: 71 1 72 2015-04-16 Csaba Osztrogonác <ossy@webkit.org> 2 73 -
trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
r182871 r182899 717 717 <ClCompile Include="..\runtime\FunctionHasExecutedCache.cpp" /> 718 718 <ClCompile Include="..\runtime\FunctionPrototype.cpp" /> 719 <ClCompile Include="..\runtime\FunctionRareData.cpp" /> 719 720 <ClCompile Include="..\runtime\GetterSetter.cpp" /> 720 721 <ClCompile Include="..\runtime\Identifier.cpp" /> … … 1497 1498 <ClInclude Include="..\runtime\FunctionHasExecutedCache.h" /> 1498 1499 <ClInclude Include="..\runtime\FunctionPrototype.h" /> 1500 <ClInclude Include="..\runtime\FunctionRareData.h" /> 1499 1501 <ClInclude Include="..\runtime\GenericArguments.h" /> 1500 1502 <ClInclude Include="..\runtime\GenericArgumentsInlines.h" /> -
trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
r182871 r182899 607 607 <Filter>runtime</Filter> 608 608 </ClCompile> 609 <ClCompile Include="..\runtime\FunctionRareData.cpp"> 610 <Filter>runtime</Filter> 611 </ClCompile> 609 612 <ClCompile Include="..\runtime\GetterSetter.cpp"> 610 613 <Filter>runtime</Filter> … … 2632 2635 </ClInclude> 2633 2636 <ClInclude Include="..\runtime\FunctionPrototype.h"> 2637 <Filter>runtime</Filter> 2638 </ClInclude> 2639 <ClInclude Include="..\runtime\FunctionRareData.h"> 2634 2640 <Filter>runtime</Filter> 2635 2641 </ClInclude> -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r182871 r182899 954 954 5DBB1525131D0BD70056AD36 /* minidom.js in Copy Support Script */ = {isa = PBXBuildFile; fileRef = 1412110D0A48788700480255 /* minidom.js */; }; 955 955 5DE6E5B30E1728EC00180407 /* create_hash_table in Headers */ = {isa = PBXBuildFile; fileRef = F692A8540255597D01FF60F7 /* create_hash_table */; settings = {ATTRIBUTES = (); }; }; 956 62D2D38F1ADF103F000206C1 /* FunctionRareData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 62D2D38D1ADF103F000206C1 /* FunctionRareData.cpp */; }; 957 62D2D3901ADF103F000206C1 /* FunctionRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 62D2D38E1ADF103F000206C1 /* FunctionRareData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 956 958 6507D29E0E871E5E00D7D896 /* JSTypeInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6507D2970E871E4A00D7D896 /* JSTypeInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; 957 959 651122FD14046A4C002B101D /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; }; … … 2645 2647 5DDDF44614FEE72200B4FB4D /* LLIntDesiredOffsets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntDesiredOffsets.h; path = LLIntOffsets/LLIntDesiredOffsets.h; sourceTree = BUILT_PRODUCTS_DIR; }; 2646 2648 5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitAvailability.h; sourceTree = "<group>"; }; 2649 62D2D38D1ADF103F000206C1 /* FunctionRareData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionRareData.cpp; sourceTree = "<group>"; }; 2650 62D2D38E1ADF103F000206C1 /* FunctionRareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunctionRareData.h; sourceTree = "<group>"; }; 2647 2651 6507D2970E871E4A00D7D896 /* JSTypeInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTypeInfo.h; sourceTree = "<group>"; }; 2648 2652 651122E5140469BA002B101D /* testRegExp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = testRegExp.cpp; sourceTree = "<group>"; }; … … 4398 4402 F692A85C0255597D01FF60F7 /* FunctionPrototype.cpp */, 4399 4403 F692A85D0255597D01FF60F7 /* FunctionPrototype.h */, 4404 62D2D38D1ADF103F000206C1 /* FunctionRareData.cpp */, 4405 62D2D38E1ADF103F000206C1 /* FunctionRareData.h */, 4400 4406 0FE050111AA9091100D33B33 /* GenericArguments.h */, 4401 4407 0FE050121AA9091100D33B33 /* GenericArgumentsInlines.h */, … … 5625 5631 0FB7F39715ED8E4600F167B2 /* Butterfly.h in Headers */, 5626 5632 0FB7F39815ED8E4600F167B2 /* ButterflyInlines.h in Headers */, 5633 62D2D3901ADF103F000206C1 /* FunctionRareData.h in Headers */, 5627 5634 C2FCAE1117A9C24E0034C735 /* BytecodeBasicBlock.h in Headers */, 5628 5635 0F21C27F14BEAA8200ADC64B /* BytecodeConventions.h in Headers */, … … 7446 7453 A5BA15EE182340B400A82E69 /* RemoteInspectorXPCConnection.mm in Sources */, 7447 7454 0F24E55017EE274900ABB217 /* Repatch.cpp in Sources */, 7455 62D2D38F1ADF103F000206C1 /* FunctionRareData.cpp in Sources */, 7448 7456 0F7700921402FF3C0078EB39 /* SamplingCounter.cpp in Sources */, 7449 7457 1429D8850ED21C3D00B89619 /* SamplingTool.cpp in Sources */, -
trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
r182759 r182899 230 230 #endif 231 231 232 return constructEmptyObject(exec, jsCast<JSFunction*>(constructor)-> allocationProfile(exec, inlineCapacity)->structure());232 return constructEmptyObject(exec, jsCast<JSFunction*>(constructor)->rareData(exec, inlineCapacity)->allocationProfile()->structure()); 233 233 } 234 234 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r182827 r182899 3498 3498 GPRReg structureGPR = structure.gpr(); 3499 3499 GPRReg scratchGPR = scratch.gpr(); 3500 // Rare data is only used to access the allocator & structure 3501 // We can avoid using an additional GPR this way 3502 GPRReg rareDataGPR = structureGPR; 3500 3503 3501 3504 MacroAssembler::JumpList slowPath; 3502 3505 3503 m_jit.loadPtr(JITCompiler::Address(calleeGPR, JSFunction::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfAllocator()), allocatorGPR); 3504 m_jit.loadPtr(JITCompiler::Address(calleeGPR, JSFunction::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfStructure()), structureGPR); 3505 slowPath.append(m_jit.branchTestPtr(MacroAssembler::Zero, allocatorGPR)); 3506 m_jit.loadPtr(JITCompiler::Address(calleeGPR, JSFunction::offsetOfRareData()), rareDataGPR); 3507 slowPath.append(m_jit.branchTestPtr(MacroAssembler::Zero, rareDataGPR)); 3508 m_jit.loadPtr(JITCompiler::Address(rareDataGPR, FunctionRareData::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfAllocator()), allocatorGPR); 3509 m_jit.loadPtr(JITCompiler::Address(rareDataGPR, FunctionRareData::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfStructure()), structureGPR); 3506 3510 emitAllocateJSObject(resultGPR, allocatorGPR, structureGPR, TrustedImmPtr(0), scratchGPR, slowPath); 3507 3511 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r182827 r182899 3569 3569 GPRReg structureGPR = structure.gpr(); 3570 3570 GPRReg scratchGPR = scratch.gpr(); 3571 // Rare data is only used to access the allocator & structure 3572 // We can avoid using an additional GPR this way 3573 GPRReg rareDataGPR = structureGPR; 3571 3574 3572 3575 MacroAssembler::JumpList slowPath; 3573 3574 m_jit.loadPtr(JITCompiler::Address(calleeGPR, JSFunction::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfAllocator()), allocatorGPR); 3575 m_jit.loadPtr(JITCompiler::Address(calleeGPR, JSFunction::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfStructure()), structureGPR); 3576 slowPath.append(m_jit.branchTestPtr(MacroAssembler::Zero, allocatorGPR)); 3576 3577 m_jit.loadPtr(JITCompiler::Address(calleeGPR, JSFunction::offsetOfRareData()), rareDataGPR); 3578 slowPath.append(m_jit.branchTestPtr(MacroAssembler::Zero, rareDataGPR)); 3579 m_jit.loadPtr(JITCompiler::Address(rareDataGPR, FunctionRareData::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfAllocator()), allocatorGPR); 3580 m_jit.loadPtr(JITCompiler::Address(rareDataGPR, FunctionRareData::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfStructure()), structureGPR); 3577 3581 emitAllocateJSObject(resultGPR, allocatorGPR, structureGPR, TrustedImmPtr(0), scratchGPR, slowPath); 3578 3582 -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r182759 r182899 696 696 int callee = currentInstruction[2].u.operand; 697 697 RegisterID calleeReg = regT0; 698 RegisterID rareDataReg = regT0; 698 699 RegisterID resultReg = regT0; 699 700 RegisterID allocatorReg = regT1; … … 702 703 703 704 emitGetVirtualRegister(callee, calleeReg); 704 loadPtr(Address(calleeReg, JSFunction::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfAllocator()), allocatorReg); 705 loadPtr(Address(calleeReg, JSFunction::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfStructure()), structureReg); 706 addSlowCase(branchTestPtr(Zero, allocatorReg)); 705 loadPtr(Address(calleeReg, JSFunction::offsetOfRareData()), rareDataReg); 706 addSlowCase(branchTestPtr(Zero, rareDataReg)); 707 loadPtr(Address(rareDataReg, FunctionRareData::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfAllocator()), allocatorReg); 708 loadPtr(Address(rareDataReg, FunctionRareData::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfStructure()), structureReg); 707 709 708 710 emitAllocateJSObject(allocatorReg, structureReg, resultReg, scratchReg); -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r181993 r182899 915 915 int callee = currentInstruction[2].u.operand; 916 916 RegisterID calleeReg = regT0; 917 RegisterID rareDataReg = regT0; 917 918 RegisterID resultReg = regT0; 918 919 RegisterID allocatorReg = regT1; … … 921 922 922 923 emitLoadPayload(callee, calleeReg); 923 loadPtr(Address(calleeReg, JSFunction::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfAllocator()), allocatorReg); 924 loadPtr(Address(calleeReg, JSFunction::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfStructure()), structureReg); 925 addSlowCase(branchTestPtr(Zero, allocatorReg)); 924 loadPtr(Address(calleeReg, JSFunction::offsetOfRareData()), rareDataReg); 925 addSlowCase(branchTestPtr(Zero, rareDataReg)); 926 loadPtr(Address(rareDataReg, FunctionRareData::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfAllocator()), allocatorReg); 927 loadPtr(Address(rareDataReg, FunctionRareData::offsetOfAllocationProfile() + ObjectAllocationProfile::offsetOfStructure()), structureReg); 926 928 927 929 emitAllocateJSObject(allocatorReg, structureReg, resultReg, scratchReg); -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
r182759 r182899 741 741 loadi 8[PC], t0 742 742 loadp PayloadOffset[cfr, t0, 8], t0 743 loadp JSFunction::m_allocationProfile + ObjectAllocationProfile::m_allocator[t0], t1 744 loadp JSFunction::m_allocationProfile + ObjectAllocationProfile::m_structure[t0], t2 745 btpz t1, .opCreateThisSlow 743 loadp JSFunction::m_rareData[t0], t4 744 btpz t4, .opCreateThisSlow 745 loadp FunctionRareData::m_allocationProfile + ObjectAllocationProfile::m_allocator[t4], t1 746 loadp FunctionRareData::m_allocationProfile + ObjectAllocationProfile::m_structure[t4], t2 746 747 allocateJSObject(t1, t2, t0, t3, .opCreateThisSlow) 747 748 loadi 4[PC], t1 -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r182759 r182899 627 627 loadisFromInstruction(2, t0) 628 628 loadp [cfr, t0, 8], t0 629 loadp JSFunction::m_allocationProfile + ObjectAllocationProfile::m_allocator[t0], t1 630 loadp JSFunction::m_allocationProfile + ObjectAllocationProfile::m_structure[t0], t2 631 btpz t1, .opCreateThisSlow 629 loadp JSFunction::m_rareData[t0], t4 630 btpz t4, .opCreateThisSlow 631 loadp FunctionRareData::m_allocationProfile + ObjectAllocationProfile::m_allocator[t4], t1 632 loadp FunctionRareData::m_allocationProfile + ObjectAllocationProfile::m_structure[t4], t2 632 633 allocateJSObject(t1, t2, t0, t3, .opCreateThisSlow) 633 634 loadisFromInstruction(1, t1) -
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
r182759 r182899 237 237 238 238 size_t inlineCapacity = pc[3].u.operand; 239 Structure* structure = constructor-> allocationProfile(exec, inlineCapacity)->structure();239 Structure* structure = constructor->rareData(exec, inlineCapacity)->allocationProfile()->structure(); 240 240 RETURN(constructEmptyObject(exec, structure)); 241 241 } -
trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
r171939 r182899 87 87 } 88 88 89 void JSBoundFunction::destroy(JSCell* cell)90 {91 static_cast<JSBoundFunction*>(cell)->JSBoundFunction::~JSBoundFunction();92 }93 94 89 bool JSBoundFunction::customHasInstance(JSObject* object, ExecState* exec, JSValue value) 95 90 { -
trunk/Source/JavaScriptCore/runtime/JSBoundFunction.h
r182747 r182899 41 41 static JSBoundFunction* create(VM&, JSGlobalObject*, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs, int, const String&); 42 42 43 static void destroy(JSCell*);44 45 43 static bool customHasInstance(JSObject*, ExecState*, JSValue); 46 44 -
trunk/Source/JavaScriptCore/runtime/JSCallee.cpp
r181765 r182899 40 40 const ClassInfo JSCallee::s_info = { "Callee", &Base::s_info, 0, CREATE_METHOD_TABLE(JSCallee) }; 41 41 42 void JSCallee::destroy(JSCell* cell)43 {44 static_cast<JSCallee*>(cell)->JSCallee::~JSCallee();45 }46 47 42 JSCallee::JSCallee(VM& vm, JSGlobalObject* globalObject, Structure* structure) 48 43 : Base(vm, structure) -
trunk/Source/JavaScriptCore/runtime/JSCallee.h
r182747 r182899 27 27 #define JSCallee_h 28 28 29 #include "JSDestructibleObject.h"30 29 #include "JSGlobalObject.h" 30 #include "JSObject.h" 31 31 #include "JSScope.h" 32 32 … … 37 37 38 38 39 class JSCallee : public JS DestructibleObject {39 class JSCallee : public JSNonFinalObject { 40 40 friend class JIT; 41 41 #if ENABLE(DFG_JIT) … … 46 46 47 47 public: 48 typedef JS DestructibleObject Base;48 typedef JSNonFinalObject Base; 49 49 const static unsigned StructureFlags = Base::StructureFlags | ImplementsHasInstance; 50 50 … … 56 56 } 57 57 58 static void destroy(JSCell*);59 60 58 JSScope* scope() 61 59 { -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r182759 r182899 86 86 } 87 87 88 void JSFunction::destroy(JSCell* cell)89 {90 static_cast<JSFunction*>(cell)->JSFunction::~JSFunction();91 }92 93 88 JSFunction::JSFunction(VM& vm, JSGlobalObject* globalObject, Structure* structure) 94 89 : Base(vm, globalObject, structure) 95 90 , m_executable() 96 // We initialize blind so that changes to the prototype after function creation but before97 // the optimizer kicks in don't disable optimizations. Once the optimizer kicks in, the98 // watchpoint will start watching and any changes will both force deoptimization and disable99 // future attempts to optimize. This is necessary because we are guaranteed that the100 // allocation profile is changed exactly once prior to optimizations kicking in. We could be101 // smarter and count the number of times the prototype is clobbered and only optimize if it102 // was clobbered exactly once, but that seems like overkill. In almost all cases it will be103 // clobbered once, and if it's clobbered more than once, that will probably only occur104 // before we started optimizing, anyway.105 , m_allocationProfileWatchpoint(ClearWatchpoint)106 91 { 107 92 } … … 124 109 } 125 110 126 ObjectAllocationProfile* JSFunction::createAllocationProfile(ExecState* exec, size_t inlineCapacity)111 FunctionRareData* JSFunction::createRareData(ExecState* exec, size_t inlineCapacity) 127 112 { 128 113 VM& vm = exec->vm(); … … 130 115 if (!prototype) 131 116 prototype = globalObject()->objectPrototype(); 132 m_allocationProfile.initialize(globalObject()->vm(), this, prototype, inlineCapacity); 133 return &m_allocationProfile; 117 FunctionRareData* rareData = FunctionRareData::create(vm, prototype, inlineCapacity); 118 m_rareData.set(vm, this, rareData); 119 return m_rareData.get(); 134 120 } 135 121 … … 177 163 178 164 visitor.append(&thisObject->m_executable); 179 thisObject->m_allocationProfile.visitAggregate(visitor); 165 if (thisObject->m_rareData) 166 visitor.append(&thisObject->m_rareData); 180 167 } 181 168 … … 403 390 PropertySlot slot(thisObject); 404 391 thisObject->methodTable(exec->vm())->getOwnPropertySlot(thisObject, exec, propertyName, slot); 405 thisObject->m_allocationProfile.clear(); 406 thisObject->m_allocationProfileWatchpoint.fireAll("Store to prototype property of a function"); 407 // Don't allow this to be cached, since a [[Put]] must clear m_allocationProfile. 392 if (thisObject->m_rareData) { 393 thisObject->m_rareData->allocationProfileWatchpointSet().fireAll("Store to prototype property of a function"); 394 thisObject->m_rareData.clear(); 395 } 396 // Don't allow this to be cached, since a [[Put]] must clear m_rareData. 408 397 PutPropertySlot dontCache(thisObject); 409 398 Base::put(thisObject, exec, propertyName, value, dontCache); … … 450 439 PropertySlot slot(thisObject); 451 440 thisObject->methodTable(exec->vm())->getOwnPropertySlot(thisObject, exec, propertyName, slot); 452 thisObject->m_allocationProfile.clear(); 453 thisObject->m_allocationProfileWatchpoint.fireAll("Store to prototype property of a function"); 441 if (thisObject->m_rareData) { 442 thisObject->m_rareData->allocationProfileWatchpointSet().fireAll("Store to prototype property of a function"); 443 thisObject->m_rareData.clear(); 444 } 454 445 return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException); 455 446 } -
trunk/Source/JavaScriptCore/runtime/JSFunction.h
r182759 r182899 25 25 #define JSFunction_h 26 26 27 #include "FunctionRareData.h" 27 28 #include "InternalFunction.h" 28 29 #include "JSCallee.h" 29 30 #include "JSScope.h" 30 #include "ObjectAllocationProfile.h"31 31 #include "Watchpoint.h" 32 32 … … 49 49 50 50 JS_EXPORT_PRIVATE String getCalculatedDisplayName(CallFrame*, JSObject*); 51 51 52 52 class JSFunction : public JSCallee { 53 53 friend class JIT; … … 67 67 68 68 static JSFunction* createBuiltinFunction(VM&, FunctionExecutable*, JSGlobalObject*); 69 70 static void destroy(JSCell*);71 69 72 70 JS_EXPORT_PRIVATE String name(ExecState*); … … 101 99 } 102 100 103 static inline ptrdiff_t offsetOf AllocationProfile()101 static inline ptrdiff_t offsetOfRareData() 104 102 { 105 return OBJECT_OFFSETOF(JSFunction, m_ allocationProfile);103 return OBJECT_OFFSETOF(JSFunction, m_rareData); 106 104 } 107 105 108 ObjectAllocationProfile* allocationProfile(ExecState* exec, unsigned inlineCapacity)106 FunctionRareData* rareData(ExecState* exec, unsigned inlineCapacity) 109 107 { 110 if (UNLIKELY( m_allocationProfile.isNull()))111 return create AllocationProfile(exec, inlineCapacity);112 return &m_allocationProfile;108 if (UNLIKELY(!m_rareData)) 109 return createRareData(exec, inlineCapacity); 110 return m_rareData.get(); 113 111 } 114 112 115 Structure* allocationStructure() { return m_allocationProfile.structure(); } 113 Structure* allocationStructure() 114 { 115 ASSERT(m_rareData); 116 return m_rareData.get()->allocationStructure(); 117 } 116 118 117 119 InlineWatchpointSet& allocationProfileWatchpointSet() 118 120 { 119 return m_allocationProfileWatchpoint; 121 ASSERT(m_rareData); 122 return m_rareData.get()->allocationProfileWatchpointSet(); 120 123 } 121 124 … … 132 135 using Base::finishCreation; 133 136 134 ObjectAllocationProfile* createAllocationProfile(ExecState*, size_t inlineCapacity);137 FunctionRareData* createRareData(ExecState*, size_t inlineCapacity); 135 138 136 139 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); … … 161 164 162 165 WriteBarrier<ExecutableBase> m_executable; 163 ObjectAllocationProfile m_allocationProfile; 164 InlineWatchpointSet m_allocationProfileWatchpoint; 166 WriteBarrier<FunctionRareData> m_rareData; 165 167 }; 166 168 -
trunk/Source/JavaScriptCore/runtime/JSFunctionInlines.h
r182759 r182899 42 42 : Base(vm, scope, scope->globalObject()->functionStructure()) 43 43 , m_executable(vm, this, executable) 44 , m_ allocationProfileWatchpoint(ClearWatchpoint) // See comment in JSFunction.cpp concerning the reason for using ClearWatchpoint as opposed to IsWatched.44 , m_rareData() 45 45 { 46 46 } -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r182831 r182899 232 232 weakMapDataStructure.set(*this, WeakMapData::createStructure(*this, 0, jsNull())); 233 233 inferredValueStructure.set(*this, InferredValue::createStructure(*this, 0, jsNull())); 234 functionRareDataStructure.set(*this, FunctionRareData::createStructure(*this, 0, jsNull())); 234 235 #if ENABLE(PROMISES) 235 236 promiseDeferredStructure.set(*this, JSPromiseDeferred::createStructure(*this, 0, jsNull())); -
trunk/Source/JavaScriptCore/runtime/VM.h
r182759 r182899 272 272 Strong<Structure> weakMapDataStructure; 273 273 Strong<Structure> inferredValueStructure; 274 Strong<Structure> functionRareDataStructure; 274 275 #if ENABLE(PROMISES) 275 276 Strong<Structure> promiseDeferredStructure; -
trunk/WebKit.xcworkspace/contents.xcworkspacedata
r166950 r182899 2 2 <Workspace 3 3 version = "1.0"> 4 <FileRef 5 location = "group:Source/JavaScriptCore/runtime/FunctionRareData.cpp"> 6 </FileRef> 7 <FileRef 8 location = "group:Source/JavaScriptCore/runtime/FunctionRareData.h"> 9 </FileRef> 10 <FileRef 11 location = "group:Source"> 12 </FileRef> 4 13 <FileRef 5 14 location = "group:Source/bmalloc/bmalloc.xcodeproj">
Note: See TracChangeset
for help on using the changeset viewer.