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

Unified Diff: src/objects-inl.h

Issue 1997363002: Adds support for collecting statistics about code and its metadata. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments from Hannes. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | no next file » | 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 3cbf5915a7569bf8b56eacd607981d13ff047ea3..4ec6164dd5baa5344020f3715a93fe3fe1bfcd4a 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4020,6 +4020,13 @@ Address BytecodeArray::GetFirstBytecodeAddress() {
int BytecodeArray::BytecodeArraySize() { return SizeFor(this->length()); }
+int BytecodeArray::SizeIncludingMetadata() {
+ int size = BytecodeArraySize();
+ size += constant_pool()->Size();
+ size += handler_table()->Size();
+ size += source_position_table()->Size();
+ return size;
+}
ACCESSORS(FixedTypedArrayBase, base_pointer, Object, kBasePointerOffset)
@@ -5198,6 +5205,13 @@ int AbstractCode::instruction_size() {
}
}
+int AbstractCode::SizeIncludingMetadata() {
+ if (IsCode()) {
+ return GetCode()->SizeIncludingMetadata();
+ } else {
+ return GetBytecodeArray()->SizeIncludingMetadata();
+ }
+}
int AbstractCode::ExecutableSize() {
if (IsCode()) {
return GetCode()->ExecutableSize();
@@ -6427,6 +6441,13 @@ int Code::body_size() {
return RoundUp(instruction_size(), kObjectAlignment);
}
+int Code::SizeIncludingMetadata() {
+ int size = CodeSize();
+ size += relocation_info()->Size();
+ size += deoptimization_data()->Size();
+ size += handler_table()->Size();
+ return size;
+}
ByteArray* Code::unchecked_relocation_info() {
return reinterpret_cast<ByteArray*>(READ_FIELD(this, kRelocationInfoOffset));
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698