Changeset 181828 in webkit
- Timestamp:
- Mar 21, 2015, 5:07:46 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
bytecode/UnlinkedCodeBlock.cpp (modified) (3 diffs)
-
bytecode/UnlinkedCodeBlock.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r181821 r181828 1 2015-03-21 Andreas Kling <akling@apple.com> 2 3 Make UnlinkedFunctionExecutable fit in a 128-byte cell. 4 <https://webkit.org/b/142939> 5 6 Reviewed by Mark Hahnenberg. 7 8 Re-arrange the members of UnlinkedFunctionExecutable so it can fit inside 9 a 128-byte heap cell instead of requiring a 256-byte one. 10 11 Threw in a static_assert to catch anyone pushing it over the limit again. 12 13 * bytecode/UnlinkedCodeBlock.cpp: 14 (JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable): 15 * bytecode/UnlinkedCodeBlock.h: 16 (JSC::UnlinkedFunctionExecutable::functionMode): 17 1 18 2015-03-20 Mark Hahnenberg <mhahnenb@gmail.com> 2 19 -
trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
r181810 r181828 43 43 namespace JSC { 44 44 45 static_assert(sizeof(UnlinkedFunctionExecutable) <= 128, "UnlinkedFunctionExecutable should fit in a 128-byte cell."); 46 45 47 const ClassInfo UnlinkedFunctionExecutable::s_info = { "UnlinkedFunctionExecutable", 0, 0, CREATE_METHOD_TABLE(UnlinkedFunctionExecutable) }; 46 48 const ClassInfo UnlinkedCodeBlock::s_info = { "UnlinkedCodeBlock", 0, 0, CREATE_METHOD_TABLE(UnlinkedCodeBlock) }; … … 90 92 UnlinkedFunctionExecutable::UnlinkedFunctionExecutable(VM* vm, Structure* structure, const SourceCode& source, RefPtr<SourceProvider>&& sourceOverride, FunctionBodyNode* node, UnlinkedFunctionKind kind) 91 93 : Base(*vm, structure) 92 , m_isInStrictContext(node->isInStrictContext())93 , m_hasCapturedVariables(false)94 , m_isBuiltinFunction(kind == UnlinkedBuiltinFunction)95 , m_constructorKind(static_cast<unsigned>(node->constructorKind()))96 94 , m_name(node->ident()) 97 95 , m_inferredName(node->inferredName()) 98 96 , m_parameters(node->parameters()) 97 , m_sourceOverride(WTF::move(sourceOverride)) 99 98 , m_firstLineOffset(node->firstLine() - source.firstLine()) 100 99 , m_lineCount(node->lastLine() - node->firstLine()) … … 106 105 , m_typeProfilingStartOffset(node->functionKeywordStart()) 107 106 , m_typeProfilingEndOffset(node->startStartOffset() + node->source().length() - 1) 108 , m_sourceOverride(sourceOverride)109 107 , m_features(0) 108 , m_isInStrictContext(node->isInStrictContext()) 109 , m_hasCapturedVariables(false) 110 , m_isBuiltinFunction(kind == UnlinkedBuiltinFunction) 111 , m_constructorKind(static_cast<unsigned>(node->constructorKind())) 110 112 , m_functionMode(node->functionMode()) 111 113 { -
trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
r181810 r181828 121 121 size_t parameterCount() const; 122 122 bool isInStrictContext() const { return m_isInStrictContext; } 123 FunctionMode functionMode() const { return m_functionMode; }123 FunctionMode functionMode() const { return static_cast<FunctionMode>(m_functionMode); } 124 124 ConstructorKind constructorKind() const { return static_cast<ConstructorKind>(m_constructorKind); } 125 125 … … 170 170 WriteBarrier<UnlinkedFunctionCodeBlock> m_codeBlockForConstruct; 171 171 172 unsigned m_isInStrictContext : 1;173 unsigned m_hasCapturedVariables : 1;174 unsigned m_isBuiltinFunction : 1;175 unsigned m_constructorKind : 2;176 177 172 Identifier m_name; 178 173 Identifier m_inferredName; … … 181 176 WriteBarrier<SymbolTable> m_symbolTableForConstruct; 182 177 RefPtr<FunctionParameters> m_parameters; 178 RefPtr<SourceProvider> m_sourceOverride; 183 179 unsigned m_firstLineOffset; 184 180 unsigned m_lineCount; … … 190 186 unsigned m_typeProfilingStartOffset; 191 187 unsigned m_typeProfilingEndOffset; 192 RefPtr<SourceProvider> m_sourceOverride;193 188 194 189 CodeFeatures m_features; 195 190 196 FunctionMode m_functionMode; 191 unsigned m_isInStrictContext : 1; 192 unsigned m_hasCapturedVariables : 1; 193 unsigned m_isBuiltinFunction : 1; 194 unsigned m_constructorKind : 2; 195 unsigned m_functionMode : 1; // FunctionMode 197 196 198 197 protected:
Note:
See TracChangeset
for help on using the changeset viewer.