Title: [240823] trunk/Source/_javascript_Core
Revision
240823
Author
ysuz...@apple.com
Date
2019-01-31 15:20:08 -0800 (Thu, 31 Jan 2019)

Log Message

[JSC] Remove finalizer in AsyncFromSyncIteratorPrototype
https://bugs.webkit.org/show_bug.cgi?id=194107

Reviewed by Saam Barati.

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:
* _javascript_Core.xcodeproj/project.pbxproj:
* runtime/AsyncFromSyncIteratorPrototype.cpp:
(JSC::AsyncFromSyncIteratorPrototype::AsyncFromSyncIteratorPrototype):
(JSC::AsyncFromSyncIteratorPrototype::finishCreation):
(JSC::AsyncFromSyncIteratorPrototype::create):
* runtime/AsyncFromSyncIteratorPrototype.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/CMakeLists.txt (240822 => 240823)


--- trunk/Source/_javascript_Core/CMakeLists.txt	2019-01-31 22:28:19 UTC (rev 240822)
+++ trunk/Source/_javascript_Core/CMakeLists.txt	2019-01-31 23:20:08 UTC (rev 240823)
@@ -60,6 +60,7 @@
 set(_javascript_Core_OBJECT_LUT_SOURCES
     runtime/ArrayConstructor.cpp
     runtime/ArrayIteratorPrototype.cpp
+    runtime/AsyncFromSyncIteratorPrototype.cpp
     runtime/AsyncGeneratorPrototype.cpp
     runtime/BigIntConstructor.cpp
     runtime/BigIntPrototype.cpp

Modified: trunk/Source/_javascript_Core/ChangeLog (240822 => 240823)


--- trunk/Source/_javascript_Core/ChangeLog	2019-01-31 22:28:19 UTC (rev 240822)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-01-31 23:20:08 UTC (rev 240823)
@@ -1,3 +1,22 @@
+2019-01-31  Yusuke Suzuki  <ysuz...@apple.com>
+
+        [JSC] Remove finalizer in AsyncFromSyncIteratorPrototype
+        https://bugs.webkit.org/show_bug.cgi?id=194107
+
+        Reviewed by Saam Barati.
+
+        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:
+        * _javascript_Core.xcodeproj/project.pbxproj:
+        * runtime/AsyncFromSyncIteratorPrototype.cpp:
+        (JSC::AsyncFromSyncIteratorPrototype::AsyncFromSyncIteratorPrototype):
+        (JSC::AsyncFromSyncIteratorPrototype::finishCreation):
+        (JSC::AsyncFromSyncIteratorPrototype::create):
+        * runtime/AsyncFromSyncIteratorPrototype.h:
+
 2019-01-31  Tadeu Zagallo  <tzaga...@apple.com>
 
         Fix `runJITThreadLimitTests` in testapi

Modified: trunk/Source/_javascript_Core/DerivedSources.make (240822 => 240823)


--- trunk/Source/_javascript_Core/DerivedSources.make	2019-01-31 22:28:19 UTC (rev 240822)
+++ trunk/Source/_javascript_Core/DerivedSources.make	2019-01-31 23:20:08 UTC (rev 240823)
@@ -134,6 +134,7 @@
 # Perfect hash lookup tables for _javascript_ classes.
 
 OBJECT_LUT_HEADERS = \
+    AsyncFromSyncIteratorPrototype.lut.h \
     ArrayConstructor.lut.h \
     ArrayIteratorPrototype.lut.h \
     AsyncGeneratorPrototype.lut.h \

Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (240822 => 240823)


--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2019-01-31 22:28:19 UTC (rev 240822)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2019-01-31 23:20:08 UTC (rev 240823)
@@ -1764,6 +1764,7 @@
 		E35E03601B7AB43E0073AD2A /* InspectorInstrumentationObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E35E035E1B7AB43E0073AD2A /* InspectorInstrumentationObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E36CC9472086314F0051FFD6 /* WasmCreationMode.h in Headers */ = {isa = PBXBuildFile; fileRef = E36CC9462086314F0051FFD6 /* WasmCreationMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E3794E761B77EB97005543AE /* ModuleAnalyzer.h in Headers */ = {isa = PBXBuildFile; fileRef = E3794E741B77EB97005543AE /* ModuleAnalyzer.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		E3893A1D2203A7C600E79A74 /* AsyncFromSyncIteratorPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = E3893A1C2203A7C600E79A74 /* AsyncFromSyncIteratorPrototype.lut.h */; };
 		E393ADD81FE702D00022D681 /* WeakMapImplInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = E393ADD71FE702CC0022D681 /* WeakMapImplInlines.h */; };
 		E39D45F51D39005600B3B377 /* InterpreterInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = E39D9D841D39000600667282 /* InterpreterInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E39DA4A71B7E8B7C0084F33A /* JSModuleRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = E39DA4A51B7E8B7C0084F33A /* JSModuleRecord.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -4702,6 +4703,7 @@
 		E3794E741B77EB97005543AE /* ModuleAnalyzer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleAnalyzer.h; sourceTree = "<group>"; };
 		E380A76B1DCD7195000F89E6 /* MacroAssemblerHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerHelpers.h; sourceTree = "<group>"; };
 		E380D66B1F19249D00A59095 /* BuiltinNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BuiltinNames.cpp; sourceTree = "<group>"; };
+		E3893A1C2203A7C600E79A74 /* AsyncFromSyncIteratorPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AsyncFromSyncIteratorPrototype.lut.h; path = AsyncFromSyncIteratorPrototype.lut.h; sourceTree = "<group>"; };
 		E38D060B1F8E814100649CF2 /* JSScriptFetchParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScriptFetchParameters.h; sourceTree = "<group>"; };
 		E38D060C1F8E814100649CF2 /* ScriptFetchParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptFetchParameters.h; sourceTree = "<group>"; };
 		E38D060D1F8E814100649CF2 /* JSScriptFetchParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScriptFetchParameters.cpp; sourceTree = "<group>"; };
@@ -6341,6 +6343,7 @@
 				0F6183351C45F3B60072450B /* AirOpcodeUtils.h */,
 				996B73151BDA05AA00331B84 /* ArrayConstructor.lut.h */,
 				996B73161BDA05AA00331B84 /* ArrayIteratorPrototype.lut.h */,
+				E3893A1C2203A7C600E79A74 /* AsyncFromSyncIteratorPrototype.lut.h */,
 				8B3BF5E31E3D365A0076A87A /* AsyncGeneratorPrototype.lut.h */,
 				996B73071BD9FA2C00331B84 /* BooleanPrototype.lut.h */,
 				6514F21718B3E1670098FF8B /* Bytecodes.h */,
@@ -6436,10 +6439,10 @@
 			isa = PBXGroup;
 			children = (
 				AD2FCB8A1DB5840000B3E736 /* js */,
+				52847AD921FFB8630061A9DB /* WasmAirIRGenerator.cpp */,
+				52847ADA21FFB8630061A9DB /* WasmAirIRGenerator.h */,
 				53F40E8E1D5902820099A1B6 /* WasmB3IRGenerator.cpp */,
 				53F40E921D5A4AB30099A1B6 /* WasmB3IRGenerator.h */,
-				52847AD921FFB8630061A9DB /* WasmAirIRGenerator.cpp */,
-				52847ADA21FFB8630061A9DB /* WasmAirIRGenerator.h */,
 				53CA73071EA533D80076049D /* WasmBBQPlan.cpp */,
 				53CA73081EA533D80076049D /* WasmBBQPlan.h */,
 				53F8D1FF1E8387D400D21116 /* WasmBBQPlanInlines.h */,
@@ -8469,6 +8472,7 @@
 				0F24E54117EA9F5900ABB217 /* AssemblyHelpers.h in Headers */,
 				A784A26111D16622005776AC /* ASTBuilder.h in Headers */,
 				8B6016F61F3E3CC000F9DE6A /* AsyncFromSyncIteratorPrototype.h in Headers */,
+				E3893A1D2203A7C600E79A74 /* AsyncFromSyncIteratorPrototype.lut.h in Headers */,
 				5B70CFE21DB69E6600EC23F9 /* AsyncFunctionConstructor.h in Headers */,
 				5B70CFE01DB69E6600EC23F9 /* AsyncFunctionPrototype.h in Headers */,
 				8BC0648B1E1ABA9400B2B8CA /* AsyncGeneratorFunctionConstructor.h in Headers */,
@@ -8535,7 +8539,6 @@
 				436E54531C468E7400B5AF73 /* B3LegalizeMemoryOffsets.h in Headers */,
 				0F338E1E1BF286EA0013C88F /* B3LowerMacros.h in Headers */,
 				4319DA041C1BE40D001D260B /* B3LowerMacrosAfterOptimizations.h in Headers */,
-				52847ADC21FFB8690061A9DB /* WasmAirIRGenerator.h in Headers */,
 				0FEC851E1BDACDAC0080FF74 /* B3LowerToAir.h in Headers */,
 				43AB26C61C1A535900D82AE6 /* B3MathExtras.h in Headers */,
 				0FEC85201BDACDAC0080FF74 /* B3MemoryValue.h in Headers */,
@@ -9763,6 +9766,7 @@
 				0F5AE2C41DF4F2800066EFE1 /* VMInlines.h in Headers */,
 				FE3022D71E42857300BAC493 /* VMInspector.h in Headers */,
 				FE6F56DE1E64EAD600D17801 /* VMTraps.h in Headers */,
+				52847ADC21FFB8690061A9DB /* WasmAirIRGenerator.h in Headers */,
 				53F40E931D5A4AB30099A1B6 /* WasmB3IRGenerator.h in Headers */,
 				53CA730A1EA533D80076049D /* WasmBBQPlan.h in Headers */,
 				53F8D2001E8387D400D21116 /* WasmBBQPlanInlines.h in Headers */,
@@ -10547,7 +10551,6 @@
 				536B319A1F735E780037FC33 /* UnifiedSource1-mm.mm in Sources */,
 				536B315F1F71C5990037FC33 /* UnifiedSource1.cpp in Sources */,
 				536B319B1F735E780037FC33 /* UnifiedSource2-mm.mm in Sources */,
-				525C9CDF220285830082DBFD /* WasmAirIRGenerator.cpp in Sources */,
 				536B31571F71C5990037FC33 /* UnifiedSource2.cpp in Sources */,
 				530A66B91FA3E78B0026A545 /* UnifiedSource3-mm.mm in Sources */,
 				536B31581F71C5990037FC33 /* UnifiedSource3.cpp in Sources */,
@@ -10695,6 +10698,7 @@
 				530A66C21FA3E78B0026A545 /* UnifiedSource143.cpp in Sources */,
 				530A66C31FA3E78B0026A545 /* UnifiedSource144.cpp in Sources */,
 				530A66C41FA3E78B0026A545 /* UnifiedSource145.cpp in Sources */,
+				525C9CDF220285830082DBFD /* WasmAirIRGenerator.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: trunk/Source/_javascript_Core/runtime/AsyncFromSyncIteratorPrototype.cpp (240822 => 240823)


--- trunk/Source/_javascript_Core/runtime/AsyncFromSyncIteratorPrototype.cpp	2019-01-31 22:28:19 UTC (rev 240822)
+++ trunk/Source/_javascript_Core/runtime/AsyncFromSyncIteratorPrototype.cpp	2019-01-31 23:20:08 UTC (rev 240823)
@@ -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;
 }
 

Modified: trunk/Source/_javascript_Core/runtime/AsyncFromSyncIteratorPrototype.h (240822 => 240823)


--- trunk/Source/_javascript_Core/runtime/AsyncFromSyncIteratorPrototype.h	2019-01-31 22:28:19 UTC (rev 240822)
+++ trunk/Source/_javascript_Core/runtime/AsyncFromSyncIteratorPrototype.h	2019-01-31 23:20:08 UTC (rev 240823)
@@ -31,6 +31,7 @@
 class AsyncFromSyncIteratorPrototype final : public JSNonFinalObject {
 public:
     using Base = JSNonFinalObject;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
 
     DECLARE_INFO;
 
@@ -41,11 +42,9 @@
         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
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to