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

Unified Diff: src/parsing/parser.cc

Issue 2485423002: Adding smi cache (Closed)
Patch Set: Changed signature to uint Created 4 years, 1 month 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
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 92822d477aacff987d06f3f74fd987e57232f069..2eacfed96c4029f1d1d2211a60e3e69d064e6957 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -502,7 +502,7 @@ Literal* Parser::ExpressionFromLiteral(Token::Value token, int pos) {
case Token::FALSE_LITERAL:
return factory()->NewBooleanLiteral(false, pos);
case Token::SMI: {
- int value = scanner()->smi_value();
+ uint32_t value = scanner()->smi_value();
return factory()->NewSmiLiteral(value, pos);
}
case Token::NUMBER: {
@@ -3922,8 +3922,8 @@ Expression* Parser::CloseTemplateLiteral(TemplateLiteralState* state, int start,
zone());
// Ensure hash is suitable as a Smi value
- Smi* hash_obj = Smi::cast(Internals::IntToSmi(static_cast<int>(hash)));
- args->Add(factory()->NewSmiLiteral(hash_obj->value(), pos), zone());
+ DCHECK(Smi::IsValid(static_cast<intptr_t>(hash)));
vogelheim 2016/11/09 15:04:10 I don't get this change. What does this do, and h
vogelheim 2016/11/09 15:05:18 Ah, I see patch set 4 resolves this.
+ args->Add(factory()->NewSmiLiteral(hash, pos), zone());
Expression* call_site = factory()->NewCallRuntime(
Context::GET_TEMPLATE_CALL_SITE_INDEX, args, start);

Powered by Google App Engine
This is Rietveld 408576698