Skip to content

Conversation

@rajatd
Copy link
Contributor

@rajatd rajatd commented Aug 25, 2017

While we don't enumerate internal properties, setting an internal property as enumerable unnecessarily sets the hasNoEnumerableProperties flag to false on the type handler. This may have perf impact as this flag is used to skip prototypes when enumerating properties.

Changing this to set internal properties as non-enumerable from the beginning. Doing this for non-path type handlers only because,

  1. An object with a path type handler should theoretically have hasNoEnumerableProperties set to false anyway.
  2. Setting a non-enumerable property on an object with a path type handler will convert its type handler to a (simple) dictionary type handler.

Fixes #1622

return TRUE;
}

DynamicTypeHandler * typeHandler = GetCurrentTypeHandler(instance);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just call typeHandler->SetInternalProperty here?

@rajatd
Copy link
Contributor Author

rajatd commented Aug 25, 2017 via email

@chakrabot chakrabot merged commit b25f86d into chakra-core:release/1.7 Aug 26, 2017
chakrabot pushed a commit that referenced this pull request Aug 26, 2017
…ttribute off.

Merge pull request #3587 from rajatd:hasNoEnumerableProps-2

While we don't enumerate internal properties, setting an internal property as enumerable unnecessarily sets the hasNoEnumerableProperties flag to false on the type handler. This may have perf impact as this flag is used to skip prototypes when enumerating properties.

Changing this to set internal properties as non-enumerable from the beginning. Doing this for non-path type handlers only because,
1. An object with a path type handler should theoretically have hasNoEnumerableProperties set to false anyway.
2. Setting a non-enumerable property on an object with a path type handler will convert its type handler to a (simple) dictionary type handler.

Fixes #1622
chakrabot pushed a commit that referenced this pull request Aug 26, 2017
…enumerable" attribute off.

Merge pull request #3587 from rajatd:hasNoEnumerableProps-2

While we don't enumerate internal properties, setting an internal property as enumerable unnecessarily sets the hasNoEnumerableProperties flag to false on the type handler. This may have perf impact as this flag is used to skip prototypes when enumerating properties.

Changing this to set internal properties as non-enumerable from the beginning. Doing this for non-path type handlers only because,
1. An object with a path type handler should theoretically have hasNoEnumerableProperties set to false anyway.
2. Setting a non-enumerable property on an object with a path type handler will convert its type handler to a (simple) dictionary type handler.

Fixes #1622
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants