Revert "Fix runtime_call_stats for background parsing."
This reverts commit 8f4e8c0aee
.
Reason for revert: Speculative revert for http://crbug.com/717854
Original change's description:
> Fix runtime_call_stats for background parsing.
>
> BUG=v8:6093
>
> Change-Id: I365fbd7c3f33e2de47e0a84ee3ea631b4ffa6d35
> Reviewed-on: https://chromium-review.googlesource.com/488243
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org>
> Commit-Queue: Wiktor Garbacz <wiktorg@google.com>
> Cr-Commit-Position: refs/heads/master@{#45013}
TBR=marja@chromium.org
R=marja@chromium.org,vogelheim@chromium.org,cbruni@chromium.org,jochen@chromium.org
BUG=v8:6093,chromium:717854
Change-Id: Ia58a420ec4c1e84a9f01eb90545fabb0bc03aa63
Reviewed-on: https://chromium-review.googlesource.com/494568
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45070}
This commit is contained in:
parent
6cb995b936
commit
ce5ffd931c
@ -2473,7 +2473,6 @@ MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context,
|
||||
source->parser->ReportErrors(isolate, script);
|
||||
}
|
||||
source->parser->UpdateStatistics(isolate, script);
|
||||
source->info->UpdateStatisticsAfterBackgroundParse(isolate);
|
||||
|
||||
i::DeferredHandleScope deferred_handle_scope(isolate);
|
||||
{
|
||||
|
@ -37,9 +37,6 @@ BackgroundParsingTask::BackgroundParsingTask(
|
||||
info->set_unicode_cache(&source_->unicode_cache);
|
||||
info->set_compile_options(options);
|
||||
info->set_allow_lazy_parsing();
|
||||
if (V8_UNLIKELY(FLAG_runtime_call_stats)) {
|
||||
info->set_runtime_call_stats(new (info->zone()) RuntimeCallStats());
|
||||
}
|
||||
|
||||
source_->info->set_cached_data(&script_data_);
|
||||
// Parser needs to stay alive for finalizing the parsing on the main
|
||||
|
@ -90,10 +90,6 @@ CompilerDispatcherJob::CompilerDispatcherJob(
|
||||
parse_info_->set_language_mode(language_mode);
|
||||
parse_info_->set_function_literal_id(function_literal_id);
|
||||
parse_info_->set_ast_string_constants(ast_string_constants);
|
||||
if (V8_UNLIKELY(FLAG_runtime_call_stats)) {
|
||||
parse_info_->set_runtime_call_stats(new (parse_info_->zone())
|
||||
RuntimeCallStats());
|
||||
}
|
||||
|
||||
parse_info_->set_native(native);
|
||||
parse_info_->set_module(module);
|
||||
@ -270,10 +266,6 @@ void CompilerDispatcherJob::PrepareToParseOnMainThread() {
|
||||
parse_info_->set_unicode_cache(unicode_cache_.get());
|
||||
parse_info_->set_language_mode(shared_->language_mode());
|
||||
parse_info_->set_function_literal_id(shared_->function_literal_id());
|
||||
if (V8_UNLIKELY(FLAG_runtime_call_stats)) {
|
||||
parse_info_->set_runtime_call_stats(new (parse_info_->zone())
|
||||
RuntimeCallStats());
|
||||
}
|
||||
|
||||
parser_.reset(new Parser(parse_info_.get()));
|
||||
MaybeHandle<ScopeInfo> outer_scope_info;
|
||||
@ -342,7 +334,6 @@ bool CompilerDispatcherJob::FinalizeParsingOnMainThread() {
|
||||
status_ = CompileJobStatus::kReadyToAnalyze;
|
||||
}
|
||||
parser_->UpdateStatistics(isolate_, script);
|
||||
parse_info_->UpdateStatisticsAfterBackgroundParse(isolate_);
|
||||
|
||||
DeferredHandleScope scope(isolate_);
|
||||
{
|
||||
|
@ -164,20 +164,6 @@ void ParseInfo::InitFromIsolate(Isolate* isolate) {
|
||||
set_ast_string_constants(isolate->ast_string_constants());
|
||||
}
|
||||
|
||||
void ParseInfo::UpdateStatisticsAfterBackgroundParse(Isolate* isolate) {
|
||||
// Copy over the counters from the background thread to the main counters on
|
||||
// the isolate.
|
||||
RuntimeCallStats* main_call_stats = isolate->counters()->runtime_call_stats();
|
||||
if (FLAG_runtime_stats ==
|
||||
v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE) {
|
||||
DCHECK_NE(main_call_stats, runtime_call_stats());
|
||||
DCHECK_NOT_NULL(main_call_stats);
|
||||
DCHECK_NOT_NULL(runtime_call_stats());
|
||||
main_call_stats->Add(runtime_call_stats());
|
||||
}
|
||||
set_runtime_call_stats(main_call_stats);
|
||||
}
|
||||
|
||||
void ParseInfo::ParseFinished(std::unique_ptr<ParseInfo> info) {
|
||||
if (info->literal()) {
|
||||
base::LockGuard<base::Mutex> access_child_infos(&child_infos_mutex_);
|
||||
|
@ -246,8 +246,6 @@ class V8_EXPORT_PRIVATE ParseInfo : public CompileJobFinishCallback {
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateStatisticsAfterBackgroundParse(Isolate* isolate);
|
||||
|
||||
// The key of the map is the FunctionLiteral's start_position
|
||||
std::map<int, ParseInfo*> child_infos() const;
|
||||
|
||||
|
@ -3519,6 +3519,13 @@ void Parser::UpdateStatistics(Isolate* isolate, Handle<Script> script) {
|
||||
}
|
||||
isolate->counters()->total_preparse_skipped()->Increment(
|
||||
total_preparse_skipped_);
|
||||
if (!parsing_on_main_thread_ &&
|
||||
FLAG_runtime_stats ==
|
||||
v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE) {
|
||||
// Copy over the counters from the background thread to the main counters on
|
||||
// the isolate.
|
||||
isolate->counters()->runtime_call_stats()->Add(runtime_call_stats_);
|
||||
}
|
||||
}
|
||||
|
||||
void Parser::ParseOnBackground(ParseInfo* info) {
|
||||
@ -3535,6 +3542,10 @@ void Parser::ParseOnBackground(ParseInfo* info) {
|
||||
compile_options_ = ScriptCompiler::kNoCompileOptions;
|
||||
}
|
||||
}
|
||||
if (FLAG_runtime_stats) {
|
||||
// Create separate runtime stats for background parsing.
|
||||
runtime_call_stats_ = new (zone()) RuntimeCallStats();
|
||||
}
|
||||
|
||||
std::unique_ptr<Utf16CharacterStream> stream;
|
||||
Utf16CharacterStream* stream_ptr;
|
||||
@ -5220,7 +5231,6 @@ void Parser::StitchAst(ParseInfo* top_level_parse_info, Isolate* isolate) {
|
||||
// If the parse task failed the function will be treated as lazy function
|
||||
// and reparsed before it gets called
|
||||
if (!result) continue;
|
||||
result->UpdateStatisticsAfterBackgroundParse(isolate);
|
||||
if (!result->literal()) continue;
|
||||
while ((*it)->start_position() != child_info.first) {
|
||||
if (++it == literals_to_stitch_.end()) {
|
||||
|
Loading…
Reference in New Issue
Block a user