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
4 #ifndef jit_RegisterSets_h
5 #define jit_RegisterSets_h
7 -#include "mozilla/Alignment.h"
8 #include "mozilla/MathAlgorithms.h"
10 #include "jit/JitAllocPolicy.h"
17 + AnyRegister() = default;
19 explicit AnyRegister(Register gpr) {
27 + ValueOperand() = default;
30 // Registers to hold either either a typed or untyped value.
32 // Type of value being stored.
35 - // Space to hold either an AnyRegister or a ValueOperand.
37 - mozilla::AlignedStorage2<AnyRegister> typed;
38 - mozilla::AlignedStorage2<ValueOperand> value;
43 - AnyRegister& dataTyped() {
44 - MOZ_ASSERT(hasTyped());
45 - return *data.typed.addr();
47 - ValueOperand& dataValue() {
48 - MOZ_ASSERT(hasValue());
49 - return *data.value.addr();
52 - AnyRegister dataTyped() const {
53 - MOZ_ASSERT(hasTyped());
54 - return *data.typed.addr();
56 - const ValueOperand& dataValue() const {
57 - MOZ_ASSERT(hasValue());
58 - return *data.value.addr();
63 - TypedOrValueRegister()
64 - : type_(MIRType_None)
66 + TypedOrValueRegister() = default;
68 TypedOrValueRegister(MIRType type, AnyRegister reg)
75 MOZ_IMPLICIT TypedOrValueRegister(ValueOperand value)
76 : type_(MIRType_Value)
78 - dataValue() = value;
82 MIRType type() const {
86 AnyRegister typedReg() const {
88 + MOZ_ASSERT(hasTyped());
92 ValueOperand valueReg() const {
94 + MOZ_ASSERT(hasValue());
98 AnyRegister scratchReg() {
100 // Whether a constant value is being stored.
103 - // Space to hold either a Value or a TypedOrValueRegister.
105 - mozilla::AlignedStorage2<Value> constant;
106 - mozilla::AlignedStorage2<TypedOrValueRegister> reg;
108 + TypedOrValueRegister reg;
112 MOZ_ASSERT(constant());
113 - return *data.constant.addr();
114 + return data.constant;
116 TypedOrValueRegister& dataReg() {
117 MOZ_ASSERT(!constant());
118 - return *data.reg.addr();