Index: src/ic-inl.h |
diff --git a/src/ic-inl.h b/src/ic-inl.h |
index 56cea817600c29748fc0e9cd9e0037d3b70cd20d..5bb4f87d52f381cff67640894d10ea549a16091f 100644 |
--- a/src/ic-inl.h |
+++ b/src/ic-inl.h |
@@ -1,4 +1,4 @@ |
-// Copyright 2011 the V8 project authors. All rights reserved. |
+// Copyright 2012 the V8 project authors. All rights reserved. |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
// met: |
@@ -29,6 +29,8 @@ |
#define V8_IC_INL_H_ |
#include "ic.h" |
+ |
+#include "compiler.h" |
#include "debug.h" |
#include "macro-assembler.h" |
@@ -89,6 +91,27 @@ void IC::SetTargetAtAddress(Address address, Code* target) { |
Assembler::set_target_address_at(address, target->instruction_start()); |
target->GetHeap()->incremental_marking()->RecordCodeTargetPatch(address, |
target); |
Erik Corry
2012/02/09 09:43:33
Confusing that this is under the counting_profiler
Jakob Kummerow
2012/02/09 10:13:20
As discussed, I'll split the flag in a separate CL
|
+ if (FLAG_counting_profiler) { |
Erik Corry
2012/02/09 09:43:33
This function is getting too beefy for an inline f
Jakob Kummerow
2012/02/09 10:13:20
Done.
|
+ 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(); |
+ } |
+ } |
} |