| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1608 break; | 1608 break; |
| 1609 case Code::CALL_IC: | 1609 case Code::CALL_IC: |
| 1610 description = "A call IC from the snapshot"; | 1610 description = "A call IC from the snapshot"; |
| 1611 tag = Logger::CALL_IC_TAG; | 1611 tag = Logger::CALL_IC_TAG; |
| 1612 break; | 1612 break; |
| 1613 case Code::KEYED_CALL_IC: | 1613 case Code::KEYED_CALL_IC: |
| 1614 description = "A keyed call IC from the snapshot"; | 1614 description = "A keyed call IC from the snapshot"; |
| 1615 tag = Logger::KEYED_CALL_IC_TAG; | 1615 tag = Logger::KEYED_CALL_IC_TAG; |
| 1616 break; | 1616 break; |
| 1617 } | 1617 } |
| 1618 PROFILE(ISOLATE, CodeCreateEvent(tag, code_object, description)); | 1618 PROFILE(isolate_, CodeCreateEvent(tag, code_object, description)); |
| 1619 } | 1619 } |
| 1620 } | 1620 } |
| 1621 | 1621 |
| 1622 | 1622 |
| 1623 void Logger::LogCodeInfo() { | 1623 void Logger::LogCodeInfo() { |
| 1624 if (!log_->IsEnabled() || !FLAG_ll_prof) return; | 1624 if (!log_->IsEnabled() || !FLAG_ll_prof) return; |
| 1625 #if V8_TARGET_ARCH_IA32 | 1625 #if V8_TARGET_ARCH_IA32 |
| 1626 const char arch[] = "ia32"; | 1626 const char arch[] = "ia32"; |
| 1627 #elif V8_TARGET_ARCH_X64 | 1627 #elif V8_TARGET_ARCH_X64 |
| 1628 const char arch[] = "x64"; | 1628 const char arch[] = "x64"; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1712 | 1712 |
| 1713 void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared, | 1713 void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared, |
| 1714 Handle<Code> code) { | 1714 Handle<Code> code) { |
| 1715 Handle<String> func_name(shared->DebugName()); | 1715 Handle<String> func_name(shared->DebugName()); |
| 1716 if (shared->script()->IsScript()) { | 1716 if (shared->script()->IsScript()) { |
| 1717 Handle<Script> script(Script::cast(shared->script())); | 1717 Handle<Script> script(Script::cast(shared->script())); |
| 1718 if (script->name()->IsString()) { | 1718 if (script->name()->IsString()) { |
| 1719 Handle<String> script_name(String::cast(script->name())); | 1719 Handle<String> script_name(String::cast(script->name())); |
| 1720 int line_num = GetScriptLineNumber(script, shared->start_position()); | 1720 int line_num = GetScriptLineNumber(script, shared->start_position()); |
| 1721 if (line_num > 0) { | 1721 if (line_num > 0) { |
| 1722 PROFILE(ISOLATE, | 1722 PROFILE(isolate_, |
| 1723 CodeCreateEvent( | 1723 CodeCreateEvent( |
| 1724 Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script), | 1724 Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script), |
| 1725 *code, *shared, | 1725 *code, *shared, |
| 1726 *script_name, line_num + 1)); | 1726 *script_name, line_num + 1)); |
| 1727 } else { | 1727 } else { |
| 1728 // Can't distinguish eval and script here, so always use Script. | 1728 // Can't distinguish eval and script here, so always use Script. |
| 1729 PROFILE(ISOLATE, | 1729 PROFILE(isolate_, |
| 1730 CodeCreateEvent( | 1730 CodeCreateEvent( |
| 1731 Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script), | 1731 Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script), |
| 1732 *code, *shared, *script_name)); | 1732 *code, *shared, *script_name)); |
| 1733 } | 1733 } |
| 1734 } else { | 1734 } else { |
| 1735 PROFILE(ISOLATE, | 1735 PROFILE(isolate_, |
| 1736 CodeCreateEvent( | 1736 CodeCreateEvent( |
| 1737 Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script), | 1737 Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script), |
| 1738 *code, *shared, *func_name)); | 1738 *code, *shared, *func_name)); |
| 1739 } | 1739 } |
| 1740 } else if (shared->IsApiFunction()) { | 1740 } else if (shared->IsApiFunction()) { |
| 1741 // API function. | 1741 // API function. |
| 1742 FunctionTemplateInfo* fun_data = shared->get_api_func_data(); | 1742 FunctionTemplateInfo* fun_data = shared->get_api_func_data(); |
| 1743 Object* raw_call_data = fun_data->call_code(); | 1743 Object* raw_call_data = fun_data->call_code(); |
| 1744 if (!raw_call_data->IsUndefined()) { | 1744 if (!raw_call_data->IsUndefined()) { |
| 1745 CallHandlerInfo* call_data = CallHandlerInfo::cast(raw_call_data); | 1745 CallHandlerInfo* call_data = CallHandlerInfo::cast(raw_call_data); |
| 1746 Object* callback_obj = call_data->callback(); | 1746 Object* callback_obj = call_data->callback(); |
| 1747 Address entry_point = v8::ToCData<Address>(callback_obj); | 1747 Address entry_point = v8::ToCData<Address>(callback_obj); |
| 1748 PROFILE(ISOLATE, CallbackEvent(*func_name, entry_point)); | 1748 PROFILE(isolate_, CallbackEvent(*func_name, entry_point)); |
| 1749 } | 1749 } |
| 1750 } else { | 1750 } else { |
| 1751 PROFILE(ISOLATE, | 1751 PROFILE(isolate_, |
| 1752 CodeCreateEvent( | 1752 CodeCreateEvent( |
| 1753 Logger::LAZY_COMPILE_TAG, *code, *shared, *func_name)); | 1753 Logger::LAZY_COMPILE_TAG, *code, *shared, *func_name)); |
| 1754 } | 1754 } |
| 1755 } | 1755 } |
| 1756 | 1756 |
| 1757 | 1757 |
| 1758 void Logger::LogCompiledFunctions() { | 1758 void Logger::LogCompiledFunctions() { |
| 1759 Heap* heap = isolate_->heap(); | 1759 Heap* heap = isolate_->heap(); |
| 1760 heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, | 1760 heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, |
| 1761 "Logger::LogCompiledFunctions"); | 1761 "Logger::LogCompiledFunctions"); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1782 "Logger::LogAccessorCallbacks"); | 1782 "Logger::LogAccessorCallbacks"); |
| 1783 HeapIterator iterator(heap); | 1783 HeapIterator iterator(heap); |
| 1784 AssertNoAllocation no_alloc; | 1784 AssertNoAllocation no_alloc; |
| 1785 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { | 1785 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { |
| 1786 if (!obj->IsExecutableAccessorInfo()) continue; | 1786 if (!obj->IsExecutableAccessorInfo()) continue; |
| 1787 ExecutableAccessorInfo* ai = ExecutableAccessorInfo::cast(obj); | 1787 ExecutableAccessorInfo* ai = ExecutableAccessorInfo::cast(obj); |
| 1788 if (!ai->name()->IsName()) continue; | 1788 if (!ai->name()->IsName()) continue; |
| 1789 Address getter_entry = v8::ToCData<Address>(ai->getter()); | 1789 Address getter_entry = v8::ToCData<Address>(ai->getter()); |
| 1790 Name* name = Name::cast(ai->name()); | 1790 Name* name = Name::cast(ai->name()); |
| 1791 if (getter_entry != 0) { | 1791 if (getter_entry != 0) { |
| 1792 PROFILE(ISOLATE, GetterCallbackEvent(name, getter_entry)); | 1792 PROFILE(isolate_, GetterCallbackEvent(name, getter_entry)); |
| 1793 } | 1793 } |
| 1794 Address setter_entry = v8::ToCData<Address>(ai->setter()); | 1794 Address setter_entry = v8::ToCData<Address>(ai->setter()); |
| 1795 if (setter_entry != 0) { | 1795 if (setter_entry != 0) { |
| 1796 PROFILE(ISOLATE, SetterCallbackEvent(name, setter_entry)); | 1796 PROFILE(isolate_, SetterCallbackEvent(name, setter_entry)); |
| 1797 } | 1797 } |
| 1798 } | 1798 } |
| 1799 } | 1799 } |
| 1800 | 1800 |
| 1801 | 1801 |
| 1802 bool Logger::SetUp() { | 1802 bool Logger::SetUp() { |
| 1803 // Tests and EnsureInitialize() can call this twice in a row. It's harmless. | 1803 // Tests and EnsureInitialize() can call this twice in a row. It's harmless. |
| 1804 if (is_initialized_) return true; | 1804 if (is_initialized_) return true; |
| 1805 is_initialized_ = true; | 1805 is_initialized_ = true; |
| 1806 | 1806 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1953 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { | 1953 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { |
| 1954 ASSERT(sampler->IsActive()); | 1954 ASSERT(sampler->IsActive()); |
| 1955 ScopedLock lock(active_samplers_mutex); | 1955 ScopedLock lock(active_samplers_mutex); |
| 1956 ASSERT(active_samplers_ != NULL); | 1956 ASSERT(active_samplers_ != NULL); |
| 1957 bool removed = active_samplers_->RemoveElement(sampler); | 1957 bool removed = active_samplers_->RemoveElement(sampler); |
| 1958 ASSERT(removed); | 1958 ASSERT(removed); |
| 1959 USE(removed); | 1959 USE(removed); |
| 1960 } | 1960 } |
| 1961 | 1961 |
| 1962 } } // namespace v8::internal | 1962 } } // namespace v8::internal |
| OLD | NEW |