• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2021 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_DEOPTIMIZER_MATERIALIZED_OBJECT_STORE_H_
6 #define V8_DEOPTIMIZER_MATERIALIZED_OBJECT_STORE_H_
7 
8 #include <vector>
9 
10 #include "src/handles/handles.h"
11 
12 namespace v8 {
13 namespace internal {
14 
15 class FixedArray;
16 class Isolate;
17 
18 class MaterializedObjectStore {
19  public:
MaterializedObjectStore(Isolate * isolate)20   explicit MaterializedObjectStore(Isolate* isolate) : isolate_(isolate) {}
21 
22   Handle<FixedArray> Get(Address fp);
23   void Set(Address fp, Handle<FixedArray> materialized_objects);
24   bool Remove(Address fp);
25 
26  private:
isolate()27   Isolate* isolate() const { return isolate_; }
28   Handle<FixedArray> GetStackEntries();
29   Handle<FixedArray> EnsureStackEntries(int size);
30 
31   int StackIdToIndex(Address fp);
32 
33   Isolate* isolate_;
34   std::vector<Address> frame_fps_;
35 };
36 
37 }  // namespace internal
38 }  // namespace v8
39 
40 #endif  // V8_DEOPTIMIZER_MATERIALIZED_OBJECT_STORE_H_
41