void-packages/srcpkgs/mozjs38/patches/gcc-alignment.patch
2018-01-26 18:29:56 +01:00

122 lines
2.8 KiB
Diff

--- a/js/src/jit/RegisterSets.h 2017-02-10 17:33:06.210702431 -0800
+++ b/js/src/jit/RegisterSets.h 2017-02-10 17:43:52.877514146 -0800
@@ -7,7 +7,6 @@
#ifndef jit_RegisterSets_h
#define jit_RegisterSets_h
-#include "mozilla/Alignment.h"
#include "mozilla/MathAlgorithms.h"
#include "jit/JitAllocPolicy.h"
@@ -26,8 +25,8 @@
Code code_;
public:
- AnyRegister()
- { }
+ AnyRegister() = default;
+
explicit AnyRegister(Register gpr) {
code_ = gpr.code();
}
@@ -156,7 +155,7 @@
}
#endif
- ValueOperand() {}
+ ValueOperand() = default;
};
// Registers to hold either either a typed or untyped value.
@@ -165,46 +164,25 @@
// Type of value being stored.
MIRType type_;
- // Space to hold either an AnyRegister or a ValueOperand.
union U {
- mozilla::AlignedStorage2<AnyRegister> typed;
- mozilla::AlignedStorage2<ValueOperand> value;
+ AnyRegister typed;
+ ValueOperand value;
} data;
- AnyRegister& dataTyped() {
- MOZ_ASSERT(hasTyped());
- return *data.typed.addr();
- }
- ValueOperand& dataValue() {
- MOZ_ASSERT(hasValue());
- return *data.value.addr();
- }
-
- AnyRegister dataTyped() const {
- MOZ_ASSERT(hasTyped());
- return *data.typed.addr();
- }
- const ValueOperand& dataValue() const {
- MOZ_ASSERT(hasValue());
- return *data.value.addr();
- }
-
public:
- TypedOrValueRegister()
- : type_(MIRType_None)
- {}
+ TypedOrValueRegister() = default;
TypedOrValueRegister(MIRType type, AnyRegister reg)
: type_(type)
{
- dataTyped() = reg;
+ data.typed = reg;
}
MOZ_IMPLICIT TypedOrValueRegister(ValueOperand value)
: type_(MIRType_Value)
{
- dataValue() = value;
+ data.value = value;
}
MIRType type() const {
@@ -220,11 +198,13 @@
}
AnyRegister typedReg() const {
- return dataTyped();
+ MOZ_ASSERT(hasTyped());
+ return data.typed;
}
ValueOperand valueReg() const {
- return dataValue();
+ MOZ_ASSERT(hasValue());
+ return data.value;
}
AnyRegister scratchReg() {
@@ -240,19 +220,18 @@
// Whether a constant value is being stored.
bool constant_;
- // Space to hold either a Value or a TypedOrValueRegister.
union U {
- mozilla::AlignedStorage2<Value> constant;
- mozilla::AlignedStorage2<TypedOrValueRegister> reg;
+ Value constant;
+ TypedOrValueRegister reg;
} data;
Value& dataValue() {
MOZ_ASSERT(constant());
- return *data.constant.addr();
+ return data.constant;
}
TypedOrValueRegister& dataReg() {
MOZ_ASSERT(!constant());
- return *data.reg.addr();
+ return data.reg;
}
public: