| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 #endif | 780 #endif |
| 781 | 781 |
| 782 | 782 |
| 783 void Logger::CodeCreateEvent(LogEventsAndTags tag, | 783 void Logger::CodeCreateEvent(LogEventsAndTags tag, |
| 784 Code* code, | 784 Code* code, |
| 785 SharedFunctionInfo* shared, | 785 SharedFunctionInfo* shared, |
| 786 String* name) { | 786 String* name) { |
| 787 #ifdef ENABLE_LOGGING_AND_PROFILING | 787 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 788 if (!log_->IsEnabled() || !FLAG_log_code) return; | 788 if (!log_->IsEnabled() || !FLAG_log_code) return; |
| 789 if (code == Isolate::Current()->builtins()->builtin( | 789 if (code == Isolate::Current()->builtins()->builtin( |
| 790 Builtins::LazyCompile)) | 790 Builtins::kLazyCompile)) |
| 791 return; | 791 return; |
| 792 | 792 |
| 793 LogMessageBuilder msg(this); | 793 LogMessageBuilder msg(this); |
| 794 SmartPointer<char> str = | 794 SmartPointer<char> str = |
| 795 name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 795 name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
| 796 msg.Append("%s,%s,", | 796 msg.Append("%s,%s,", |
| 797 kLogEventsNames[CODE_CREATION_EVENT], | 797 kLogEventsNames[CODE_CREATION_EVENT], |
| 798 kLogEventsNames[tag]); | 798 kLogEventsNames[tag]); |
| 799 msg.AppendAddress(code->address()); | 799 msg.AppendAddress(code->address()); |
| 800 msg.Append(",%d,\"%s\",", code->ExecutableSize(), *str); | 800 msg.Append(",%d,\"%s\",", code->ExecutableSize(), *str); |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 HandleScope scope; | 1409 HandleScope scope; |
| 1410 const int compiled_funcs_count = EnumerateCompiledFunctions(NULL, NULL); | 1410 const int compiled_funcs_count = EnumerateCompiledFunctions(NULL, NULL); |
| 1411 ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count); | 1411 ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count); |
| 1412 ScopedVector< Handle<Code> > code_objects(compiled_funcs_count); | 1412 ScopedVector< Handle<Code> > code_objects(compiled_funcs_count); |
| 1413 EnumerateCompiledFunctions(sfis.start(), code_objects.start()); | 1413 EnumerateCompiledFunctions(sfis.start(), code_objects.start()); |
| 1414 | 1414 |
| 1415 // During iteration, there can be heap allocation due to | 1415 // During iteration, there can be heap allocation due to |
| 1416 // GetScriptLineNumber call. | 1416 // GetScriptLineNumber call. |
| 1417 for (int i = 0; i < compiled_funcs_count; ++i) { | 1417 for (int i = 0; i < compiled_funcs_count; ++i) { |
| 1418 if (*code_objects[i] == Isolate::Current()->builtins()->builtin( | 1418 if (*code_objects[i] == Isolate::Current()->builtins()->builtin( |
| 1419 Builtins::LazyCompile)) | 1419 Builtins::kLazyCompile)) |
| 1420 continue; | 1420 continue; |
| 1421 Handle<SharedFunctionInfo> shared = sfis[i]; | 1421 Handle<SharedFunctionInfo> shared = sfis[i]; |
| 1422 Handle<String> func_name(shared->DebugName()); | 1422 Handle<String> func_name(shared->DebugName()); |
| 1423 if (shared->script()->IsScript()) { | 1423 if (shared->script()->IsScript()) { |
| 1424 Handle<Script> script(Script::cast(shared->script())); | 1424 Handle<Script> script(Script::cast(shared->script())); |
| 1425 if (script->name()->IsString()) { | 1425 if (script->name()->IsString()) { |
| 1426 Handle<String> script_name(String::cast(script->name())); | 1426 Handle<String> script_name(String::cast(script->name())); |
| 1427 int line_num = GetScriptLineNumber(script, shared->start_position()); | 1427 int line_num = GetScriptLineNumber(script, shared->start_position()); |
| 1428 if (line_num > 0) { | 1428 if (line_num > 0) { |
| 1429 PROFILE(ISOLATE, | 1429 PROFILE(ISOLATE, |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1654 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { | 1654 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { |
| 1655 ASSERT(sampler->IsActive()); | 1655 ASSERT(sampler->IsActive()); |
| 1656 ScopedLock lock(mutex_); | 1656 ScopedLock lock(mutex_); |
| 1657 ASSERT(active_samplers_ != NULL); | 1657 ASSERT(active_samplers_ != NULL); |
| 1658 bool removed = active_samplers_->RemoveElement(sampler); | 1658 bool removed = active_samplers_->RemoveElement(sampler); |
| 1659 ASSERT(removed); | 1659 ASSERT(removed); |
| 1660 USE(removed); | 1660 USE(removed); |
| 1661 } | 1661 } |
| 1662 | 1662 |
| 1663 } } // namespace v8::internal | 1663 } } // namespace v8::internal |
| OLD | NEW |