1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
19 TypeData() : type_(JSVAL_TYPE_UNKNOWN
) {}
20 explicit TypeData(JSValueType type
) : type_(type
) {}
22 JSValueType
type() const { return type_
; }
23 bool hasData() const { return type_
!= JSVAL_TYPE_UNKNOWN
; }
27 const static size_t MaxLength
= 6;
30 TypeData typeData_
[MaxLength
];
35 uint8_t count() const { return count_
; }
37 void addTypeData(TypeData data
) {
38 MOZ_ASSERT(count_
< MaxLength
);
39 MOZ_ASSERT(!typeData_
[count_
].hasData());
40 typeData_
[count_
++] = data
;
42 TypeData
get(uint32_t idx
) const {
43 MOZ_ASSERT(idx
< count_
);
44 return typeData_
[idx
];
47 const TypeData
* begin() const { return &typeData_
[0]; }
48 const TypeData
* end() const { return begin() + count_
; }
54 #endif /* jit_TypeData_h */