WebKit Bugzilla
Attachment 359709 Details for
Bug 193646
: [JSC] Lazily initialize JSModuleLoader
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193646-20190121135420.patch (text/plain), 4.38 KB, created by
Yusuke Suzuki
on 2019-01-21 13:54:20 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2019-01-21 13:54:20 PST
Size:
4.38 KB
patch
obsolete
>Subversion Revision: 240241 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 9e71ea73c554becbdae8dad17cce69b879dd1a20..5e3a8d1c1120cf0657a64f838d8c45282ccae5b4 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-01-21 Yusuke Suzuki <ysuzuki@apple.com> >+ >+ [JSC] Lazily initialize JSModuleLoader >+ https://bugs.webkit.org/show_bug.cgi?id=193646 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Lazily initialize JSModuleLoader so that we do not need to initialize it until we need modules. >+ >+ * runtime/JSGlobalObject.cpp: >+ (JSC::JSGlobalObject::init): >+ (JSC::JSGlobalObject::visitChildren): >+ * runtime/JSGlobalObject.h: >+ (JSC::JSGlobalObject::moduleLoader const): >+ > 2019-01-20 Yusuke Suzuki <ysuzuki@apple.com> > > [JSC] sub op with 0 should be optimized >diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >index e540048ed8a8b790d9d86dd91901fef85f4c9a7f..1a61f9db30f4a89e2c248798ecd2529b5fdec4cb 100644 >--- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >@@ -788,9 +788,14 @@ putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Construct > ReflectObject* reflectObject = ReflectObject::create(vm, this, ReflectObject::createStructure(vm, this, m_objectPrototype.get())); > putDirectWithoutTransition(vm, vm.propertyNames->Reflect, reflectObject, static_cast<unsigned>(PropertyAttribute::DontEnum)); > >- m_moduleLoader.set(vm, this, JSModuleLoader::create(globalExec(), vm, this, JSModuleLoader::createStructure(vm, this, jsNull()))); >+ m_moduleLoader.initLater( >+ [] (const Initializer<JSModuleLoader>& init) { >+ auto catchScope = DECLARE_CATCH_SCOPE(init.vm); >+ init.set(JSModuleLoader::create(init.owner->globalExec(), init.vm, init.owner, JSModuleLoader::createStructure(init.vm, init.owner, jsNull()))); >+ catchScope.releaseAssertNoException(); >+ }); > if (Options::exposeInternalModuleLoader()) >- putDirectWithoutTransition(vm, vm.propertyNames->Loader, m_moduleLoader.get(), static_cast<unsigned>(PropertyAttribute::DontEnum)); >+ putDirectWithoutTransition(vm, vm.propertyNames->Loader, moduleLoader(), static_cast<unsigned>(PropertyAttribute::DontEnum)); > > JSFunction* builtinLog = JSFunction::create(vm, this, 1, vm.propertyNames->emptyIdentifier.string(), globalFuncBuiltinLog); > JSFunction* builtinDescribe = JSFunction::create(vm, this, 1, vm.propertyNames->emptyIdentifier.string(), globalFuncBuiltinDescribe); >@@ -1574,7 +1579,7 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor) > visitor.append(thisObject->m_functionProtoHasInstanceSymbolFunction); > thisObject->m_throwTypeErrorGetterSetter.visit(visitor); > visitor.append(thisObject->m_throwTypeErrorArgumentsCalleeAndCallerGetterSetter); >- visitor.append(thisObject->m_moduleLoader); >+ thisObject->m_moduleLoader.visit(visitor); > > visitor.append(thisObject->m_objectPrototype); > visitor.append(thisObject->m_functionPrototype); >diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.h b/Source/JavaScriptCore/runtime/JSGlobalObject.h >index d52d0fbfc9828e69666af5b52014b8f39c6e56ef..b1d96ad3b58584b722871c682b18071aab9c42fa 100644 >--- a/Source/JavaScriptCore/runtime/JSGlobalObject.h >+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.h >@@ -300,7 +300,7 @@ class JSGlobalObject : public JSSegmentedVariableObject { > WriteBarrier<JSObject> m_regExpProtoUnicodeGetter; > WriteBarrier<GetterSetter> m_throwTypeErrorArgumentsCalleeAndCallerGetterSetter; > >- WriteBarrier<JSModuleLoader> m_moduleLoader; >+ LazyProperty<JSGlobalObject, JSModuleLoader> m_moduleLoader; > > WriteBarrier<ObjectPrototype> m_objectPrototype; > WriteBarrier<FunctionPrototype> m_functionPrototype; >@@ -611,7 +611,7 @@ class JSGlobalObject : public JSSegmentedVariableObject { > return m_throwTypeErrorArgumentsCalleeAndCallerGetterSetter.get(); > } > >- JSModuleLoader* moduleLoader() const { return m_moduleLoader.get(); } >+ JSModuleLoader* moduleLoader() const { return m_moduleLoader.get(this); } > > ObjectPrototype* objectPrototype() const { return m_objectPrototype.get(); } > FunctionPrototype* functionPrototype() const { return m_functionPrototype.get(); }
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 193646
:
359672
|
359673
| 359709