v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
external-reference-encoder.h
Go to the documentation of this file.
1// Copyright 2020 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_CODEGEN_EXTERNAL_REFERENCE_ENCODER_H_
6#define V8_CODEGEN_EXTERNAL_REFERENCE_ENCODER_H_
7
8#include <vector>
9
10#include "src/base/bit-field.h"
11#include "src/common/globals.h"
13
14namespace v8 {
15namespace internal {
16
17class Isolate;
18
20 public:
21 class Value {
22 public:
23 explicit Value(uint32_t raw) : value_(raw) {}
24 Value() : value_(0) {}
25 static uint32_t Encode(uint32_t index, bool is_from_api) {
27 }
28
29 bool is_from_api() const { return IsFromAPI::decode(value_); }
30 uint32_t index() const { return Index::decode(value_); }
31
32 private:
35 uint32_t value_;
36 };
37
38 explicit ExternalReferenceEncoder(Isolate* isolate);
41#ifdef DEBUG
43#endif // DEBUG
44
45 Value Encode(Address key) const;
47
48 const char* NameOfAddress(Isolate* isolate, Address address) const;
49
50 private:
52
53#ifdef DEBUG
54 mutable std::vector<int> count_;
55 mutable const intptr_t* api_references_;
56#endif // DEBUG
57};
58
59} // namespace internal
60} // namespace v8
61
62#endif // V8_CODEGEN_EXTERNAL_REFERENCE_ENCODER_H_
static constexpr T decode(U value)
Definition bit-field.h:66
static constexpr U encode(T value)
Definition bit-field.h:55
static uint32_t Encode(uint32_t index, bool is_from_api)
ExternalReferenceEncoder(const ExternalReferenceEncoder &)=delete
Maybe< Value > TryEncode(Address key) const
ExternalReferenceEncoder & operator=(const ExternalReferenceEncoder &)=delete
const char * NameOfAddress(Isolate *isolate, Address address) const
size_t count_
Definition sweeper.cc:55