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

Unified Diff: src/ic.cc

Issue 9361026: Count-based profiling for primitive functions (hidden behind a flag) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: more comments 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') | no next file with comments »
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 b084109a713aa572bb79acdfb7f1155d8a9ba9f8..9122294bee2f3cca32d3eea2e2b363e1f2c988ae 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -292,6 +292,31 @@ Failure* IC::ReferenceError(const char* type, Handle<String> name) {
}
+void IC::PostPatching() {
+ if (FLAG_counting_profiler) {
+ Isolate::Current()->runtime_profiler()->NotifyICChanged();
+ // We do not want to optimize until the ICs have settled down,
+ // so when they are patched, we postpone optimization for the
+ // current function and the functions above it on the stack that
+ // might want to inline this one.
+ StackFrameIterator it;
+ if (it.done()) return;
+ it.Advance();
+ static const int kStackFramesToMark = Compiler::kMaxInliningLevels - 1;
+ for (int i = 0; i < kStackFramesToMark; ++i) {
+ if (it.done()) return;
+ StackFrame* raw_frame = it.frame();
+ if (raw_frame->is_java_script()) {
+ JSFunction* function =
+ JSFunction::cast(JavaScriptFrame::cast(raw_frame)->function());
+ function->shared()->set_profiler_ticks(0);
+ }
+ it.Advance();
+ }
+ }
+}
+
+
void IC::Clear(Address address) {
Code* target = GetTargetAtAddress(address);
« no previous file with comments | « src/ic.h ('k') | src/ic-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698