1 /** 2 * Copyright (c) 2021-2024 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 #ifndef PANDA_RUNTIME_LANGUAGE_CONTEXT_H_ 16 #define PANDA_RUNTIME_LANGUAGE_CONTEXT_H_ 17 18 #include "libpandabase/utils/utf.h" 19 #include "libpandafile/class_data_accessor-inl.h" 20 #include "libpandafile/file_items.h" 21 #include "macros.h" 22 #include "compiler/code_info/vreg_info.h" 23 #include "runtime/class_initializer.h" 24 #include "runtime/include/class-inl.h" 25 #include "runtime/include/class_linker_extension.h" 26 #include "runtime/include/coretypes/tagged_value.h" 27 #include "runtime/include/imtable_builder.h" 28 #include "runtime/include/itable_builder.h" 29 #include "runtime/include/language_config.h" 30 #include "runtime/include/vtable_builder_interface.h" 31 #include "runtime/include/tooling/inspector_extension.h" 32 #include "runtime/include/tooling/pt_lang_extension.h" 33 #include "runtime/include/stack_walker.h" 34 #include "runtime/mem/gc/gc_types.h" 35 namespace ark { 36 class Thread; 37 class Trace; 38 class Runtime; 39 class RuntimeOptions; 40 41 namespace mem { 42 class GC; 43 class ObjectAllocatorBase; 44 class GCSettings; 45 } // namespace mem 46 47 struct VerificationInitAPI { 48 std::vector<panda_file::Type::TypeId> primitiveRootsForVerification; 49 std::vector<const uint8_t *> arrayElementsForVerification; 50 bool isNeedObjectSyntheticClass = false; 51 bool isNeedStringSyntheticClass = false; 52 bool isNeedClassSyntheticClass = false; 53 }; 54 55 class LanguageContextBase { 56 public: 57 LanguageContextBase() = default; 58 59 DEFAULT_COPY_SEMANTIC(LanguageContextBase); 60 DEFAULT_MOVE_SEMANTIC(LanguageContextBase); 61 62 virtual ~LanguageContextBase() = default; 63 64 virtual panda_file::SourceLang GetLanguage() const = 0; 65 GetStringClassDescriptor()66 virtual const uint8_t *GetStringClassDescriptor() const 67 { 68 return utf::CStringAsMutf8(ark::panda_file::GetStringClassDescriptor(GetLanguage())); 69 } 70 71 virtual LangTypeT GetLanguageType() const = 0; 72 73 virtual const uint8_t *GetObjectClassDescriptor() const = 0; 74 75 virtual const uint8_t *GetClassClassDescriptor() const = 0; 76 77 virtual const uint8_t *GetClassArrayClassDescriptor() const = 0; 78 79 virtual const uint8_t *GetStringArrayClassDescriptor() const = 0; 80 GetCtorName()81 virtual const uint8_t *GetCtorName() const 82 { 83 return utf::CStringAsMutf8(ark::panda_file::GetCtorName(GetLanguage())); 84 } 85 GetCctorName()86 virtual const uint8_t *GetCctorName() const 87 { 88 return utf::CStringAsMutf8(ark::panda_file::GetCctorName(GetLanguage())); 89 } 90 91 virtual const uint8_t *GetNullPointerExceptionClassDescriptor() const = 0; 92 GetStackOverflowErrorClassDescriptor()93 virtual const uint8_t *GetStackOverflowErrorClassDescriptor() const 94 { 95 UNREACHABLE(); 96 return nullptr; 97 } 98 99 virtual const uint8_t *GetArrayIndexOutOfBoundsExceptionClassDescriptor() const = 0; 100 101 virtual const uint8_t *GetIndexOutOfBoundsExceptionClassDescriptor() const = 0; 102 103 virtual const uint8_t *GetIllegalStateExceptionClassDescriptor() const = 0; 104 105 virtual const uint8_t *GetNegativeArraySizeExceptionClassDescriptor() const = 0; 106 107 virtual const uint8_t *GetStringIndexOutOfBoundsExceptionClassDescriptor() const = 0; 108 109 virtual const uint8_t *GetArithmeticExceptionClassDescriptor() const = 0; 110 111 virtual const uint8_t *GetClassCastExceptionClassDescriptor() const = 0; 112 113 virtual const uint8_t *GetAbstractMethodErrorClassDescriptor() const = 0; 114 115 virtual const uint8_t *GetArrayStoreExceptionClassDescriptor() const = 0; 116 117 virtual const uint8_t *GetRuntimeExceptionClassDescriptor() const = 0; 118 119 virtual const uint8_t *GetFileNotFoundExceptionClassDescriptor() const = 0; 120 121 virtual const uint8_t *GetIOExceptionClassDescriptor() const = 0; 122 123 virtual const uint8_t *GetIllegalArgumentExceptionClassDescriptor() const = 0; 124 125 virtual const uint8_t *GetIllegalAccessExceptionClassDescriptor() const = 0; 126 127 virtual const uint8_t *GetOutOfMemoryErrorClassDescriptor() const = 0; 128 129 virtual const uint8_t *GetNoClassDefFoundErrorDescriptor() const = 0; 130 131 virtual const uint8_t *GetClassCircularityErrorDescriptor() const = 0; 132 133 virtual const uint8_t *GetNoSuchFieldErrorDescriptor() const = 0; 134 135 virtual const uint8_t *GetNoSuchMethodErrorDescriptor() const = 0; 136 137 virtual coretypes::TaggedValue GetInitialTaggedValue() const = 0; 138 139 virtual coretypes::TaggedValue GetEncodedTaggedValue(int64_t value, int64_t tag) const = 0; 140 141 virtual std::pair<Method *, uint32_t> GetCatchMethodAndOffset(Method *method, ManagedThread *thread) const; 142 143 virtual PandaVM *CreateVM(Runtime *runtime, const RuntimeOptions &options) const = 0; 144 145 virtual mem::GC *CreateGC(mem::GCType gcType, mem::ObjectAllocatorBase *objectAllocator, 146 const mem::GCSettings &settings) const = 0; 147 148 virtual std::unique_ptr<ClassLinkerExtension> CreateClassLinkerExtension() const; 149 150 virtual std::unique_ptr<tooling::InspectorExtension> CreateInspectorExtension() const; 151 152 virtual PandaUniquePtr<tooling::PtLangExt> CreatePtLangExt() const; 153 154 virtual void ThrowException(ManagedThread *thread, const uint8_t *mutf8Name, const uint8_t *mutf8Msg) const; 155 156 virtual void SetExceptionToVReg( 157 [[maybe_unused]] interpreter::AccVRegister &vreg, // NOLINTNEXTLINE(google-runtime-references) 158 [[maybe_unused]] ObjectHeader *obj) const; 159 160 virtual bool IsCallableObject([[maybe_unused]] ObjectHeader *obj) const = 0; 161 162 virtual Method *GetCallTarget(ObjectHeader *obj) const = 0; 163 164 virtual const uint8_t *GetExceptionInInitializerErrorDescriptor() const = 0; 165 166 virtual const uint8_t *GetClassNotFoundExceptionDescriptor() const = 0; 167 168 virtual const uint8_t *GetInstantiationErrorDescriptor() const = 0; 169 170 virtual const uint8_t *GetUnsupportedOperationExceptionClassDescriptor() const = 0; 171 172 virtual const uint8_t *GetVerifyErrorClassDescriptor() const = 0; 173 174 virtual const uint8_t *GetReferenceErrorDescriptor() const = 0; 175 176 virtual const uint8_t *GetTypedErrorDescriptor() const = 0; 177 178 virtual const uint8_t *GetIllegalMonitorStateExceptionDescriptor() const = 0; 179 ThrowStackOverflowException(ManagedThread * thread)180 virtual void ThrowStackOverflowException([[maybe_unused]] ManagedThread *thread) const 181 { 182 UNREACHABLE(); 183 } 184 GetCloneNotSupportedExceptionDescriptor()185 virtual const uint8_t *GetCloneNotSupportedExceptionDescriptor() const 186 { 187 UNREACHABLE(); 188 } 189 GetFrameExtSize()190 virtual uint32_t GetFrameExtSize() const 191 { 192 return 0; 193 } 194 GetIncompatibleClassChangeErrorDescriptor()195 virtual const uint8_t *GetIncompatibleClassChangeErrorDescriptor() const 196 { 197 UNREACHABLE(); 198 } 199 CreateIMTableBuilder()200 virtual PandaUniquePtr<IMTableBuilder> CreateIMTableBuilder() const 201 { 202 return MakePandaUnique<IMTableBuilder>(); 203 } 204 GetErrorClassDescriptor()205 virtual const uint8_t *GetErrorClassDescriptor() const 206 { 207 return nullptr; 208 } 209 CreateITableBuilder(ClassLinkerErrorHandler * errHandler)210 virtual PandaUniquePtr<ITableBuilder> CreateITableBuilder( 211 [[maybe_unused]] ClassLinkerErrorHandler *errHandler) const 212 { 213 return nullptr; 214 } 215 CreateVTableBuilder(ClassLinkerErrorHandler * errHandler)216 virtual PandaUniquePtr<VTableBuilder> CreateVTableBuilder( 217 [[maybe_unused]] ClassLinkerErrorHandler *errHandler) const 218 { 219 return nullptr; 220 } 221 InitializeClass(ClassLinker * classLinker,ManagedThread * thread,Class * klass)222 virtual bool InitializeClass([[maybe_unused]] ClassLinker *classLinker, [[maybe_unused]] ManagedThread *thread, 223 [[maybe_unused]] Class *klass) const 224 { 225 return true; 226 } 227 GetStringSize(const ObjectHeader * stringObject)228 virtual size_t GetStringSize(const ObjectHeader *stringObject) const 229 { 230 return stringObject->ObjectSize(); 231 } 232 CreateTrace(PandaUniquePtr<ark::os::file::File> traceFile,size_t bufferSize)233 virtual Trace *CreateTrace([[maybe_unused]] PandaUniquePtr<ark::os::file::File> traceFile, 234 [[maybe_unused]] size_t bufferSize) const 235 { 236 UNREACHABLE(); 237 } 238 GetBootPandaFilesOpenMode()239 virtual ark::panda_file::File::OpenMode GetBootPandaFilesOpenMode() const 240 { 241 return panda_file::File::READ_ONLY; 242 } 243 GetVerificationInitAPI()244 virtual VerificationInitAPI GetVerificationInitAPI() const 245 { 246 return VerificationInitAPI(); 247 } 248 GetVerificationTypeClass()249 virtual const char *GetVerificationTypeClass() const 250 { 251 return nullptr; 252 } 253 GetVerificationTypeObject()254 virtual const char *GetVerificationTypeObject() const 255 { 256 return nullptr; 257 } 258 GetVerificationTypeThrowable()259 virtual const char *GetVerificationTypeThrowable() const 260 { 261 return nullptr; 262 } 263 RestoreEnv(Frame * currentIframe,const StackWalker::EnvData & envData)264 virtual void RestoreEnv([[maybe_unused]] Frame *currentIframe, 265 [[maybe_unused]] const StackWalker::EnvData &envData) const 266 { 267 } 268 IsEnabledCHA()269 virtual bool IsEnabledCHA() const 270 { 271 return true; 272 } 273 InitializeOsrCframeSlots(Span<uintptr_t> paramSlots)274 virtual void InitializeOsrCframeSlots([[maybe_unused]] Span<uintptr_t> paramSlots) const {} 275 GetOsrEnv(const Frame * iframe,compiler::VRegInfo vregInfo)276 virtual uint64_t GetOsrEnv([[maybe_unused]] const Frame *iframe, [[maybe_unused]] compiler::VRegInfo vregInfo) const 277 { 278 return 0; 279 } 280 281 virtual void WrapClassInitializerException(ClassLinker *classLinker, ManagedThread *thread) const; 282 }; 283 284 class LanguageContext { 285 public: LanguageContext(const LanguageContextBase * context)286 explicit LanguageContext(const LanguageContextBase *context) : base_(context) {} 287 288 DEFAULT_COPY_SEMANTIC(LanguageContext); 289 DEFAULT_MOVE_SEMANTIC(LanguageContext); 290 291 ~LanguageContext() = default; 292 GetLanguage()293 panda_file::SourceLang GetLanguage() const 294 { 295 return base_->GetLanguage(); 296 } 297 GetLanguageType()298 LangTypeT GetLanguageType() const 299 { 300 return base_->GetLanguageType(); 301 } 302 GetInitialTaggedValue()303 coretypes::TaggedValue GetInitialTaggedValue() const 304 { 305 return base_->GetInitialTaggedValue(); 306 } 307 GetEncodedTaggedValue(int64_t value,int64_t tag)308 coretypes::TaggedValue GetEncodedTaggedValue(int64_t value, int64_t tag) const 309 { 310 return base_->GetEncodedTaggedValue(value, tag); 311 } 312 GetCatchMethodAndOffset(Method * method,ManagedThread * thread)313 std::pair<Method *, uint32_t> GetCatchMethodAndOffset(Method *method, ManagedThread *thread) const 314 { 315 return base_->GetCatchMethodAndOffset(method, thread); 316 } 317 CreateVM(Runtime * runtime,const RuntimeOptions & options)318 PandaVM *CreateVM(Runtime *runtime, const RuntimeOptions &options) 319 { 320 return base_->CreateVM(runtime, options); 321 } 322 CreateGC(mem::GCType gcType,mem::ObjectAllocatorBase * objectAllocator,const mem::GCSettings & settings)323 mem::GC *CreateGC(mem::GCType gcType, mem::ObjectAllocatorBase *objectAllocator, 324 const mem::GCSettings &settings) const 325 { 326 return base_->CreateGC(gcType, objectAllocator, settings); 327 } 328 CreateClassLinkerExtension()329 std::unique_ptr<ClassLinkerExtension> CreateClassLinkerExtension() 330 { 331 return base_->CreateClassLinkerExtension(); 332 } 333 CreateInspectorExtension()334 std::unique_ptr<tooling::InspectorExtension> CreateInspectorExtension() 335 { 336 return base_->CreateInspectorExtension(); 337 } 338 CreatePtLangExt()339 PandaUniquePtr<tooling::PtLangExt> CreatePtLangExt() 340 { 341 return base_->CreatePtLangExt(); 342 } 343 ThrowException(ManagedThread * thread,const uint8_t * mutf8Name,const uint8_t * mutf8Msg)344 void ThrowException(ManagedThread *thread, const uint8_t *mutf8Name, const uint8_t *mutf8Msg) const 345 { 346 base_->ThrowException(thread, mutf8Name, mutf8Msg); 347 } 348 SetExceptionToVReg(interpreter::AccVRegister & vreg,ObjectHeader * obj)349 void SetExceptionToVReg( 350 [[maybe_unused]] interpreter::AccVRegister &vreg, // NOLINTNEXTLINE(google-runtime-references) 351 [[maybe_unused]] ObjectHeader *obj) const 352 { 353 base_->SetExceptionToVReg(vreg, obj); 354 } 355 GetStringClassDescriptor()356 const uint8_t *GetStringClassDescriptor() const 357 { 358 return base_->GetStringClassDescriptor(); 359 } 360 GetObjectClassDescriptor()361 const uint8_t *GetObjectClassDescriptor() const 362 { 363 return base_->GetObjectClassDescriptor(); 364 } 365 GetClassClassDescriptor()366 const uint8_t *GetClassClassDescriptor() const 367 { 368 return base_->GetClassClassDescriptor(); 369 } 370 GetClassArrayClassDescriptor()371 const uint8_t *GetClassArrayClassDescriptor() const 372 { 373 return base_->GetClassArrayClassDescriptor(); 374 } 375 GetStringArrayClassDescriptor()376 const uint8_t *GetStringArrayClassDescriptor() const 377 { 378 return base_->GetStringArrayClassDescriptor(); 379 } 380 GetCtorName()381 const uint8_t *GetCtorName() const 382 { 383 return base_->GetCtorName(); 384 } 385 GetCctorName()386 const uint8_t *GetCctorName() const 387 { 388 return base_->GetCctorName(); 389 } 390 GetNullPointerExceptionClassDescriptor()391 const uint8_t *GetNullPointerExceptionClassDescriptor() const 392 { 393 return base_->GetNullPointerExceptionClassDescriptor(); 394 } 395 GetStackOverflowErrorClassDescriptor()396 const uint8_t *GetStackOverflowErrorClassDescriptor() const 397 { 398 return base_->GetStackOverflowErrorClassDescriptor(); 399 } 400 ThrowStackOverflowException(ManagedThread * thread)401 void ThrowStackOverflowException(ManagedThread *thread) const 402 { 403 return base_->ThrowStackOverflowException(thread); 404 } 405 GetArrayIndexOutOfBoundsExceptionClassDescriptor()406 const uint8_t *GetArrayIndexOutOfBoundsExceptionClassDescriptor() const 407 { 408 return base_->GetArrayIndexOutOfBoundsExceptionClassDescriptor(); 409 } 410 GetIndexOutOfBoundsExceptionClassDescriptor()411 const uint8_t *GetIndexOutOfBoundsExceptionClassDescriptor() const 412 { 413 return base_->GetIndexOutOfBoundsExceptionClassDescriptor(); 414 } 415 GetIllegalStateExceptionClassDescriptor()416 const uint8_t *GetIllegalStateExceptionClassDescriptor() const 417 { 418 return base_->GetIllegalStateExceptionClassDescriptor(); 419 } 420 GetNegativeArraySizeExceptionClassDescriptor()421 const uint8_t *GetNegativeArraySizeExceptionClassDescriptor() const 422 { 423 return base_->GetNegativeArraySizeExceptionClassDescriptor(); 424 } 425 GetStringIndexOutOfBoundsExceptionClassDescriptor()426 const uint8_t *GetStringIndexOutOfBoundsExceptionClassDescriptor() const 427 { 428 return base_->GetStringIndexOutOfBoundsExceptionClassDescriptor(); 429 } 430 GetArithmeticExceptionClassDescriptor()431 const uint8_t *GetArithmeticExceptionClassDescriptor() const 432 { 433 return base_->GetArithmeticExceptionClassDescriptor(); 434 } 435 GetClassCastExceptionClassDescriptor()436 const uint8_t *GetClassCastExceptionClassDescriptor() const 437 { 438 return base_->GetClassCastExceptionClassDescriptor(); 439 } 440 GetAbstractMethodErrorClassDescriptor()441 const uint8_t *GetAbstractMethodErrorClassDescriptor() const 442 { 443 return base_->GetAbstractMethodErrorClassDescriptor(); 444 } 445 GetArrayStoreExceptionClassDescriptor()446 const uint8_t *GetArrayStoreExceptionClassDescriptor() const 447 { 448 return base_->GetArrayStoreExceptionClassDescriptor(); 449 } 450 GetRuntimeExceptionClassDescriptor()451 const uint8_t *GetRuntimeExceptionClassDescriptor() const 452 { 453 return base_->GetRuntimeExceptionClassDescriptor(); 454 } 455 GetFileNotFoundExceptionClassDescriptor()456 const uint8_t *GetFileNotFoundExceptionClassDescriptor() const 457 { 458 return base_->GetFileNotFoundExceptionClassDescriptor(); 459 } 460 GetIOExceptionClassDescriptor()461 const uint8_t *GetIOExceptionClassDescriptor() const 462 { 463 return base_->GetIOExceptionClassDescriptor(); 464 } 465 GetIllegalArgumentExceptionClassDescriptor()466 const uint8_t *GetIllegalArgumentExceptionClassDescriptor() const 467 { 468 return base_->GetIllegalArgumentExceptionClassDescriptor(); 469 } 470 GetIllegalAccessExceptionClassDescriptor()471 const uint8_t *GetIllegalAccessExceptionClassDescriptor() const 472 { 473 return base_->GetIllegalAccessExceptionClassDescriptor(); 474 } 475 GetOutOfMemoryErrorClassDescriptor()476 const uint8_t *GetOutOfMemoryErrorClassDescriptor() const 477 { 478 return base_->GetOutOfMemoryErrorClassDescriptor(); 479 } 480 GetNoClassDefFoundErrorDescriptor()481 const uint8_t *GetNoClassDefFoundErrorDescriptor() const 482 { 483 return base_->GetNoClassDefFoundErrorDescriptor(); 484 } 485 GetClassCircularityErrorDescriptor()486 const uint8_t *GetClassCircularityErrorDescriptor() const 487 { 488 return base_->GetClassCircularityErrorDescriptor(); 489 } 490 GetNoSuchFieldErrorDescriptor()491 const uint8_t *GetNoSuchFieldErrorDescriptor() const 492 { 493 return base_->GetNoSuchFieldErrorDescriptor(); 494 } 495 GetNoSuchMethodErrorDescriptor()496 const uint8_t *GetNoSuchMethodErrorDescriptor() const 497 { 498 return base_->GetNoSuchMethodErrorDescriptor(); 499 } 500 GetExceptionInInitializerErrorDescriptor()501 const uint8_t *GetExceptionInInitializerErrorDescriptor() const 502 { 503 return base_->GetExceptionInInitializerErrorDescriptor(); 504 } 505 GetClassNotFoundExceptionDescriptor()506 const uint8_t *GetClassNotFoundExceptionDescriptor() const 507 { 508 return base_->GetClassNotFoundExceptionDescriptor(); 509 } 510 GetInstantiationErrorDescriptor()511 const uint8_t *GetInstantiationErrorDescriptor() const 512 { 513 return base_->GetInstantiationErrorDescriptor(); 514 } 515 GetUnsupportedOperationExceptionClassDescriptor()516 const uint8_t *GetUnsupportedOperationExceptionClassDescriptor() const 517 { 518 return base_->GetUnsupportedOperationExceptionClassDescriptor(); 519 } 520 GetVerifyErrorClassDescriptor()521 const uint8_t *GetVerifyErrorClassDescriptor() const 522 { 523 return base_->GetVerifyErrorClassDescriptor(); 524 } 525 GetIllegalMonitorStateExceptionDescriptor()526 const uint8_t *GetIllegalMonitorStateExceptionDescriptor() const 527 { 528 return base_->GetIllegalMonitorStateExceptionDescriptor(); 529 } 530 GetCloneNotSupportedExceptionDescriptor()531 const uint8_t *GetCloneNotSupportedExceptionDescriptor() const 532 { 533 return base_->GetCloneNotSupportedExceptionDescriptor(); 534 } 535 GetErrorClassDescriptor()536 const uint8_t *GetErrorClassDescriptor() const 537 { 538 return base_->GetErrorClassDescriptor(); 539 } 540 GetIncompatibleClassChangeErrorDescriptor()541 const uint8_t *GetIncompatibleClassChangeErrorDescriptor() const 542 { 543 return base_->GetIncompatibleClassChangeErrorDescriptor(); 544 } 545 546 friend std::ostream &operator<<(std::ostream &stream, const LanguageContext &ctx) 547 { 548 return stream << ark::panda_file::LanguageToString(ctx.base_->GetLanguage()); 549 } 550 IsCallableObject(ObjectHeader * obj)551 bool IsCallableObject([[maybe_unused]] ObjectHeader *obj) 552 { 553 return base_->IsCallableObject(obj); 554 } 555 GetCallTarget(ObjectHeader * obj)556 Method *GetCallTarget(ObjectHeader *obj) const 557 { 558 return base_->GetCallTarget(obj); 559 } 560 GetReferenceErrorDescriptor()561 const uint8_t *GetReferenceErrorDescriptor() const 562 { 563 return base_->GetReferenceErrorDescriptor(); 564 } 565 GetTypedErrorDescriptor()566 const uint8_t *GetTypedErrorDescriptor() const 567 { 568 return base_->GetTypedErrorDescriptor(); 569 } 570 GetFrameExtSize()571 uint32_t GetFrameExtSize() const 572 { 573 return base_->GetFrameExtSize(); 574 } 575 CreateIMTableBuilder()576 PandaUniquePtr<IMTableBuilder> CreateIMTableBuilder() 577 { 578 return base_->CreateIMTableBuilder(); 579 } 580 CreateITableBuilder(ClassLinkerErrorHandler * errHandler)581 PandaUniquePtr<ITableBuilder> CreateITableBuilder(ClassLinkerErrorHandler *errHandler) 582 { 583 return base_->CreateITableBuilder(errHandler); 584 } 585 CreateVTableBuilder(ClassLinkerErrorHandler * errHandler)586 PandaUniquePtr<VTableBuilder> CreateVTableBuilder(ClassLinkerErrorHandler *errHandler) 587 { 588 return base_->CreateVTableBuilder(errHandler); 589 } 590 InitializeClass(ClassLinker * classLinker,ManagedThread * thread,Class * klass)591 bool InitializeClass(ClassLinker *classLinker, ManagedThread *thread, Class *klass) const 592 { 593 return base_->InitializeClass(classLinker, thread, klass); 594 } 595 CreateTrace(PandaUniquePtr<ark::os::file::File> traceFile,size_t bufferSize)596 Trace *CreateTrace(PandaUniquePtr<ark::os::file::File> traceFile, size_t bufferSize) const 597 { 598 return base_->CreateTrace(std::move(traceFile), bufferSize); 599 } 600 GetStringSize(const ObjectHeader * stringObject)601 size_t GetStringSize(const ObjectHeader *stringObject) const 602 { 603 return base_->GetStringSize(stringObject); 604 } 605 GetVerificationInitAPI()606 VerificationInitAPI GetVerificationInitAPI() const 607 { 608 return base_->GetVerificationInitAPI(); 609 } 610 GetVerificationTypeClass()611 const char *GetVerificationTypeClass() const 612 { 613 return base_->GetVerificationTypeClass(); 614 } 615 GetVerificationTypeObject()616 const char *GetVerificationTypeObject() const 617 { 618 return base_->GetVerificationTypeObject(); 619 } 620 GetVerificationTypeThrowable()621 const char *GetVerificationTypeThrowable() const 622 { 623 return base_->GetVerificationTypeThrowable(); 624 } 625 GetBootPandaFilesOpenMode()626 ark::panda_file::File::OpenMode GetBootPandaFilesOpenMode() const 627 { 628 return base_->GetBootPandaFilesOpenMode(); 629 } 630 RestoreEnv(Frame * currentIframe,const StackWalker::EnvData & envData)631 virtual void RestoreEnv(Frame *currentIframe, const StackWalker::EnvData &envData) const 632 { 633 return base_->RestoreEnv(currentIframe, envData); 634 } 635 IsEnabledCHA()636 virtual bool IsEnabledCHA() const 637 { 638 return base_->IsEnabledCHA(); 639 } 640 InitializeOsrCframeSlots(Span<uintptr_t> paramSlots)641 void InitializeOsrCframeSlots(Span<uintptr_t> paramSlots) const 642 { 643 base_->InitializeOsrCframeSlots(paramSlots); 644 } 645 GetOsrEnv(const Frame * iframe,compiler::VRegInfo vregInfo)646 uint64_t GetOsrEnv(const Frame *iframe, compiler::VRegInfo vregInfo) const 647 { 648 return base_->GetOsrEnv(iframe, vregInfo); 649 } 650 WrapClassInitializerException(ClassLinker * classLinker,ManagedThread * thread)651 void WrapClassInitializerException(ClassLinker *classLinker, ManagedThread *thread) const 652 { 653 base_->WrapClassInitializerException(classLinker, thread); 654 } 655 656 private: 657 const LanguageContextBase *base_; 658 }; 659 660 } // namespace ark 661 662 #endif // PANDA_RUNTIME_LANGUAGE_CONTEXT_H_ 663