Remove Compiler::RecordFunctionCompilation from interface.

R=sigurds@chromium.org

Review URL: https://codereview.chromium.org/582593003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24025 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4413d318
...@@ -638,6 +638,40 @@ static void SetFunctionInfo(Handle<SharedFunctionInfo> function_info, ...@@ -638,6 +638,40 @@ static void SetFunctionInfo(Handle<SharedFunctionInfo> function_info,
} }
static void RecordFunctionCompilation(Logger::LogEventsAndTags tag,
CompilationInfo* info,
Handle<SharedFunctionInfo> shared) {
// SharedFunctionInfo is passed separately, because if CompilationInfo
// was created using Script object, it will not have it.
// Log the code generation. If source information is available include
// script name and line number. Check explicitly whether logging is
// enabled as finding the line number is not free.
if (info->isolate()->logger()->is_logging_code_events() ||
info->isolate()->cpu_profiler()->is_profiling()) {
Handle<Script> script = info->script();
Handle<Code> code = info->code();
if (code.is_identical_to(info->isolate()->builtins()->CompileLazy())) {
return;
}
int line_num = Script::GetLineNumber(script, shared->start_position()) + 1;
int column_num =
Script::GetColumnNumber(script, shared->start_position()) + 1;
String* script_name = script->name()->IsString()
? String::cast(script->name())
: info->isolate()->heap()->empty_string();
Logger::LogEventsAndTags log_tag = Logger::ToNativeByScript(tag, *script);
PROFILE(info->isolate(),
CodeCreateEvent(log_tag, *code, *shared, info, script_name,
line_num, column_num));
}
GDBJIT(AddCode(Handle<String>(shared->DebugName()),
Handle<Script>(info->script()), Handle<Code>(info->code()),
info));
}
static bool CompileUnoptimizedCode(CompilationInfo* info) { static bool CompileUnoptimizedCode(CompilationInfo* info) {
DCHECK(AllowCompilation::IsAllowed(info->isolate())); DCHECK(AllowCompilation::IsAllowed(info->isolate()));
DCHECK(info->function() != NULL); DCHECK(info->function() != NULL);
...@@ -672,8 +706,7 @@ MUST_USE_RESULT static MaybeHandle<Code> GetUnoptimizedCodeCommon( ...@@ -672,8 +706,7 @@ MUST_USE_RESULT static MaybeHandle<Code> GetUnoptimizedCodeCommon(
if (!CompileUnoptimizedCode(info)) return MaybeHandle<Code>(); if (!CompileUnoptimizedCode(info)) return MaybeHandle<Code>();
CHECK_EQ(Code::FUNCTION, info->code()->kind()); CHECK_EQ(Code::FUNCTION, info->code()->kind());
Compiler::RecordFunctionCompilation( RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, shared);
Logger::LAZY_COMPILE_TAG, info, info->shared_info());
// Update the shared function info with the scope info. Allocating the // Update the shared function info with the scope info. Allocating the
// ScopeInfo object may cause a GC. // ScopeInfo object may cause a GC.
...@@ -1233,8 +1266,8 @@ static bool GetOptimizedCodeNow(CompilationInfo* info) { ...@@ -1233,8 +1266,8 @@ static bool GetOptimizedCodeNow(CompilationInfo* info) {
// Success! // Success!
DCHECK(!info->isolate()->has_pending_exception()); DCHECK(!info->isolate()->has_pending_exception());
InsertCodeIntoOptimizedCodeMap(info); InsertCodeIntoOptimizedCodeMap(info);
Compiler::RecordFunctionCompilation( RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info,
Logger::LAZY_COMPILE_TAG, info, info->shared_info()); info->shared_info());
return true; return true;
} }
...@@ -1357,8 +1390,7 @@ Handle<Code> Compiler::GetConcurrentlyOptimizedCode(OptimizedCompileJob* job) { ...@@ -1357,8 +1390,7 @@ Handle<Code> Compiler::GetConcurrentlyOptimizedCode(OptimizedCompileJob* job) {
return Handle<Code>::null(); return Handle<Code>::null();
} }
Compiler::RecordFunctionCompilation( RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info.get(), shared);
Logger::LAZY_COMPILE_TAG, info.get(), shared);
if (info->shared_info()->SearchOptimizedCodeMap( if (info->shared_info()->SearchOptimizedCodeMap(
info->context()->native_context(), info->osr_ast_id()) == -1) { info->context()->native_context(), info->osr_ast_id()) == -1) {
InsertCodeIntoOptimizedCodeMap(info.get()); InsertCodeIntoOptimizedCodeMap(info.get());
...@@ -1374,40 +1406,6 @@ Handle<Code> Compiler::GetConcurrentlyOptimizedCode(OptimizedCompileJob* job) { ...@@ -1374,40 +1406,6 @@ Handle<Code> Compiler::GetConcurrentlyOptimizedCode(OptimizedCompileJob* job) {
} }
void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag,
CompilationInfo* info,
Handle<SharedFunctionInfo> shared) {
// SharedFunctionInfo is passed separately, because if CompilationInfo
// was created using Script object, it will not have it.
// Log the code generation. If source information is available include
// script name and line number. Check explicitly whether logging is
// enabled as finding the line number is not free.
if (info->isolate()->logger()->is_logging_code_events() ||
info->isolate()->cpu_profiler()->is_profiling()) {
Handle<Script> script = info->script();
Handle<Code> code = info->code();
if (code.is_identical_to(info->isolate()->builtins()->CompileLazy())) {
return;
}
int line_num = Script::GetLineNumber(script, shared->start_position()) + 1;
int column_num =
Script::GetColumnNumber(script, shared->start_position()) + 1;
String* script_name = script->name()->IsString()
? String::cast(script->name())
: info->isolate()->heap()->empty_string();
Logger::LogEventsAndTags log_tag = Logger::ToNativeByScript(tag, *script);
PROFILE(info->isolate(), CodeCreateEvent(
log_tag, *code, *shared, info, script_name, line_num, column_num));
}
GDBJIT(AddCode(Handle<String>(shared->DebugName()),
Handle<Script>(info->script()),
Handle<Code>(info->code()),
info));
}
bool Compiler::DebuggerWantsEagerCompilation(CompilationInfo* info, bool Compiler::DebuggerWantsEagerCompilation(CompilationInfo* info,
bool allow_lazy_without_ctx) { bool allow_lazy_without_ctx) {
return LiveEditFunctionTracker::IsActive(info->isolate()) || return LiveEditFunctionTracker::IsActive(info->isolate()) ||
......
...@@ -712,10 +712,6 @@ class Compiler : public AllStatic { ...@@ -712,10 +712,6 @@ class Compiler : public AllStatic {
// On failure, return the empty handle. // On failure, return the empty handle.
static Handle<Code> GetConcurrentlyOptimizedCode(OptimizedCompileJob* job); static Handle<Code> GetConcurrentlyOptimizedCode(OptimizedCompileJob* job);
static void RecordFunctionCompilation(Logger::LogEventsAndTags tag,
CompilationInfo* info,
Handle<SharedFunctionInfo> shared);
static bool DebuggerWantsEagerCompilation( static bool DebuggerWantsEagerCompilation(
CompilationInfo* info, bool allow_lazy_without_ctx = false); CompilationInfo* info, bool allow_lazy_without_ctx = false);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment