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

Unified Diff: src/preparser.h

Issue 345513003: Revert "Parser: Delay internalizing strings and values." (r21841) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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/parser.cc ('k') | src/prettyprinter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index c3dea60108885eb00d869eed378daa576398af0a..94f42797740cd27bc31726dd03341fee360a305d 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -149,8 +149,7 @@ class ParserBase : public Traits {
FunctionState** function_state_stack,
typename Traits::Type::Scope** scope_stack,
typename Traits::Type::Scope* scope,
- typename Traits::Type::Zone* zone = NULL,
- AstValueFactory* ast_value_factory = NULL);
+ typename Traits::Type::Zone* zone = NULL);
~FunctionState();
int NextMaterializedLiteralIndex() {
@@ -357,9 +356,7 @@ class ParserBase : public Traits {
void ReportMessageAt(Scanner::Location location, const char* message,
bool is_reference_error = false) {
- Traits::ReportMessageAt(location, message,
- reinterpret_cast<const char*>(NULL),
- is_reference_error);
+ Traits::ReportMessageAt(location, message, NULL, is_reference_error);
}
void ReportUnexpectedToken(Token::Value token);
@@ -746,9 +743,9 @@ class PreParserScope {
class PreParserFactory {
public:
- explicit PreParserFactory(void* extra_param1, void* extra_param2) {}
- PreParserExpression NewStringLiteral(PreParserIdentifier identifier,
- int pos) {
+ explicit PreParserFactory(void* extra_param) {}
+ PreParserExpression NewLiteral(PreParserIdentifier identifier,
+ int pos) {
return PreParserExpression::Default();
}
PreParserExpression NewNumberLiteral(double number,
@@ -1000,8 +997,8 @@ class PreParserTraits {
// Producing data during the recursive descent.
PreParserIdentifier GetSymbol(Scanner* scanner);
-
- static PreParserIdentifier GetNextSymbol(Scanner* scanner) {
+ static PreParserIdentifier NextLiteralString(Scanner* scanner,
+ PretenureFlag tenured) {
return PreParserIdentifier::Default();
}
@@ -1189,8 +1186,7 @@ ParserBase<Traits>::FunctionState::FunctionState(
FunctionState** function_state_stack,
typename Traits::Type::Scope** scope_stack,
typename Traits::Type::Scope* scope,
- typename Traits::Type::Zone* extra_param,
- AstValueFactory* ast_value_factory)
+ typename Traits::Type::Zone* extra_param)
: next_materialized_literal_index_(JSFunction::kLiteralsPrefixSize),
next_handler_index_(0),
expected_property_count_(0),
@@ -1202,7 +1198,7 @@ ParserBase<Traits>::FunctionState::FunctionState(
outer_scope_(*scope_stack),
saved_ast_node_id_(0),
extra_param_(extra_param),
- factory_(extra_param, ast_value_factory) {
+ factory_(extra_param) {
*scope_stack_ = scope;
*function_state_stack = this;
Traits::SetUpFunctionState(this, extra_param);
@@ -1328,14 +1324,14 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseRegExpLiteral(
int literal_index = function_state_->NextMaterializedLiteralIndex();
- IdentifierT js_pattern = this->GetNextSymbol(scanner());
+ IdentifierT js_pattern = this->NextLiteralString(scanner(), TENURED);
if (!scanner()->ScanRegExpFlags()) {
Next();
ReportMessage("invalid_regexp_flags");
*ok = false;
return Traits::EmptyExpression();
}
- IdentifierT js_flags = this->GetNextSymbol(scanner());
+ IdentifierT js_flags = this->NextLiteralString(scanner(), TENURED);
Next();
return factory()->NewRegExpLiteral(js_pattern, js_flags, literal_index, pos);
}
@@ -1580,7 +1576,7 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseObjectLiteral(
}
// Failed to parse as get/set property, so it's just a normal property
// (which might be called "get" or "set" or something else).
- key = factory()->NewStringLiteral(id, next_pos);
+ key = factory()->NewLiteral(id, next_pos);
break;
}
case Token::STRING: {
@@ -1592,7 +1588,7 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseObjectLiteral(
key = factory()->NewNumberLiteral(index, next_pos);
break;
}
- key = factory()->NewStringLiteral(string, next_pos);
+ key = factory()->NewLiteral(string, next_pos);
break;
}
case Token::NUMBER: {
@@ -1605,7 +1601,7 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseObjectLiteral(
if (Token::IsKeyword(next)) {
Consume(next);
IdentifierT string = this->GetSymbol(scanner_);
- key = factory()->NewStringLiteral(string, next_pos);
+ key = factory()->NewLiteral(string, next_pos);
} else {
Token::Value next = Next();
ReportUnexpectedToken(next);
@@ -1974,7 +1970,7 @@ ParserBase<Traits>::ParseLeftHandSideExpression(bool* ok) {
int pos = position();
IdentifierT name = ParseIdentifierName(CHECK_OK);
result = factory()->NewProperty(
- result, factory()->NewStringLiteral(name, pos), pos);
+ result, factory()->NewLiteral(name, pos), pos);
if (fni_ != NULL) this->PushLiteralName(fni_, name);
break;
}
@@ -2097,7 +2093,7 @@ ParserBase<Traits>::ParseMemberExpressionContinuation(ExpressionT expression,
int pos = position();
IdentifierT name = ParseIdentifierName(CHECK_OK);
expression = factory()->NewProperty(
- expression, factory()->NewStringLiteral(name, pos), pos);
+ expression, factory()->NewLiteral(name, pos), pos);
if (fni_ != NULL) {
this->PushLiteralName(fni_, name);
}
« no previous file with comments | « src/parser.cc ('k') | src/prettyprinter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698