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

Unified Diff: src/cpu-profiler.cc

Issue 3763012: CPU Profiler: postpone moved functions registration until GC completes. (Closed)
Patch Set: Created 10 years, 2 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/cpu-profiler.h ('k') | src/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cpu-profiler.cc
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc
index acf3349be4fe8bfe901d7a1f77376fbf1caf84b7..e53aa4c8eb9f1a6558dfa63f5fff7b2ffdac7e2a 100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -188,6 +188,20 @@ bool ProfilerEventsProcessor::IsKnownFunction(Address start) {
}
+void ProfilerEventsProcessor::RegisterMovedFunctions() {
+ for (int i = 0; i < moved_functions_.length(); ++i) {
+ JSFunction* function = moved_functions_[i];
+ CpuProfiler::FunctionCreateEvent(function);
+ }
+ moved_functions_.Clear();
+}
+
+
+void ProfilerEventsProcessor::RememberMovedFunction(JSFunction* function) {
+ moved_functions_.Add(function);
+}
+
+
void ProfilerEventsProcessor::RegExpCodeCreateEvent(
Logger::LogEventsAndTags tag,
const char* prefix,
@@ -426,8 +440,12 @@ void CpuProfiler::FunctionCreateEvent(JSFunction* function) {
}
-void CpuProfiler::FunctionCreateEventFromMove(JSFunction* function,
- HeapObject* source) {
+void CpuProfiler::RegisterMovedFunctions() {
Søren Thygesen Gjesse 2010/10/20 07:08:22 Register -> Process?
mnaganov (inactive) 2010/10/20 08:29:05 Done.
+ singleton_->processor_->RegisterMovedFunctions();
+}
+
+
+void CpuProfiler::FunctionCreateEventFromMove(JSFunction* function) {
// This function is called from GC iterators (during Scavenge,
// MC, and MS), so marking bits can be set on objects. That's
// why unchecked accessors are used here.
@@ -436,27 +454,7 @@ void CpuProfiler::FunctionCreateEventFromMove(JSFunction* function,
if (function->unchecked_code() == Builtins::builtin(Builtins::LazyCompile)
|| singleton_->processor_->IsKnownFunction(function->address())) return;
- int security_token_id = TokenEnumerator::kNoSecurityToken;
- // In debug mode, assertions may fail for contexts,
- // and we can live without security tokens in debug mode.
-#ifndef DEBUG
- if (function->unchecked_context()->IsContext()) {
- security_token_id = singleton_->token_enumerator_->GetTokenId(
- function->context()->global_context()->security_token());
- }
- // Security token may not be moved yet.
- if (security_token_id == TokenEnumerator::kNoSecurityToken) {
- JSFunction* old_function = reinterpret_cast<JSFunction*>(source);
- if (old_function->unchecked_context()->IsContext()) {
- security_token_id = singleton_->token_enumerator_->GetTokenId(
- old_function->context()->global_context()->security_token());
- }
- }
-#endif
- singleton_->processor_->FunctionCreateEvent(
- function->address(),
- function->unchecked_code()->address(),
- security_token_id);
+ singleton_->processor_->RememberMovedFunction(function);
}
« no previous file with comments | « src/cpu-profiler.h ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698