diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-04-14 10:34:17 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-04-14 10:34:27 -0700 |
commit | 41ef1717e096a9e1761efa0df97c395f59c51f16 (patch) | |
tree | 7e854284ef8ce5189a63074857a408b6eea5a9cb /deps/v8/src/profile-generator-inl.h | |
parent | 760bba55186eba039ca00e532f7813d2aea450a2 (diff) | |
download | node-41ef1717e096a9e1761efa0df97c395f59c51f16.tar.gz |
Upgrade V8 to 2.2.3.1
Diffstat (limited to 'deps/v8/src/profile-generator-inl.h')
-rw-r--r-- | deps/v8/src/profile-generator-inl.h | 54 |
1 files changed, 48 insertions, 6 deletions
diff --git a/deps/v8/src/profile-generator-inl.h b/deps/v8/src/profile-generator-inl.h index 5e92be470..b4fdfb7d7 100644 --- a/deps/v8/src/profile-generator-inl.h +++ b/deps/v8/src/profile-generator-inl.h @@ -28,27 +28,34 @@ #ifndef V8_PROFILE_GENERATOR_INL_H_ #define V8_PROFILE_GENERATOR_INL_H_ +#ifdef ENABLE_CPP_PROFILES_PROCESSOR + #include "profile-generator.h" namespace v8 { namespace internal { - CodeEntry::CodeEntry(Logger::LogEventsAndTags tag, + const char* name_prefix, const char* name, const char* resource_name, int line_number) - : tag_(tag), + : call_uid_(next_call_uid_++), + tag_(tag), + name_prefix_(name_prefix), name_(name), resource_name_(resource_name), line_number_(line_number) { } -bool CodeEntry::is_js_function() { - return tag_ == Logger::FUNCTION_TAG - || tag_ == Logger::LAZY_COMPILE_TAG - || tag_ == Logger::SCRIPT_TAG; +bool CodeEntry::is_js_function_tag(Logger::LogEventsAndTags tag) { + return tag == Logger::FUNCTION_TAG + || tag == Logger::LAZY_COMPILE_TAG + || tag == Logger::SCRIPT_TAG + || tag == Logger::NATIVE_FUNCTION_TAG + || tag == Logger::NATIVE_LAZY_COMPILE_TAG + || tag == Logger::NATIVE_SCRIPT_TAG; } @@ -76,6 +83,41 @@ void CodeMap::DeleteCode(Address addr) { } +bool CpuProfilesCollection::is_last_profile() { + // Called from VM thread, and only it can mutate the list, + // so no locking is needed here. + return current_profiles_.length() == 1; +} + + +const char* CpuProfilesCollection::GetFunctionName(String* name) { + return GetFunctionName(GetName(name)); +} + + +const char* CpuProfilesCollection::GetFunctionName(const char* name) { + return strlen(name) > 0 ? name : ProfileGenerator::kAnonymousFunctionName; +} + + +CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) { + switch (tag) { + case GC: + return gc_entry_; + case JS: + case COMPILER: + // DOM events handlers are reported as OTHER / EXTERNAL entries. + // To avoid confusing people, let's put all these entries into + // one bucket. + case OTHER: + case EXTERNAL: + return program_entry_; + default: return NULL; + } +} + } } // namespace v8::internal +#endif // ENABLE_CPP_PROFILES_PROCESSOR + #endif // V8_PROFILE_GENERATOR_INL_H_ |