diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-10-21 15:22:38 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-10-21 15:22:38 -0700 |
commit | 3b861db31d1ecc92149cf6b2497b6539276e0f70 (patch) | |
tree | 67c84f64183536213383373804520f84b931d865 /deps/v8/src/cpu-profiler.cc | |
parent | 2629296c257b6d74e86e9f9139b04ba5e27b68d8 (diff) | |
download | node-3b861db31d1ecc92149cf6b2497b6539276e0f70.tar.gz |
Upgrade V8 to 2.5.1
Diffstat (limited to 'deps/v8/src/cpu-profiler.cc')
-rw-r--r-- | deps/v8/src/cpu-profiler.cc | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/deps/v8/src/cpu-profiler.cc b/deps/v8/src/cpu-profiler.cc index acf3349be..da19a4501 100644 --- a/deps/v8/src/cpu-profiler.cc +++ b/deps/v8/src/cpu-profiler.cc @@ -188,6 +188,20 @@ bool ProfilerEventsProcessor::IsKnownFunction(Address start) { } +void ProfilerEventsProcessor::ProcessMovedFunctions() { + 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::ProcessMovedFunctions() { + singleton_->processor_->ProcessMovedFunctions(); +} + + +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); } |