v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
isolate-utils.h
Go to the documentation of this file.
1// Copyright 2019 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_EXECUTION_ISOLATE_UTILS_H_
6#define V8_EXECUTION_ISOLATE_UTILS_H_
7
9
10namespace v8::internal {
11
12class HeapObjectLayout;
13
14// Computes the pointer compression cage base from any read only or writable
15// heap object. The resulting value is intended to be used only as a hoisted
16// computation of cage base inside trivial accessors for optimizing value
17// decompression. When pointer compression is disabled this function always
18// returns nullptr.
19V8_INLINE PtrComprCageBase GetPtrComprCageBase(Tagged<HeapObject> object);
20
22
24
25// Support `*this` for HeapObjectLayout subclasses.
26// TODO(leszeks): Change the NEVER_READ_ONLY_SPACE_IMPL macro to pass `this`
27// instead of `*this` and use `const HeapObjectLayout*` here.
28V8_INLINE Heap* GetHeapFromWritableObject(const HeapObjectLayout& object);
29V8_INLINE Isolate* GetIsolateFromWritableObject(const HeapObjectLayout& object);
30
31// Returns true if it succeeded to obtain isolate from given object.
32// If it fails then the object is definitely a read-only object but it may also
33// succeed for read only objects if pointer compression is enabled.
35 Isolate** isolate);
36
37} // namespace v8::internal
38
39#endif // V8_EXECUTION_ISOLATE_UTILS_H_
V8_INLINE Isolate * GetIsolateFromWritableObject(Tagged< HeapObject > object)
V8_INLINE bool GetIsolateFromHeapObject(Tagged< HeapObject > object, Isolate **isolate)
kInterpreterTrampolineOffset Tagged< HeapObject >
V8_INLINE PtrComprCageBase GetPtrComprCageBase()
V8_INLINE Heap * GetHeapFromWritableObject(Tagged< HeapObject > object)
#define V8_INLINE
Definition v8config.h:500