• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching +full:where +full:- +full:object

2 // Use of this source code is governed by a BSD-style license that can be
7 #include "src/assembler-inl.h"
8 #include "src/heap/heap-write-barrier-inl.h"
10 #include "src/objects/api-callbacks.h"
11 #include "src/objects/hash-table.h"
12 #include "src/objects/js-array-buffer-inl.h"
13 #include "src/objects/js-array-inl.h"
14 #include "src/objects/maybe-object.h"
16 #include "src/snapshot/builtin-deserializer-allocator.h"
29 external_reference_table_ = isolate->heap()->external_reference_table(); in Initialize()
33 if (isolate_->api_external_references() != nullptr) { in Initialize()
34 while (isolate_->api_external_references()[num_api_references_] != 0) { in Initialize()
45 return FLAG_lazy_deserialization && !isolate()->serializer_enabled(); in IsLazyDeserializationEnabled()
51 for (const auto& item : to_rehash_) item->RehashBasedOnMap(isolate()); in Rehash()
62 DCHECK(allocator()->ReservationsAreFullyUsed()); in ~Deserializer()
71 Object** start, Object** end) { in VisitRootPointers()
96 int alignment = code - (SerializerDeserializer::kAlignmentPrefix - 1); in DeserializeDeferredObjects()
97 allocator()->SetAlignment(static_cast<AllocationAlignment>(alignment)); in DeserializeDeferredObjects()
103 DCHECK_EQ(code - space, kNewObject); in DeserializeDeferredObjects()
104 HeapObject* object = GetBackReferencedObject(space); in DeserializeDeferredObjects() local
106 Address obj_address = object->address(); in DeserializeDeferredObjects()
112 DCHECK(CanBeDeferred(object)); in DeserializeDeferredObjects()
113 PostProcessNewObject(object, space); in DeserializeDeferredObjects()
121 DCHECK(string->IsInternalizedString()); in StringTableInsertionKey()
124 bool StringTableInsertionKey::IsMatch(Object* string) { in IsMatch()
127 if (Hash() != String::cast(string)->Hash()) return false; in IsMatch()
129 return string_->SlowEquals(String::cast(string)); in IsMatch()
138 string->Hash(); in ComputeHashField()
139 return string->hash_field(); in ComputeHashField()
146 if (obj->IsString()) { in PostProcessNewObject()
149 string->set_hash_field(String::kEmptyHashField); in PostProcessNewObject()
150 } else if (obj->NeedsRehashing()) { in PostProcessNewObject()
156 if (obj->IsString()) { in PostProcessNewObject()
158 if (string->IsInternalizedString()) { in PostProcessNewObject()
170 } else if (obj->IsScript()) { in PostProcessNewObject()
175 } else if (obj->IsScript()) { in PostProcessNewObject()
177 Script::cast(obj)->id())); in PostProcessNewObject()
181 if (obj->IsAllocationSite()) { in PostProcessNewObject()
185 // TODO(mvstanton): consider treating the heap()->allocation_sites_list() in PostProcessNewObject()
188 if (isolate_->heap()->allocation_sites_list() == Smi::kZero) { in PostProcessNewObject()
189 site->set_weak_next(ReadOnlyRoots(isolate_).undefined_value()); in PostProcessNewObject()
191 site->set_weak_next(isolate_->heap()->allocation_sites_list()); in PostProcessNewObject()
193 isolate_->heap()->set_allocation_sites_list(site); in PostProcessNewObject()
194 } else if (obj->IsCode()) { in PostProcessNewObject()
196 // case, we only need to remember code objects in the large object space. in PostProcessNewObject()
197 // When deserializing user code, remember each individual code object. in PostProcessNewObject()
201 } else if (obj->IsAccessorInfo()) { in PostProcessNewObject()
205 } else if (obj->IsCallHandlerInfo()) { in PostProcessNewObject()
209 } else if (obj->IsExternalString()) { in PostProcessNewObject()
210 if (obj->map() == ReadOnlyRoots(isolate_).native_source_string_map()) { in PostProcessNewObject()
212 DCHECK(string->is_short()); in PostProcessNewObject()
213 string->SetResource( in PostProcessNewObject()
215 string->resource())); in PostProcessNewObject()
218 uint32_t index = string->resource_as_uint32(); in PostProcessNewObject()
220 static_cast<Address>(isolate_->api_external_references()[index]); in PostProcessNewObject()
221 string->set_address_as_resource(address); in PostProcessNewObject()
222 isolate_->heap()->UpdateExternalString(string, 0, in PostProcessNewObject()
223 string->ExternalPayloadSize()); in PostProcessNewObject()
225 isolate_->heap()->RegisterExternalString(String::cast(obj)); in PostProcessNewObject()
226 } else if (obj->IsJSTypedArray()) { in PostProcessNewObject()
228 CHECK(typed_array->byte_offset()->IsSmi()); in PostProcessNewObject()
229 int32_t byte_offset = NumberToInt32(typed_array->byte_offset()); in PostProcessNewObject()
232 FixedTypedArrayBase::cast(typed_array->elements()); in PostProcessNewObject()
233 // Must be off-heap layout. in PostProcessNewObject()
234 DCHECK(!typed_array->is_on_heap()); in PostProcessNewObject()
237 reinterpret_cast<intptr_t>(elements->external_pointer()) + in PostProcessNewObject()
239 elements->set_external_pointer(pointer_with_offset); in PostProcessNewObject()
241 } else if (obj->IsJSArrayBuffer()) { in PostProcessNewObject()
243 // Only fixup for the off-heap case. in PostProcessNewObject()
244 if (buffer->backing_store() != nullptr) { in PostProcessNewObject()
245 Smi* store_index = reinterpret_cast<Smi*>(buffer->backing_store()); in PostProcessNewObject()
246 void* backing_store = off_heap_backing_stores_[store_index->value()]; in PostProcessNewObject()
248 buffer->set_backing_store(backing_store); in PostProcessNewObject()
249 isolate_->heap()->RegisterNewArrayBuffer(buffer); in PostProcessNewObject()
251 } else if (obj->IsFixedTypedArrayBase()) { in PostProcessNewObject()
253 // Only fixup for the off-heap case. in PostProcessNewObject()
254 if (fta->base_pointer() == nullptr) { in PostProcessNewObject()
255 Smi* store_index = reinterpret_cast<Smi*>(fta->external_pointer()); in PostProcessNewObject()
256 void* backing_store = off_heap_backing_stores_[store_index->value()]; in PostProcessNewObject()
257 fta->set_external_pointer(backing_store); in PostProcessNewObject()
259 } else if (obj->IsBytecodeArray()) { in PostProcessNewObject()
263 bytecode_array->set_interrupt_budget( in PostProcessNewObject()
265 bytecode_array->set_osr_loop_nesting_level(0); in PostProcessNewObject()
269 DCHECK_EQ(0, Heap::GetFillToAlign(obj->address(), in PostProcessNewObject()
270 HeapObject::RequiredAlignment(obj->map()))); in PostProcessNewObject()
287 obj = allocator()->GetLargeObject(source_.GetInt()); in GetBackReferencedObject()
290 obj = allocator()->GetMap(source_.GetInt()); in GetBackReferencedObject()
295 if (isolate()->heap()->deserialization_complete()) { in GetBackReferencedObject()
296 PagedSpace* read_only_space = isolate()->heap()->read_only_space(); in GetBackReferencedObject()
297 Page* page = read_only_space->first_page(); in GetBackReferencedObject()
299 page = page->next_page(); in GetBackReferencedObject()
301 Address address = page->OffsetToAddress(chunk_offset); in GetBackReferencedObject()
304 obj = allocator()->GetObject(static_cast<AllocationSpace>(space), in GetBackReferencedObject()
312 obj = allocator()->GetObject(static_cast<AllocationSpace>(space), in GetBackReferencedObject()
318 if (deserializing_user_code() && obj->IsThinString()) { in GetBackReferencedObject()
319 obj = ThinString::cast(obj)->actual(); in GetBackReferencedObject()
327 // This routine writes the new object into the pointer provided.
328 // The reason for this strange interface is that otherwise the object is
338 allocator()->Allocate(static_cast<AllocationSpace>(space_number), size); in ReadObject()
341 isolate_->heap()->OnAllocationEvent(obj, size); in ReadObject()
346 // Only post process if object content has not been deferred. in ReadObject()
356 if (obj->IsCode()) { in ReadObject()
365 Object* Deserializer<AllocatorT>::ReadDataSingle() { in ReadDataSingle()
374 bool success = o->ToStrongHeapObject(&heap_object); in ReadDataSingle()
381 // The following check will trigger if a function or object template in NoExternalReferencesCallback()
402 #define CASE_STATEMENT(where, how, within, space_number) \ in ReadData() argument
403 case where + how + within + space_number: \ in ReadData()
404 STATIC_ASSERT((where & ~kWhereMask) == 0); \ in ReadData()
409 #define CASE_BODY(where, how, within, space_number_if_any) \ in ReadData() argument
410 current = ReadDataCase<where, how, within, space_number_if_any>( \ in ReadData()
415 // write barrier handling) and handles the other spaces with fall-through cases in ReadData()
417 #define ALL_SPACES(where, how, within) \ in ReadData() argument
418 CASE_STATEMENT(where, how, within, NEW_SPACE) \ in ReadData()
419 CASE_BODY(where, how, within, NEW_SPACE) \ in ReadData()
420 CASE_STATEMENT(where, how, within, OLD_SPACE) \ in ReadData()
422 CASE_STATEMENT(where, how, within, CODE_SPACE) \ in ReadData()
424 CASE_STATEMENT(where, how, within, MAP_SPACE) \ in ReadData()
426 CASE_STATEMENT(where, how, within, LO_SPACE) \ in ReadData()
428 CASE_STATEMENT(where, how, within, RO_SPACE) \ in ReadData()
429 CASE_BODY(where, how, within, kAnyOldSpace) in ReadData()
443 #define SINGLE_CASE(where, how, within, space) \ in ReadData() argument
444 CASE_STATEMENT(where, how, within, space) \ in ReadData()
445 CASE_BODY(where, how, within, space) in ReadData()
447 // Deserialize a new object and write a pointer to it to the current in ReadData()
448 // object. in ReadData()
450 // Deserialize a new code object and write a pointer to its first in ReadData()
451 // instruction to the current code object. in ReadData()
453 // Find a recently deserialized object using its offset from the current in ReadData()
454 // allocation point and write a pointer to it to the current object. in ReadData()
458 // Deserialize a new object from pointer found in code and write in ReadData()
459 // a pointer to it to the current object. Required only for MIPS, PPC, ARM in ReadData()
463 // Find a recently deserialized code object using its offset from the in ReadData()
465 // object. Required only for MIPS, PPC, ARM or S390 with embedded in ReadData()
470 // Find a recently deserialized code object using its offset from the in ReadData()
472 // to the current code object or the instruction pointer in a function in ReadData()
473 // object. in ReadData()
476 // Find an object in the roots array and write a pointer to it to the in ReadData()
477 // current object. in ReadData()
480 // Find an object in the roots array and write a pointer to it to in code. in ReadData()
483 // Find an object in the partial snapshots cache and write a pointer to it in ReadData()
484 // to the current object. in ReadData()
488 // Find an object in the attached references and write a pointer to it to in ReadData()
489 // the current object. in ReadData()
493 // Find a builtin and write a pointer to it to the current object. in ReadData()
510 // object. in ReadData()
516 // code object. in ReadData()
531 DCHECK(0 <= pc_offset && pc_offset <= code->raw_instruction_size()); in ReadData()
533 target_offset <= code->raw_instruction_size()); in ReadData()
534 Address pc = code->entry() + pc_offset; in ReadData()
535 Address target = code->entry() + target_offset; in ReadData()
552 CHECK_NOT_NULL(isolate->embedded_blob()); in ReadData()
580 allocator()->MoveToNextChunk(static_cast<AllocationSpace>(space)); in ReadData()
585 // Deferred can only occur right after the heap object header. in ReadData()
589 // If the deferred object is a map, its instance type may be used in ReadData()
591 if (obj->IsMap()) Map::cast(obj)->set_instance_type(FILLER_TYPE); in ReadData()
611 // Deserialize raw code directly into the body of the code object. in ReadData()
623 MaybeObject* object = current[-1]; in ReadData() local
624 DCHECK(!Heap::InNewSpace(object)); in ReadData()
625 DCHECK(!allocator()->next_reference_is_weak()); in ReadData()
626 for (int i = 0; i < repeats; i++) UnalignedCopy(current++, &object); in ReadData()
633 isolate->array_buffer_allocator()->AllocateUninitialized( in ReadData()
647 if (isolate->api_external_references()) { in ReadData()
652 isolate->api_external_references()[reference_id]); in ReadData()
662 DCHECK(!allocator()->next_reference_is_weak()); in ReadData()
663 allocator()->set_next_reference_is_weak(true); in ReadData()
669 int alignment = data - (SerializerDeserializer::kAlignmentPrefix - 1); in ReadData()
670 allocator()->SetAlignment(static_cast<AllocationAlignment>(alignment)); in ReadData()
688 MaybeObject* object = in ReadData() local
689 MaybeObject::FromObject(isolate->heap()->root(root_index)); in ReadData()
690 DCHECK(!Heap::InNewSpace(object)); in ReadData()
691 DCHECK(!allocator()->next_reference_is_weak()); in ReadData()
692 UnalignedCopy(current++, &object); in ReadData()
708 Object* hot_object = hot_objects_.Get(index); in ReadData()
710 if (allocator()->GetAndClearNextReferenceIsWeak()) { in ReadData()
730 int size_in_bytes = (data - kFixedRawDataStart) << kPointerSizeLog2; in ReadData()
738 int repeats = data - kFixedRepeatStart; in ReadData()
739 MaybeObject* object; in ReadData() local
740 DCHECK(!allocator()->next_reference_is_weak()); in ReadData()
741 UnalignedCopy(&object, current - 1); in ReadData()
742 DCHECK(!Heap::InNewSpace(object)); in ReadData()
743 for (int i = 0; i < repeats; i++) UnalignedCopy(current++, &object); in ReadData()
770 Address address = external_reference_table_->address(reference_id); in ReadExternalReferenceCase()
790 template <int where, int how, int within, int space_number_if_any>
799 if (where == kNewObject && how == kPlain && within == kStartOfObject) { in ReadDataCase()
800 if (allocator()->GetAndClearNextReferenceIsWeak()) { in ReadDataCase()
806 Object* new_object = nullptr; /* May not be a real Object pointer. */ in ReadDataCase()
807 if (where == kNewObject) { in ReadDataCase()
810 } else if (where == kBackref) { in ReadDataCase()
813 } else if (where == kBackrefWithSkip) { in ReadDataCase()
819 } else if (where == kRootArray) { in ReadDataCase()
822 new_object = isolate->heap()->root(root_index); in ReadDataCase()
825 } else if (where == kPartialSnapshotCache) { in ReadDataCase()
827 new_object = isolate->partial_snapshot_cache()->at(cache_index); in ReadDataCase()
829 } else if (where == kAttachedReference) { in ReadDataCase()
834 DCHECK_EQ(where, kBuiltin); in ReadDataCase()
836 new_object = isolate->builtins()->builtin(builtin_id); in ReadDataCase()
841 if (where == kBuiltin) { in ReadDataCase()
844 new_object = reinterpret_cast<Object*>( in ReadDataCase()
845 reinterpret_cast<Code*>(new_object)->raw_instruction_start()); in ReadDataCase()
846 } else if (new_object->IsCode()) { in ReadDataCase()
847 new_object = reinterpret_cast<Object*>( in ReadDataCase()
848 Code::cast(new_object)->raw_instruction_start()); in ReadDataCase()
851 new_object = reinterpret_cast<Object*>(cell->ValueAddress()); in ReadDataCase()
855 DCHECK(!allocator()->next_reference_is_weak()); in ReadDataCase()
868 if (allocator()->GetAndClearNextReferenceIsWeak()) { in ReadDataCase()
876 SLOW_DCHECK(isolate->heap()->ContainsSlow(current_object_address)); in ReadDataCase()