• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef ART_RUNTIME_MIRROR_STACK_FRAME_INFO_H_
18 #define ART_RUNTIME_MIRROR_STACK_FRAME_INFO_H_
19 
20 #include "method_type.h"
21 #include "object.h"
22 #include "stack_trace_element.h"
23 
24 namespace art {
25 
26 template<class T> class Handle;
27 struct StackFrameInfoOffsets;
28 
29 namespace mirror {
30 
31 // C++ mirror of java.lang.StackFrameInfo
32 class MANAGED StackFrameInfo final : public Object {
33  public:
34   MIRROR_CLASS("Ljava/lang/StackFrameInfo;");
35 
36   void AssignFields(Handle<Class> declaring_class,
37                     Handle<MethodType> method_type,
38                     Handle<String> method_name,
39                     Handle<String> file_name,
40                     int32_t line_number,
41                     int32_t dex_pc)
42       REQUIRES_SHARED(Locks::mutator_lock_);
43 
44  private:
45   // Field order required by test "ValidateFieldOrderOfJavaCppUnionClasses".
46   HeapReference<Class> declaring_class_;
47   HeapReference<String> file_name_;
48   HeapReference<String> method_name_;
49   HeapReference<Class> method_type_;
50   HeapReference<StackTraceElement> ste_;
51   int32_t bci_;
52   int32_t line_number_;
53   bool retain_class_ref_;
54 
55   template<bool kTransactionActive>
56   void SetFields(ObjPtr<Class> declaring_class,
57                  ObjPtr<MethodType> method_type,
58                  ObjPtr<String> method_name,
59                  ObjPtr<String> file_name,
60                  int32_t line_number,
61                  int32_t bci)
62       REQUIRES_SHARED(Locks::mutator_lock_);
63 
64   friend struct art::StackFrameInfoOffsets;  // for verifying offset information
65   DISALLOW_IMPLICIT_CONSTRUCTORS(StackFrameInfo);
66 };
67 
68 }  // namespace mirror
69 }  // namespace art
70 
71 #endif  // ART_RUNTIME_MIRROR_STACK_FRAME_INFO_H_
72