summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/tagged-value.h
blob: bb7609f7c35516981ab79c8710e329fa4fb6512a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_OBJECTS_TAGGED_VALUE_H_
#define V8_OBJECTS_TAGGED_VALUE_H_

#include "src/objects/objects.h"

#include "include/v8-internal.h"
#include "src/objects/tagged-impl.h"

namespace v8 {
namespace internal {

// Almost same as Object but this one deals with in-heap and potentially
// compressed representation of Objects and provide only limited functionality
// which doesn't require decompression.
class StrongTaggedValue
    : public TaggedImpl<HeapObjectReferenceType::STRONG, Tagged_t> {
 public:
  constexpr StrongTaggedValue() : TaggedImpl() {}
  explicit constexpr StrongTaggedValue(Tagged_t ptr) : TaggedImpl(ptr) {}

  inline static Object ToObject(WITH_ROOT_PARAM(StrongTaggedValue object));
};

// Almost same as MaybeObject but this one deals with in-heap and potentially
// compressed representation of Objects and provide only limited functionality
// which doesn't require decompression.
class TaggedValue : public TaggedImpl<HeapObjectReferenceType::WEAK, Tagged_t> {
 public:
  constexpr TaggedValue() : TaggedImpl() {}
  explicit constexpr TaggedValue(Tagged_t ptr) : TaggedImpl(ptr) {}

  inline static MaybeObject ToMaybeObject(WITH_ROOT_PARAM(TaggedValue object));
};

}  // namespace internal
}  // namespace v8

#endif  // V8_OBJECTS_TAGGED_VALUE_H_