Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: src/log.cc

Issue 110203002: Refactor the compiling pipeline. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/liveedit.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1425 Code* code, 1425 Code* code,
1426 SharedFunctionInfo* shared, 1426 SharedFunctionInfo* shared,
1427 CompilationInfo* info, 1427 CompilationInfo* info,
1428 Name* name) { 1428 Name* name) {
1429 PROFILER_LOG(CodeCreateEvent(tag, code, shared, info, name)); 1429 PROFILER_LOG(CodeCreateEvent(tag, code, shared, info, name));
1430 1430
1431 if (!is_logging_code_events()) return; 1431 if (!is_logging_code_events()) return;
1432 CALL_LISTENERS(CodeCreateEvent(tag, code, shared, info, name)); 1432 CALL_LISTENERS(CodeCreateEvent(tag, code, shared, info, name));
1433 1433
1434 if (!FLAG_log_code || !log_->IsEnabled()) return; 1434 if (!FLAG_log_code || !log_->IsEnabled()) return;
1435 if (code == isolate_->builtins()->builtin( 1435 if (code == isolate_->builtins()->builtin(Builtins::kCompileUnoptimized))
1436 Builtins::kLazyCompile))
1437 return; 1436 return;
1438 1437
1439 Log::MessageBuilder msg(log_); 1438 Log::MessageBuilder msg(log_);
1440 AppendCodeCreateHeader(&msg, tag, code); 1439 AppendCodeCreateHeader(&msg, tag, code);
1441 if (name->IsString()) { 1440 if (name->IsString()) {
1442 SmartArrayPointer<char> str = 1441 SmartArrayPointer<char> str =
1443 String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); 1442 String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
1444 msg.Append("\"%s\"", str.get()); 1443 msg.Append("\"%s\"", str.get());
1445 } else { 1444 } else {
1446 msg.AppendSymbolName(Symbol::cast(name)); 1445 msg.AppendSymbolName(Symbol::cast(name));
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1960 "Logger::LogCompiledFunctions"); 1959 "Logger::LogCompiledFunctions");
1961 HandleScope scope(isolate_); 1960 HandleScope scope(isolate_);
1962 const int compiled_funcs_count = EnumerateCompiledFunctions(heap, NULL, NULL); 1961 const int compiled_funcs_count = EnumerateCompiledFunctions(heap, NULL, NULL);
1963 ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count); 1962 ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count);
1964 ScopedVector< Handle<Code> > code_objects(compiled_funcs_count); 1963 ScopedVector< Handle<Code> > code_objects(compiled_funcs_count);
1965 EnumerateCompiledFunctions(heap, sfis.start(), code_objects.start()); 1964 EnumerateCompiledFunctions(heap, sfis.start(), code_objects.start());
1966 1965
1967 // During iteration, there can be heap allocation due to 1966 // During iteration, there can be heap allocation due to
1968 // GetScriptLineNumber call. 1967 // GetScriptLineNumber call.
1969 for (int i = 0; i < compiled_funcs_count; ++i) { 1968 for (int i = 0; i < compiled_funcs_count; ++i) {
1970 if (*code_objects[i] == isolate_->builtins()->builtin( 1969 if (code_objects[i].is_identical_to(
1971 Builtins::kLazyCompile)) 1970 isolate_->builtins()->CompileUnoptimized()))
1972 continue; 1971 continue;
1973 LogExistingFunction(sfis[i], code_objects[i]); 1972 LogExistingFunction(sfis[i], code_objects[i]);
1974 } 1973 }
1975 } 1974 }
1976 1975
1977 1976
1978 void Logger::LogAccessorCallbacks() { 1977 void Logger::LogAccessorCallbacks() {
1979 Heap* heap = isolate_->heap(); 1978 Heap* heap = isolate_->heap();
1980 heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, 1979 heap->CollectAllGarbage(Heap::kMakeHeapIterableMask,
1981 "Logger::LogAccessorCallbacks"); 1980 "Logger::LogAccessorCallbacks");
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
2162 if (jit_logger_) { 2161 if (jit_logger_) {
2163 removeCodeEventListener(jit_logger_); 2162 removeCodeEventListener(jit_logger_);
2164 delete jit_logger_; 2163 delete jit_logger_;
2165 jit_logger_ = NULL; 2164 jit_logger_ = NULL;
2166 } 2165 }
2167 2166
2168 return log_->Close(); 2167 return log_->Close();
2169 } 2168 }
2170 2169
2171 } } // namespace v8::internal 2170 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/liveedit.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698