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

Unified Diff: src/objects-inl.h

Issue 441643008: Track number of generic ICs per function (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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-debug.cc ('k') | src/objects-printer.cc » ('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 301f177ef018a5ce82155c042690ceb1a642adbd..b88dac937a52aa0b69398dd0647f3b25a27a85c7 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -7061,6 +7061,7 @@ int TypeFeedbackInfo::ic_with_type_info_count() {
void TypeFeedbackInfo::change_ic_with_type_info_count(int delta) {
+ if (delta == 0) return;
int value = Smi::cast(READ_FIELD(this, kStorage2Offset))->value();
int new_count = ICsWithTypeInfoCountField::decode(value) + delta;
// We can get negative count here when the type-feedback info is
@@ -7076,9 +7077,25 @@ void TypeFeedbackInfo::change_ic_with_type_info_count(int delta) {
}
+int TypeFeedbackInfo::ic_generic_count() {
+ return Smi::cast(READ_FIELD(this, kStorage3Offset))->value();
+}
+
+
+void TypeFeedbackInfo::change_ic_generic_count(int delta) {
+ if (delta == 0) return;
+ int new_count = ic_generic_count() + delta;
+ if (new_count >= 0) {
+ new_count &= ~Smi::kMinValue;
+ WRITE_FIELD(this, kStorage3Offset, Smi::FromInt(new_count));
+ }
+}
+
+
void TypeFeedbackInfo::initialize_storage() {
WRITE_FIELD(this, kStorage1Offset, Smi::FromInt(0));
WRITE_FIELD(this, kStorage2Offset, Smi::FromInt(0));
+ WRITE_FIELD(this, kStorage3Offset, Smi::FromInt(0));
}
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698