tagged-value-inl.h 1.05 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
// 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_INL_H_
#define V8_OBJECTS_TAGGED_VALUE_INL_H_

#include "src/objects/tagged-value.h"

#include "include/v8-internal.h"
11
#include "src/common/ptr-compr-inl.h"
12 13 14
#include "src/objects/heap-object-inl.h"
#include "src/objects/oddball.h"
#include "src/objects/tagged-impl-inl.h"
15
#include "src/roots/roots-inl.h"
16 17 18 19

namespace v8 {
namespace internal {

20
Object StrongTaggedValue::ToObject(Isolate* isolate, StrongTaggedValue object) {
21
#ifdef V8_COMPRESS_POINTERS
22
  return Object(DecompressTaggedAny(isolate, object.ptr()));
23 24 25 26 27
#else
  return Object(object.ptr());
#endif
}

28
MaybeObject TaggedValue::ToMaybeObject(Isolate* isolate, TaggedValue object) {
29
#ifdef V8_COMPRESS_POINTERS
30
  return MaybeObject(DecompressTaggedAny(isolate, object.ptr()));
31 32 33 34 35 36 37 38 39
#else
  return MaybeObject(object.ptr());
#endif
}

}  // namespace internal
}  // namespace v8

#endif  // V8_OBJECTS_TAGGED_VALUE_INL_H_