PropertyIdArray.h 1.1 KB

1234567891011121314151617181920212223242526272829
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. namespace Js
  7. {
  8. struct PropertyIdArray
  9. {
  10. Field(uint32) count;
  11. Field(byte) extraSlots;
  12. Field(bool) hadDuplicates;
  13. Field(bool) has__proto__; // Only used for object literal
  14. Field(bool) hasNonSimpleParams;
  15. Field(PropertyId) elements[];
  16. PropertyIdArray(uint32 count, byte extraSlots, bool hadDuplicates = false, bool has__proto__ = false, bool hasNonSimpleParams = false) :
  17. count(count),
  18. extraSlots(extraSlots),
  19. hadDuplicates(hadDuplicates),
  20. has__proto__(has__proto__),
  21. hasNonSimpleParams(hasNonSimpleParams)
  22. {
  23. }
  24. size_t GetDataSize() const { return sizeof(PropertyIdArray) + sizeof(PropertyId) * (count + extraSlots); }
  25. };
  26. };