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

Unified Diff: src/compiler.cc

Issue 1903723002: [compiler] Remove CompilationInfo::abstract_code accessor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-compiler-simplify-26
Patch Set: Created 4 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 1ff4a46e208428ce218db1add2416782ef6e4bc3..b0f5ea1a8e671a927707da10046be1b72b55eefa 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -447,18 +447,18 @@ void OptimizedCompileJob::RecordOptimizationStats() {
namespace {
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.
-
+ CompilationInfo* info) {
// 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<SharedFunctionInfo> shared = info->shared_info();
Handle<Script> script = info->parse_info()->script();
- Handle<AbstractCode> abstract_code = info->abstract_code();
+ Handle<AbstractCode> abstract_code =
+ info->has_bytecode_array()
+ ? Handle<AbstractCode>::cast(info->bytecode_array())
+ : Handle<AbstractCode>::cast(info->code());
if (abstract_code.is_identical_to(
info->isolate()->builtins()->CompileLazy())) {
return;
@@ -583,7 +583,7 @@ MUST_USE_RESULT MaybeHandle<Code> GetUnoptimizedCode(CompilationInfo* info) {
// Compile either unoptimized code or bytecode for the interpreter.
if (!CompileBaselineCode(info)) return MaybeHandle<Code>();
- RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, shared);
+ RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info);
// Update the shared function info with the scope info. Allocating the
// ScopeInfo object may cause a GC.
@@ -726,8 +726,7 @@ bool GetOptimizedCodeNow(CompilationInfo* info) {
job->RecordOptimizationStats();
DCHECK(!isolate->has_pending_exception());
InsertCodeIntoOptimizedCodeMap(info);
- RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info,
- info->shared_info());
+ RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info);
return true;
}
@@ -1027,7 +1026,7 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
? Logger::EVAL_TAG
: Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script);
- PROFILE(isolate, CodeCreateEvent(log_tag, *info->abstract_code(), *result,
+ PROFILE(isolate, CodeCreateEvent(log_tag, result->abstract_code(), *result,
info, *script_name));
if (!script.is_null())
@@ -1218,7 +1217,7 @@ bool Compiler::EnsureDeoptimizationSupport(CompilationInfo* info) {
}
// The existing unoptimized code was replaced with the new one.
- RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, &unoptimized, shared);
+ RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, &unoptimized);
}
return true;
}
@@ -1546,7 +1545,7 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
}
if (maybe_existing.is_null()) {
- RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, result);
+ RecordFunctionCompilation(Logger::FUNCTION_TAG, &info);
live_edit_tracker.RecordFunctionInfo(result, literal, info.zone());
}
@@ -1620,7 +1619,7 @@ void Compiler::FinalizeOptimizedCompileJob(OptimizedCompileJob* job) {
job->RetryOptimization(kBailedOutDueToDependencyChange);
} else if (job->GenerateCode() == OptimizedCompileJob::SUCCEEDED) {
job->RecordOptimizationStats();
- RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info.get(), shared);
+ RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info.get());
if (shared->SearchOptimizedCodeMap(info->context()->native_context(),
info->osr_ast_id()).code == nullptr) {
InsertCodeIntoOptimizedCodeMap(info.get());
« no previous file with comments | « src/compiler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698