Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: runtime/vm/raw_object.h

Issue 1150633002: Track prologue offset of Code and use for more precise return addresses (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« runtime/vm/profiler.cc ('K') | « runtime/vm/profiler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/atomic.h" 9 #include "vm/atomic.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 RawArray* hide_names_; // blacklist of names that are not exported. 937 RawArray* hide_names_; // blacklist of names that are not exported.
938 RawField* metadata_field_; // remembers the token pos of metadata if any, 938 RawField* metadata_field_; // remembers the token pos of metadata if any,
939 // and the metadata values if computed. 939 // and the metadata values if computed.
940 RawObject** to() { 940 RawObject** to() {
941 return reinterpret_cast<RawObject**>(&ptr()->metadata_field_); 941 return reinterpret_cast<RawObject**>(&ptr()->metadata_field_);
942 } 942 }
943 }; 943 };
944 944
945 945
946 class RawCode : public RawObject { 946 class RawCode : public RawObject {
947 enum InlinedMetadataIndex {
948 kInlinedIntervalsIndex = 0,
949 kInlinedIdToFunctionIndex = 1,
950 kInlinedMetadataSize = 2,
951 };
952
947 RAW_HEAP_OBJECT_IMPLEMENTATION(Code); 953 RAW_HEAP_OBJECT_IMPLEMENTATION(Code);
948 954
949 RawObject** from() { 955 RawObject** from() {
950 return reinterpret_cast<RawObject**>(&ptr()->instructions_); 956 return reinterpret_cast<RawObject**>(&ptr()->instructions_);
951 } 957 }
952 RawInstructions* instructions_; 958 RawInstructions* instructions_;
953 // If owner_ is Function::null() the owner is a regular stub. 959 // If owner_ is Function::null() the owner is a regular stub.
954 // If owner_ is a Class the owner is the allocation stub for that class. 960 // If owner_ is a Class the owner is the allocation stub for that class.
955 // Else, owner_ is a regular Dart Function. 961 // Else, owner_ is a regular Dart Function.
956 RawObject* owner_; // Function, Null, or a Class. 962 RawObject* owner_; // Function, Null, or a Class.
957 RawExceptionHandlers* exception_handlers_; 963 RawExceptionHandlers* exception_handlers_;
958 RawPcDescriptors* pc_descriptors_; 964 RawPcDescriptors* pc_descriptors_;
959 RawArray* deopt_info_array_; 965 RawArray* deopt_info_array_;
960 RawArray* static_calls_target_table_; // (code-offset, function, code). 966 RawArray* static_calls_target_table_; // (code-offset, function, code).
961 RawArray* stackmaps_; 967 RawArray* stackmaps_;
962 RawLocalVarDescriptors* var_descriptors_; 968 RawLocalVarDescriptors* var_descriptors_;
963 RawArray* inlined_intervals_; 969 RawArray* inlined_metadata_;
964 RawArray* inlined_id_to_function_;
965 RawArray* comments_; 970 RawArray* comments_;
971 // If return_address_info_ is a Smi, it is the offset to the prologue.
972 // Else, return_address_info_ is null.
973 RawObject* return_address_metadata_;
966 RawObject** to() { 974 RawObject** to() {
967 return reinterpret_cast<RawObject**>(&ptr()->comments_); 975 return reinterpret_cast<RawObject**>(&ptr()->comments_);
968 } 976 }
969 977
970 // Compilation timestamp. 978 // Compilation timestamp.
971 int64_t compile_timestamp_; 979 int64_t compile_timestamp_;
972 980
973 // state_bits_ is a bitfield with three fields: 981 // state_bits_ is a bitfield with three fields:
974 // The optimized bit, the alive bit, and a count of the number of pointer 982 // The optimized bit, the alive bit, and a count of the number of pointer
975 // offsets. 983 // offsets.
976 // Alive: If true, the embedded object pointers will be visited during GC. 984 // Alive: If true, the embedded object pointers will be visited during GC.
977 int32_t state_bits_; 985 int32_t state_bits_;
978 986
979 // PC offsets for code patching. 987 // PC offsets for code patching.
980 int32_t entry_patch_pc_offset_; 988 int32_t entry_patch_pc_offset_;
981 int32_t patch_code_pc_offset_; 989 int32_t patch_code_pc_offset_;
982 int32_t lazy_deopt_pc_offset_; 990 int32_t lazy_deopt_pc_offset_;
983 991
984 // Variable length data follows here. 992 // Variable length data follows here.
985 int32_t* data() { OPEN_ARRAY_START(int32_t, int32_t); } 993 int32_t* data() { OPEN_ARRAY_START(int32_t, int32_t); }
986 const int32_t* data() const { OPEN_ARRAY_START(int32_t, int32_t); } 994 const int32_t* data() const { OPEN_ARRAY_START(int32_t, int32_t); }
987 995
996 friend class Code;
997 friend class Function;
998 friend class MarkingVisitor;
988 friend class StackFrame; 999 friend class StackFrame;
989 friend class MarkingVisitor;
990 friend class Function;
991 }; 1000 };
992 1001
993 1002
994 class RawInstructions : public RawObject { 1003 class RawInstructions : public RawObject {
995 RAW_HEAP_OBJECT_IMPLEMENTATION(Instructions); 1004 RAW_HEAP_OBJECT_IMPLEMENTATION(Instructions);
996 1005
997 RawObject** from() { 1006 RawObject** from() {
998 return reinterpret_cast<RawObject**>(&ptr()->code_); 1007 return reinterpret_cast<RawObject**>(&ptr()->code_);
999 } 1008 }
1000 RawCode* code_; 1009 RawCode* code_;
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2123 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2132 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2124 kTypedDataInt8ArrayViewCid + 15); 2133 kTypedDataInt8ArrayViewCid + 15);
2125 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2134 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2126 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2135 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2127 return (kNullCid - kTypedDataInt8ArrayCid); 2136 return (kNullCid - kTypedDataInt8ArrayCid);
2128 } 2137 }
2129 2138
2130 } // namespace dart 2139 } // namespace dart
2131 2140
2132 #endif // VM_RAW_OBJECT_H_ 2141 #endif // VM_RAW_OBJECT_H_
OLDNEW
« runtime/vm/profiler.cc ('K') | « runtime/vm/profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698