Commit 430baf40 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Parsing] Move pending_error_handler from Parser to ParseInfo.

This is to enable it to also be used for reporting AsmJS errors such that
this can be moved off-thread.

BUG=v8:5203

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Ia46040b14d010702f10c02b8254aea84cba4d54d
Reviewed-on: https://chromium-review.googlesource.com/735606
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48881}
parent de4463bb
...@@ -2614,7 +2614,8 @@ MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context, ...@@ -2614,7 +2614,8 @@ MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context,
source->info->set_script(script); source->info->set_script(script);
if (source->info->literal() == nullptr) { if (source->info->literal() == nullptr) {
source->parser->ReportErrors(isolate, script); source->info->pending_error_handler()->ReportErrors(
isolate, script, source->info->ast_value_factory());
} }
source->parser->UpdateStatistics(isolate, script); source->parser->UpdateStatistics(isolate, script);
source->info->UpdateStatisticsAfterBackgroundParse(isolate); source->info->UpdateStatisticsAfterBackgroundParse(isolate);
......
...@@ -319,7 +319,8 @@ void UnoptimizedCompileJob::FinalizeParsingOnMainThread(Isolate* isolate) { ...@@ -319,7 +319,8 @@ void UnoptimizedCompileJob::FinalizeParsingOnMainThread(Isolate* isolate) {
} }
if (parse_info_->literal() == nullptr) { if (parse_info_->literal() == nullptr) {
parser_->ReportErrors(isolate, script); parse_info_->pending_error_handler()->ReportErrors(
isolate, script, parse_info_->ast_value_factory());
status_ = Status::kFailed; status_ = Status::kFailed;
} else { } else {
parse_info_->literal()->scope()->AttachOuterScopeInfo(parse_info_.get(), parse_info_->literal()->scope()->AttachOuterScopeInfo(parse_info_.get(),
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "src/globals.h" #include "src/globals.h"
#include "src/handles.h" #include "src/handles.h"
#include "src/parsing/preparsed-scope-data.h" #include "src/parsing/preparsed-scope-data.h"
#include "src/pending-compilation-error-handler.h"
namespace v8 { namespace v8 {
...@@ -193,6 +194,10 @@ class V8_EXPORT_PRIVATE ParseInfo { ...@@ -193,6 +194,10 @@ class V8_EXPORT_PRIVATE ParseInfo {
source_range_map_ = source_range_map; source_range_map_ = source_range_map;
} }
PendingCompilationErrorHandler* pending_error_handler() {
return &pending_error_handler_;
}
// Getters for individual compiler hints. // Getters for individual compiler hints.
bool is_declaration() const; bool is_declaration() const;
FunctionKind function_kind() const; FunctionKind function_kind() const;
...@@ -284,6 +289,7 @@ class V8_EXPORT_PRIVATE ParseInfo { ...@@ -284,6 +289,7 @@ class V8_EXPORT_PRIVATE ParseInfo {
//----------- Output of parsing and scope analysis ------------------------ //----------- Output of parsing and scope analysis ------------------------
FunctionLiteral* literal_; FunctionLiteral* literal_;
std::shared_ptr<DeferredHandles> deferred_handles_; std::shared_ptr<DeferredHandles> deferred_handles_;
PendingCompilationErrorHandler pending_error_handler_;
void SetFlag(Flag f) { flags_ |= f; } void SetFlag(Flag f) { flags_ |= f; }
void SetFlag(Flag f, bool v) { flags_ = v ? flags_ | f : flags_ & ~f; } void SetFlag(Flag f, bool v) { flags_ = v ? flags_ | f : flags_ & ~f; }
......
...@@ -252,6 +252,7 @@ class ParserBase { ...@@ -252,6 +252,7 @@ class ParserBase {
ParserBase(Zone* zone, Scanner* scanner, uintptr_t stack_limit, ParserBase(Zone* zone, Scanner* scanner, uintptr_t stack_limit,
v8::Extension* extension, AstValueFactory* ast_value_factory, v8::Extension* extension, AstValueFactory* ast_value_factory,
RuntimeCallStats* runtime_call_stats, bool parsing_module, RuntimeCallStats* runtime_call_stats, bool parsing_module,
PendingCompilationErrorHandler* pending_error_handler,
bool parsing_on_main_thread = true) bool parsing_on_main_thread = true)
: scope_(nullptr), : scope_(nullptr),
original_scope_(nullptr), original_scope_(nullptr),
...@@ -264,10 +265,10 @@ class ParserBase { ...@@ -264,10 +265,10 @@ class ParserBase {
parsing_on_main_thread_(parsing_on_main_thread), parsing_on_main_thread_(parsing_on_main_thread),
parsing_module_(parsing_module), parsing_module_(parsing_module),
stack_limit_(stack_limit), stack_limit_(stack_limit),
pending_error_handler_(pending_error_handler),
zone_(zone), zone_(zone),
classifier_(nullptr), classifier_(nullptr),
scanner_(scanner), scanner_(scanner),
stack_overflow_(false),
default_eager_compile_hint_(FunctionLiteral::kShouldLazyCompile), default_eager_compile_hint_(FunctionLiteral::kShouldLazyCompile),
function_literal_id_(0), function_literal_id_(0),
allow_natives_(false), allow_natives_(false),
...@@ -646,11 +647,13 @@ class ParserBase { ...@@ -646,11 +647,13 @@ class ParserBase {
AstValueFactory* ast_value_factory() const { return ast_value_factory_; } AstValueFactory* ast_value_factory() const { return ast_value_factory_; }
int position() const { return scanner_->location().beg_pos; } int position() const { return scanner_->location().beg_pos; }
int peek_position() const { return scanner_->peek_location().beg_pos; } int peek_position() const { return scanner_->peek_location().beg_pos; }
bool stack_overflow() const { return stack_overflow_; } bool stack_overflow() const {
void set_stack_overflow() { stack_overflow_ = true; } return pending_error_handler()->stack_overflow();
}
void set_stack_overflow() { pending_error_handler()->set_stack_overflow(); }
INLINE(Token::Value peek()) { INLINE(Token::Value peek()) {
if (stack_overflow_) return Token::ILLEGAL; if (stack_overflow()) return Token::ILLEGAL;
return scanner()->peek(); return scanner()->peek();
} }
...@@ -662,18 +665,18 @@ class ParserBase { ...@@ -662,18 +665,18 @@ class ParserBase {
} }
INLINE(Token::Value PeekAhead()) { INLINE(Token::Value PeekAhead()) {
if (stack_overflow_) return Token::ILLEGAL; if (stack_overflow()) return Token::ILLEGAL;
return scanner()->PeekAhead(); return scanner()->PeekAhead();
} }
INLINE(Token::Value Next()) { INLINE(Token::Value Next()) {
if (stack_overflow_) return Token::ILLEGAL; if (stack_overflow()) return Token::ILLEGAL;
{ {
if (GetCurrentStackPosition() < stack_limit_) { if (GetCurrentStackPosition() < stack_limit_) {
// Any further calls to Next or peek will return the illegal token. // Any further calls to Next or peek will return the illegal token.
// The current call must return the next token, which might already // The current call must return the next token, which might already
// have been peek'ed. // have been peek'ed.
stack_overflow_ = true; set_stack_overflow();
} }
} }
return scanner()->Next(); return scanner()->Next();
...@@ -885,6 +888,13 @@ class ParserBase { ...@@ -885,6 +888,13 @@ class ParserBase {
return IsResumableFunction(function_state_->kind()); return IsResumableFunction(function_state_->kind());
} }
const PendingCompilationErrorHandler* pending_error_handler() const {
return pending_error_handler_;
}
PendingCompilationErrorHandler* pending_error_handler() {
return pending_error_handler_;
}
// Report syntax errors. // Report syntax errors.
void ReportMessage(MessageTemplate::Template message) { void ReportMessage(MessageTemplate::Template message) {
Scanner::Location source_location = scanner()->location(); Scanner::Location source_location = scanner()->location();
...@@ -1493,6 +1503,7 @@ class ParserBase { ...@@ -1493,6 +1503,7 @@ class ParserBase {
bool parsing_on_main_thread_; bool parsing_on_main_thread_;
const bool parsing_module_; const bool parsing_module_;
uintptr_t stack_limit_; uintptr_t stack_limit_;
PendingCompilationErrorHandler* pending_error_handler_;
// Parser base's private field members. // Parser base's private field members.
...@@ -1501,7 +1512,6 @@ class ParserBase { ...@@ -1501,7 +1512,6 @@ class ParserBase {
ExpressionClassifier* classifier_; ExpressionClassifier* classifier_;
Scanner* scanner_; Scanner* scanner_;
bool stack_overflow_;
FunctionLiteral::EagerCompileHint default_eager_compile_hint_; FunctionLiteral::EagerCompileHint default_eager_compile_hint_;
......
...@@ -472,7 +472,8 @@ Expression* Parser::NewV8Intrinsic(const AstRawString* name, ...@@ -472,7 +472,8 @@ Expression* Parser::NewV8Intrinsic(const AstRawString* name,
Parser::Parser(ParseInfo* info) Parser::Parser(ParseInfo* info)
: ParserBase<Parser>(info->zone(), &scanner_, info->stack_limit(), : ParserBase<Parser>(info->zone(), &scanner_, info->stack_limit(),
info->extension(), info->GetOrCreateAstValueFactory(), info->extension(), info->GetOrCreateAstValueFactory(),
info->runtime_call_stats(), info->is_module(), true), info->runtime_call_stats(), info->is_module(),
info->pending_error_handler(), true),
scanner_(info->unicode_cache(), use_counts_), scanner_(info->unicode_cache(), use_counts_),
reusable_preparser_(nullptr), reusable_preparser_(nullptr),
mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly. mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly.
...@@ -667,9 +668,8 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) { ...@@ -667,9 +668,8 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
zone()); zone());
ParseModuleItemList(body, &ok); ParseModuleItemList(body, &ok);
ok = ok && ok = ok && module()->Validate(this->scope()->AsModuleScope(),
module()->Validate(this->scope()->AsModuleScope(), pending_error_handler(), zone());
&pending_error_handler_, zone());
} else { } else {
// Don't count the mode in the use counters--give the program a chance // Don't count the mode in the use counters--give the program a chance
// to enable script-wide strict mode below. // to enable script-wide strict mode below.
...@@ -2785,7 +2785,7 @@ Parser::LazyParsingResult Parser::SkipFunction( ...@@ -2785,7 +2785,7 @@ Parser::LazyParsingResult Parser::SkipFunction(
*ok = false; *ok = false;
return kLazyParsingComplete; return kLazyParsingComplete;
} }
if (pending_error_handler_.has_pending_error()) { if (pending_error_handler()->has_pending_error()) {
*ok = false; *ok = false;
return kLazyParsingComplete; return kLazyParsingComplete;
} }
...@@ -3374,17 +3374,6 @@ void Parser::HandleSourceURLComments(Isolate* isolate, Handle<Script> script) { ...@@ -3374,17 +3374,6 @@ void Parser::HandleSourceURLComments(Isolate* isolate, Handle<Script> script) {
} }
} }
void Parser::ReportErrors(Isolate* isolate, Handle<Script> script) {
if (stack_overflow()) {
isolate->StackOverflow();
} else {
DCHECK(pending_error_handler_.has_pending_error());
// Internalize ast values for throwing the pending error.
ast_value_factory()->Internalize(isolate);
pending_error_handler_.ThrowPendingError(isolate, script);
}
}
void Parser::UpdateStatistics(Isolate* isolate, Handle<Script> script) { void Parser::UpdateStatistics(Isolate* isolate, Handle<Script> script) {
// Move statistics to Isolate. // Move statistics to Isolate.
for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount; for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount;
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "src/parsing/preparse-data-format.h" #include "src/parsing/preparse-data-format.h"
#include "src/parsing/preparse-data.h" #include "src/parsing/preparse-data.h"
#include "src/parsing/preparser.h" #include "src/parsing/preparser.h"
#include "src/pending-compilation-error-handler.h"
#include "src/utils.h" #include "src/utils.h"
namespace v8 { namespace v8 {
...@@ -31,6 +30,7 @@ class ParseInfo; ...@@ -31,6 +30,7 @@ class ParseInfo;
class ScriptData; class ScriptData;
class ParserTarget; class ParserTarget;
class ParserTargetScope; class ParserTargetScope;
class PendingCompilationErrorHandler;
class PreParsedScopeData; class PreParsedScopeData;
class FunctionEntry BASE_EMBEDDED { class FunctionEntry BASE_EMBEDDED {
...@@ -210,8 +210,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) { ...@@ -210,8 +210,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
void DeserializeScopeChain(ParseInfo* info, void DeserializeScopeChain(ParseInfo* info,
MaybeHandle<ScopeInfo> maybe_outer_scope_info); MaybeHandle<ScopeInfo> maybe_outer_scope_info);
// Handle errors detected during parsing
void ReportErrors(Isolate* isolate, Handle<Script> script);
// Move statistics to Isolate // Move statistics to Isolate
void UpdateStatistics(Isolate* isolate, Handle<Script> script); void UpdateStatistics(Isolate* isolate, Handle<Script> script);
void HandleSourceURLComments(Isolate* isolate, Handle<Script> script); void HandleSourceURLComments(Isolate* isolate, Handle<Script> script);
...@@ -286,7 +284,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) { ...@@ -286,7 +284,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
if (reusable_preparser_ == nullptr) { if (reusable_preparser_ == nullptr) {
reusable_preparser_ = reusable_preparser_ =
new PreParser(zone(), &scanner_, stack_limit_, ast_value_factory(), new PreParser(zone(), &scanner_, stack_limit_, ast_value_factory(),
&pending_error_handler_, runtime_call_stats_, pending_error_handler(), runtime_call_stats_,
parsing_module_, parsing_on_main_thread_); parsing_module_, parsing_on_main_thread_);
#define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name()); #define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name());
SET_ALLOW(natives); SET_ALLOW(natives);
...@@ -807,9 +805,9 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) { ...@@ -807,9 +805,9 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
// and we want to report the stack overflow later. // and we want to report the stack overflow later.
return; return;
} }
pending_error_handler_.ReportMessageAt(source_location.beg_pos, pending_error_handler()->ReportMessageAt(source_location.beg_pos,
source_location.end_pos, message, source_location.end_pos, message,
arg, error_type); arg, error_type);
} }
V8_INLINE void ReportMessageAt(Scanner::Location source_location, V8_INLINE void ReportMessageAt(Scanner::Location source_location,
...@@ -823,9 +821,9 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) { ...@@ -823,9 +821,9 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
// and we want to report the stack overflow later. // and we want to report the stack overflow later.
return; return;
} }
pending_error_handler_.ReportMessageAt(source_location.beg_pos, pending_error_handler()->ReportMessageAt(source_location.beg_pos,
source_location.end_pos, message, source_location.end_pos, message,
arg, error_type); arg, error_type);
} }
// "null" return type creators. // "null" return type creators.
...@@ -1107,8 +1105,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) { ...@@ -1107,8 +1105,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
ScriptCompiler::CompileOptions compile_options_; ScriptCompiler::CompileOptions compile_options_;
ParseData* cached_parse_data_; ParseData* cached_parse_data_;
PendingCompilationErrorHandler pending_error_handler_;
// Other information which will be stored in Parser and moved to Isolate after // Other information which will be stored in Parser and moved to Isolate after
// parsing. // parsing.
int use_counts_[v8::Isolate::kUseCounterFeatureCount]; int use_counts_[v8::Isolate::kUseCounterFeatureCount];
......
...@@ -40,7 +40,8 @@ bool ParseProgram(ParseInfo* info, Isolate* isolate) { ...@@ -40,7 +40,8 @@ bool ParseProgram(ParseInfo* info, Isolate* isolate) {
result = parser.ParseProgram(isolate, info); result = parser.ParseProgram(isolate, info);
info->set_literal(result); info->set_literal(result);
if (result == nullptr) { if (result == nullptr) {
parser.ReportErrors(isolate, info->script()); info->pending_error_handler()->ReportErrors(isolate, info->script(),
info->ast_value_factory());
} else { } else {
result->scope()->AttachOuterScopeInfo(info, isolate); result->scope()->AttachOuterScopeInfo(info, isolate);
info->set_language_mode(info->literal()->language_mode()); info->set_language_mode(info->literal()->language_mode());
...@@ -74,7 +75,8 @@ bool ParseFunction(ParseInfo* info, Handle<SharedFunctionInfo> shared_info, ...@@ -74,7 +75,8 @@ bool ParseFunction(ParseInfo* info, Handle<SharedFunctionInfo> shared_info,
result = parser.ParseFunction(isolate, info, shared_info); result = parser.ParseFunction(isolate, info, shared_info);
info->set_literal(result); info->set_literal(result);
if (result == nullptr) { if (result == nullptr) {
parser.ReportErrors(isolate, info->script()); info->pending_error_handler()->ReportErrors(isolate, info->script(),
info->ast_value_factory());
} else { } else {
result->scope()->AttachOuterScopeInfo(info, isolate); result->scope()->AttachOuterScopeInfo(info, isolate);
} }
......
...@@ -222,7 +222,7 @@ PreParser::PreParseResult PreParser::PreParseFunction( ...@@ -222,7 +222,7 @@ PreParser::PreParseResult PreParser::PreParseFunction(
} else if (stack_overflow()) { } else if (stack_overflow()) {
return kPreParseStackOverflow; return kPreParseStackOverflow;
} else if (!*ok) { } else if (!*ok) {
DCHECK(pending_error_handler_->has_pending_error()); DCHECK(pending_error_handler()->has_pending_error());
} else { } else {
DCHECK_EQ(Token::RBRACE, scanner()->peek()); DCHECK_EQ(Token::RBRACE, scanner()->peek());
......
...@@ -884,10 +884,10 @@ class PreParser : public ParserBase<PreParser> { ...@@ -884,10 +884,10 @@ class PreParser : public ParserBase<PreParser> {
bool parsing_on_main_thread = true) bool parsing_on_main_thread = true)
: ParserBase<PreParser>(zone, scanner, stack_limit, nullptr, : ParserBase<PreParser>(zone, scanner, stack_limit, nullptr,
ast_value_factory, runtime_call_stats, ast_value_factory, runtime_call_stats,
parsing_module, parsing_on_main_thread), parsing_module, pending_error_handler,
parsing_on_main_thread),
use_counts_(nullptr), use_counts_(nullptr),
track_unresolved_variables_(false), track_unresolved_variables_(false),
pending_error_handler_(pending_error_handler),
produced_preparsed_scope_data_(nullptr) {} produced_preparsed_scope_data_(nullptr) {}
static bool IsPreParser() { return true; } static bool IsPreParser() { return true; }
...@@ -940,6 +940,10 @@ class PreParser : public ParserBase<PreParser> { ...@@ -940,6 +940,10 @@ class PreParser : public ParserBase<PreParser> {
bool AllowsLazyParsingWithoutUnresolvedVariables() const { return false; } bool AllowsLazyParsingWithoutUnresolvedVariables() const { return false; }
bool parse_lazily() const { return false; } bool parse_lazily() const { return false; }
PendingCompilationErrorHandler* pending_error_handler() {
return pending_error_handler_;
}
V8_INLINE LazyParsingResult V8_INLINE LazyParsingResult
SkipFunction(const AstRawString* name, FunctionKind kind, SkipFunction(const AstRawString* name, FunctionKind kind,
FunctionLiteral::FunctionType function_type, FunctionLiteral::FunctionType function_type,
...@@ -1411,9 +1415,9 @@ class PreParser : public ParserBase<PreParser> { ...@@ -1411,9 +1415,9 @@ class PreParser : public ParserBase<PreParser> {
MessageTemplate::Template message, MessageTemplate::Template message,
const char* arg = nullptr, const char* arg = nullptr,
ParseErrorType error_type = kSyntaxError) { ParseErrorType error_type = kSyntaxError) {
pending_error_handler_->ReportMessageAt(source_location.beg_pos, pending_error_handler()->ReportMessageAt(source_location.beg_pos,
source_location.end_pos, message, source_location.end_pos, message,
arg, error_type); arg, error_type);
} }
V8_INLINE void ReportMessageAt(Scanner::Location source_location, V8_INLINE void ReportMessageAt(Scanner::Location source_location,
...@@ -1671,7 +1675,6 @@ class PreParser : public ParserBase<PreParser> { ...@@ -1671,7 +1675,6 @@ class PreParser : public ParserBase<PreParser> {
int* use_counts_; int* use_counts_;
bool track_unresolved_variables_; bool track_unresolved_variables_;
PreParserLogger log_; PreParserLogger log_;
PendingCompilationErrorHandler* pending_error_handler_;
ProducedPreParsedScopeData* produced_preparsed_scope_data_; ProducedPreParsedScopeData* produced_preparsed_scope_data_;
}; };
......
...@@ -14,6 +14,19 @@ ...@@ -14,6 +14,19 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
void PendingCompilationErrorHandler::ReportErrors(
Isolate* isolate, Handle<Script> script,
AstValueFactory* ast_value_factory) {
if (stack_overflow()) {
isolate->StackOverflow();
} else {
DCHECK(has_pending_error());
// Internalize ast values for throwing the pending error.
ast_value_factory->Internalize(isolate);
ThrowPendingError(isolate, script);
}
}
Handle<String> PendingCompilationErrorHandler::ArgumentString( Handle<String> PendingCompilationErrorHandler::ArgumentString(
Isolate* isolate) { Isolate* isolate) {
if (arg_ != nullptr) return arg_->string(); if (arg_ != nullptr) return arg_->string();
......
...@@ -14,6 +14,7 @@ namespace v8 { ...@@ -14,6 +14,7 @@ namespace v8 {
namespace internal { namespace internal {
class AstRawString; class AstRawString;
class AstValueFactory;
class Isolate; class Isolate;
class Script; class Script;
...@@ -23,6 +24,7 @@ class PendingCompilationErrorHandler { ...@@ -23,6 +24,7 @@ class PendingCompilationErrorHandler {
public: public:
PendingCompilationErrorHandler() PendingCompilationErrorHandler()
: has_pending_error_(false), : has_pending_error_(false),
stack_overflow_(false),
start_position_(-1), start_position_(-1),
end_position_(-1), end_position_(-1),
message_(MessageTemplate::kNone), message_(MessageTemplate::kNone),
...@@ -58,15 +60,27 @@ class PendingCompilationErrorHandler { ...@@ -58,15 +60,27 @@ class PendingCompilationErrorHandler {
error_type_ = error_type; error_type_ = error_type;
} }
bool stack_overflow() const { return stack_overflow_; }
void set_stack_overflow() {
has_pending_error_ = true;
stack_overflow_ = true;
}
bool has_pending_error() const { return has_pending_error_; } bool has_pending_error() const { return has_pending_error_; }
void ThrowPendingError(Isolate* isolate, Handle<Script> script); // Handle errors detected during parsing.
void ReportErrors(Isolate* isolate, Handle<Script> script,
AstValueFactory* ast_value_factory);
Handle<String> FormatMessage(Isolate* isolate); Handle<String> FormatMessage(Isolate* isolate);
private: private:
void ThrowPendingError(Isolate* isolate, Handle<Script> script);
Handle<String> ArgumentString(Isolate* isolate); Handle<String> ArgumentString(Isolate* isolate);
bool has_pending_error_; bool has_pending_error_;
bool stack_overflow_;
int start_position_; int start_position_;
int end_position_; int end_position_;
MessageTemplate::Template message_; MessageTemplate::Template message_;
......
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