summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/oddball.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/objects/oddball.h')
-rw-r--r--deps/v8/src/objects/oddball.h37
1 files changed, 10 insertions, 27 deletions
diff --git a/deps/v8/src/objects/oddball.h b/deps/v8/src/objects/oddball.h
index f608a76a2f..025f9379ba 100644
--- a/deps/v8/src/objects/oddball.h
+++ b/deps/v8/src/objects/oddball.h
@@ -6,7 +6,7 @@
#define V8_OBJECTS_ODDBALL_H_
#include "src/objects/heap-object.h"
-#include "torque-generated/class-definitions-from-dsl.h"
+#include "torque-generated/class-definitions-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
@@ -15,45 +15,26 @@ namespace v8 {
namespace internal {
// The Oddball describes objects null, undefined, true, and false.
-class Oddball : public HeapObject {
+class Oddball : public TorqueGeneratedOddball<Oddball, HeapObject> {
public:
// [to_number_raw]: Cached raw to_number computed at startup.
- inline double to_number_raw() const;
- inline void set_to_number_raw(double value);
inline void set_to_number_raw_as_bits(uint64_t bits);
- // [to_string]: Cached to_string computed at startup.
- DECL_ACCESSORS(to_string, String)
-
- // [to_number]: Cached to_number computed at startup.
- DECL_ACCESSORS(to_number, Object)
-
- // [typeof]: Cached type_of computed at startup.
- DECL_ACCESSORS(type_of, String)
-
inline byte kind() const;
inline void set_kind(byte kind);
+ // Oddball has a custom verifier.
+ void OddballVerify(Isolate* isolate);
+
// ES6 section 7.1.3 ToNumber for Boolean, Null, Undefined.
V8_WARN_UNUSED_RESULT static inline Handle<Object> ToNumber(
Isolate* isolate, Handle<Oddball> input);
- DECL_CAST(Oddball)
-
- // Dispatched behavior.
- DECL_VERIFIER(Oddball)
-
// Initialize the fields.
static void Initialize(Isolate* isolate, Handle<Oddball> oddball,
const char* to_string, Handle<Object> to_number,
const char* type_of, byte kind);
- DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
- TORQUE_GENERATED_ODDBALL_FIELDS)
- // TODO(v8:8989): [torque] Support marker constants.
- static const int kTaggedFieldsStartOffset = kToStringOffset;
- static const int kTaggedFieldsEndOffset = kKindOffset;
-
static const byte kFalse = 0;
static const byte kTrue = 1;
static const byte kNotBooleanMask = static_cast<byte>(~1);
@@ -68,14 +49,16 @@ class Oddball : public HeapObject {
static const byte kStaleRegister = 10;
static const byte kSelfReferenceMarker = 10;
- using BodyDescriptor = FixedBodyDescriptor<kTaggedFieldsStartOffset,
- kTaggedFieldsEndOffset, kSize>;
+ static_assert(kStartOfWeakFieldsOffset == kEndOfWeakFieldsOffset,
+ "Ensure BodyDescriptor does not need to handle weak fields.");
+ using BodyDescriptor = FixedBodyDescriptor<kStartOfStrongFieldsOffset,
+ kEndOfStrongFieldsOffset, kSize>;
STATIC_ASSERT(kKindOffset == Internals::kOddballKindOffset);
STATIC_ASSERT(kNull == Internals::kNullOddballKind);
STATIC_ASSERT(kUndefined == Internals::kUndefinedOddballKind);
- OBJECT_CONSTRUCTORS(Oddball, HeapObject);
+ TQ_OBJECT_CONSTRUCTORS(Oddball)
};
} // namespace internal