Title: [233645] trunk/Source/_javascript_Core
Revision
233645
Author
[email protected]
Date
2018-07-09 10:09:43 -0700 (Mon, 09 Jul 2018)

Log Message

[JSC] Make some data members of UnlinkedCodeBlock private
https://bugs.webkit.org/show_bug.cgi?id=187467

Reviewed by Mark Lam.

This patch makes m_numVars, m_numCalleeLocals, and m_numParameters of UnlinkedCodeBlock private.
We also remove m_numCapturedVars since it is no longer used.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
* bytecode/CodeBlock.h:
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (233644 => 233645)


--- trunk/Source/_javascript_Core/ChangeLog	2018-07-09 17:08:17 UTC (rev 233644)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-07-09 17:09:43 UTC (rev 233645)
@@ -1,5 +1,22 @@
 2018-07-09  Yusuke Suzuki  <[email protected]>
 
+        [JSC] Make some data members of UnlinkedCodeBlock private
+        https://bugs.webkit.org/show_bug.cgi?id=187467
+
+        Reviewed by Mark Lam.
+
+        This patch makes m_numVars, m_numCalleeLocals, and m_numParameters of UnlinkedCodeBlock private.
+        We also remove m_numCapturedVars since it is no longer used.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::CodeBlock):
+        * bytecode/CodeBlock.h:
+        * bytecode/UnlinkedCodeBlock.cpp:
+        (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
+        * bytecode/UnlinkedCodeBlock.h:
+
+2018-07-09  Yusuke Suzuki  <[email protected]>
+
         [JSC] Optimize layout of AccessCase / ProxyableAccessCase to reduce size of ProxyableAccessCase
         https://bugs.webkit.org/show_bug.cgi?id=187465
 

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (233644 => 233645)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2018-07-09 17:08:17 UTC (rev 233644)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2018-07-09 17:09:43 UTC (rev 233645)
@@ -371,8 +371,8 @@
     , m_isConstructor(unlinkedCodeBlock->isConstructor())
     , m_isStrictMode(unlinkedCodeBlock->isStrictMode())
     , m_codeType(unlinkedCodeBlock->codeType())
-    , m_numCalleeLocals(unlinkedCodeBlock->m_numCalleeLocals)
-    , m_numVars(unlinkedCodeBlock->m_numVars)
+    , m_numCalleeLocals(unlinkedCodeBlock->numCalleeLocals())
+    , m_numVars(unlinkedCodeBlock->numVars())
     , m_hasDebuggerStatement(false)
     , m_steppingMode(SteppingModeDisabled)
     , m_numBreakpoints(0)

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.h (233644 => 233645)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2018-07-09 17:08:17 UTC (rev 233644)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2018-07-09 17:09:43 UTC (rev 233645)
@@ -82,7 +82,6 @@
 } // namespace DFG
 #endif
 
-class BytecodeGenerator;
 class BytecodeLivenessAnalysis;
 class CodeBlockSet;
 class ExecState;
@@ -103,7 +102,6 @@
 
 class CodeBlock : public JSCell {
     typedef JSCell Base;
-    friend class BytecodeGenerator;
     friend class BytecodeLivenessAnalysis;
     friend class JIT;
     friend class LLIntOffsetsExtractor;

Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp (233644 => 233645)


--- trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp	2018-07-09 17:08:17 UTC (rev 233644)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp	2018-07-09 17:09:43 UTC (rev 233645)
@@ -54,9 +54,6 @@
 
 UnlinkedCodeBlock::UnlinkedCodeBlock(VM* vm, Structure* structure, CodeType codeType, const ExecutableInfo& info, DebuggerMode debuggerMode)
     : Base(*vm, structure)
-    , m_numVars(0)
-    , m_numCalleeLocals(0)
-    , m_numParameters(0)
     , m_usesEval(info.usesEval())
     , m_isStrictMode(info.isStrictMode())
     , m_isConstructor(info.isConstructor())
@@ -73,15 +70,7 @@
     , m_hasTailCalls(false)
     , m_codeType(codeType)
     , m_didOptimize(MixedTriState)
-    , m_lineCount(0)
-    , m_endColumn(UINT_MAX)
     , m_parseMode(info.parseMode())
-    , m_features(0)
-    , m_arrayProfileCount(0)
-    , m_arrayAllocationProfileCount(0)
-    , m_objectAllocationProfileCount(0)
-    , m_valueProfileCount(0)
-    , m_llintCallLinkInfoCount(0)
 {
     for (auto& constantRegisterIndex : m_linkTimeConstants)
         constantRegisterIndex = 0;

Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h (233644 => 233645)


--- trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h	2018-07-09 17:08:17 UTC (rev 233644)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h	2018-07-09 17:09:43 UTC (rev 233645)
@@ -47,6 +47,7 @@
 
 namespace JSC {
 
+class BytecodeGenerator;
 class BytecodeLivenessAnalysis;
 class BytecodeRewriter;
 class CodeBlock;
@@ -259,10 +260,6 @@
     int numCalleeLocals() const { return m_numCalleeLocals; }
     int numVars() const { return m_numVars; }
 
-    int m_numVars;
-    int m_numCapturedVars;
-    int m_numCalleeLocals;
-
     // Jump Tables
 
     size_t numberOfSwitchJumpTables() const { return m_rareData ? m_rareData->m_switchJumpTables.size() : 0; }
@@ -423,6 +420,8 @@
 
 private:
     friend class BytecodeRewriter;
+    friend class BytecodeGenerator;
+
     void applyModification(BytecodeRewriter&, UnpackedInstructions&);
 
     void createRareDataIfNecessary()
@@ -436,8 +435,6 @@
     void getLineAndColumn(const ExpressionRangeInfo&, unsigned& line, unsigned& column) const;
     BytecodeLivenessAnalysis& livenessAnalysisSlow(CodeBlock*);
 
-    int m_numParameters;
-
     std::unique_ptr<UnlinkedInstructionStream> m_unlinkedInstructions;
     std::unique_ptr<BytecodeLivenessAnalysis> m_liveness;
 
@@ -464,9 +461,13 @@
     unsigned m_hasTailCalls : 1;
     unsigned m_codeType : 2; // CodeType
     unsigned m_didOptimize : 2; // TriState
-    unsigned m_lineCount;
-    unsigned m_endColumn;
+    unsigned m_lineCount { 0 };
+    unsigned m_endColumn { UINT_MAX };
 
+    int m_numVars { 0 };
+    int m_numCalleeLocals { 0 };
+    int m_numParameters { 0 };
+
     VirtualRegister m_thisRegister;
     VirtualRegister m_scopeRegister;
     VirtualRegister m_globalObjectRegister;
@@ -476,7 +477,7 @@
 public:
     ConcurrentJSLock m_lock;
 private:
-    CodeFeatures m_features;
+    CodeFeatures m_features { 0 };
 
     Vector<unsigned> m_jumpTargets;
 
@@ -493,11 +494,11 @@
     FunctionExpressionVector m_functionExprs;
     std::array<unsigned, LinkTimeConstantCount> m_linkTimeConstants;
 
-    unsigned m_arrayProfileCount;
-    unsigned m_arrayAllocationProfileCount;
-    unsigned m_objectAllocationProfileCount;
-    unsigned m_valueProfileCount;
-    unsigned m_llintCallLinkInfoCount;
+    unsigned m_arrayProfileCount { 0 };
+    unsigned m_arrayAllocationProfileCount { 0 };
+    unsigned m_objectAllocationProfileCount { 0 };
+    unsigned m_valueProfileCount { 0 };
+    unsigned m_llintCallLinkInfoCount { 0 };
 
 public:
     struct RareData {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to