mozjs38-1269317.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. --- a/js/src/jit/RegisterSets.h 2017-02-10 17:33:06.210702431 -0800
  2. +++ b/js/src/jit/RegisterSets.h 2017-02-10 17:43:52.877514146 -0800
  3. @@ -7,7 +7,6 @@
  4. #ifndef jit_RegisterSets_h
  5. #define jit_RegisterSets_h
  6. -#include "mozilla/Alignment.h"
  7. #include "mozilla/MathAlgorithms.h"
  8. #include "jit/JitAllocPolicy.h"
  9. @@ -26,8 +25,8 @@
  10. Code code_;
  11. public:
  12. - AnyRegister()
  13. - { }
  14. + AnyRegister() = default;
  15. +
  16. explicit AnyRegister(Register gpr) {
  17. code_ = gpr.code();
  18. }
  19. @@ -156,7 +155,7 @@
  20. }
  21. #endif
  22. - ValueOperand() {}
  23. + ValueOperand() = default;
  24. };
  25. // Registers to hold either either a typed or untyped value.
  26. @@ -165,46 +164,25 @@
  27. // Type of value being stored.
  28. MIRType type_;
  29. - // Space to hold either an AnyRegister or a ValueOperand.
  30. union U {
  31. - mozilla::AlignedStorage2<AnyRegister> typed;
  32. - mozilla::AlignedStorage2<ValueOperand> value;
  33. + AnyRegister typed;
  34. + ValueOperand value;
  35. } data;
  36. - AnyRegister& dataTyped() {
  37. - MOZ_ASSERT(hasTyped());
  38. - return *data.typed.addr();
  39. - }
  40. - ValueOperand& dataValue() {
  41. - MOZ_ASSERT(hasValue());
  42. - return *data.value.addr();
  43. - }
  44. -
  45. - AnyRegister dataTyped() const {
  46. - MOZ_ASSERT(hasTyped());
  47. - return *data.typed.addr();
  48. - }
  49. - const ValueOperand& dataValue() const {
  50. - MOZ_ASSERT(hasValue());
  51. - return *data.value.addr();
  52. - }
  53. -
  54. public:
  55. - TypedOrValueRegister()
  56. - : type_(MIRType_None)
  57. - {}
  58. + TypedOrValueRegister() = default;
  59. TypedOrValueRegister(MIRType type, AnyRegister reg)
  60. : type_(type)
  61. {
  62. - dataTyped() = reg;
  63. + data.typed = reg;
  64. }
  65. MOZ_IMPLICIT TypedOrValueRegister(ValueOperand value)
  66. : type_(MIRType_Value)
  67. {
  68. - dataValue() = value;
  69. + data.value = value;
  70. }
  71. MIRType type() const {
  72. @@ -220,11 +198,13 @@
  73. }
  74. AnyRegister typedReg() const {
  75. - return dataTyped();
  76. + MOZ_ASSERT(hasTyped());
  77. + return data.typed;
  78. }
  79. ValueOperand valueReg() const {
  80. - return dataValue();
  81. + MOZ_ASSERT(hasValue());
  82. + return data.value;
  83. }
  84. AnyRegister scratchReg() {
  85. @@ -240,19 +220,18 @@
  86. // Whether a constant value is being stored.
  87. bool constant_;
  88. - // Space to hold either a Value or a TypedOrValueRegister.
  89. union U {
  90. - mozilla::AlignedStorage2<Value> constant;
  91. - mozilla::AlignedStorage2<TypedOrValueRegister> reg;
  92. + Value constant;
  93. + TypedOrValueRegister reg;
  94. } data;
  95. Value& dataValue() {
  96. MOZ_ASSERT(constant());
  97. - return *data.constant.addr();
  98. + return data.constant;
  99. }
  100. TypedOrValueRegister& dataReg() {
  101. MOZ_ASSERT(!constant());
  102. - return *data.reg.addr();
  103. + return data.reg;
  104. }
  105. public: