WebKit Bugzilla
Attachment 360771 Details for
Bug 194107
: [JSC] Remove finalizer in AsyncFromSyncIteratorPrototype
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194107-20190131140010.patch (text/plain), 6.00 KB, created by
Yusuke Suzuki
on 2019-01-31 14:00:11 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2019-01-31 14:00:11 PST
Size:
6.00 KB
patch
obsolete
>Subversion Revision: 240807 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index e5bc3208383c3959f8bc013012c9f0fe2c43ae27..a165c2d01a6771e1a5c75135efaf15a5f88e4743 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,21 @@ >+2019-01-31 Yusuke Suzuki <ysuzuki@apple.com> >+ >+ [JSC] Remove finalizer in AsyncFromSyncIteratorPrototype >+ https://bugs.webkit.org/show_bug.cgi?id=194107 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ AsyncFromSyncIteratorPrototype uses the finalizer, but it is not necessary since it does not hold any objects which require destruction. >+ We drop this finalizer. And we also make methods of AsyncFromSyncIteratorPrototype lazily allocated. >+ >+ * CMakeLists.txt: >+ * DerivedSources.make: >+ * runtime/AsyncFromSyncIteratorPrototype.cpp: >+ (JSC::AsyncFromSyncIteratorPrototype::AsyncFromSyncIteratorPrototype): >+ (JSC::AsyncFromSyncIteratorPrototype::finishCreation): >+ (JSC::AsyncFromSyncIteratorPrototype::create): >+ * runtime/AsyncFromSyncIteratorPrototype.h: >+ > 2019-01-31 Yusuke Suzuki <ysuzuki@apple.com> > > Unreviewed, follow-up after r240796 >diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt >index fb6ed4077c0112f8ce21c121c37f437897194034..d04740bf141d32996c62f585b28bc4ccb435d800 100644 >--- a/Source/JavaScriptCore/CMakeLists.txt >+++ b/Source/JavaScriptCore/CMakeLists.txt >@@ -60,6 +60,7 @@ set(JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES > set(JavaScriptCore_OBJECT_LUT_SOURCES > runtime/ArrayConstructor.cpp > runtime/ArrayIteratorPrototype.cpp >+ runtime/AsyncFromSyncIteratorPrototype.cpp > runtime/AsyncGeneratorPrototype.cpp > runtime/BigIntConstructor.cpp > runtime/BigIntPrototype.cpp >diff --git a/Source/JavaScriptCore/DerivedSources.make b/Source/JavaScriptCore/DerivedSources.make >index d9e2c8bc55306c2551eb65717650d5aa1a9fe7fd..4d3e429074c12ef54dca25512ac203c593299013 100644 >--- a/Source/JavaScriptCore/DerivedSources.make >+++ b/Source/JavaScriptCore/DerivedSources.make >@@ -134,6 +134,7 @@ JSCBuiltins.h: $(BUILTINS_GENERATOR_SCRIPTS) $(JavaScriptCore_BUILTINS_SOURCES) > # Perfect hash lookup tables for JavaScript classes. > > OBJECT_LUT_HEADERS = \ >+ AsyncFromSyncIteratorPrototype.lut.h \ > ArrayConstructor.lut.h \ > ArrayIteratorPrototype.lut.h \ > AsyncGeneratorPrototype.lut.h \ >diff --git a/Source/JavaScriptCore/runtime/AsyncFromSyncIteratorPrototype.cpp b/Source/JavaScriptCore/runtime/AsyncFromSyncIteratorPrototype.cpp >index 0ec9a5ead82b8a890689729adf61a9c30d60088d..a6a3b54ba1b7d6f59c1785863d7c96dbfb1ee9ae 100644 >--- a/Source/JavaScriptCore/runtime/AsyncFromSyncIteratorPrototype.cpp >+++ b/Source/JavaScriptCore/runtime/AsyncFromSyncIteratorPrototype.cpp >@@ -31,32 +31,36 @@ > #include "JSCInlines.h" > #include "JSObject.h" > >+#include "AsyncFromSyncIteratorPrototype.lut.h" >+ > namespace JSC { > >-const ClassInfo AsyncFromSyncIteratorPrototype::s_info = { "AsyncFromSyncIterator", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(AsyncFromSyncIteratorPrototype) }; >+const ClassInfo AsyncFromSyncIteratorPrototype::s_info = { "AsyncFromSyncIterator", &Base::s_info, &asyncFromSyncIteratorPrototypeTable, nullptr, CREATE_METHOD_TABLE(AsyncFromSyncIteratorPrototype) }; > > AsyncFromSyncIteratorPrototype::AsyncFromSyncIteratorPrototype(VM& vm, Structure* structure) >- : JSC::JSNonFinalObject(vm, structure) >+ : Base(vm, structure) > { > } > >-void AsyncFromSyncIteratorPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) >+/* Source for AsyncFromSyncIteratorPrototype.lut.h >+@begin asyncFromSyncIteratorPrototypeTable >+ next JSBuiltin DontEnum|Function 1 >+ return JSBuiltin DontEnum|Function 1 >+ throw JSBuiltin DontEnum|Function 1 >+@end >+*/ >+ >+void AsyncFromSyncIteratorPrototype::finishCreation(VM& vm) > { > Base::finishCreation(vm); > ASSERT(inherits(vm, info())); > didBecomePrototype(); >- >- JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION("next", asyncFromSyncIteratorPrototypeNextCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum)); >- JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION("return", asyncFromSyncIteratorPrototypeReturnCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum)); >- JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION("throw", asyncFromSyncIteratorPrototypeThrowCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum)); > } > >-AsyncFromSyncIteratorPrototype* AsyncFromSyncIteratorPrototype::create(VM& vm, JSGlobalObject* globalObject, Structure* structure) >+AsyncFromSyncIteratorPrototype* AsyncFromSyncIteratorPrototype::create(VM& vm, JSGlobalObject*, Structure* structure) > { > AsyncFromSyncIteratorPrototype* prototype = new (NotNull, allocateCell<AsyncFromSyncIteratorPrototype>(vm.heap)) AsyncFromSyncIteratorPrototype(vm, structure); >- prototype->finishCreation(vm, globalObject); >- vm.heap.addFinalizer(prototype, destroy); >- >+ prototype->finishCreation(vm); > return prototype; > } > >diff --git a/Source/JavaScriptCore/runtime/AsyncFromSyncIteratorPrototype.h b/Source/JavaScriptCore/runtime/AsyncFromSyncIteratorPrototype.h >index b7e1531d6ce9e2e56687e3d9eab93c23fe355e98..6d9d8749c8d89275f72a6aab39757be2d403c677 100644 >--- a/Source/JavaScriptCore/runtime/AsyncFromSyncIteratorPrototype.h >+++ b/Source/JavaScriptCore/runtime/AsyncFromSyncIteratorPrototype.h >@@ -31,6 +31,7 @@ namespace JSC { > class AsyncFromSyncIteratorPrototype final : public JSNonFinalObject { > public: > using Base = JSNonFinalObject; >+ static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable; > > DECLARE_INFO; > >@@ -41,11 +42,9 @@ class AsyncFromSyncIteratorPrototype final : public JSNonFinalObject { > return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info()); > } > >- protected: >- void finishCreation(VM&, JSGlobalObject*); >- >- private: >+private: > AsyncFromSyncIteratorPrototype(VM&, Structure*); >+ void finishCreation(VM&); > }; > > } // namespace JSC
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194107
:
360771
|
360773