Commit 7899fcc5 authored by verwaest's avatar verwaest Committed by Commit bot

Drop Lazy from parser method names and events

BUG=

Review-Url: https://codereview.chromium.org/2414383002
Cr-Commit-Position: refs/heads/master@{#40318}
parent cb0958e6
...@@ -702,8 +702,8 @@ class RuntimeCallTimer { ...@@ -702,8 +702,8 @@ class RuntimeCallTimer {
V(Map_TransitionToDataProperty) \ V(Map_TransitionToDataProperty) \
V(Object_DeleteProperty) \ V(Object_DeleteProperty) \
V(OptimizeCode) \ V(OptimizeCode) \
V(Parse) \ V(ParseProgram) \
V(ParseLazy) \ V(ParseFunction) \
V(PropertyCallback) \ V(PropertyCallback) \
V(PrototypeMap_TransitionToAccessorProperty) \ V(PrototypeMap_TransitionToAccessorProperty) \
V(PrototypeMap_TransitionToDataProperty) \ V(PrototypeMap_TransitionToDataProperty) \
......
...@@ -678,8 +678,8 @@ FunctionLiteral* Parser::ParseProgram(Isolate* isolate, ParseInfo* info) { ...@@ -678,8 +678,8 @@ FunctionLiteral* Parser::ParseProgram(Isolate* isolate, ParseInfo* info) {
DCHECK(parsing_on_main_thread_); DCHECK(parsing_on_main_thread_);
HistogramTimerScope timer_scope(isolate->counters()->parse(), true); HistogramTimerScope timer_scope(isolate->counters()->parse(), true);
RuntimeCallTimerScope runtime_timer(isolate, &RuntimeCallStats::Parse); RuntimeCallTimerScope runtime_timer(isolate, &RuntimeCallStats::ParseProgram);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.Parse"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.ParseProgram");
Handle<String> source(String::cast(info->script()->source())); Handle<String> source(String::cast(info->script()->source()));
isolate->counters()->total_parse_size()->Increment(source->length()); isolate->counters()->total_parse_size()->Increment(source->length());
base::ElapsedTimer timer; base::ElapsedTimer timer;
...@@ -837,14 +837,14 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) { ...@@ -837,14 +837,14 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
return result; return result;
} }
FunctionLiteral* Parser::ParseFunction(Isolate* isolate, ParseInfo* info) {
FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info) {
// It's OK to use the Isolate & counters here, since this function is only // It's OK to use the Isolate & counters here, since this function is only
// called in the main thread. // called in the main thread.
DCHECK(parsing_on_main_thread_); DCHECK(parsing_on_main_thread_);
RuntimeCallTimerScope runtime_timer(isolate, &RuntimeCallStats::ParseLazy); RuntimeCallTimerScope runtime_timer(isolate,
&RuntimeCallStats::ParseFunction);
HistogramTimerScope timer_scope(isolate->counters()->parse_lazy()); HistogramTimerScope timer_scope(isolate->counters()->parse_lazy());
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.ParseLazy"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.ParseFunction");
Handle<String> source(String::cast(info->script()->source())); Handle<String> source(String::cast(info->script()->source()));
isolate->counters()->total_parse_size()->Increment(source->length()); isolate->counters()->total_parse_size()->Increment(source->length());
base::ElapsedTimer timer; base::ElapsedTimer timer;
...@@ -861,8 +861,8 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info) { ...@@ -861,8 +861,8 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info) {
std::unique_ptr<Utf16CharacterStream> stream(ScannerStream::For( std::unique_ptr<Utf16CharacterStream> stream(ScannerStream::For(
source, shared_info->start_position(), shared_info->end_position())); source, shared_info->start_position(), shared_info->end_position()));
Handle<String> name(String::cast(shared_info->name())); Handle<String> name(String::cast(shared_info->name()));
result = result = DoParseFunction(info, ast_value_factory()->GetString(name),
DoParseLazy(info, ast_value_factory()->GetString(name), stream.get()); stream.get());
if (result != nullptr) { if (result != nullptr) {
Handle<String> inferred_name(shared_info->inferred_name()); Handle<String> inferred_name(shared_info->inferred_name());
result->set_inferred_name(inferred_name); result->set_inferred_name(inferred_name);
...@@ -891,9 +891,9 @@ static FunctionLiteral::FunctionType ComputeFunctionType(ParseInfo* info) { ...@@ -891,9 +891,9 @@ static FunctionLiteral::FunctionType ComputeFunctionType(ParseInfo* info) {
return FunctionLiteral::kAnonymousExpression; return FunctionLiteral::kAnonymousExpression;
} }
FunctionLiteral* Parser::DoParseLazy(ParseInfo* info, FunctionLiteral* Parser::DoParseFunction(ParseInfo* info,
const AstRawString* raw_name, const AstRawString* raw_name,
Utf16CharacterStream* source) { Utf16CharacterStream* source) {
scanner_.Initialize(source); scanner_.Initialize(source);
DCHECK_NULL(scope_state_); DCHECK_NULL(scope_state_);
DCHECK_NULL(target_stack_); DCHECK_NULL(target_stack_);
...@@ -2789,7 +2789,7 @@ Parser::LazyParsingResult Parser::SkipLazyFunctionBody( ...@@ -2789,7 +2789,7 @@ Parser::LazyParsingResult Parser::SkipLazyFunctionBody(
// AST. This gathers the data needed to build a lazy function. // AST. This gathers the data needed to build a lazy function.
SingletonLogger logger; SingletonLogger logger;
PreParser::PreParseResult result = PreParser::PreParseResult result =
ParseLazyFunctionBodyWithPreParser(&logger, is_inner_function, may_abort); ParseFunctionBodyWithPreParser(&logger, is_inner_function, may_abort);
// Return immediately if pre-parser decided to abort parsing. // Return immediately if pre-parser decided to abort parsing.
if (result == PreParser::kPreParseAbort) return kLazyParsingAborted; if (result == PreParser::kPreParseAbort) return kLazyParsingAborted;
...@@ -3249,7 +3249,7 @@ ZoneList<Statement*>* Parser::ParseEagerFunctionBody( ...@@ -3249,7 +3249,7 @@ ZoneList<Statement*>* Parser::ParseEagerFunctionBody(
return result; return result;
} }
PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser( PreParser::PreParseResult Parser::ParseFunctionBodyWithPreParser(
SingletonLogger* logger, bool is_inner_function, bool may_abort) { SingletonLogger* logger, bool is_inner_function, bool may_abort) {
// This function may be called on a background thread too; record only the // This function may be called on a background thread too; record only the
// main thread preparse times. // main thread preparse times.
...@@ -3279,7 +3279,7 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser( ...@@ -3279,7 +3279,7 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
DCHECK(!is_inner_function || !may_abort); DCHECK(!is_inner_function || !may_abort);
DeclarationScope* function_scope = function_state_->scope(); DeclarationScope* function_scope = function_state_->scope();
PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction( PreParser::PreParseResult result = reusable_preparser_->PreParseFunction(
function_scope, parsing_module_, logger, is_inner_function, may_abort, function_scope, parsing_module_, logger, is_inner_function, may_abort,
use_counts_); use_counts_);
if (pre_parse_timer_ != NULL) { if (pre_parse_timer_ != NULL) {
...@@ -3771,7 +3771,7 @@ bool Parser::Parse(ParseInfo* info) { ...@@ -3771,7 +3771,7 @@ bool Parser::Parse(ParseInfo* info) {
SetCachedData(info); SetCachedData(info);
result = ParseProgram(isolate, info); result = ParseProgram(isolate, info);
} else { } else {
result = ParseLazy(isolate, info); result = ParseFunction(isolate, info);
} }
info->set_literal(result); info->set_literal(result);
...@@ -3815,7 +3815,7 @@ void Parser::ParseOnBackground(ParseInfo* info) { ...@@ -3815,7 +3815,7 @@ void Parser::ParseOnBackground(ParseInfo* info) {
scanner_.Initialize(stream_ptr); scanner_.Initialize(stream_ptr);
result = DoParseProgram(info); result = DoParseProgram(info);
} else { } else {
result = DoParseLazy(info, info->function_name(), stream_ptr); result = DoParseFunction(info, info->function_name(), stream_ptr);
} }
info->set_literal(result); info->set_literal(result);
......
...@@ -236,9 +236,10 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) { ...@@ -236,9 +236,10 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
// Returns NULL if parsing failed. // Returns NULL if parsing failed.
FunctionLiteral* ParseProgram(Isolate* isolate, ParseInfo* info); FunctionLiteral* ParseProgram(Isolate* isolate, ParseInfo* info);
FunctionLiteral* ParseLazy(Isolate* isolate, ParseInfo* info); FunctionLiteral* ParseFunction(Isolate* isolate, ParseInfo* info);
FunctionLiteral* DoParseLazy(ParseInfo* info, const AstRawString* raw_name, FunctionLiteral* DoParseFunction(ParseInfo* info,
Utf16CharacterStream* source); const AstRawString* raw_name,
Utf16CharacterStream* source);
// Called by ParseProgram after setting up the scanner. // Called by ParseProgram after setting up the scanner.
FunctionLiteral* DoParseProgram(ParseInfo* info); FunctionLiteral* DoParseProgram(ParseInfo* info);
...@@ -494,7 +495,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) { ...@@ -494,7 +495,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
bool is_inner_function, bool may_abort, bool is_inner_function, bool may_abort,
bool* ok); bool* ok);
PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser( PreParser::PreParseResult ParseFunctionBodyWithPreParser(
SingletonLogger* logger, bool is_inner_function, bool may_abort); SingletonLogger* logger, bool is_inner_function, bool may_abort);
Block* BuildParameterInitializationBlock( Block* BuildParameterInitializationBlock(
......
...@@ -83,7 +83,7 @@ PreParserIdentifier PreParser::GetSymbol() const { ...@@ -83,7 +83,7 @@ PreParserIdentifier PreParser::GetSymbol() const {
return symbol; return symbol;
} }
PreParser::PreParseResult PreParser::PreParseLazyFunction( PreParser::PreParseResult PreParser::PreParseFunction(
DeclarationScope* function_scope, bool parsing_module, SingletonLogger* log, DeclarationScope* function_scope, bool parsing_module, SingletonLogger* log,
bool is_inner_function, bool may_abort, int* use_counts) { bool is_inner_function, bool may_abort, int* use_counts) {
DCHECK_EQ(FUNCTION_SCOPE, function_scope->scope_type()); DCHECK_EQ(FUNCTION_SCOPE, function_scope->scope_type());
......
...@@ -887,10 +887,10 @@ class PreParser : public ParserBase<PreParser> { ...@@ -887,10 +887,10 @@ class PreParser : public ParserBase<PreParser> {
// keyword and parameters, and have consumed the initial '{'. // keyword and parameters, and have consumed the initial '{'.
// At return, unless an error occurred, the scanner is positioned before the // At return, unless an error occurred, the scanner is positioned before the
// the final '}'. // the final '}'.
PreParseResult PreParseLazyFunction(DeclarationScope* function_scope, PreParseResult PreParseFunction(DeclarationScope* function_scope,
bool parsing_module, SingletonLogger* log, bool parsing_module, SingletonLogger* log,
bool track_unresolved_variables, bool track_unresolved_variables,
bool may_abort, int* use_counts); bool may_abort, int* use_counts);
private: private:
// These types form an algebra over syntactic categories that is just // These types form an algebra over syntactic categories that is just
......
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