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