v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
reloc-info.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_CODEGEN_RELOC_INFO_H_
6#define V8_CODEGEN_RELOC_INFO_H_
7
10#include "src/common/globals.h"
11#include "src/objects/code.h"
13
14namespace v8 {
15namespace internal {
16
17class CodeReference;
18class EmbeddedData;
19
20// Specifies whether to perform icache flush operations on RelocInfo updates.
21// If FLUSH_ICACHE_IF_NEEDED, the icache will always be flushed if an
22// instruction was modified. If SKIP_ICACHE_FLUSH the flush will always be
23// skipped (only use this if you will flush the icache manually before it is
24// executed).
26
27namespace detail {
28// -----------------------------------------------------------------------------
29// Implementation of RelocInfoWriter and RelocIterator
30//
31// Relocation information is written backwards in memory, from high addresses
32// towards low addresses, byte by byte. Therefore, in the encodings listed
33// below, the first byte listed it at the highest address, and successive
34// bytes in the record are at progressively lower addresses.
35//
36// Encoding
37//
38// The most common modes are given single-byte encodings. Also, it is
39// easy to identify the type of reloc info and skip unwanted modes in
40// an iteration.
41//
42// The encoding relies on the fact that there are fewer than 14
43// different relocation modes using standard non-compact encoding.
44//
45// The first byte of a relocation record has a tag in its low 2 bits:
46// Here are the record schemes, depending on the low tag and optional higher
47// tags.
48//
49// Low tag:
50// 00: embedded_object: [6-bit pc delta] 00
51//
52// 01: code_target: [6-bit pc delta] 01
53//
54// 10: wasm_stub_call: [6-bit pc delta] 10
55//
56// 11: long_record [6 bit reloc mode] 11
57// followed by pc delta
58// followed by optional data depending on type.
59//
60// If a pc delta exceeds 6 bits, it is split into a remainder that fits into
61// 6 bits and a part that does not. The latter is encoded as a long record
62// with PC_JUMP as pseudo reloc info mode. The former is encoded as part of
63// the following record in the usual way. The long pc jump record has variable
64// length:
65// pc-jump: [PC_JUMP] 11
66// 1 [7 bits data]
67// ...
68// 0 [7 bits data]
69// (Bits 6..31 of pc delta, encoded with VLQ.)
70
71constexpr int kTagBits = 2;
72constexpr int kTagMask = (1 << kTagBits) - 1;
73constexpr int kLongTagBits = 6;
74
75constexpr int kEmbeddedObjectTag = 0;
76constexpr int kCodeTargetTag = 1;
77constexpr int kWasmStubCallTag = 2;
78constexpr int kDefaultTag = 3;
79
81constexpr int kSmallPCDeltaMask = (1 << kSmallPCDeltaBits) - 1;
82} // namespace detail
83
84// -----------------------------------------------------------------------------
85// Relocation information
86
87// Relocation information consists of the address (pc) of the datum
88// to which the relocation information applies, the relocation mode
89// (rmode), and an optional data field. The relocation mode may be
90// "descriptive" and not indicate a need for relocation, but simply
91// describe a property of the datum. Such rmodes are useful for GC
92// and nice disassembly output.
93
94class RelocInfo {
95 public:
96 // The minimum size of a comment is equal to two bytes for the extra tagged
97 // pc and kSystemPointerSize for the actual pointer to the comment.
98 static constexpr int kMinRelocCommentSize = 2 + kSystemPointerSize;
99
100 // The maximum size for a call instruction including pc-jump.
101 static constexpr int kMaxCallSize = 6;
102
103 // The maximum pc delta that will use the short encoding.
105
106 enum Mode : int8_t {
107 // Please note the order is important (see IsRealRelocMode, IsGCRelocMode,
108 // and IsShareableRelocMode predicates below).
109
110 NO_INFO, // Never recorded value. Most common one, hence value 0.
111
113 // TODO(ishell): rename to NEAR_CODE_TARGET.
114 RELATIVE_CODE_TARGET, // LAST_CODE_TARGET_MODE
116 FULL_EMBEDDED_OBJECT, // LAST_GCED_ENUM
117
118 WASM_CALL, // FIRST_SHAREABLE_RELOC_MODE
122
123 EXTERNAL_REFERENCE, // The address of an external C++ function.
124 INTERNAL_REFERENCE, // An address inside the same function.
125
126 // Encoded internal reference, used only on RISCV64, RISCV32, MIPS64
127 // and PPC.
129
130 // An integer JSDispatchHandle, referring to an entry in the
131 // JSDispatchTable.
133
134 // An off-heap instruction stream target. See http://goo.gl/Z2HUiM.
135 // TODO(ishell): rename to BUILTIN_ENTRY.
136 OFF_HEAP_TARGET, // FIRST_BUILTIN_ENTRY_MODE
137 // An un-embedded off-heap instruction stream target.
138 // See http://crbug.com/v8/11527 for details.
139 NEAR_BUILTIN_ENTRY, // LAST_BUILTIN_ENTRY_MODE
140
141 // Marks constant and veneer pools. Only used on ARM and ARM64.
142 // They use a custom noncompact encoding.
145
147 DEOPT_INLINING_ID, // Deoptimization source position.
148 DEOPT_REASON, // Deoptimization reason index.
149 DEOPT_ID, // Deoptimization inlining id.
150 DEOPT_NODE_ID, // Id of the node that caused deoptimization. This
151 // information is only recorded in debug builds.
152
153 // This is not an actual reloc mode, but used to encode a long pc jump that
154 // cannot be encoded as part of another record.
156
157 // Pseudo-types
159
169 };
170
171 static_assert(NUMBER_OF_MODES <= kBitsPerInt);
172
173 RelocInfo() = default;
174
181
182 // Convenience ctor.
184
185 static constexpr bool IsRealRelocMode(Mode mode) {
186 return mode >= FIRST_REAL_RELOC_MODE && mode <= LAST_REAL_RELOC_MODE;
187 }
188 // Is the relocation mode affected by GC?
189 static constexpr bool IsGCRelocMode(Mode mode) {
190 return mode <= LAST_GCED_ENUM;
191 }
192 static constexpr bool IsShareableRelocMode(Mode mode) {
193 return mode == RelocInfo::NO_INFO ||
195 }
196 static constexpr bool IsCodeTarget(Mode mode) { return mode == CODE_TARGET; }
197 static constexpr bool IsCodeTargetMode(Mode mode) {
198 return mode <= LAST_CODE_TARGET_MODE;
199 }
200 static constexpr bool IsRelativeCodeTarget(Mode mode) {
201 return mode == RELATIVE_CODE_TARGET;
202 }
203 static constexpr bool IsFullEmbeddedObject(Mode mode) {
204 return mode == FULL_EMBEDDED_OBJECT;
205 }
206 static constexpr bool IsCompressedEmbeddedObject(Mode mode) {
208 }
213 static constexpr bool IsWasmCall(Mode mode) { return mode == WASM_CALL; }
214 static constexpr bool IsWasmStubCall(Mode mode) {
215 return mode == WASM_STUB_CALL;
216 }
217 static constexpr bool IsWasmCanonicalSigId(Mode mode) {
218 return mode == WASM_CANONICAL_SIG_ID;
219 }
220 static constexpr bool IsWasmCodePointerTableEntry(Mode mode) {
221 return mode == WASM_CODE_POINTER_TABLE_ENTRY;
222 }
223 static constexpr bool IsConstPool(Mode mode) { return mode == CONST_POOL; }
224 static constexpr bool IsVeneerPool(Mode mode) { return mode == VENEER_POOL; }
225 static constexpr bool IsDeoptPosition(Mode mode) {
226 return mode == DEOPT_SCRIPT_OFFSET || mode == DEOPT_INLINING_ID;
227 }
228 static constexpr bool IsDeoptReason(Mode mode) {
229 return mode == DEOPT_REASON;
230 }
231 static constexpr bool IsDeoptId(Mode mode) { return mode == DEOPT_ID; }
232 static constexpr bool IsDeoptNodeId(Mode mode) {
233 return mode == DEOPT_NODE_ID;
234 }
235 static constexpr bool IsExternalReference(Mode mode) {
236 return mode == EXTERNAL_REFERENCE;
237 }
238 static constexpr bool IsInternalReference(Mode mode) {
239 return mode == INTERNAL_REFERENCE;
240 }
241 static constexpr bool IsInternalReferenceEncoded(Mode mode) {
242 return mode == INTERNAL_REFERENCE_ENCODED;
243 }
244 static constexpr bool IsOffHeapTarget(Mode mode) {
245 return mode == OFF_HEAP_TARGET;
246 }
247 static constexpr bool IsNearBuiltinEntry(Mode mode) {
248 return mode == NEAR_BUILTIN_ENTRY;
249 }
250 static constexpr bool IsBuiltinEntryMode(Mode mode) {
253 }
254 static constexpr bool IsJSDispatchHandle(Mode mode) {
255 return mode == JS_DISPATCH_HANDLE;
256 }
257 static constexpr bool IsNoInfo(Mode mode) { return mode == NO_INFO; }
258
259 static bool IsOnlyForSerializer(Mode mode) {
260#ifdef V8_TARGET_ARCH_IA32
261 // On ia32, inlined off-heap trampolines must be relocated.
264 return mode == EXTERNAL_REFERENCE;
265#else
268 return mode == EXTERNAL_REFERENCE || mode == OFF_HEAP_TARGET;
269#endif
270 }
271
272 static constexpr int ModeMask(Mode mode) { return 1 << mode; }
273
274 // Accessors
275 Address pc() const { return pc_; }
276 Mode rmode() const { return rmode_; }
278 intptr_t data() const { return data_; }
279
280 // Is the pointer this relocation info refers to coded like a plain pointer
281 // or is it strange in some way (e.g. relative or patched into a series of
282 // instructions).
283 bool IsCodedSpecially();
284
285 // The static pendant to IsCodedSpecially, just for off-heap targets. Used
286 // during deserialization, when we don't actually have a RelocInfo handy.
287 static bool OffHeapTargetIsCodedSpecially();
288
289 // If true, the pointer this relocation info refers to is an entry in the
290 // constant pool, otherwise the pointer is embedded in the instruction stream.
291 bool IsInConstantPool();
292
297
298 uint32_t wasm_call_tag() const;
299
301 Address target,
302 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
303
304 // this relocation applies to;
305 // can only be called if IsCodeTarget(rmode_)
307 // Cage base value is used for decompressing compressed embedded references.
309
311
312 // Decodes builtin ID encoded as a PC-relative offset. This encoding is used
313 // during code generation of call/jump with NEAR_BUILTIN_ENTRY.
316
317 // Returns the address of the constant pool entry where the target address
318 // is held. This should only be called if IsInConstantPool returns true.
320
321 // Read the address of the word containing the target_address in an
322 // instruction stream. What this means exactly is architecture-independent.
323 // The only architecture-independent user of this function is the serializer.
324 // The serializer uses it to find out how many raw bytes of instruction to
325 // output before the next target. Architecture-independent code shouldn't
326 // dereference the pointer it gets back from this.
328 bool HasTargetAddressAddress() const;
329
330 // This indicates how much space a target takes up when deserializing a code
331 // stream. For most architectures this is just the size of a pointer. For
332 // an instruction like movw/movt where the target bits are mixed into the
333 // instruction bits the size of the target will be zero, indicating that the
334 // serializer should not step forwards in memory after a target is resolved
335 // and written. In this case the target_address_address function above
336 // should return the end of the instructions to be patched, allowing the
337 // deserializer to deserialize the instructions as raw bytes and put them in
338 // place, ready to be patched with the target.
340
341 // Read the reference in the instruction this relocation
342 // applies to; can only be called if rmode_ is EXTERNAL_REFERENCE.
344
345 // Read the reference in the instruction this relocation
346 // applies to; can only be called if rmode_ is INTERNAL_REFERENCE.
348
349 // Return the reference address this relocation applies to;
350 // can only be called if rmode_ is INTERNAL_REFERENCE.
352
353 // Return the JSDispatchHandle this relocation applies to;
354 // can only be called if rmode_ is JS_DISPATCH_HANDLE.
356
357 template <typename ObjectVisitor>
358 void Visit(Tagged<InstructionStream> host, ObjectVisitor* visitor);
359
360#ifdef ENABLE_DISASSEMBLER
361 // Printing
362 static const char* RelocModeName(Mode rmode);
363 void Print(Isolate* isolate, std::ostream& os);
364#endif // ENABLE_DISASSEMBLER
365#ifdef VERIFY_HEAP
366 void Verify(Isolate* isolate);
367#endif
368
369 static const int kApplyMask; // Modes affected by apply. Depends on arch.
370
371 static constexpr int AllRealModesMask() {
372 constexpr Mode kFirstUnrealRelocMode =
373 static_cast<Mode>(RelocInfo::LAST_REAL_RELOC_MODE + 1);
374 return (ModeMask(kFirstUnrealRelocMode) - 1) &
376 }
377
382
386
387 // In addition to modes covered by the apply mask (which is applied at GC
388 // time, among others), this covers all modes that are relocated by
389 // InstructionStream::CopyFromNoFlush after code generation.
398
399 protected:
400 // On ARM/ARM64, note that pc_ is the address of the instruction referencing
401 // the constant pool and not the address of the constant pool entry.
404 intptr_t data_ = 0;
406
407 template <typename RelocIteratorType>
408 friend class RelocIteratorBase;
409};
410
412 public:
420
421 // Apply a relocation by delta bytes. When the code object is moved, PC
422 // relative addresses have to be updated as well as absolute addresses
423 // inside the code (internal references).
424 // Do not forget to flush the icache afterwards!
425 V8_INLINE void apply(intptr_t delta);
426
429 void set_wasm_canonical_sig_id(uint32_t);
432 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
433
436 WriteBarrierMode write_barrier_mode = UPDATE_WRITE_BARRIER,
437 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
438 // Use this overload only when an InstructionStream host is not available.
439 void set_target_address(Address target, ICacheFlushMode icache_flush_mode =
441
444 WriteBarrierMode write_barrier_mode = UPDATE_WRITE_BARRIER,
445 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
446 // Use this overload only when an InstructionStream host is not available.
448 Tagged<HeapObject> target,
449 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
450
452 Address, ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
453
456 WriteBarrierMode write_barrier_mode = UPDATE_WRITE_BARRIER,
457 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
458
460
461 private:
463};
464
465// RelocInfoWriter serializes a stream of relocation info. It writes towards
466// lower addresses.
468 public:
469 RelocInfoWriter() : pos_(nullptr), last_pc_(nullptr) {}
470
473
474 uint8_t* pos() const { return pos_; }
475 uint8_t* last_pc() const { return last_pc_; }
476
477 void Write(const RelocInfo* rinfo);
478
479 // Update the state of the stream after reloc info buffer
480 // and/or code is moved while the stream is active.
481 void Reposition(uint8_t* pos, uint8_t* pc) {
482 pos_ = pos;
483 last_pc_ = pc;
484 }
485
486 // Max size (bytes) of a written RelocInfo. Longest encoding is
487 // ExtraTag, VariableLengthPCJump, ExtraTag, pc_delta, data_delta.
488 static constexpr int kMaxSize = 1 + 4 + 1 + 1 + kSystemPointerSize;
489
490 private:
491 inline uint32_t WriteLongPCJump(uint32_t pc_delta);
492
493 inline void WriteShortTaggedPC(uint32_t pc_delta, int tag);
494 inline void WriteShortData(uint8_t data_delta);
495
496 inline void WriteMode(RelocInfo::Mode rmode);
497 inline void WriteModeAndPC(uint32_t pc_delta, RelocInfo::Mode rmode);
498 inline void WriteIntData(int data_delta);
499
500 uint8_t* pos_;
501 uint8_t* last_pc_;
502};
503
504// A RelocIterator iterates over relocation information.
505// Typical use:
506//
507// for (RelocIterator it(code); !it.done(); it.next()) {
508// // do something with it.rinfo() here
509// }
510//
511// A mask can be specified to skip unwanted modes.
512template <typename RelocInfoT>
514 public:
515 static constexpr int kAllModesMask = -1;
516
519 RelocIteratorBase& operator=(const RelocIteratorBase&) = delete;
520
521 bool done() const { return done_; }
522 void next();
523
524 // The returned pointer is valid until the next call to next().
525 RelocInfoT* rinfo() {
526 DCHECK(!done());
527 return &rinfo_;
528 }
529
530 protected:
531 V8_INLINE RelocIteratorBase(RelocInfoT reloc_info, const uint8_t* pos,
532 const uint8_t* end, int mode_mask);
533
534 // Used for efficiently skipping unwanted modes.
536 if ((mode_mask_ & (1 << mode)) == 0) return false;
537 rinfo_.rmode_ = mode;
538 return true;
539 }
540
542 return static_cast<RelocInfo::Mode>((*pos_ >> detail::kTagBits) &
543 ((1 << detail::kLongTagBits) - 1));
544 }
545
546 void Advance(int bytes = 1) { pos_ -= bytes; }
547 int AdvanceGetTag() { return *--pos_ & detail::kTagMask; }
549 void AdvanceReadPC() { rinfo_.pc_ += *--pos_; }
550 void AdvanceReadInt();
551
553 void ReadShortData();
554
555 const uint8_t* pos_;
556 const uint8_t* const end_;
557 RelocInfoT rinfo_;
558 bool done_ = false;
559 const int mode_mask_;
560};
561
564extern template class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE)
566
568 public:
569 // Prefer using this ctor when possible:
570 explicit RelocIterator(Tagged<InstructionStream> istream, int mode_mask);
571 // Convenience wrapper.
572 explicit RelocIterator(Tagged<Code> code, int mode_mask = kAllModesMask);
573
574 // For Wasm.
575 explicit RelocIterator(base::Vector<uint8_t> instructions,
577 Address const_pool, int mode_mask = kAllModesMask);
578 // For the disassembler.
579 explicit RelocIterator(const CodeReference code_reference);
580 // For FinalizeEmbeddedCodeTargets when creating embedded builtins.
581 explicit RelocIterator(EmbeddedData* embedded_data, Tagged<Code> code,
582 int mode_mask);
583
585 RelocIterator(const RelocIterator&) = delete;
586 RelocIterator& operator=(const RelocIterator&) = delete;
587
588 private:
590 const uint8_t* end, int mode_mask);
591};
592
595 public:
596 // Constructor for iterating InstructionStreams.
599 Address constant_pool, int mode_mask);
600 // Constructor for iterating Wasm code.
602 base::Vector<uint8_t> instructions,
604 Address constant_pool, int mode_mask = kAllModesMask);
605};
606
607} // namespace internal
608} // namespace v8
609
610#endif // V8_CODEGEN_RELOC_INFO_H_
SourcePosition pos
void WriteShortData(uint8_t data_delta)
Definition reloc-info.cc:43
void WriteModeAndPC(uint32_t pc_delta, RelocInfo::Mode rmode)
Definition reloc-info.cc:52
RelocInfoWriter & operator=(const RelocInfoWriter &)=delete
void Reposition(uint8_t *pos, uint8_t *pc)
Definition reloc-info.h:481
void WriteIntData(int data_delta)
Definition reloc-info.cc:59
void WriteMode(RelocInfo::Mode rmode)
Definition reloc-info.cc:47
uint8_t * last_pc() const
Definition reloc-info.h:475
void WriteShortTaggedPC(uint32_t pc_delta, int tag)
Definition reloc-info.cc:37
RelocInfoWriter(const RelocInfoWriter &)=delete
void Write(const RelocInfo *rinfo)
Definition reloc-info.cc:67
static constexpr int kMaxSize
Definition reloc-info.h:488
uint32_t WriteLongPCJump(uint32_t pc_delta)
Definition reloc-info.cc:24
static constexpr bool IsDeoptReason(Mode mode)
Definition reloc-info.h:228
static constexpr int kMaxSmallPCDelta
Definition reloc-info.h:104
V8_INLINE Address target_internal_reference()
static constexpr bool IsConstPool(Mode mode)
Definition reloc-info.h:223
RelocInfo(Address pc, Mode rmode)
Definition reloc-info.h:183
static constexpr bool IsWasmCanonicalSigId(Mode mode)
Definition reloc-info.h:217
static bool IsOnlyForSerializer(Mode mode)
Definition reloc-info.h:259
static constexpr bool IsDeoptNodeId(Mode mode)
Definition reloc-info.h:232
static constexpr bool IsInternalReference(Mode mode)
Definition reloc-info.h:238
static constexpr bool IsOffHeapTarget(Mode mode)
Definition reloc-info.h:244
static constexpr bool IsGCRelocMode(Mode mode)
Definition reloc-info.h:189
static const int kApplyMask
Definition reloc-info.h:369
void set_off_heap_target_address(Address target, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED)
static constexpr bool IsShareableRelocMode(Mode mode)
Definition reloc-info.h:192
uint32_t wasm_call_tag() const
static constexpr bool IsRelativeCodeTarget(Mode mode)
Definition reloc-info.h:200
static constexpr bool IsCodeTargetMode(Mode mode)
Definition reloc-info.h:197
static constexpr int AllRealModesMask()
Definition reloc-info.h:371
static constexpr int ModeMask(Mode mode)
Definition reloc-info.h:272
static constexpr bool IsCompressedEmbeddedObject(Mode mode)
Definition reloc-info.h:206
V8_INLINE Address target_address()
void Visit(Tagged< InstructionStream > host, ObjectVisitor *visitor)
static constexpr bool IsNearBuiltinEntry(Mode mode)
Definition reloc-info.h:247
static constexpr bool IsInternalReferenceEncoded(Mode mode)
Definition reloc-info.h:241
static constexpr int kMaxCallSize
Definition reloc-info.h:101
V8_EXPORT_PRIVATE uint32_t wasm_canonical_sig_id() const
V8_INLINE Address target_internal_reference_address()
static constexpr bool IsCodeTarget(Mode mode)
Definition reloc-info.h:196
static int PostCodegenRelocationMask()
Definition reloc-info.h:390
static constexpr bool IsWasmCall(Mode mode)
Definition reloc-info.h:213
V8_INLINE int target_address_size()
static constexpr bool IsDeoptId(Mode mode)
Definition reloc-info.h:231
V8_INLINE Builtin target_builtin_at(Assembler *origin)
V8_INLINE WasmCodePointer wasm_code_pointer_table_entry() const
V8_INLINE Address target_off_heap_target()
static constexpr bool IsWasmStubCall(Mode mode)
Definition reloc-info.h:214
static constexpr bool IsJSDispatchHandle(Mode mode)
Definition reloc-info.h:254
static constexpr bool IsEmbeddedObjectMode(Mode mode)
Definition reloc-info.h:209
static constexpr bool IsRealRelocMode(Mode mode)
Definition reloc-info.h:185
static constexpr bool IsExternalReference(Mode mode)
Definition reloc-info.h:235
V8_INLINE Address target_external_reference()
Address constant_pool() const
Definition reloc-info.h:277
V8_INLINE Tagged< HeapObject > target_object(PtrComprCageBase cage_base)
V8_INLINE Address constant_pool_entry_address()
Address wasm_call_address() const
static bool OffHeapTargetIsCodedSpecially()
V8_INLINE JSDispatchHandle js_dispatch_handle()
V8_INLINE DirectHandle< HeapObject > target_object_handle(Assembler *origin)
static constexpr bool IsWasmCodePointerTableEntry(Mode mode)
Definition reloc-info.h:220
static constexpr bool IsFullEmbeddedObject(Mode mode)
Definition reloc-info.h:203
static int JSDispatchHandleModeMask()
Definition reloc-info.h:383
intptr_t data() const
Definition reloc-info.h:278
bool HasTargetAddressAddress() const
static constexpr bool IsBuiltinEntryMode(Mode mode)
Definition reloc-info.h:250
RelocInfo(Address pc, Mode rmode, intptr_t data, Address constant_pool=kNullAddress)
Definition reloc-info.h:175
V8_INLINE Address target_address_address()
Address pc() const
Definition reloc-info.h:275
static constexpr int kMinRelocCommentSize
Definition reloc-info.h:98
static constexpr bool IsVeneerPool(Mode mode)
Definition reloc-info.h:224
static constexpr bool IsDeoptPosition(Mode mode)
Definition reloc-info.h:225
static constexpr bool IsNoInfo(Mode mode)
Definition reloc-info.h:257
static int EmbeddedObjectModeMask()
Definition reloc-info.h:378
Address wasm_stub_call_address() const
static constexpr int kAllModesMask
Definition reloc-info.h:515
bool SetMode(RelocInfo::Mode mode)
Definition reloc-info.h:535
RelocInfo::Mode GetMode() const
Definition reloc-info.h:541
const uint8_t *const end_
Definition reloc-info.h:556
RelocIteratorBase(RelocIteratorBase &&) V8_NOEXCEPT=default
RelocIterator(RelocIterator &&) V8_NOEXCEPT=default
V8_INLINE void set_target_object(Tagged< InstructionStream > host, Tagged< HeapObject > target, WriteBarrierMode write_barrier_mode=UPDATE_WRITE_BARRIER, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED)
V8_INLINE WritableJitAllocation & jit_allocation()
Definition reloc-info.h:459
WritableRelocInfo(WritableJitAllocation &jit_allocation, Address pc, Mode rmode, intptr_t data, Address constant_pool)
Definition reloc-info.h:416
WritableRelocInfo(WritableJitAllocation &jit_allocation, Address pc, Mode rmode)
Definition reloc-info.h:413
void set_js_dispatch_handle(Tagged< InstructionStream > host, JSDispatchHandle handle, WriteBarrierMode write_barrier_mode=UPDATE_WRITE_BARRIER, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED)
void set_wasm_stub_call_address(Address)
void set_target_address(Tagged< InstructionStream > host, Address target, WriteBarrierMode write_barrier_mode=UPDATE_WRITE_BARRIER, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED)
WritableJitAllocation & jit_allocation_
Definition reloc-info.h:462
V8_INLINE void set_wasm_code_pointer_table_entry(WasmCodePointer, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED)
V8_INLINE void apply(intptr_t delta)
V8_INLINE void set_target_external_reference(Address, ICacheFlushMode icache_flush_mode=FLUSH_ICACHE_IF_NEEDED)
void set_wasm_canonical_sig_id(uint32_t)
#define COMPRESS_POINTERS_BOOL
Definition globals.h:99
int end
#define EXPORT_TEMPLATE_DECLARE(export)
constexpr bool IsInRange(T value, U lower_limit, U higher_limit)
Definition bounds.h:20
constexpr int kDefaultTag
Definition reloc-info.h:78
constexpr int kCodeTargetTag
Definition reloc-info.h:76
constexpr int kWasmStubCallTag
Definition reloc-info.h:77
constexpr int kTagBits
Definition reloc-info.h:71
constexpr int kSmallPCDeltaMask
Definition reloc-info.h:81
constexpr int kLongTagBits
Definition reloc-info.h:73
constexpr int kEmbeddedObjectTag
Definition reloc-info.h:75
constexpr int kTagMask
Definition reloc-info.h:72
constexpr int kSmallPCDeltaBits
Definition reloc-info.h:80
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
Definition handles-inl.h:72
constexpr int kBitsPerByte
Definition globals.h:682
@ UPDATE_WRITE_BARRIER
Definition objects.h:55
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in allocation gc speed threshold for starting incremental marking via a task in percent of available threshold for starting incremental marking immediately in percent of available Use a single schedule for determining a marking schedule between JS and C objects schedules the minor GC task with kUserVisible priority max worker number of concurrent for NumberOfWorkerThreads start background threads that allocate memory concurrent_array_buffer_sweeping use parallel threads to clear weak refs in the atomic pause trace progress of the incremental marking trace object counts and memory usage report a tick only when allocated zone memory changes by this amount TracingFlags::gc_stats TracingFlags::gc_stats track native contexts that are expected to be garbage collected verify heap pointers before and after GC memory reducer runs GC with ReduceMemoryFootprint flag Maximum number of memory reducer GCs scheduled Old gen GC speed is computed directly from gc tracer counters Perform compaction on full GCs based on V8 s default heuristics Perform compaction on every full GC Perform code space compaction when finalizing a full GC with stack Stress GC compaction to flush out bugs with moving objects flush of baseline code when it has not been executed recently Use time base code flushing instead of age Use a progress bar to scan large objects in increments when incremental marking is active force incremental marking for small heaps and run it more often force marking at random points between and force scavenge at random points between and reclaim otherwise unreachable unmodified wrapper objects when possible less compaction in non memory reducing mode use high priority threads for concurrent Marking Test mode only flag It allows an unit test to select evacuation candidates use incremental marking for CppHeap cppheap_concurrent_marking c value for membalancer A special constant to balance between memory and space tradeoff The smaller the more memory it uses enable use of SSE4 instructions if available enable use of AVX VNNI instructions if available enable use of POPCNT instruction if available force all emitted branches to be in long mode(MIPS/PPC only)") DEFINE_BOOL(partial_constant_pool
void Print(Tagged< Object > obj)
Definition objects.h:774
constexpr int kSystemPointerSize
Definition globals.h:410
constexpr int kBitsPerInt
Definition globals.h:687
@ FLUSH_ICACHE_IF_NEEDED
Definition reloc-info.h:25
static constexpr Address kNullAddress
Definition v8-internal.h:53
#define V8_NOEXCEPT
#define DCHECK_IMPLIES(v1, v2)
Definition logging.h:493
#define DCHECK_NE(v1, v2)
Definition logging.h:486
#define DCHECK(condition)
Definition logging.h:482
#define DCHECK_EQ(v1, v2)
Definition logging.h:485
#define V8_EXPORT_PRIVATE
Definition macros.h:460
#define V8_INLINE
Definition v8config.h:500