• 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_OBJECTS_VISITORS_INL_H_
6 #define V8_OBJECTS_VISITORS_INL_H_
7 
8 #include "src/common/globals.h"
9 #include "src/execution/isolate.h"
10 #include "src/objects/visitors.h"
11 
12 namespace v8 {
13 namespace internal {
14 
ObjectVisitorWithCageBases(PtrComprCageBase cage_base,PtrComprCageBase code_cage_base)15 ObjectVisitorWithCageBases::ObjectVisitorWithCageBases(
16     PtrComprCageBase cage_base, PtrComprCageBase code_cage_base)
17 #if V8_COMPRESS_POINTERS
18     : cage_base_(cage_base)
19 #ifdef V8_EXTERNAL_CODE_SPACE
20       ,
21       code_cage_base_(code_cage_base)
22 #endif  // V8_EXTERNAL_CODE_SPACE
23 #endif  // V8_COMPRESS_POINTERS
24 {
25 }
26 
ObjectVisitorWithCageBases(Isolate * isolate)27 ObjectVisitorWithCageBases::ObjectVisitorWithCageBases(Isolate* isolate)
28 #if V8_COMPRESS_POINTERS
29     : ObjectVisitorWithCageBases(PtrComprCageBase(isolate->cage_base()),
30                                  PtrComprCageBase(isolate->code_cage_base()))
31 #else
32     : ObjectVisitorWithCageBases(PtrComprCageBase(), PtrComprCageBase())
33 #endif  // V8_COMPRESS_POINTERS
34 {
35 }
36 
ObjectVisitorWithCageBases(Heap * heap)37 ObjectVisitorWithCageBases::ObjectVisitorWithCageBases(Heap* heap)
38     : ObjectVisitorWithCageBases(Isolate::FromHeap(heap)) {}
39 
40 }  // namespace internal
41 }  // namespace v8
42 
43 #endif  // V8_OBJECTS_VISITORS_INL_H_
44