diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-09-19 15:27:41 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-09-27 08:34:10 +0000 |
commit | 7c592625032a98f68fd6a09026e466c5fbc7bb09 (patch) | |
tree | 4ab9182d3b1468941226652ad0816e1f0c00e66b /src/qml/jsruntime/qv4functionobject_p.h | |
parent | 9df44b2b502f9ab9a379c8454b000d2085aed744 (diff) |
Unify layout of function objects
Ensure we have the proto property at always the same place.
This will be used in a subsequent commit to optimize accesses
to the prototype property e.g. when doing instanceof
operations or constructor calls.
Change-Id: I6e9a19e0b7d0e8ab583648a60d1978f5cf838b06
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject_p.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index 11ddd9a211..8a2c84a8f6 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -76,7 +76,8 @@ namespace Heap { DECLARE_HEAP_OBJECT(FunctionObject, Object) { DECLARE_MARKOBJECTS(FunctionObject); enum { - Index_ProtoConstructor = 0 + Index_ProtoConstructor = 0, + Index_Prototype = 0 }; bool isConstructor() const { @@ -111,7 +112,7 @@ struct IndexedBuiltinFunction : FunctionObject { struct ArrowFunction : FunctionObject { enum { - Index_Name, + Index_Name = Index_Prototype + 1, Index_Length }; void init(QV4::ExecutionContext *scope, Function *function, QV4::String *name = nullptr); @@ -122,10 +123,6 @@ struct ArrowFunction : FunctionObject { DECLARE_HEAP_OBJECT(ScriptFunction, ArrowFunction) { DECLARE_MARKOBJECTS(ScriptFunction) - enum { - Index_Name, - Index_Length - }; void init(QV4::ExecutionContext *scope, Function *function); }; |