1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "ecmascript/mem/regexp_cached_chunk.h" 17 18 #include "ecmascript/mem/heap.h" 19 20 namespace panda::ecmascript { 21 RegExpCachedChunk(JSThread * JSThread)22RegExpCachedChunk::RegExpCachedChunk(JSThread *JSThread) : jsThread_(JSThread) 23 { 24 allocator_ = jsThread_->GetNativeAreaAllocator(); 25 currentArea_ = jsThread_->GetOrCreateRegExpCache(); 26 ptr_ = currentArea_->GetBegin(); 27 end_ = currentArea_->GetEnd(); 28 } 29 } // namespace panda::ecmascript 30