WebKit Bugzilla
Attachment 361286 Details for
Bug 194339
: [JSC] Unify indirectEvalExecutableSpace and directEvalExecutableSpace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194339-20190206032641.patch (text/plain), 6.45 KB, created by
Yusuke Suzuki
on 2019-02-06 03:26:42 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2019-02-06 03:26:42 PST
Size:
6.45 KB
patch
obsolete
>Subversion Revision: 241015 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index f4449dc425515ccf320f79b1e498b6166e489d66..5ff55bc7a1865139dd75c2622da4cd21eee01fce 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,21 @@ >+2019-02-06 Yusuke Suzuki <ysuzuki@apple.com> >+ >+ [JSC] Unify indirectEvalExecutableSpace and directEvalExecutableSpace >+ https://bugs.webkit.org/show_bug.cgi?id=194339 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ DirectEvalExecutable and IndirectEvalExecutable have completely same memory layout. >+ They have even the same structure. This patch unifies the subspaces for them. >+ >+ * runtime/DirectEvalExecutable.h: >+ * runtime/EvalExecutable.h: >+ (JSC::EvalExecutable::subspaceFor): >+ * runtime/IndirectEvalExecutable.h: >+ * runtime/VM.cpp: >+ * runtime/VM.h: >+ (JSC::VM::forEachScriptExecutableSpace): >+ > 2019-02-06 Pablo Saavedra <psaavedra@igalia.com> > > Build failure after r240431 >diff --git a/Source/JavaScriptCore/runtime/DirectEvalExecutable.h b/Source/JavaScriptCore/runtime/DirectEvalExecutable.h >index 63e00f446c6bb92a49995e64ec1fbc420a1b6872..8948d45b582ec65c68dcdc3eb4fdce18f97e58bd 100644 >--- a/Source/JavaScriptCore/runtime/DirectEvalExecutable.h >+++ b/Source/JavaScriptCore/runtime/DirectEvalExecutable.h >@@ -31,15 +31,11 @@ namespace JSC { > > class DirectEvalExecutable final : public EvalExecutable { > public: >- template<typename CellType, SubspaceAccess mode> >- static IsoSubspace* subspaceFor(VM& vm) >- { >- return vm.directEvalExecutableSpace<mode>(); >- } >- > static DirectEvalExecutable* create(ExecState*, const SourceCode&, bool isInStrictContext, DerivedContextType, bool isArrowFunctionContext, EvalContextType, const VariableEnvironment*); > private: > DirectEvalExecutable(ExecState*, const SourceCode&, bool inStrictContext, DerivedContextType, bool isArrowFunctionContext, EvalContextType); > }; > >+static_assert(sizeof(DirectEvalExecutable) == sizeof(EvalExecutable), ""); >+ > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/EvalExecutable.h b/Source/JavaScriptCore/runtime/EvalExecutable.h >index b834a7c981efe798c69c9fbadc474d384f752167..f98b644a7a129df1d9c951cc5f7e32b10c1577db 100644 >--- a/Source/JavaScriptCore/runtime/EvalExecutable.h >+++ b/Source/JavaScriptCore/runtime/EvalExecutable.h >@@ -54,6 +54,12 @@ class EvalExecutable : public ScriptExecutable { > return Structure::create(vm, globalObject, proto, TypeInfo(EvalExecutableType, StructureFlags), info()); > } > >+ template<typename CellType, SubspaceAccess mode> >+ static IsoSubspace* subspaceFor(VM& vm) >+ { >+ return vm.evalExecutableSpace<mode>(); >+ } >+ > DECLARE_INFO; > > ExecutableInfo executableInfo() const { return ExecutableInfo(usesEval(), isStrictMode(), false, false, ConstructorKind::None, JSParserScriptMode::Classic, SuperBinding::NotNeeded, SourceParseMode::ProgramMode, derivedContextType(), isArrowFunctionContext(), false, evalContextType()); } >diff --git a/Source/JavaScriptCore/runtime/IndirectEvalExecutable.h b/Source/JavaScriptCore/runtime/IndirectEvalExecutable.h >index 511b447ec9b982f202beca3bbc5092288f66ae66..1ede1a8cde99e1fc75bec1f58035ca1cd5a5f3e5 100644 >--- a/Source/JavaScriptCore/runtime/IndirectEvalExecutable.h >+++ b/Source/JavaScriptCore/runtime/IndirectEvalExecutable.h >@@ -31,15 +31,11 @@ namespace JSC { > > class IndirectEvalExecutable final : public EvalExecutable { > public: >- template<typename CellType, SubspaceAccess mode> >- static IsoSubspace* subspaceFor(VM& vm) >- { >- return vm.indirectEvalExecutableSpace<mode>(); >- } >- > static IndirectEvalExecutable* create(ExecState*, const SourceCode&, bool isInStrictContext, DerivedContextType, bool isArrowFunctionContext, EvalContextType); > private: > IndirectEvalExecutable(ExecState*, const SourceCode&, bool inStrictContext, DerivedContextType, bool isArrowFunctionContext, EvalContextType); > }; > >+static_assert(sizeof(IndirectEvalExecutable) == sizeof(EvalExecutable), ""); >+ > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/VM.cpp b/Source/JavaScriptCore/runtime/VM.cpp >index 4ef7baab5c51c8854ba95a08627ddbf964bbf25c..b9edecc2faaa01c0ba16057bee0398d3cc17fa84 100644 >--- a/Source/JavaScriptCore/runtime/VM.cpp >+++ b/Source/JavaScriptCore/runtime/VM.cpp >@@ -1259,8 +1259,7 @@ DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(webAssemblyWrapperFunctionSpace, cellHea > } > > DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER_SLOW(inferredValueSpace, destructibleCellHeapCellType.get(), InferredValue) >-DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER_SLOW(directEvalExecutableSpace, destructibleCellHeapCellType.get(), DirectEvalExecutable) >-DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER_SLOW(indirectEvalExecutableSpace, destructibleCellHeapCellType.get(), IndirectEvalExecutable) >+DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER_SLOW(evalExecutableSpace, destructibleCellHeapCellType.get(), EvalExecutable) > DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER_SLOW(moduleProgramExecutableSpace, destructibleCellHeapCellType.get(), ModuleProgramExecutable) > > #undef DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER_SLOW >diff --git a/Source/JavaScriptCore/runtime/VM.h b/Source/JavaScriptCore/runtime/VM.h >index 2ea82078a01f6d4ffdf36cb874a71e3fc0571faa..ae88ec8ce340bb69efb290b29d12ef720b27aea5 100644 >--- a/Source/JavaScriptCore/runtime/VM.h >+++ b/Source/JavaScriptCore/runtime/VM.h >@@ -455,8 +455,7 @@ class VM : public ThreadSafeRefCounted<VM>, public DoublyLinkedListNode<VM> { > func(codeBlockSpace); > } > >- DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER(directEvalExecutableSpace) >- DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER(indirectEvalExecutableSpace) >+ DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER(evalExecutableSpace) > DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER(moduleProgramExecutableSpace) > SpaceAndSet functionExecutableSpace; > SpaceAndSet programExecutableSpace; >@@ -464,11 +463,9 @@ class VM : public ThreadSafeRefCounted<VM>, public DoublyLinkedListNode<VM> { > template<typename Func> > void forEachScriptExecutableSpace(const Func& func) > { >- if (m_directEvalExecutableSpace) >- func(*m_directEvalExecutableSpace); >+ if (m_evalExecutableSpace) >+ func(*m_evalExecutableSpace); > func(functionExecutableSpace); >- if (m_indirectEvalExecutableSpace) >- func(*m_indirectEvalExecutableSpace); > if (m_moduleProgramExecutableSpace) > func(*m_moduleProgramExecutableSpace); > func(programExecutableSpace);
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 194339
: 361286