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

Unified Diff: src/objects-inl.h

Issue 1993653003: Initial support for emitting unwinding information in perf jitdump. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Enable with --perf-prof-unwinding-info. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | src/perf-jit.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 931a7ef9315fdce114e86de05059d16ed920a3cb..784fc8d205bb93e3579a1fda1f52a0685cffc2f4 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4887,6 +4887,16 @@ inline bool Code::is_interpreter_trampoline_builtin() {
this == *builtins->InterpreterMarkBaselineOnReturn();
}
+inline bool Code::has_unwinding_info() const {
+ return HasUnwindingInfoField::decode(READ_UINT32_FIELD(this, kFlagsOffset));
+}
+
+inline void Code::set_has_unwinding_info(bool state) {
+ uint32_t previous = READ_UINT32_FIELD(this, kFlagsOffset);
+ uint32_t updated_value = HasUnwindingInfoField::update(previous, state);
+ WRITE_UINT32_FIELD(this, kFlagsOffset, updated_value);
+}
+
inline void Code::set_is_crankshafted(bool value) {
int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
int updated = IsCrankshaftedField::update(previous, value);
@@ -6409,7 +6419,6 @@ ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset)
ACCESSORS(Code, raw_type_feedback_info, Object, kTypeFeedbackInfoOffset)
ACCESSORS(Code, next_code_link, Object, kNextCodeLinkOffset)
-
void Code::WipeOutHeader() {
WRITE_FIELD(this, kRelocationInfoOffset, NULL);
WRITE_FIELD(this, kHandlerTableOffset, NULL);
@@ -6463,9 +6472,38 @@ byte* Code::instruction_end() {
return instruction_start() + instruction_size();
}
+int Code::GetUnwindingInfoSizeOffset() const {
+ DCHECK(has_unwinding_info());
+ return RoundUp(kHeaderSize + instruction_size(), kInt64Size);
+}
+
+int Code::unwinding_info_size() const {
+ DCHECK(has_unwinding_info());
+ return static_cast<int>(
+ READ_UINT64_FIELD(this, GetUnwindingInfoSizeOffset()));
+}
+
+void Code::set_unwinding_info_size(int value) {
+ DCHECK(has_unwinding_info());
+ WRITE_UINT64_FIELD(this, GetUnwindingInfoSizeOffset(), value);
+}
+
+byte* Code::unwinding_info_start() {
+ DCHECK(has_unwinding_info());
+ return FIELD_ADDR(this, GetUnwindingInfoSizeOffset()) + kInt64Size;
+}
+
+byte* Code::unwinding_info_end() {
+ DCHECK(has_unwinding_info());
+ return unwinding_info_start() + unwinding_info_size();
+}
int Code::body_size() {
- return RoundUp(instruction_size(), kObjectAlignment);
+ int unpadded_body_size =
+ has_unwinding_info()
+ ? static_cast<int>(unwinding_info_end() - instruction_start())
+ : instruction_size();
+ return RoundUp(unpadded_body_size, kObjectAlignment);
}
int Code::SizeIncludingMetadata() {
« no previous file with comments | « src/objects.cc ('k') | src/perf-jit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698