Better align data members in ExecutionContext
authorLars Knoll <lars.knoll@theqtcompany.com>
Mon, 19 Jan 2015 15:36:17 +0000 (16:36 +0100)
committerLars Knoll <lars.knoll@digia.com>
Fri, 23 Jan 2015 11:30:47 +0000 (12:30 +0100)
Saves another 4-8 bytes per object.

Change-Id: Iaeb013abd20733cd7a5d9a5e0d42b92da8153da9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/jsruntime/qv4context_p.h
src/qml/jsruntime/qv4engine_p.h

index 93cd9d4..46c5904 100644 (file)
@@ -81,9 +81,6 @@ struct ExecutionContext : Base {
 
     inline ExecutionContext(ExecutionEngine *engine, ContextType t);
 
-    ContextType type;
-    bool strictMode;
-
     CallData *callData;
 
     ExecutionEngine *engine;
@@ -92,8 +89,9 @@ struct ExecutionContext : Base {
     Lookup *lookups;
     CompiledData::CompilationUnit *compilationUnit;
 
+    ContextType type : 8;
+    bool strictMode : 8;
     int lineNumber;
-
 };
 
 struct CallContext : ExecutionContext {
index 5709ca9..d7dbb46 100644 (file)
@@ -358,13 +358,13 @@ inline Heap::ExecutionContext *ExecutionEngine::popContext()
 
 inline
 Heap::ExecutionContext::ExecutionContext(ExecutionEngine *engine, ContextType t)
-    : type(t)
-    , strictMode(false)
-    , engine(engine)
+    : engine(engine)
     , parent(engine->currentContext())
     , outer(0)
     , lookups(0)
     , compilationUnit(0)
+    , type(t)
+    , strictMode(false)
     , lineNumber(-1)
 {
     engine->current = this;