Commit ea9e9d4e authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

[parser] Remove dead from code in PreParser

Also a few bits of related dead code in Parser.

Bug: v8:6092
Change-Id: Ie30aa1bd769b78fec2563fc6ba82ef0bcd7668bb
Reviewed-on: https://chromium-review.googlesource.com/639311Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47688}
parent 9ee7e4ec
......@@ -1870,7 +1870,7 @@ typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParsePrimaryExpression(
case Token::TEMPLATE_SPAN:
case Token::TEMPLATE_TAIL:
BindingPatternUnexpectedToken();
return ParseTemplateLiteral(impl()->NoTemplateTag(), beg_pos, false, ok);
return ParseTemplateLiteral(impl()->NullExpression(), beg_pos, false, ok);
case Token::MOD:
if (allow_natives() || extension_ != NULL) {
......
......@@ -3178,7 +3178,7 @@ void Parser::DeclareClassProperty(const AstRawString* class_name,
ClassInfo* class_info, bool* ok) {
if (is_constructor) {
DCHECK(!class_info->constructor);
class_info->constructor = GetPropertyValue(property)->AsFunctionLiteral();
class_info->constructor = property->value()->AsFunctionLiteral();
DCHECK_NOT_NULL(class_info->constructor);
class_info->constructor->set_raw_name(
class_name != nullptr ? ast_value_factory()->NewConsString(class_name)
......
......@@ -694,10 +694,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
return arg == nullptr || literal->raw_value()->AsString() == arg;
}
V8_INLINE static Expression* GetPropertyValue(LiteralProperty* property) {
return property->value();
}
V8_INLINE void GetDefaultStrings(
const AstRawString** default_string,
const AstRawString** star_default_star_string) {
......@@ -986,11 +982,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
Scanner::Location* duplicate_loc,
bool* ok);
V8_INLINE Expression* NoTemplateTag() { return NULL; }
V8_INLINE static bool IsTaggedTemplate(const Expression* tag) {
return tag != NULL;
}
Expression* ExpressionListToExpression(ZoneList<Expression*>* args);
void SetFunctionNameFromPropertyName(LiteralProperty* property,
......
......@@ -135,8 +135,7 @@ class PreParserExpression {
}
static PreParserExpression NewTargetExpression() {
return PreParserExpression(TypeField::encode(kExpression) |
ExpressionTypeField::encode(kNewTarget));
return PreParserExpression::Default();
}
static PreParserExpression ObjectLiteral(
......@@ -199,12 +198,6 @@ class PreParserExpression {
ExpressionTypeField::encode(kSuperCallReference));
}
static PreParserExpression NoTemplateTag() {
return PreParserExpression(
TypeField::encode(kExpression) |
ExpressionTypeField::encode(kNoTemplateTagExpression));
}
bool IsNull() const { return TypeField::decode(code_) == kNull; }
bool IsIdentifier() const {
......@@ -278,11 +271,6 @@ class PreParserExpression {
bool IsFunctionLiteral() const { return false; }
bool IsCallNew() const { return false; }
bool IsNoTemplateTag() const {
return TypeField::decode(code_) == kExpression &&
ExpressionTypeField::decode(code_) == kNoTemplateTagExpression;
}
bool IsSpread() const {
return TypeField::decode(code_) == kSpreadExpression;
}
......@@ -317,9 +305,7 @@ class PreParserExpression {
kCallExpression,
kCallEvalExpression,
kSuperCallReference,
kNoTemplateTagExpression,
kAssignment,
kNewTarget
kAssignment
};
explicit PreParserExpression(uint32_t expression_code,
......@@ -764,14 +750,6 @@ class PreParserFactory {
return PreParserExpression::Default();
}
// Return the object itself as AstVisitor and implement the needed
// dummy method right in this class.
PreParserFactory* visitor() { return this; }
int* ast_properties() {
static int dummy = 42;
return &dummy;
}
private:
// For creating VariableProxy objects (if
// PreParser::track_unresolved_variables_ is used).
......@@ -968,9 +946,6 @@ class PreParser : public ParserBase<PreParser> {
}
V8_INLINE void SetAsmModule() {}
V8_INLINE void MarkCollectedTailCallExpressions() {}
V8_INLINE void MarkTailPosition(const PreParserExpression& expression) {}
V8_INLINE PreParserExpression SpreadCall(const PreParserExpression& function,
const PreParserExpressionList& args,
int pos,
......@@ -1240,11 +1215,6 @@ class PreParser : public ParserBase<PreParser> {
return statement.IsStringLiteral();
}
V8_INLINE static PreParserExpression GetPropertyValue(
const PreParserExpression& property) {
return PreParserExpression::Default();
}
V8_INLINE static void GetDefaultStrings(
PreParserIdentifier* default_string,
PreParserIdentifier* star_default_star_string) {}
......@@ -1630,14 +1600,6 @@ class PreParser : public ParserBase<PreParser> {
}
}
V8_INLINE PreParserExpression NoTemplateTag() {
return PreParserExpression::NoTemplateTag();
}
V8_INLINE static bool IsTaggedTemplate(const PreParserExpression& tag) {
return !tag.IsNoTemplateTag();
}
V8_INLINE PreParserExpression
ExpressionListToExpression(const PreParserExpressionList& args) {
return PreParserExpression::Default(args.variables_);
......
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