| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdarg.h> | 5 #include <stdarg.h> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 Code* code, | 1214 Code* code, |
| 1215 SharedFunctionInfo* shared, | 1215 SharedFunctionInfo* shared, |
| 1216 CompilationInfo* info, | 1216 CompilationInfo* info, |
| 1217 Name* name) { | 1217 Name* name) { |
| 1218 PROFILER_LOG(CodeCreateEvent(tag, code, shared, info, name)); | 1218 PROFILER_LOG(CodeCreateEvent(tag, code, shared, info, name)); |
| 1219 | 1219 |
| 1220 if (!is_logging_code_events()) return; | 1220 if (!is_logging_code_events()) return; |
| 1221 CALL_LISTENERS(CodeCreateEvent(tag, code, shared, info, name)); | 1221 CALL_LISTENERS(CodeCreateEvent(tag, code, shared, info, name)); |
| 1222 | 1222 |
| 1223 if (!FLAG_log_code || !log_->IsEnabled()) return; | 1223 if (!FLAG_log_code || !log_->IsEnabled()) return; |
| 1224 if (code == isolate_->builtins()->builtin(Builtins::kCompileUnoptimized)) | 1224 if (code == isolate_->builtins()->builtin(Builtins::kCompileLazy)) return; |
| 1225 return; | |
| 1226 | 1225 |
| 1227 Log::MessageBuilder msg(log_); | 1226 Log::MessageBuilder msg(log_); |
| 1228 AppendCodeCreateHeader(&msg, tag, code); | 1227 AppendCodeCreateHeader(&msg, tag, code); |
| 1229 if (name->IsString()) { | 1228 if (name->IsString()) { |
| 1230 SmartArrayPointer<char> str = | 1229 SmartArrayPointer<char> str = |
| 1231 String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 1230 String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
| 1232 msg.Append("\"%s\"", str.get()); | 1231 msg.Append("\"%s\"", str.get()); |
| 1233 } else { | 1232 } else { |
| 1234 msg.AppendSymbolName(Symbol::cast(name)); | 1233 msg.AppendSymbolName(Symbol::cast(name)); |
| 1235 } | 1234 } |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1748 "Logger::LogCompiledFunctions"); | 1747 "Logger::LogCompiledFunctions"); |
| 1749 HandleScope scope(isolate_); | 1748 HandleScope scope(isolate_); |
| 1750 const int compiled_funcs_count = EnumerateCompiledFunctions(heap, NULL, NULL); | 1749 const int compiled_funcs_count = EnumerateCompiledFunctions(heap, NULL, NULL); |
| 1751 ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count); | 1750 ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count); |
| 1752 ScopedVector< Handle<Code> > code_objects(compiled_funcs_count); | 1751 ScopedVector< Handle<Code> > code_objects(compiled_funcs_count); |
| 1753 EnumerateCompiledFunctions(heap, sfis.start(), code_objects.start()); | 1752 EnumerateCompiledFunctions(heap, sfis.start(), code_objects.start()); |
| 1754 | 1753 |
| 1755 // During iteration, there can be heap allocation due to | 1754 // During iteration, there can be heap allocation due to |
| 1756 // GetScriptLineNumber call. | 1755 // GetScriptLineNumber call. |
| 1757 for (int i = 0; i < compiled_funcs_count; ++i) { | 1756 for (int i = 0; i < compiled_funcs_count; ++i) { |
| 1758 if (code_objects[i].is_identical_to( | 1757 if (code_objects[i].is_identical_to(isolate_->builtins()->CompileLazy())) |
| 1759 isolate_->builtins()->CompileUnoptimized())) | |
| 1760 continue; | 1758 continue; |
| 1761 LogExistingFunction(sfis[i], code_objects[i]); | 1759 LogExistingFunction(sfis[i], code_objects[i]); |
| 1762 } | 1760 } |
| 1763 } | 1761 } |
| 1764 | 1762 |
| 1765 | 1763 |
| 1766 void Logger::LogAccessorCallbacks() { | 1764 void Logger::LogAccessorCallbacks() { |
| 1767 Heap* heap = isolate_->heap(); | 1765 Heap* heap = isolate_->heap(); |
| 1768 heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, | 1766 heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, |
| 1769 "Logger::LogAccessorCallbacks"); | 1767 "Logger::LogAccessorCallbacks"); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1935 if (jit_logger_) { | 1933 if (jit_logger_) { |
| 1936 removeCodeEventListener(jit_logger_); | 1934 removeCodeEventListener(jit_logger_); |
| 1937 delete jit_logger_; | 1935 delete jit_logger_; |
| 1938 jit_logger_ = NULL; | 1936 jit_logger_ = NULL; |
| 1939 } | 1937 } |
| 1940 | 1938 |
| 1941 return log_->Close(); | 1939 return log_->Close(); |
| 1942 } | 1940 } |
| 1943 | 1941 |
| 1944 } } // namespace v8::internal | 1942 } } // namespace v8::internal |
| OLD | NEW |