v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
per-isolate-compiler-cache.h
Go to the documentation of this file.
1// Copyright 2018 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_COMPILER_PER_ISOLATE_COMPILER_CACHE_H_
6#define V8_COMPILER_PER_ISOLATE_COMPILER_CACHE_H_
7
10
11namespace v8 {
12namespace internal {
13
14class Isolate;
15class Zone;
16
17namespace compiler {
18
19class ObjectData;
20
21// This class serves as a container of data that should persist across all
22// (optimizing) compiler runs in an isolate. For now it stores serialized data
23// for various common objects such as builtins, so that these objects don't have
24// to be serialized in each compilation job. See JSHeapBroker::InitializeRefsMap
25// for details.
27 public:
30
31 bool HasSnapshot() const { return refs_snapshot_ != nullptr; }
36 void SetSnapshot(RefsMap* refs) {
38 DCHECK(!refs->IsEmpty());
41 }
42
43 Zone* zone() const { return zone_; }
44
45 static void Setup(Isolate* isolate) {
46 if (isolate->compiler_cache() == nullptr) {
47 Zone* zone = new Zone(isolate->allocator(), "Compiler zone");
49 isolate->set_compiler_utils(cache, zone);
50 }
51 DCHECK_NOT_NULL(isolate->compiler_cache());
52 }
53
54 private:
55 Zone* const zone_;
57};
58
59} // namespace compiler
60} // namespace internal
61} // namespace v8
62
63#endif // V8_COMPILER_PER_ISOLATE_COMPILER_CACHE_H_
friend Zone
Definition asm-types.cc:195
T * New(Args &&... args)
Definition zone.h:114
#define DCHECK_NOT_NULL(val)
Definition logging.h:492
#define DCHECK(condition)
Definition logging.h:482