ES6 Generator can save the execution state inside an object. When the underlying CodeBlock is jettisoned and generated again, if the CodeBlock content is different, resume becomes totally broken! e.g. regenerating CodeBlock with Debugger.
<rdar://problem/48538201>
Created attachment 368915 [details] Patch
Comment on attachment 368915 [details] Patch Attachment 368915 [details] did not pass mac-ews (mac): Output: https://webkit-queues.webkit.org/results/12082656 Number of test failures exceeded the failure limit.
Created attachment 368917 [details] Archive of layout-test-results from ews101 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-highsierra Platform: Mac OS X 10.13.6
Comment on attachment 368915 [details] Patch Attachment 368915 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/12082694 Number of test failures exceeded the failure limit.
Created attachment 368918 [details] Archive of layout-test-results from ews107 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
Created attachment 368919 [details] Patch
Comment on attachment 368919 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368919&action=review > Source/JavaScriptCore/ChangeLog:28 > + and pass them as a parameter, OptionSet<CodeGeneratorMode>. Note that each created Generator holds JSFunction to the generator body. So state & ScriptExecutable is always tightly coupled. Storing CodeGeneratorMode in ScriptExecutable allows us to regenerate the same CodeBlock for that if the generator is created before the debugger is enabled.
Comment on attachment 368919 [details] Patch r=me.
Committed r244915: <https://trac.webkit.org/changeset/244915>
Comment on attachment 368919 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368919&action=review > Source/JavaScriptCore/runtime/ScriptExecutable.cpp:318 > + // We continue using the same CodeGenerationMode for Generators because live generator objects can > + // keep the state which is only valid with the CodeBlock compiled with the same CodeGenerationMode. So what happens when we enable the debugger? Will we never be able to pause on this generator then? Or will we be able to pause for new invocations? It seems like this makes it so new invocations of the generator won't have debugging opcodes ever. Can we find a way to not make that the case?