46 DCHECK(!IsInstructionStream(*
object));
56 auto find_result =
map_.
Find(
object);
61 if (!find_result.already_exists) {
63 *find_result.entry =
map_.
size() - 1;
65 return *find_result.entry;
70void CheckPreconditionsForPatching(
Isolate* isolate,
75 DCHECK(!isolate->roots_table().IsRootHandle(replacement_object,
81 isolate->heap()->builtins_constants_table());
83 DCHECK(isolate->IsGeneratingEmbeddedBuiltins());
90 CheckPreconditionsForPatching(
isolate_, code_object);
95 DCHECK(IsInstructionStream(*code_object));
102 CheckPreconditionsForPatching(
isolate_, counters);
125 ConstantsMap::IteratableScope it_scope(&
map_);
126 for (
auto it = it_scope.begin(); it != it_scope.end(); ++it) {
127 uint32_t index = *it.entry();
129 if (IsCode(value) &&
Cast<Code>(value)->
kind() == CodeKind::BUILTIN) {
134 value = builtins->code(
Cast<Code>(value)->builtin_id());
137 table->set(index, value);
void PatchBasicBlockCountersReference(Handle< ByteArray > counters)
BuiltinsConstantsTableBuilder(Isolate *isolate)
void PatchSelfReference(DirectHandle< Object > self_reference, Handle< InstructionStream > code_object)
uint32_t AddObject(Handle< Object > object)
Handle< FixedArray > NewFixedArray(int length, AllocationType allocation=AllocationType::kYoung)
static V8_INLINE bool InReadOnlySpace(Tagged< HeapObject > object)
void SetBuiltinsConstantsTable(Tagged< FixedArray > cache)
void Insert(DirectHandle< Object > key, V v)
bool Delete(DirectHandle< Object > key, V *deleted_value)
V * Find(DirectHandle< Object > key) const
IdentityMapFindResult< V > FindOrInsert(DirectHandle< Object > key)
ThreadId thread_id() const
v8::internal::Factory * factory()
RootsTable & roots_table()
bool IsGeneratingEmbeddedBuiltins() const
bool IsRootHandle(IndirectHandle< T > handle, RootIndex *index) const
static constexpr bool IsImmortalImmovable(RootIndex root_index)
static ThreadId Current()
V8_INLINE constexpr bool IsHeapObject(TaggedImpl< kRefType, StorageType > obj)
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
#define DCHECK_NOT_NULL(val)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK_NE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)