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

Unified Diff: src/ic.cc

Issue 9403009: Count ICs that have type information. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix confusing --trace-opt output Created 8 years, 10 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/ic.h ('k') | src/ic-inl.h » ('j') | src/objects-inl.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index f774b928ce7c7656b19bdc7d69abb103ae218967..642a9e27318405bc6020bd5f61af4dca9aefa24e 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -296,7 +296,32 @@ Failure* IC::ReferenceError(const char* type, Handle<String> name) {
}
-void IC::PostPatching() {
+void IC::PostPatching(Address address, Code* target, Code* old_target) {
+ if (FLAG_type_info_threshold > 0) {
+ if (old_target->is_inline_cache_stub() &&
+ target->is_inline_cache_stub()) {
+ State old_state = old_target->ic_state();
+ State new_state = target->ic_state();
+ bool was_uninitialized =
+ old_state == UNINITIALIZED || old_state == PREMONOMORPHIC;
+ bool is_uninitialized =
+ new_state == UNINITIALIZED || new_state == PREMONOMORPHIC;
+ int delta = 0;
+ if (was_uninitialized && !is_uninitialized) {
+ delta = 1;
+ } else if (!was_uninitialized && is_uninitialized) {
+ delta = -1;
+ }
+ if (delta != 0) {
+ Code* host = target->GetHeap()->isolate()->
+ inner_pointer_to_code_cache()->GetCacheEntry(address)->code;
+ TypeFeedbackInfo* info =
+ TypeFeedbackInfo::cast(host->type_feedback_info());
+ info->set_ic_with_typeinfo_count(
+ info->ic_with_typeinfo_count() + delta);
+ }
+ }
+ }
if (FLAG_watch_ic_patching) {
Isolate::Current()->runtime_profiler()->NotifyICChanged();
// We do not want to optimize until the ICs have settled down,
@@ -313,7 +338,9 @@ void IC::PostPatching() {
if (raw_frame->is_java_script()) {
JSFunction* function =
JSFunction::cast(JavaScriptFrame::cast(raw_frame)->function());
- function->shared()->set_profiler_ticks(0);
+ if (function->IsOptimized()) continue;
+ SharedFunctionInfo* shared = function->shared();
+ shared->set_profiler_ticks(0);
}
it.Advance();
}
« no previous file with comments | « src/ic.h ('k') | src/ic-inl.h » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698