Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (242811 => 242812)
--- trunk/Source/_javascript_Core/ChangeLog 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/ChangeLog 2019-03-12 19:07:04 UTC (rev 242812)
@@ -1,3 +1,49 @@
+2019-03-12 Robin Morisset <[email protected]>
+
+ A lot more classes have padding that can be reduced by reordering their fields
+ https://bugs.webkit.org/show_bug.cgi?id=195579
+
+ Reviewed by Mark Lam.
+
+ * assembler/LinkBuffer.h:
+ * dfg/DFGArrayifySlowPathGenerator.h:
+ (JSC::DFG::ArrayifySlowPathGenerator::ArrayifySlowPathGenerator):
+ * dfg/DFGCallArrayAllocatorSlowPathGenerator.h:
+ (JSC::DFG::CallArrayAllocatorSlowPathGenerator::CallArrayAllocatorSlowPathGenerator):
+ (JSC::DFG::CallArrayAllocatorWithVariableSizeSlowPathGenerator::CallArrayAllocatorWithVariableSizeSlowPathGenerator):
+ * dfg/DFGGraph.h:
+ * dfg/DFGNode.h:
+ (JSC::DFG::SwitchData::SwitchData):
+ * dfg/DFGPlan.cpp:
+ (JSC::DFG::Plan::Plan):
+ * dfg/DFGPlan.h:
+ * dfg/DFGSlowPathGenerator.h:
+ (JSC::DFG::CallSlowPathGenerator::CallSlowPathGenerator):
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
+ * dfg/DFGSpeculativeJIT.h:
+ * domjit/DOMJITSignature.h:
+ (JSC::DOMJIT::Signature::Signature):
+ (JSC::DOMJIT::Signature::effect):
+ (JSC::DOMJIT::Signature::argumentCount): Deleted.
+ * heap/MarkingConstraintSolver.h:
+ * heap/SlotVisitor.h:
+ * jit/CallFrameShuffleData.h:
+ * jit/JITDivGenerator.h:
+ * jit/SpillRegistersMode.h:
+ * parser/Nodes.h:
+ * profiler/ProfilerOSRExit.cpp:
+ (JSC::Profiler::OSRExit::OSRExit):
+ * profiler/ProfilerOSRExit.h:
+ * runtime/ArrayBufferView.h:
+ * runtime/SamplingProfiler.cpp:
+ (JSC::SamplingProfiler::SamplingProfiler):
+ * runtime/SamplingProfiler.h:
+ * runtime/TypeSet.cpp:
+ (JSC::StructureShape::StructureShape):
+ * runtime/TypeSet.h:
+ * runtime/Watchdog.h:
+
2019-03-12 Mark Lam <[email protected]>
The HasIndexedProperty node does GC.
Modified: trunk/Source/_javascript_Core/assembler/LinkBuffer.h (242811 => 242812)
--- trunk/Source/_javascript_Core/assembler/LinkBuffer.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/assembler/LinkBuffer.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -93,10 +93,10 @@
LinkBuffer(MacroAssembler& macroAssembler, MacroAssemblerCodePtr<tag> code, size_t size, JITCompilationEffort effort = JITCompilationMustSucceed, bool shouldPerformBranchCompaction = true)
: m_size(size)
, m_didAllocate(false)
- , m_code(code.template retagged<LinkBufferPtrTag>())
#ifndef NDEBUG
, m_completed(false)
#endif
+ , m_code(code.template retagged<LinkBufferPtrTag>())
{
#if ENABLE(BRANCH_COMPACTION)
m_shouldPerformBranchCompaction = shouldPerformBranchCompaction;
@@ -342,11 +342,11 @@
bool m_shouldPerformBranchCompaction { true };
#endif
bool m_didAllocate;
- MacroAssemblerCodePtr<LinkBufferPtrTag> m_code;
#ifndef NDEBUG
bool m_completed;
#endif
bool m_alreadyDisassembled { false };
+ MacroAssemblerCodePtr<LinkBufferPtrTag> m_code;
Vector<RefPtr<SharedTask<void(LinkBuffer&)>>> m_linkTasks;
};
Modified: trunk/Source/_javascript_Core/dfg/DFGArrayifySlowPathGenerator.h (242811 => 242812)
--- trunk/Source/_javascript_Core/dfg/DFGArrayifySlowPathGenerator.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/dfg/DFGArrayifySlowPathGenerator.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -43,8 +43,8 @@
GPRReg propertyGPR, GPRReg tempGPR, GPRReg structureGPR)
: JumpingSlowPathGenerator<MacroAssembler::JumpList>(from, jit)
, m_op(node->op())
+ , m_structure(node->op() == ArrayifyToStructure ? node->structure() : RegisteredStructure())
, m_arrayMode(node->arrayMode())
- , m_structure(node->op() == ArrayifyToStructure ? node->structure() : RegisteredStructure())
, m_baseGPR(baseGPR)
, m_propertyGPR(propertyGPR)
, m_tempGPR(tempGPR)
@@ -134,8 +134,8 @@
private:
NodeType m_op;
+ RegisteredStructure m_structure;
ArrayMode m_arrayMode;
- RegisteredStructure m_structure;
GPRReg m_baseGPR;
GPRReg m_propertyGPR;
GPRReg m_tempGPR;
Modified: trunk/Source/_javascript_Core/dfg/DFGCallArrayAllocatorSlowPathGenerator.h (242811 => 242812)
--- trunk/Source/_javascript_Core/dfg/DFGCallArrayAllocatorSlowPathGenerator.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/dfg/DFGCallArrayAllocatorSlowPathGenerator.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -42,8 +42,8 @@
, m_function(function)
, m_resultGPR(resultGPR)
, m_storageGPR(storageGPR)
+ , m_size(size)
, m_structure(structure)
- , m_size(size)
{
ASSERT(size < static_cast<size_t>(std::numeric_limits<int32_t>::max()));
jit->silentSpillAllRegistersImpl(false, m_plans, resultGPR);
@@ -67,8 +67,8 @@
P_JITOperation_EStZB m_function;
GPRReg m_resultGPR;
GPRReg m_storageGPR;
+ int m_size;
RegisteredStructure m_structure;
- int m_size;
Vector<SilentRegisterSavePlan, 2> m_plans;
};
@@ -79,9 +79,9 @@
GPRReg resultGPR, RegisteredStructure contiguousStructure, RegisteredStructure arrayStorageStructure, GPRReg sizeGPR, GPRReg storageGPR)
: JumpingSlowPathGenerator<MacroAssembler::JumpList>(from, jit)
, m_function(function)
- , m_resultGPR(resultGPR)
, m_contiguousStructure(contiguousStructure)
, m_arrayStorageOrContiguousStructure(arrayStorageStructure)
+ , m_resultGPR(resultGPR)
, m_sizeGPR(sizeGPR)
, m_storageGPR(storageGPR)
{
@@ -113,9 +113,9 @@
private:
P_JITOperation_EStZB m_function;
- GPRReg m_resultGPR;
RegisteredStructure m_contiguousStructure;
RegisteredStructure m_arrayStorageOrContiguousStructure;
+ GPRReg m_resultGPR;
GPRReg m_sizeGPR;
GPRReg m_storageGPR;
Vector<SilentRegisterSavePlan, 2> m_plans;
Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.h (242811 => 242812)
--- trunk/Source/_javascript_Core/dfg/DFGGraph.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -1022,16 +1022,6 @@
// So argumentFormats[0] are the argument formats for the normal call entrypoint.
Vector<Vector<FlushFormat>> m_argumentFormats;
- // This maps an entrypoint index to a particular op_catch bytecode offset. By convention,
- // it'll never have zero as a key because we use zero to mean the op_enter entrypoint.
- HashMap<unsigned, unsigned> m_entrypointIndexToCatchBytecodeOffset;
-
- // This is the number of logical entrypoints that we're compiling. This is only used
- // in SSA. Each EntrySwitch node must have m_numberOfEntrypoints cases. Note, this is
- // not the same as m_roots.size(). m_roots.size() represents the number of roots in
- // the CFG. In SSA, m_roots.size() == 1 even if we're compiling more than one entrypoint.
- unsigned m_numberOfEntrypoints { UINT_MAX };
-
SegmentedVector<VariableAccessData, 16> m_variableAccessData;
SegmentedVector<ArgumentPosition, 8> m_argumentPositions;
Bag<Transition> m_transitions;
@@ -1064,7 +1054,17 @@
unsigned m_localVars;
unsigned m_nextMachineLocal;
unsigned m_parameterSlots;
-
+
+ // This is the number of logical entrypoints that we're compiling. This is only used
+ // in SSA. Each EntrySwitch node must have m_numberOfEntrypoints cases. Note, this is
+ // not the same as m_roots.size(). m_roots.size() represents the number of roots in
+ // the CFG. In SSA, m_roots.size() == 1 even if we're compiling more than one entrypoint.
+ unsigned m_numberOfEntrypoints { UINT_MAX };
+
+ // This maps an entrypoint index to a particular op_catch bytecode offset. By convention,
+ // it'll never have zero as a key because we use zero to mean the op_enter entrypoint.
+ HashMap<unsigned, unsigned> m_entrypointIndexToCatchBytecodeOffset;
+
HashSet<String> m_localStrings;
HashMap<const StringImpl*, String> m_copiedStrings;
Modified: trunk/Source/_javascript_Core/dfg/DFGNode.h (242811 => 242812)
--- trunk/Source/_javascript_Core/dfg/DFGNode.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/dfg/DFGNode.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -213,8 +213,8 @@
// constructing this should make sure to initialize everything they
// care about manually.
SwitchData()
- : kind(static_cast<SwitchKind>(-1))
- , switchTableIndex(UINT_MAX)
+ : switchTableIndex(UINT_MAX)
+ , kind(static_cast<SwitchKind>(-1))
, didUseJumpTable(false)
{
}
@@ -221,8 +221,8 @@
Vector<SwitchCase> cases;
BranchTarget fallThrough;
+ size_t switchTableIndex;
SwitchKind kind;
- size_t switchTableIndex;
bool didUseJumpTable;
};
Modified: trunk/Source/_javascript_Core/dfg/DFGPlan.cpp (242811 => 242812)
--- trunk/Source/_javascript_Core/dfg/DFGPlan.cpp 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/dfg/DFGPlan.cpp 2019-03-12 19:07:04 UTC (rev 242812)
@@ -136,12 +136,12 @@
Plan::Plan(CodeBlock* passedCodeBlock, CodeBlock* profiledDFGCodeBlock,
CompilationMode mode, unsigned osrEntryBytecodeIndex,
const Operands<Optional<JSValue>>& mustHandleValues)
- : m_vm(passedCodeBlock->vm())
+ : m_mode(mode)
+ , m_vm(passedCodeBlock->vm())
, m_codeBlock(passedCodeBlock)
, m_profiledDFGCodeBlock(profiledDFGCodeBlock)
- , m_mode(mode)
+ , m_mustHandleValues(mustHandleValues)
, m_osrEntryBytecodeIndex(osrEntryBytecodeIndex)
- , m_mustHandleValues(mustHandleValues)
, m_compilation(UNLIKELY(m_vm->m_perBytecodeProfiler) ? adoptRef(new Profiler::Compilation(m_vm->m_perBytecodeProfiler->ensureBytecodesFor(m_codeBlock), profilerCompilationKindForMode(mode))) : nullptr)
, m_inlineCallFrames(adoptRef(new InlineCallFrameSet()))
, m_identifiers(m_codeBlock)
Modified: trunk/Source/_javascript_Core/dfg/DFGPlan.h (242811 => 242812)
--- trunk/Source/_javascript_Core/dfg/DFGPlan.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/dfg/DFGPlan.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -129,6 +129,8 @@
// Warning: pretty much all of the pointer fields in this object get nulled by cancel(). So, if
// you're writing code that is callable on the cancel path, be sure to null check everything!
+ CompilationMode m_mode;
+
VM* m_vm;
// These can be raw pointers because we visit them during every GC in checkLivenessAndVisitChildren.
@@ -135,12 +137,14 @@
CodeBlock* m_codeBlock;
CodeBlock* m_profiledDFGCodeBlock;
- CompilationMode m_mode;
- const unsigned m_osrEntryBytecodeIndex;
Operands<Optional<JSValue>> m_mustHandleValues;
bool m_mustHandleValuesMayIncludeGarbage { true };
Lock m_mustHandleValueCleaningLock;
+ bool m_willTryToTierUp { false };
+
+ const unsigned m_osrEntryBytecodeIndex;
+
ThreadData* m_threadData;
RefPtr<Profiler::Compilation> m_compilation;
@@ -155,8 +159,6 @@
DesiredGlobalProperties m_globalProperties;
RecordedStatuses m_recordedStatuses;
- bool m_willTryToTierUp { false };
-
HashMap<unsigned, Vector<unsigned>> m_tierUpInLoopHierarchy;
Vector<unsigned> m_tierUpAndOSREnterBytecodes;
Modified: trunk/Source/_javascript_Core/dfg/DFGSlowPathGenerator.h (242811 => 242812)
--- trunk/Source/_javascript_Core/dfg/DFGSlowPathGenerator.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/dfg/DFGSlowPathGenerator.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -66,8 +66,8 @@
protected:
virtual void generateInternal(SpeculativeJIT*) = 0;
+ Node* m_currentNode;
MacroAssembler::Label m_label;
- Node* m_currentNode;
unsigned m_streamIndex;
NodeOrigin m_origin;
};
@@ -97,7 +97,7 @@
MacroAssembler::Label m_to;
};
-enum class ExceptionCheckRequirement {
+enum class ExceptionCheckRequirement : uint8_t {
CheckNeeded,
CheckNotNeeded
};
@@ -109,10 +109,10 @@
JumpType from, SpeculativeJIT* jit, FunctionType function,
SpillRegistersMode spillMode, ExceptionCheckRequirement requirement, ResultType result)
: JumpingSlowPathGenerator<JumpType>(from, jit)
- , m_function(function)
, m_spillMode(spillMode)
, m_exceptionCheckRequirement(requirement)
, m_result(result)
+ , m_function(function)
{
if (m_spillMode == NeedToSpill)
jit->silentSpillAllRegistersImpl(false, m_plans, extractResult(result));
@@ -149,11 +149,11 @@
this->jumpTo(jit);
}
- FunctionType m_function;
+ MacroAssembler::Call m_call;
SpillRegistersMode m_spillMode;
ExceptionCheckRequirement m_exceptionCheckRequirement;
ResultType m_result;
- MacroAssembler::Call m_call;
+ FunctionType m_function;
Vector<SilentRegisterSavePlan, 2> m_plans;
};
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (242811 => 242812)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2019-03-12 19:07:04 UTC (rev 242812)
@@ -71,13 +71,13 @@
namespace JSC { namespace DFG {
SpeculativeJIT::SpeculativeJIT(JITCompiler& jit)
- : m_compileOkay(true)
- , m_jit(jit)
+ : m_jit(jit)
, m_graph(m_jit.graph())
, m_currentNode(0)
, m_lastGeneratedNode(LastNodeType)
, m_indexInBlock(0)
, m_generationInfo(m_jit.graph().frameRegisterCount())
+ , m_compileOkay(true)
, m_state(m_jit.graph())
, m_interpreter(m_jit.graph(), m_state)
, m_stream(&jit.jitCode()->variableEventStream)
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h (242811 => 242812)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -1652,12 +1652,6 @@
void cageTypedArrayStorage(GPRReg);
- // It is possible, during speculative generation, to reach a situation in which we
- // can statically determine a speculation will fail (for example, when two nodes
- // will make conflicting speculations about the same operand). In such cases this
- // flag is cleared, indicating no further code generation should take place.
- bool m_compileOkay;
-
void recordSetLocal(
VirtualRegister bytecodeReg, VirtualRegister machineReg, DataFormat format)
{
@@ -1700,6 +1694,12 @@
RegisterBank<GPRInfo> m_gprs;
RegisterBank<FPRInfo> m_fprs;
+ // It is possible, during speculative generation, to reach a situation in which we
+ // can statically determine a speculation will fail (for example, when two nodes
+ // will make conflicting speculations about the same operand). In such cases this
+ // flag is cleared, indicating no further code generation should take place.
+ bool m_compileOkay;
+
Vector<MacroAssembler::Label> m_osrEntryHeads;
struct BranchRecord {
Modified: trunk/Source/_javascript_Core/domjit/DOMJITSignature.h (242811 => 242812)
--- trunk/Source/_javascript_Core/domjit/DOMJITSignature.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/domjit/DOMJITSignature.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -43,19 +43,19 @@
constexpr Signature(uintptr_t unsafeFunction, const ClassInfo* classInfo, Effect effect, SpeculatedType result, Arguments... arguments)
: unsafeFunction(unsafeFunction)
, classInfo(classInfo)
- , effect(effect)
, result(result)
, arguments {static_cast<SpeculatedType>(arguments)...}
, argumentCount(sizeof...(Arguments))
+ , effect(effect)
{
}
uintptr_t unsafeFunction;
const ClassInfo* const classInfo;
- const Effect effect;
const SpeculatedType result;
const SpeculatedType arguments[JSC_DOMJIT_SIGNATURE_MAX_ARGUMENTS];
const unsigned argumentCount;
+ const Effect effect;
};
} }
Modified: trunk/Source/_javascript_Core/heap/MarkingConstraintSolver.h (242811 => 242812)
--- trunk/Source/_javascript_Core/heap/MarkingConstraintSolver.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/heap/MarkingConstraintSolver.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -97,8 +97,8 @@
Vector<unsigned, 32> m_toExecuteSequentially;
Lock m_lock;
Condition m_condition;
+ bool m_pickNextIsStillActive { true };
unsigned m_numThreadsThatMayProduceWork { 0 };
- bool m_pickNextIsStillActive { true };
Vector<VisitCounter, 16> m_visitCounters;
};
Modified: trunk/Source/_javascript_Core/heap/SlotVisitor.h (242811 => 242812)
--- trunk/Source/_javascript_Core/heap/SlotVisitor.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/heap/SlotVisitor.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -234,7 +234,6 @@
MarkStackArray m_collectorStack;
MarkStackArray m_mutatorStack;
- bool m_ignoreNewOpaqueRoots { false }; // Useful as a debugging mode.
size_t m_bytesVisited;
size_t m_visitCount;
@@ -241,6 +240,7 @@
size_t m_nonCellVisitCount { 0 }; // Used for incremental draining, ignored otherwise.
Checked<size_t, RecordOverflow> m_extraMemorySize { 0 };
bool m_isInParallelMode;
+ bool m_ignoreNewOpaqueRoots { false }; // Useful as a debugging mode.
HeapVersion m_markingVersion;
Modified: trunk/Source/_javascript_Core/jit/CallFrameShuffleData.h (242811 => 242812)
--- trunk/Source/_javascript_Core/jit/CallFrameShuffleData.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/jit/CallFrameShuffleData.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -35,9 +35,9 @@
struct CallFrameShuffleData {
WTF_MAKE_FAST_ALLOCATED;
public:
- unsigned numLocals { UINT_MAX };
ValueRecovery callee;
Vector<ValueRecovery> args;
+ unsigned numLocals { UINT_MAX };
unsigned numPassedArgs { UINT_MAX };
#if USE(JSVALUE64)
RegisterMap<ValueRecovery> registers;
Modified: trunk/Source/_javascript_Core/jit/JITDivGenerator.h (242811 => 242812)
--- trunk/Source/_javascript_Core/jit/JITDivGenerator.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/jit/JITDivGenerator.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -70,8 +70,8 @@
FPRReg m_rightFPR;
GPRReg m_scratchGPR;
FPRReg m_scratchFPR;
+ bool m_didEmitFastPath { false };
ArithProfile* m_arithProfile;
- bool m_didEmitFastPath { false };
CCallHelpers::JumpList m_endJumpList;
CCallHelpers::JumpList m_slowPathJumpList;
Modified: trunk/Source/_javascript_Core/jit/SpillRegistersMode.h (242811 => 242812)
--- trunk/Source/_javascript_Core/jit/SpillRegistersMode.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/jit/SpillRegistersMode.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -27,6 +27,6 @@
namespace JSC {
-enum SpillRegistersMode { NeedToSpill, DontSpill };
+enum SpillRegistersMode : uint8_t { NeedToSpill, DontSpill };
}
Modified: trunk/Source/_javascript_Core/parser/Nodes.h (242811 => 242812)
--- trunk/Source/_javascript_Core/parser/Nodes.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/parser/Nodes.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -2039,10 +2039,10 @@
unsigned m_constructorKind : 2;
unsigned m_isArrowFunctionBodyExpression : 1;
SourceParseMode m_parseMode;
+ FunctionMode m_functionMode;
Identifier m_ident;
Identifier m_ecmaName;
Identifier m_inferredName;
- FunctionMode m_functionMode;
unsigned m_startColumn;
unsigned m_endColumn;
int m_functionKeywordStart;
Modified: trunk/Source/_javascript_Core/profiler/ProfilerOSRExit.cpp (242811 => 242812)
--- trunk/Source/_javascript_Core/profiler/ProfilerOSRExit.cpp 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/profiler/ProfilerOSRExit.cpp 2019-03-12 19:07:04 UTC (rev 242812)
@@ -33,8 +33,8 @@
namespace JSC { namespace Profiler {
OSRExit::OSRExit(unsigned id, const OriginStack& origin, ExitKind kind, bool isWatchpoint)
- : m_id(id)
- , m_origin(origin)
+ : m_origin(origin)
+ , m_id(id)
, m_exitKind(kind)
, m_isWatchpoint(isWatchpoint)
, m_counter(0)
Modified: trunk/Source/_javascript_Core/profiler/ProfilerOSRExit.h (242811 => 242812)
--- trunk/Source/_javascript_Core/profiler/ProfilerOSRExit.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/profiler/ProfilerOSRExit.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -48,8 +48,8 @@
JSValue toJS(ExecState*) const;
private:
+ OriginStack m_origin;
unsigned m_id;
- OriginStack m_origin;
ExitKind m_exitKind;
bool m_isWatchpoint;
uint64_t m_counter;
Modified: trunk/Source/_javascript_Core/runtime/ArrayBufferView.h (242811 => 242812)
--- trunk/Source/_javascript_Core/runtime/ArrayBufferView.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/runtime/ArrayBufferView.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -148,12 +148,12 @@
*numElements = std::min(remainingElements, *numElements);
}
+ unsigned m_byteOffset : 31;
+ bool m_isNeuterable : 1;
+
// This is the address of the ArrayBuffer's storage, plus the byte offset.
CagedPtr<Gigacage::Primitive, void> m_baseAddress;
- unsigned m_byteOffset : 31;
- bool m_isNeuterable : 1;
-
private:
friend class ArrayBuffer;
RefPtr<ArrayBuffer> m_buffer;
Modified: trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp (242811 => 242812)
--- trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp 2019-03-12 19:07:04 UTC (rev 242812)
@@ -277,12 +277,12 @@
};
SamplingProfiler::SamplingProfiler(VM& vm, RefPtr<Stopwatch>&& stopwatch)
- : m_vm(vm)
+ : m_isPaused(false)
+ , m_isShutDown(false)
+ , m_vm(vm)
, m_weakRandom()
, m_stopwatch(WTFMove(stopwatch))
, m_timingInterval(Seconds::fromMicroseconds(Options::sampleInterval()))
- , m_isPaused(false)
- , m_isShutDown(false)
{
if (sReportStats) {
sNumTotalWalks = 0;
Modified: trunk/Source/_javascript_Core/runtime/SamplingProfiler.h (242811 => 242812)
--- trunk/Source/_javascript_Core/runtime/SamplingProfiler.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/runtime/SamplingProfiler.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -191,6 +191,10 @@
void timerLoop();
void takeSample(const AbstractLocker&, Seconds& stackTraceProcessingTime);
+ Lock m_lock;
+ bool m_isPaused;
+ bool m_isShutDown;
+ bool m_needsReportAtExit { false };
VM& m_vm;
WeakRandom m_weakRandom;
RefPtr<Stopwatch> m_stopwatch;
@@ -198,12 +202,8 @@
Vector<UnprocessedStackTrace> m_unprocessedStackTraces;
Seconds m_timingInterval;
Seconds m_lastTime;
- Lock m_lock;
RefPtr<Thread> m_thread;
RefPtr<Thread> m_jscExecutionThread;
- bool m_isPaused;
- bool m_isShutDown;
- bool m_needsReportAtExit { false };
HashSet<JSCell*> m_liveCellPointers;
Vector<UnprocessedStackFrame> m_currentFrames;
};
Modified: trunk/Source/_javascript_Core/runtime/TypeSet.cpp (242811 => 242812)
--- trunk/Source/_javascript_Core/runtime/TypeSet.cpp 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/runtime/TypeSet.cpp 2019-03-12 19:07:04 UTC (rev 242812)
@@ -319,10 +319,10 @@
}
StructureShape::StructureShape()
- : m_proto(nullptr)
+ : m_final(false)
+ , m_isInDictionaryMode(false)
+ , m_proto(nullptr)
, m_propertyHash(nullptr)
- , m_final(false)
- , m_isInDictionaryMode(false)
{
}
Modified: trunk/Source/_javascript_Core/runtime/TypeSet.h (242811 => 242812)
--- trunk/Source/_javascript_Core/runtime/TypeSet.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/runtime/TypeSet.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -71,13 +71,13 @@
static Ref<StructureShape> merge(Ref<StructureShape>&&, Ref<StructureShape>&&);
bool hasSamePrototypeChain(const StructureShape&);
+ bool m_final;
+ bool m_isInDictionaryMode;
HashSet<RefPtr<UniquedStringImpl>, IdentifierRepHash> m_fields;
HashSet<RefPtr<UniquedStringImpl>, IdentifierRepHash> m_optionalFields;
RefPtr<StructureShape> m_proto;
std::unique_ptr<String> m_propertyHash;
String m_constructorName;
- bool m_final;
- bool m_isInDictionaryMode;
};
class TypeSet : public ThreadSafeRefCounted<TypeSet> {
Modified: trunk/Source/_javascript_Core/runtime/Watchdog.h (242811 => 242812)
--- trunk/Source/_javascript_Core/runtime/Watchdog.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/_javascript_Core/runtime/Watchdog.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -59,6 +59,8 @@
void startTimer(Seconds timeLimit);
void stopTimer();
+ bool m_hasEnteredVM { false };
+
Lock m_lock; // Guards access to m_vm.
VM* m_vm;
@@ -67,8 +69,6 @@
Seconds m_cpuDeadline;
MonotonicTime m_deadline;
- bool m_hasEnteredVM { false };
-
ShouldTerminateCallback m_callback;
void* m_callbackData1;
void* m_callbackData2;
Modified: trunk/Source/WTF/ChangeLog (242811 => 242812)
--- trunk/Source/WTF/ChangeLog 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/WTF/ChangeLog 2019-03-12 19:07:04 UTC (rev 242812)
@@ -1,3 +1,16 @@
+2019-03-12 Robin Morisset <[email protected]>
+
+ A lot more classes have padding that can be reduced by reordering their fields
+ https://bugs.webkit.org/show_bug.cgi?id=195579
+
+ Reviewed by Mark Lam.
+
+ * wtf/CrossThreadQueue.h:
+ * wtf/Logger.h:
+ * wtf/MemoryPressureHandler.h:
+ * wtf/MetaAllocator.h:
+ * wtf/Threading.cpp:
+
2019-03-11 Alex Christensen <[email protected]>
WTF::Expected should use std::addressof instead of operator&
Modified: trunk/Source/WTF/wtf/CrossThreadQueue.h (242811 => 242812)
--- trunk/Source/WTF/wtf/CrossThreadQueue.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/WTF/wtf/CrossThreadQueue.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -51,9 +51,9 @@
bool isEmpty() const;
private:
+ Deque<DataType> m_queue;
mutable Lock m_lock;
Condition m_condition;
- Deque<DataType> m_queue;
bool m_killed { false };
};
Modified: trunk/Source/WTF/wtf/Logger.h (242811 => 242812)
--- trunk/Source/WTF/wtf/Logger.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/WTF/wtf/Logger.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -252,8 +252,8 @@
return observers;
}
+ bool m_enabled { true };
const void* m_owner;
- bool m_enabled { true };
};
template<> struct LogArgument<Logger::LogSiteIdentifier> {
Modified: trunk/Source/WTF/wtf/MemoryPressureHandler.h (242811 => 242812)
--- trunk/Source/WTF/wtf/MemoryPressureHandler.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/WTF/wtf/MemoryPressureHandler.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -181,12 +181,13 @@
unsigned m_pageCount { 0 };
- bool m_installed { false };
LowMemoryHandler m_lowMemoryHandler;
std::atomic<bool> m_underMemoryPressure;
+ bool m_installed { false };
bool m_isSimulatingMemoryPressure { false };
bool m_shouldLogMemoryMemoryPressureEvents { true };
+ bool m_hasInvokedDidExceedInactiveLimitWhileActiveCallback { false };
std::unique_ptr<RunLoop::Timer<MemoryPressureHandler>> m_measurementTimer;
MemoryUsagePolicy m_memoryUsagePolicy { MemoryUsagePolicy::Unrestricted };
@@ -193,7 +194,6 @@
WTF::Function<void()> m_memoryKillCallback;
WTF::Function<void(bool)> m_memoryPressureStatusChangedCallback;
WTF::Function<void()> m_didExceedInactiveLimitWhileActiveCallback;
- bool m_hasInvokedDidExceedInactiveLimitWhileActiveCallback { false };
#if OS(WINDOWS)
void windowsMeasurementTimerFired();
Modified: trunk/Source/WTF/wtf/MetaAllocator.h (242811 => 242812)
--- trunk/Source/WTF/wtf/MetaAllocator.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/WTF/wtf/MetaAllocator.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -179,8 +179,8 @@
WTF_EXPORT_PRIVATE void freeFreeSpaceNode(FreeSpaceNode*);
size_t m_allocationGranule;
+ size_t m_pageSize;
unsigned m_logAllocationGranule;
- size_t m_pageSize;
unsigned m_logPageSize;
Tree m_freeSpaceSizeMap;
Modified: trunk/Source/WTF/wtf/Threading.cpp (242811 => 242812)
--- trunk/Source/WTF/wtf/Threading.cpp 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/WTF/wtf/Threading.cpp 2019-03-12 19:07:04 UTC (rev 242812)
@@ -54,12 +54,12 @@
{
}
+ enum class Stage { Start, EstablishedHandle, Initialized };
+ Stage stage { Stage::Start };
const char* name;
Function<void()> entryPoint;
Ref<Thread> thread;
Mutex mutex;
- enum class Stage { Start, EstablishedHandle, Initialized };
- Stage stage { Stage::Start };
#if !HAVE(STACK_BOUNDS_FOR_NEW_THREAD)
ThreadCondition condition;
Modified: trunk/Source/bmalloc/ChangeLog (242811 => 242812)
--- trunk/Source/bmalloc/ChangeLog 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/bmalloc/ChangeLog 2019-03-12 19:07:04 UTC (rev 242812)
@@ -1,3 +1,13 @@
+2019-03-12 Robin Morisset <[email protected]>
+
+ A lot more classes have padding that can be reduced by reordering their fields
+ https://bugs.webkit.org/show_bug.cgi?id=195579
+
+ Reviewed by Mark Lam.
+
+ * bmalloc/Heap.h:
+ * bmalloc/Scavenger.h:
+
2019-03-05 Yusuke Suzuki <[email protected]>
[bmalloc] Bmalloc DebugHeap should have dump and scavenge features
Modified: trunk/Source/bmalloc/bmalloc/Heap.h (242811 => 242812)
--- trunk/Source/bmalloc/bmalloc/Heap.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/bmalloc/bmalloc/Heap.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -128,7 +128,10 @@
LargeRange splitAndAllocate(std::unique_lock<Mutex>&, LargeRange&, size_t alignment, size_t);
HeapKind m_kind;
-
+
+ bool m_hasPendingDecommits { false };
+ std::condition_variable_any m_condition;
+
size_t m_vmPageSizePhysical;
Vector<LineMetadata> m_smallLineMetadata;
std::array<size_t, sizeClassCount> m_pageClasses;
@@ -147,9 +150,6 @@
size_t m_footprint { 0 };
size_t m_freeableMemory { 0 };
- bool m_hasPendingDecommits { false };
- std::condition_variable_any m_condition;
-
#if ENABLE_PHYSICAL_PAGE_MAP
PhysicalPageMap m_physicalPageMap;
#endif
Modified: trunk/Source/bmalloc/bmalloc/Scavenger.h (242811 => 242812)
--- trunk/Source/bmalloc/bmalloc/Scavenger.h 2019-03-12 19:03:01 UTC (rev 242811)
+++ trunk/Source/bmalloc/bmalloc/Scavenger.h 2019-03-12 19:07:04 UTC (rev 242812)
@@ -95,6 +95,7 @@
std::atomic<State> m_state { State::Sleep };
size_t m_scavengerBytes { 0 };
bool m_isProbablyGrowing { false };
+ bool m_isInMiniMode { false };
Mutex m_mutex;
Mutex m_scavengingMutex;
@@ -110,8 +111,6 @@
#endif
Vector<DeferredDecommit> m_deferredDecommits;
-
- bool m_isInMiniMode { false };
};
} // namespace bmalloc