WebKit Bugzilla
Attachment 360971 Details for
Bug 194191
: [JSC] Shrink size of FunctionExecutable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194191-20190202034136.patch (text/plain), 22.95 KB, created by
Yusuke Suzuki
on 2019-02-02 03:41:37 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2019-02-02 03:41:37 PST
Size:
22.95 KB
patch
obsolete
>Subversion Revision: 240893 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index d5e4549ed1a770c4c16e2d8d49ae7dfa83c3dac6..5c9d52361b50927efbdfcd05fb88298104094c2e 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,56 @@ >+2019-02-02 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ [JSC] Shrink size of FunctionExecutable >+ https://bugs.webkit.org/show_bug.cgi?id=194191 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch reduces the size of FunctionExecutable. Since it is allocated in IsoSubspace, reducing the size directly >+ improves the allocation efficiency. >+ >+ 1. ScriptExecutable (base class of FunctionExecutable) has several members, but it is meaningful only in FunctionExecutable. >+ We remove this from ScriptExecutable, and move it to FunctionExecutable. >+ >+ 2. FunctionExecutable has several data which are rarely used. One for FunctionOverrides functionality, which is typically >+ used for JSC debugging purpose, and another is TypeSet and offsets for type profiler. We move them to RareData and reduce >+ the size of FunctionExecutable in the major case. >+ >+ This patch changes the size of FunctionExecutable from 176 to 144. >+ >+ * bytecode/CodeBlock.cpp: >+ (JSC::CodeBlock::dumpSource): >+ (JSC::CodeBlock::finishCreation): >+ * dfg/DFGNode.h: >+ (JSC::DFG::Node::OpInfoWrapper::as const): >+ * interpreter/StackVisitor.cpp: >+ (JSC::StackVisitor::Frame::computeLineAndColumn const): >+ * runtime/ExecutableBase.h: >+ * runtime/FunctionExecutable.cpp: >+ (JSC::FunctionExecutable::FunctionExecutable): >+ (JSC::FunctionExecutable::ensureRareDataSlow): >+ * runtime/FunctionExecutable.h: >+ * runtime/Intrinsic.h: >+ * runtime/ModuleProgramExecutable.cpp: >+ (JSC::ModuleProgramExecutable::ModuleProgramExecutable): >+ * runtime/ProgramExecutable.cpp: >+ (JSC::ProgramExecutable::ProgramExecutable): >+ * runtime/ScriptExecutable.cpp: >+ (JSC::ScriptExecutable::ScriptExecutable): >+ (JSC::ScriptExecutable::overrideLineNumber const): >+ (JSC::ScriptExecutable::typeProfilingStartOffset const): >+ (JSC::ScriptExecutable::typeProfilingEndOffset const): >+ * runtime/ScriptExecutable.h: >+ (JSC::ScriptExecutable::firstLine const): >+ (JSC::ScriptExecutable::setOverrideLineNumber): Deleted. >+ (JSC::ScriptExecutable::hasOverrideLineNumber const): Deleted. >+ (JSC::ScriptExecutable::overrideLineNumber const): Deleted. >+ (JSC::ScriptExecutable::typeProfilingStartOffset const): Deleted. >+ (JSC::ScriptExecutable::typeProfilingEndOffset const): Deleted. >+ * runtime/StackFrame.cpp: >+ (JSC::StackFrame::computeLineAndColumn const): >+ * tools/JSDollarVM.cpp: >+ (JSC::functionReturnTypeFor): >+ > 2019-02-01 Yusuke Suzuki <ysuzuki@apple.com> > > [JSC] Decouple JIT related data from CodeBlock >diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp >index 5340f917573dca38f2dad12eea5c068b57386079..0707789eaf1c4cef9f5909aabc757835d981f955 100644 >--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp >+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp >@@ -231,7 +231,7 @@ void CodeBlock::dumpSource(PrintStream& out) > FunctionExecutable* functionExecutable = reinterpret_cast<FunctionExecutable*>(executable); > StringView source = functionExecutable->source().provider()->getRange( > functionExecutable->parametersStartOffset(), >- functionExecutable->typeProfilingEndOffset() + 1); // Type profiling end offset is the character before the '}'. >+ functionExecutable->typeProfilingEndOffset(*vm()) + 1); // Type profiling end offset is the character before the '}'. > > out.print("function ", inferredName(), source); > return; >@@ -411,7 +411,7 @@ bool CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink > auto throwScope = DECLARE_THROW_SCOPE(vm); > > if (vm.typeProfiler() || vm.controlFlowProfiler()) >- vm.functionHasExecutedCache()->removeUnexecutedRange(ownerExecutable->sourceID(), ownerExecutable->typeProfilingStartOffset(), ownerExecutable->typeProfilingEndOffset()); >+ vm.functionHasExecutedCache()->removeUnexecutedRange(ownerExecutable->sourceID(), ownerExecutable->typeProfilingStartOffset(vm), ownerExecutable->typeProfilingEndOffset(vm)); > > setConstantRegisters(unlinkedCodeBlock->constantRegisters(), unlinkedCodeBlock->constantsSourceCodeRepresentation()); > RETURN_IF_EXCEPTION(throwScope, false); >@@ -758,7 +758,7 @@ bool CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink > // the user's program, give the type profiler some range to identify these return statements. > // Currently, the text offset that is used as identification is "f" in the function keyword > // and is stored on TypeLocation's m_divotForFunctionOffsetIfReturnStatement member variable. >- divotStart = divotEnd = ownerExecutable->typeProfilingStartOffset(); >+ divotStart = divotEnd = ownerExecutable->typeProfilingStartOffset(vm); > shouldAnalyze = true; > } > break; >@@ -771,7 +771,7 @@ bool CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink > bool isNewLocation = locationPair.second; > > if (bytecode.m_flag == ProfileTypeBytecodeFunctionReturnStatement) >- location->m_divotForFunctionOffsetIfReturnStatement = ownerExecutable->typeProfilingStartOffset(); >+ location->m_divotForFunctionOffsetIfReturnStatement = ownerExecutable->typeProfilingStartOffset(vm); > > if (shouldAnalyze && isNewLocation) > vm.typeProfiler()->insertNewLocation(location); >diff --git a/Source/JavaScriptCore/dfg/DFGNode.h b/Source/JavaScriptCore/dfg/DFGNode.h >index 4c7deb6ad68ab008c2a663b9e413f710a2ade36a..fb3679a0b298b3b58739da905e2c1be64f84fb4a 100644 >--- a/Source/JavaScriptCore/dfg/DFGNode.h >+++ b/Source/JavaScriptCore/dfg/DFGNode.h >@@ -2987,7 +2987,7 @@ struct Node { > return static_cast<T>(u.constPointer); > } > template <typename T> >- ALWAYS_INLINE auto as() const -> typename std::enable_if<(std::is_integral<T>::value || std::is_enum<T>::value) && sizeof(T) == 4, T>::type >+ ALWAYS_INLINE auto as() const -> typename std::enable_if<(std::is_integral<T>::value || std::is_enum<T>::value) && sizeof(T) <= 4, T>::type > { > return static_cast<T>(u.int32); > } >diff --git a/Source/JavaScriptCore/interpreter/StackVisitor.cpp b/Source/JavaScriptCore/interpreter/StackVisitor.cpp >index 2e110b78142cb826694e3eeba8e37170e13b5cb3..2aa3f3000aead830c2202e380f38785cdd852911 100644 >--- a/Source/JavaScriptCore/interpreter/StackVisitor.cpp >+++ b/Source/JavaScriptCore/interpreter/StackVisitor.cpp >@@ -406,8 +406,8 @@ void StackVisitor::Frame::computeLineAndColumn(unsigned& line, unsigned& column) > line = divotLine + codeBlock->ownerScriptExecutable()->firstLine(); > column = divotColumn + (divotLine ? 1 : codeBlock->firstLineColumnOffset()); > >- if (codeBlock->ownerScriptExecutable()->hasOverrideLineNumber()) >- line = codeBlock->ownerScriptExecutable()->overrideLineNumber(); >+ if (Optional<int> overrideLineNumber = codeBlock->ownerScriptExecutable()->overrideLineNumber(*codeBlock->vm())) >+ line = overrideLineNumber.value(); > } > > void StackVisitor::Frame::retrieveExpressionInfo(int& divot, int& startOffset, int& endOffset, unsigned& line, unsigned& column) const >diff --git a/Source/JavaScriptCore/runtime/ExecutableBase.h b/Source/JavaScriptCore/runtime/ExecutableBase.h >index c719ffba5f893a6ff5b82d67a42820dfd0bc8e43..296da1b4a0f8dd2ef067d4d86fee10b185e6395c 100644 >--- a/Source/JavaScriptCore/runtime/ExecutableBase.h >+++ b/Source/JavaScriptCore/runtime/ExecutableBase.h >@@ -229,11 +229,11 @@ class ExecutableBase : public JSCell { > void dump(PrintStream&) const; > > protected: >- Intrinsic m_intrinsic; > RefPtr<JITCode> m_jitCodeForCall; > RefPtr<JITCode> m_jitCodeForConstruct; > MacroAssemblerCodePtr<JSEntryPtrTag> m_jitCodeForCallWithArityCheck; > MacroAssemblerCodePtr<JSEntryPtrTag> m_jitCodeForConstructWithArityCheck; >+ Intrinsic m_intrinsic; > }; > > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/FunctionExecutable.cpp b/Source/JavaScriptCore/runtime/FunctionExecutable.cpp >index b39a8d1f3c5446bd52ffb12939f13e27b6d37ad9..ac7b0c9cb6b60cc0f917e945cbc0ca8d7b061d00 100644 >--- a/Source/JavaScriptCore/runtime/FunctionExecutable.cpp >+++ b/Source/JavaScriptCore/runtime/FunctionExecutable.cpp >@@ -50,9 +50,6 @@ FunctionExecutable::FunctionExecutable(VM& vm, const SourceCode& source, Unlinke > m_lastLine = lastLine; > ASSERT(endColumn != UINT_MAX); > m_endColumn = endColumn; >- m_parametersStartOffset = unlinkedExecutable->parametersStartOffset(); >- m_typeProfilingStartOffset = unlinkedExecutable->typeProfilingStartOffset(); >- m_typeProfilingEndOffset = unlinkedExecutable->typeProfilingEndOffset(); > if (VM::canUseJIT()) > new (&m_singletonFunction) WriteBarrier<InferredValue>(); > else >@@ -111,4 +108,11 @@ FunctionExecutable* FunctionExecutable::fromGlobalCode( > return unlinkedExecutable->link(exec.vm(), source, overrideLineNumber); > } > >+FunctionExecutable::RareData& FunctionExecutable::ensureRareDataSlow() >+{ >+ ASSERT(!m_rareData); >+ m_rareData = std::make_unique<RareData>(); >+ return *m_rareData; >+} >+ > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/FunctionExecutable.h b/Source/JavaScriptCore/runtime/FunctionExecutable.h >index 5b14e2b2ab5e7c83d799d4096bfb59d44ca49514..57ff4eeab7b26e15c5a4967470e185083c549caf 100644 >--- a/Source/JavaScriptCore/runtime/FunctionExecutable.h >+++ b/Source/JavaScriptCore/runtime/FunctionExecutable.h >@@ -29,6 +29,7 @@ > #include "ScriptExecutable.h" > #include "SourceCode.h" > #include <wtf/Box.h> >+#include <wtf/Markable.h> > > namespace JSC { > >@@ -122,10 +123,10 @@ class FunctionExecutable final : public ScriptExecutable { > > RefPtr<TypeSet> returnStatementTypeSet() > { >- if (!m_returnStatementTypeSet) >- m_returnStatementTypeSet = TypeSet::create(); >- >- return m_returnStatementTypeSet; >+ RareData& rareData = ensureRareData(); >+ if (!rareData.m_returnStatementTypeSet) >+ rareData.m_returnStatementTypeSet = TypeSet::create(); >+ return rareData.m_returnStatementTypeSet; > } > > FunctionMode functionMode() { return m_unlinkedExecutable->functionMode(); } >@@ -172,13 +173,47 @@ class FunctionExecutable final : public ScriptExecutable { > return Structure::create(vm, globalObject, proto, TypeInfo(FunctionExecutableType, StructureFlags), info()); > } > >- unsigned parametersStartOffset() const { return m_parametersStartOffset; } >+ void setOverrideLineNumber(int overrideLineNumber) >+ { >+ if (overrideLineNumber == -1) >+ return; >+ ensureRareData().m_overrideLineNumber = overrideLineNumber; >+ } >+ >+ Optional<int> overrideLineNumber() const >+ { >+ if (UNLIKELY(m_rareData)) >+ return m_rareData->m_overrideLineNumber; >+ return WTF::nullopt; >+ } >+ >+ unsigned typeProfilingStartOffset(VM&) const >+ { >+ if (UNLIKELY(m_rareData)) >+ return m_rareData->m_typeProfilingStartOffset; >+ return m_unlinkedExecutable->typeProfilingStartOffset(); >+ } >+ >+ unsigned typeProfilingEndOffset(VM&) const >+ { >+ if (UNLIKELY(m_rareData)) >+ return m_rareData->m_typeProfilingEndOffset; >+ return m_unlinkedExecutable->typeProfilingEndOffset(); >+ } >+ >+ unsigned parametersStartOffset() const >+ { >+ if (UNLIKELY(m_rareData)) >+ return m_rareData->m_parametersStartOffset; >+ return m_unlinkedExecutable->parametersStartOffset(); >+ } > > void overrideParameterAndTypeProfilingStartEndOffsets(unsigned parametersStartOffset, unsigned typeProfilingStartOffset, unsigned typeProfilingEndOffset) > { >- m_parametersStartOffset = parametersStartOffset; >- m_typeProfilingStartOffset = typeProfilingStartOffset; >- m_typeProfilingEndOffset = typeProfilingEndOffset; >+ auto& rareData = ensureRareData(); >+ rareData.m_parametersStartOffset = parametersStartOffset; >+ rareData.m_typeProfilingStartOffset = typeProfilingStartOffset; >+ rareData.m_typeProfilingEndOffset = typeProfilingEndOffset; > } > > DECLARE_INFO; >@@ -237,12 +272,28 @@ class FunctionExecutable final : public ScriptExecutable { > void finishCreation(VM&); > > friend class ScriptExecutable; >- >- unsigned m_parametersStartOffset; >+ >+ struct RareData { >+ WTF_MAKE_STRUCT_FAST_ALLOCATED; >+ Markable<int, IntegralMarkableTraits<int, -1>> m_overrideLineNumber; >+ unsigned m_parametersStartOffset { 0 }; >+ unsigned m_typeProfilingStartOffset { UINT_MAX }; >+ unsigned m_typeProfilingEndOffset { UINT_MAX }; >+ RefPtr<TypeSet> m_returnStatementTypeSet; >+ }; >+ >+ RareData& ensureRareData() >+ { >+ if (LIKELY(m_rareData)) >+ return *m_rareData; >+ return ensureRareDataSlow(); >+ } >+ RareData& ensureRareDataSlow(); >+ >+ std::unique_ptr<RareData> m_rareData; > WriteBarrier<UnlinkedFunctionExecutable> m_unlinkedExecutable; > WriteBarrier<ExecutableToCodeBlockEdge> m_codeBlockForCall; > WriteBarrier<ExecutableToCodeBlockEdge> m_codeBlockForConstruct; >- RefPtr<TypeSet> m_returnStatementTypeSet; > union { > WriteBarrier<InferredValue> m_singletonFunction; > WatchpointState m_singletonFunctionState; >diff --git a/Source/JavaScriptCore/runtime/Intrinsic.h b/Source/JavaScriptCore/runtime/Intrinsic.h >index b47f46d9e4de0013de8346e82e6816f5fd02f746..93d3643cae8cafaa8a858e062ec1560890035292 100644 >--- a/Source/JavaScriptCore/runtime/Intrinsic.h >+++ b/Source/JavaScriptCore/runtime/Intrinsic.h >@@ -27,7 +27,7 @@ > > namespace JSC { > >-enum Intrinsic { >+enum Intrinsic : uint8_t { > // Call intrinsics. > NoIntrinsic, > AbsIntrinsic, >diff --git a/Source/JavaScriptCore/runtime/ModuleProgramExecutable.cpp b/Source/JavaScriptCore/runtime/ModuleProgramExecutable.cpp >index 25fd954a5e9b4b602962c726c7ad7a6e406a890c..aef3fab15e7513400ee9e215903bf49f8ef2b2f7 100644 >--- a/Source/JavaScriptCore/runtime/ModuleProgramExecutable.cpp >+++ b/Source/JavaScriptCore/runtime/ModuleProgramExecutable.cpp >@@ -46,10 +46,9 @@ ModuleProgramExecutable::ModuleProgramExecutable(ExecState* exec, const SourceCo > : ScriptExecutable(exec->vm().moduleProgramExecutableStructure.get(), exec->vm(), source, false, DerivedContextType::None, false, EvalContextType::None, NoIntrinsic) > { > ASSERT(source.provider()->sourceType() == SourceProviderSourceType::Module); >- m_typeProfilingStartOffset = 0; >- m_typeProfilingEndOffset = source.length() - 1; >- if (exec->vm().typeProfiler() || exec->vm().controlFlowProfiler()) >- exec->vm().functionHasExecutedCache()->insertUnexecutedRange(sourceID(), m_typeProfilingStartOffset, m_typeProfilingEndOffset); >+ VM& vm = exec->vm(); >+ if (vm.typeProfiler() || vm.controlFlowProfiler()) >+ vm.functionHasExecutedCache()->insertUnexecutedRange(sourceID(), typeProfilingStartOffset(vm), typeProfilingEndOffset(vm)); > } > > ModuleProgramExecutable* ModuleProgramExecutable::create(ExecState* exec, const SourceCode& source) >diff --git a/Source/JavaScriptCore/runtime/ProgramExecutable.cpp b/Source/JavaScriptCore/runtime/ProgramExecutable.cpp >index 1a3f09242ed8d2f03dd8232343b91392e88cb52e..5d7221861c89ebf8f7c597f933f9ddb3c979c5c8 100644 >--- a/Source/JavaScriptCore/runtime/ProgramExecutable.cpp >+++ b/Source/JavaScriptCore/runtime/ProgramExecutable.cpp >@@ -47,10 +47,9 @@ ProgramExecutable::ProgramExecutable(ExecState* exec, const SourceCode& source) > : ScriptExecutable(exec->vm().programExecutableStructure.get(), exec->vm(), source, false, DerivedContextType::None, false, EvalContextType::None, NoIntrinsic) > { > ASSERT(source.provider()->sourceType() == SourceProviderSourceType::Program); >- m_typeProfilingStartOffset = 0; >- m_typeProfilingEndOffset = source.length() - 1; >- if (exec->vm().typeProfiler() || exec->vm().controlFlowProfiler()) >- exec->vm().functionHasExecutedCache()->insertUnexecutedRange(sourceID(), m_typeProfilingStartOffset, m_typeProfilingEndOffset); >+ VM& vm = exec->vm(); >+ if (vm.typeProfiler() || vm.controlFlowProfiler()) >+ vm.functionHasExecutedCache()->insertUnexecutedRange(sourceID(), typeProfilingStartOffset(vm), typeProfilingEndOffset(vm)); > } > > void ProgramExecutable::destroy(JSCell* cell) >diff --git a/Source/JavaScriptCore/runtime/ScriptExecutable.cpp b/Source/JavaScriptCore/runtime/ScriptExecutable.cpp >index 52360965bce2d4e098a8002ad54361d980439229..891c3a151a9b20f57645d6cd4943ff4ed750c560 100644 >--- a/Source/JavaScriptCore/runtime/ScriptExecutable.cpp >+++ b/Source/JavaScriptCore/runtime/ScriptExecutable.cpp >@@ -48,7 +48,6 @@ const ClassInfo ScriptExecutable::s_info = { "ScriptExecutable", &ExecutableBase > ScriptExecutable::ScriptExecutable(Structure* structure, VM& vm, const SourceCode& source, bool isInStrictContext, DerivedContextType derivedContextType, bool isInArrowFunctionContext, EvalContextType evalContextType, Intrinsic intrinsic) > : ExecutableBase(vm, structure, NUM_PARAMETERS_NOT_COMPILED, intrinsic) > , m_features(isInStrictContext ? StrictModeFeature : 0) >- , m_didTryToEnterInLoop(false) > , m_hasCapturedVariables(false) > , m_neverInline(false) > , m_neverOptimize(false) >@@ -57,11 +56,6 @@ ScriptExecutable::ScriptExecutable(Structure* structure, VM& vm, const SourceCod > , m_canUseOSRExitFuzzing(true) > , m_derivedContextType(static_cast<unsigned>(derivedContextType)) > , m_evalContextType(static_cast<unsigned>(evalContextType)) >- , m_overrideLineNumber(-1) >- , m_lastLine(-1) >- , m_endColumn(UINT_MAX) >- , m_typeProfilingStartOffset(UINT_MAX) >- , m_typeProfilingEndOffset(UINT_MAX) > , m_source(source) > { > } >@@ -372,4 +366,29 @@ CodeBlockHash ScriptExecutable::hashFor(CodeSpecializationKind kind) const > return CodeBlockHash(source(), kind); > } > >+Optional<int> ScriptExecutable::overrideLineNumber(VM& vm) const >+{ >+ if (inherits<FunctionExecutable>(vm)) >+ return jsCast<const FunctionExecutable*>(this)->overrideLineNumber(); >+ return WTF::nullopt; >+} >+ >+unsigned ScriptExecutable::typeProfilingStartOffset(VM& vm) const >+{ >+ if (inherits<FunctionExecutable>(vm)) >+ return jsCast<const FunctionExecutable*>(this)->typeProfilingStartOffset(vm); >+ if (inherits<EvalExecutable>(vm)) >+ return UINT_MAX; >+ return 0; >+} >+ >+unsigned ScriptExecutable::typeProfilingEndOffset(VM& vm) const >+{ >+ if (inherits<FunctionExecutable>(vm)) >+ return jsCast<const FunctionExecutable*>(this)->typeProfilingEndOffset(vm); >+ if (inherits<EvalExecutable>(vm)) >+ return UINT_MAX; >+ return m_source.length() - 1; >+} >+ > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/ScriptExecutable.h b/Source/JavaScriptCore/runtime/ScriptExecutable.h >index 8d891bdd8d3ee828dbb9c77a4424fc580c2e4a6d..5b85393912a53688ad20751d50fe5037b9d70238 100644 >--- a/Source/JavaScriptCore/runtime/ScriptExecutable.h >+++ b/Source/JavaScriptCore/runtime/ScriptExecutable.h >@@ -45,14 +45,13 @@ class ScriptExecutable : public ExecutableBase { > const SourceOrigin& sourceOrigin() const { return m_source.provider()->sourceOrigin(); } > const String& sourceURL() const { return m_source.provider()->url(); } > int firstLine() const { return m_source.firstLine().oneBasedInt(); } >- void setOverrideLineNumber(int overrideLineNumber) { m_overrideLineNumber = overrideLineNumber; } >- bool hasOverrideLineNumber() const { return m_overrideLineNumber != -1; } >- int overrideLineNumber() const { return m_overrideLineNumber; } > int lastLine() const { return m_lastLine; } > unsigned startColumn() const { return m_source.startColumn().oneBasedInt(); } > unsigned endColumn() const { return m_endColumn; } >- unsigned typeProfilingStartOffset() const { return m_typeProfilingStartOffset; } >- unsigned typeProfilingEndOffset() const { return m_typeProfilingEndOffset; } >+ >+ Optional<int> overrideLineNumber(VM&) const; >+ unsigned typeProfilingStartOffset(VM&) const; >+ unsigned typeProfilingEndOffset(VM&) const; > > bool usesEval() const { return m_features & EvalFeature; } > bool usesArguments() const { return m_features & ArgumentsFeature; } >@@ -124,8 +123,8 @@ class ScriptExecutable : public ExecutableBase { > #endif > } > >+ bool m_didTryToEnterInLoop { false }; > CodeFeatures m_features; >- bool m_didTryToEnterInLoop; > bool m_hasCapturedVariables : 1; > bool m_neverInline : 1; > bool m_neverOptimize : 1; >@@ -135,11 +134,8 @@ class ScriptExecutable : public ExecutableBase { > unsigned m_derivedContextType : 2; // DerivedContextType > unsigned m_evalContextType : 2; // EvalContextType > >- int m_overrideLineNumber; >- int m_lastLine; >- unsigned m_endColumn; >- unsigned m_typeProfilingStartOffset; >- unsigned m_typeProfilingEndOffset; >+ int m_lastLine { -1 }; >+ unsigned m_endColumn { UINT_MAX }; > SourceCode m_source; > }; > >diff --git a/Source/JavaScriptCore/runtime/StackFrame.cpp b/Source/JavaScriptCore/runtime/StackFrame.cpp >index 01b85b9e7624309842a7b8f21bbe98937088d931..dd29f2a98f6133962da1e6e06d49f1822fdced5d 100644 >--- a/Source/JavaScriptCore/runtime/StackFrame.cpp >+++ b/Source/JavaScriptCore/runtime/StackFrame.cpp >@@ -114,8 +114,8 @@ void StackFrame::computeLineAndColumn(unsigned& line, unsigned& column) const > m_codeBlock->expressionRangeForBytecodeOffset(m_bytecodeOffset, divot, unusedStartOffset, unusedEndOffset, line, column); > > ScriptExecutable* executable = m_codeBlock->ownerScriptExecutable(); >- if (executable->hasOverrideLineNumber()) >- line = executable->overrideLineNumber(); >+ if (Optional<int> overrideLineNumber = executable->overrideLineNumber(*m_codeBlock->vm())) >+ line = overrideLineNumber.value(); > } > > String StackFrame::toString(VM& vm) const >diff --git a/Source/JavaScriptCore/tools/JSDollarVM.cpp b/Source/JavaScriptCore/tools/JSDollarVM.cpp >index 747aa29d706e4da4f0c6ce9fe879de162520d105..a2b56e6d0cb03b381b69d5804d853e927d1af870 100644 >--- a/Source/JavaScriptCore/tools/JSDollarVM.cpp >+++ b/Source/JavaScriptCore/tools/JSDollarVM.cpp >@@ -1985,7 +1985,7 @@ static EncodedJSValue JSC_HOST_CALL functionReturnTypeFor(ExecState* exec) > RELEASE_ASSERT(functionValue.isFunction(vm)); > FunctionExecutable* executable = (jsDynamicCast<JSFunction*>(vm, functionValue.asCell()->getObject()))->jsExecutable(); > >- unsigned offset = executable->typeProfilingStartOffset(); >+ unsigned offset = executable->typeProfilingStartOffset(vm); > String jsonString = vm.typeProfiler()->typeInformationForExpressionAtOffset(TypeProfilerSearchDescriptorFunctionReturn, offset, executable->sourceID(), vm); > return JSValue::encode(JSONParse(exec, jsonString)); > }
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 194191
:
360971
|
360972
|
360973
|
360974
|
360975
|
360976
|
360984
|
360986