Title: [248237] releases/WebKitGTK/webkit-2.24
- Revision
- 248237
- Author
- [email protected]
- Date
- 2019-08-03 20:23:25 -0700 (Sat, 03 Aug 2019)
Log Message
Merge r246505 - [JSC] Introduce DisposableCallSiteIndex to enforce type-safety
https://bugs.webkit.org/show_bug.cgi?id=197378
Reviewed by Saam Barati.
JSTests:
* stress/disposable-call-site-index-with-call-and-this.js: Added.
(foo):
(bar):
* stress/disposable-call-site-index.js: Added.
(foo):
(bar):
Source/_javascript_Core:
Some of CallSiteIndex are disposable. This is because some of CallSiteIndex are allocated and freed at runtime (not DFG/FTL compile time).
The example is CallSiteIndex for exception handler in GCAwareJITStubRoutineWithExceptionHandler. If we do not allocate and free CallSiteIndex,
we will create a new CallSiteIndex continuously and leak memory.
The other CallSiteIndex are not simply disposable because the ownership model is not unique one. They can be shared between multiple clients.
But not disposing them is OK because they are static one: they are allocated when compiling DFG/FTL, and we do not allocate such CallSiteIndex
at runtime.
To make this difference explicit and avoid disposing non-disposable CallSiteIndex accidentally, we introduce DisposableCallSiteIndex type, and
enforce type-safety to some degree.
We also correctly update the DisposableCallSiteIndex => CodeOrigin table when we are reusing the previously used DisposableCallSiteIndex.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::newExceptionHandlingCallSiteIndex):
(JSC::CodeBlock::removeExceptionHandlerForCallSite):
* bytecode/CodeBlock.h:
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationState::callSiteIndexForExceptionHandling):
(JSC::PolymorphicAccess::regenerate):
* bytecode/PolymorphicAccess.h:
(JSC::AccessGenerationState::callSiteIndexForExceptionHandling): Deleted.
* dfg/DFGCommonData.cpp:
(JSC::DFG::CommonData::addUniqueCallSiteIndex):
(JSC::DFG::CommonData::addDisposableCallSiteIndex):
(JSC::DFG::CommonData::removeDisposableCallSiteIndex):
(JSC::DFG::CommonData::removeCallSiteIndex): Deleted.
* dfg/DFGCommonData.h:
* interpreter/CallFrame.h:
(JSC::DisposableCallSiteIndex::DisposableCallSiteIndex):
(JSC::DisposableCallSiteIndex::fromCallSiteIndex):
* jit/GCAwareJITStubRoutine.cpp:
(JSC::GCAwareJITStubRoutineWithExceptionHandler::GCAwareJITStubRoutineWithExceptionHandler):
(JSC::GCAwareJITStubRoutineWithExceptionHandler::observeZeroRefCount):
(JSC::createJITStubRoutine):
* jit/GCAwareJITStubRoutine.h:
* jit/JITInlineCacheGenerator.h:
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.24/JSTests/ChangeLog (248236 => 248237)
--- releases/WebKitGTK/webkit-2.24/JSTests/ChangeLog 2019-08-04 03:23:23 UTC (rev 248236)
+++ releases/WebKitGTK/webkit-2.24/JSTests/ChangeLog 2019-08-04 03:23:25 UTC (rev 248237)
@@ -1,3 +1,17 @@
+2019-06-17 Yusuke Suzuki <[email protected]>
+
+ [JSC] Introduce DisposableCallSiteIndex to enforce type-safety
+ https://bugs.webkit.org/show_bug.cgi?id=197378
+
+ Reviewed by Saam Barati.
+
+ * stress/disposable-call-site-index-with-call-and-this.js: Added.
+ (foo):
+ (bar):
+ * stress/disposable-call-site-index.js: Added.
+ (foo):
+ (bar):
+
2019-06-12 Yusuke Suzuki <[email protected]>
[JSC] Polymorphic call stub's slow path should restore callee saves before performing tail call
Modified: releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/ChangeLog (248236 => 248237)
--- releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/ChangeLog 2019-08-04 03:23:23 UTC (rev 248236)
+++ releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/ChangeLog 2019-08-04 03:23:25 UTC (rev 248237)
@@ -1,3 +1,48 @@
+2019-06-17 Yusuke Suzuki <[email protected]>
+
+ [JSC] Introduce DisposableCallSiteIndex to enforce type-safety
+ https://bugs.webkit.org/show_bug.cgi?id=197378
+
+ Reviewed by Saam Barati.
+
+ Some of CallSiteIndex are disposable. This is because some of CallSiteIndex are allocated and freed at runtime (not DFG/FTL compile time).
+ The example is CallSiteIndex for exception handler in GCAwareJITStubRoutineWithExceptionHandler. If we do not allocate and free CallSiteIndex,
+ we will create a new CallSiteIndex continuously and leak memory.
+
+ The other CallSiteIndex are not simply disposable because the ownership model is not unique one. They can be shared between multiple clients.
+ But not disposing them is OK because they are static one: they are allocated when compiling DFG/FTL, and we do not allocate such CallSiteIndex
+ at runtime.
+
+ To make this difference explicit and avoid disposing non-disposable CallSiteIndex accidentally, we introduce DisposableCallSiteIndex type, and
+ enforce type-safety to some degree.
+
+ We also correctly update the DisposableCallSiteIndex => CodeOrigin table when we are reusing the previously used DisposableCallSiteIndex.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::newExceptionHandlingCallSiteIndex):
+ (JSC::CodeBlock::removeExceptionHandlerForCallSite):
+ * bytecode/CodeBlock.h:
+ * bytecode/PolymorphicAccess.cpp:
+ (JSC::AccessGenerationState::callSiteIndexForExceptionHandling):
+ (JSC::PolymorphicAccess::regenerate):
+ * bytecode/PolymorphicAccess.h:
+ (JSC::AccessGenerationState::callSiteIndexForExceptionHandling): Deleted.
+ * dfg/DFGCommonData.cpp:
+ (JSC::DFG::CommonData::addUniqueCallSiteIndex):
+ (JSC::DFG::CommonData::addDisposableCallSiteIndex):
+ (JSC::DFG::CommonData::removeDisposableCallSiteIndex):
+ (JSC::DFG::CommonData::removeCallSiteIndex): Deleted.
+ * dfg/DFGCommonData.h:
+ * interpreter/CallFrame.h:
+ (JSC::DisposableCallSiteIndex::DisposableCallSiteIndex):
+ (JSC::DisposableCallSiteIndex::fromCallSiteIndex):
+ * jit/GCAwareJITStubRoutine.cpp:
+ (JSC::GCAwareJITStubRoutineWithExceptionHandler::GCAwareJITStubRoutineWithExceptionHandler):
+ (JSC::GCAwareJITStubRoutineWithExceptionHandler::observeZeroRefCount):
+ (JSC::createJITStubRoutine):
+ * jit/GCAwareJITStubRoutine.h:
+ * jit/JITInlineCacheGenerator.h:
+
2019-06-12 Yusuke Suzuki <[email protected]>
[JSC] Polymorphic call stub's slow path should restore callee saves before performing tail call
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes