2024-04-13 06:35:50 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
#include "ecmascript/compiler/compilation_env.h"
|
|
|
|
#include "ecmascript/ecma_context.h"
|
|
|
|
#include "ecmascript/jspandafile/program_object.h"
|
2024-04-15 06:04:51 +00:00
|
|
|
#include "ecmascript/pgo_profiler/pgo_profiler.h"
|
2024-04-13 06:35:50 +00:00
|
|
|
|
|
|
|
namespace panda::ecmascript {
|
|
|
|
CompilationEnv::CompilationEnv(EcmaVM *vm) : vm_(vm), thread_(vm_->GetJSThread()),
|
2024-04-09 23:24:36 +00:00
|
|
|
ptManager_(nullptr) { }
|
2024-04-13 06:35:50 +00:00
|
|
|
|
|
|
|
NativeAreaAllocator *CompilationEnv::GetNativeAreaAllocator() const
|
|
|
|
{
|
|
|
|
return vm_->GetNativeAreaAllocator();
|
|
|
|
}
|
2024-04-15 06:04:51 +00:00
|
|
|
|
|
|
|
std::shared_ptr<pgo::PGOProfiler> CompilationEnv::GetPGOProfiler() const
|
|
|
|
{
|
|
|
|
return vm_->GetPGOProfiler();
|
|
|
|
}
|
2024-04-13 06:35:50 +00:00
|
|
|
} // namespace panda::ecmascript
|