• Home
  • Raw
  • Download

Lines Matching +full:non +full:- +full:range

2  * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
18 #include "ecmascript/ecma_string-inl.h"
25 const uint32_t postTaskCount = Taskpool::GetCurrentTaskpool()->GetTotalThreadNum(); in PostSweepWeakRefTask()
27 …Taskpool::GetCurrentTaskpool()->PostTask(std::make_unique<SweepWeakRefTask>(iter_, this, visitor)); in PostSweepWeakRefTask()
43 cleaner->stringTable_->SweepWeakRef(visitor, tableId); in ProcessSweepWeakRef()
45 cleaner->SignalSweepWeakRefTask(); in ProcessSweepWeakRef()
84 auto range = stringTable_[GetTableId(hashcode)].table_.equal_range(hashcode); in GetStringThreadUnsafe() local
85 for (auto item = range.first; item != range.second;) { in GetStringThreadUnsafe()
86 auto foundString = (item++)->second; in GetStringThreadUnsafe()
97 auto range = stringTable_[GetTableId(hashcode)].table_.equal_range(hashcode); in GetStringThreadUnsafe() local
98 for (auto item = range.first; item != range.second;) { in GetStringThreadUnsafe()
99 auto foundString = (item++)->second; in GetStringThreadUnsafe()
110 auto range = stringTable_[GetTableId(hashcode)].table_.equal_range(hashcode); in GetStringThreadUnsafe() local
111 for (auto item = range.first; item != range.second;) { in GetStringThreadUnsafe()
112 auto foundString = (item++)->second; in GetStringThreadUnsafe()
122 auto range = stringTable_[GetTableId(hashcode)].table_.equal_range(hashcode); in GetStringWithHashThreadUnsafe() local
123 for (auto item = range.first; item != range.second;) { in GetStringWithHashThreadUnsafe()
124 auto foundString = (item++)->second; in GetStringWithHashThreadUnsafe()
134 auto range = stringTable_[GetTableId(hashcode)].table_.equal_range(hashcode); in GetStringThreadUnsafe() local
135 for (auto item = range.first; item != range.second;) { in GetStringThreadUnsafe()
136 auto foundString = (item++)->second; in GetStringThreadUnsafe()
150 ASSERT(Region::ObjectAddressToRange(reinterpret_cast<TaggedObject *>(string))->InSharedHeap()); in InternStringThreadUnsafe()
161 auto vm = thread->GetEcmaVM(); in InternEmptyString()
162 if (vm->IsCollectingScopeLockStats()) { in InternEmptyString()
163 vm->IncreaseStringTableLockCount(); in InternEmptyString()
182 bool signalState = vm->GetJsDebuggerManager()->GetSignalState(); in GetOrInternString()
183 thread = signalState ? vm->GetJSThreadNoCheck() : vm->GetJSThread(); in GetOrInternString()
198 EcmaVM *vm = thread->GetEcmaVM(); in GetOrInternStringWithoutLock()
202 if (vm->IsCollectingScopeLockStats()) { in GetOrInternStringWithoutLock()
203 vm->IncreaseStringTableLockCount(); in GetOrInternStringWithoutLock()
213 concatString->SetMixHashcode(result.second); in GetOrInternStringWithoutLock()
222 if (vm->GetJsDebuggerManager()->GetSignalState()) { in GetOrInternString()
225 RuntimeLockHolder locker(vm->GetJSThread(), stringTable_[GetTableId(hashcode)].mutex_); in GetOrInternString()
234 if (vm->IsCollectingScopeLockStats()) { in GetOrInternStringWithoutLock()
235 vm->IncreaseStringTableLockCount(); in GetOrInternStringWithoutLock()
245 str->SetMixHashcode(result.second); in GetOrInternStringWithoutLock()
255 RuntimeLockHolder locker(vm->GetJSThread(), stringTable_[GetTableId(hashcode)].mutex_); in GetOrInternCompressedSubString()
257 if (vm->IsCollectingScopeLockStats()) { in GetOrInternCompressedSubString()
258 vm->IncreaseStringTableLockCount(); in GetOrInternCompressedSubString()
270 str->SetMixHashcode(result.second); in GetOrInternCompressedSubString()
276 This function is used to create global constant strings from non-movable sapce only.
277 It only inserts string into string-table and provides no string-table validity check.
282 RuntimeLockHolder locker(vm->GetJSThread(), stringTable_[GetTableId(hashcode)].mutex_); in CreateAndInternStringNonMovable()
284 if (vm->IsCollectingScopeLockStats()) { in CreateAndInternStringNonMovable()
285 vm->IncreaseStringTableLockCount(); in CreateAndInternStringNonMovable()
293 str->SetMixHashcode(result.second); in CreateAndInternStringNonMovable()
299 This function is used to create global constant strings from read-only sapce only.
300 It only inserts string into string-table and provides no string-table validity check.
306 RuntimeLockHolder locker(vm->GetJSThread(), stringTable_[GetTableId(hashcode)].mutex_); in CreateAndInternStringReadOnly()
308 if (vm->IsCollectingScopeLockStats()) { in CreateAndInternStringReadOnly()
309 vm->IncreaseStringTableLockCount(); in CreateAndInternStringReadOnly()
318 str->SetMixHashcode(result.second); in CreateAndInternStringReadOnly()
327 RuntimeLockHolder locker(vm->GetJSThread(), stringTable_[GetTableId(hashcode)].mutex_); in GetOrInternString()
329 if (vm->IsCollectingScopeLockStats()) { in GetOrInternString()
330 vm->IncreaseStringTableLockCount(); in GetOrInternString()
340 str->SetMixHashcode(result.second); in GetOrInternString()
350 auto thread = vm->GetJSThread(); in GetOrInternString()
362 if (vm->IsCollectingScopeLockStats()) { in GetOrInternString()
363 vm->IncreaseStringTableLockCount(); in GetOrInternString()
381 JSHandle<EcmaString> strHandle(vm->GetJSThread(), string); in GetOrInternStringThreadUnsafe()
399 ASSERT(Region::ObjectAddressToRange(reinterpret_cast<TaggedObject *>(string))->InSharedHeap()); in InsertStringToTableWithHashThreadUnsafe()
409 JSHandle<EcmaString> strFlatHandle(vm->GetJSThread(), strFlat); in InsertStringToTable()
411 RuntimeLockHolder locker(vm->GetJSThread(), stringTable_[GetTableId(hashcode)].mutex_); in InsertStringToTable()
413 if (vm->IsCollectingScopeLockStats()) { in InsertStringToTable()
414 vm->IncreaseStringTableLockCount(); in InsertStringToTable()
427 auto vm = thread->GetEcmaVM(); in TryGetInternString()
428 if (vm->IsCollectingScopeLockStats()) { in TryGetInternString()
429 vm->IncreaseStringTableLockCount(); in TryGetInternString()
441 RuntimeLockHolder locker(vm->GetJSThread(), stringTable_[GetTableId(hashcode)].mutex_); in GetOrInternStringWithSpaceType()
443 if (vm->IsCollectingScopeLockStats()) { in GetOrInternStringWithSpaceType()
444 vm->IncreaseStringTableLockCount(); in GetOrInternStringWithSpaceType()
460 str->SetMixHashcode(result.second); in GetOrInternStringWithSpaceType()
471 JSHandle<EcmaString> stringHandle(vm->GetJSThread(), str); in GetOrInternStringWithSpaceType()
473 RuntimeLockHolder locker(vm->GetJSThread(), stringTable_[GetTableId(hashcode)].mutex_); in GetOrInternStringWithSpaceType()
475 if (vm->IsCollectingScopeLockStats()) { in GetOrInternStringWithSpaceType()
476 vm->IncreaseStringTableLockCount(); in GetOrInternStringWithSpaceType()
497 RuntimeLockHolder locker(vm->GetJSThread(), stringTable_[GetTableId(hashcode)].mutex_); in GetOrInternStringWithSpaceTypeWithoutJSHandle()
499 if (vm->IsCollectingScopeLockStats()) { in GetOrInternStringWithSpaceTypeWithoutJSHandle()
500 vm->IncreaseStringTableLockCount(); in GetOrInternStringWithSpaceTypeWithoutJSHandle()
508 str->SetMixHashcode(hashcode); in GetOrInternStringWithSpaceTypeWithoutJSHandle()
526 auto *object = it->second; in SweepWeakRef()
528 ASSERT(Region::ObjectAddressToRange(object)->InSharedHeap()); in SweepWeakRef()
533 it->second = static_cast<EcmaString *>(fwd); in SweepWeakRef()
535 LOG_ECMA(VERBOSE) << "StringTable: forward " << std::hex << object << " -> " << fwd; in SweepWeakRef()
545 if (vm->IsCollectingScopeLockStats()) { in RelocateConstantData()
546 vm->IncreaseStringTableLockCount(); in RelocateConstantData()
549 auto thread = vm->GetJSThread(); in RelocateConstantData()
553 auto *object = it->second; in RelocateConstantData()
559 … if (constantStr->GetEntityId() < 0 || !jsPandaFile->Contain(constantStr->GetConstantData())) { in RelocateConstantData()
560 … // EntityId is -1, which means this str has been relocated. Or the data is not in pandafile. in RelocateConstantData()
564 uint32_t id = constantStr->GetEntityIdU32(); in RelocateConstantData()
565 panda_file::File::StringData sd = jsPandaFile->GetStringData(EntityId(id)); in RelocateConstantData()
566 if (constantStr->GetConstantData() != sd.data) { in RelocateConstantData()
573 it->second = *(vm->GetFactory()->GetEmptyString()); in RelocateConstantData()
576 JSMutableHandle<ByteArray> newData(vm->GetJSThread(), JSTaggedValue::Undefined()); in RelocateConstantData()
577 newData.Update(vm->GetFactory()->NewByteArray( in RelocateConstantData()
580 constantStr->SetRelocatedData(thread, newData.GetTaggedValue()); in RelocateConstantData()
581 constantStr->SetConstantData(static_cast<uint8_t *>(newData->GetData())); in RelocateConstantData()
582 constantStr->SetEntityId(-1); in RelocateConstantData()
591 auto vm = thread->GetEcmaVM(); in CheckStringTableValidity()
592 if (vm->IsCollectingScopeLockStats()) { in CheckStringTableValidity()
593 vm->IncreaseStringTableLockCount(); in CheckStringTableValidity()
599 auto outerString = itemOuter->second; in CheckStringTableValidity()
605 auto range = table.equal_range(hashcode); in CheckStringTableValidity() local
606 for (auto it = range.first; it != range.second; ++it) { in CheckStringTableValidity()
607 auto foundString = it->second; in CheckStringTableValidity()
620 auto table = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(MAX_ONEBYTE_CHARCODE, in CreateSingleCharTable()
622 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CreateSingleCharTable()
625 table->Set(thread, i, factory->NewFromASCIIReadOnly(tmp).GetTaggedValue()); in CreateSingleCharTable()