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

Unified Diff: src/typing.cc

Issue 300103005: Split StringLiteral from Literal. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: number literals Created 6 years, 7 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/prettyprinter.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/typing.cc
diff --git a/src/typing.cc b/src/typing.cc
index 434aff349055d179256a501d2b18b6a137afaade..fdc4250f7bf7eafe57fa9679cd67cd4349de53b5 100644
--- a/src/typing.cc
+++ b/src/typing.cc
@@ -389,6 +389,16 @@ void AstTyper::VisitLiteral(Literal* expr) {
}
+void AstTyper::VisitStringLiteral(StringLiteral* expr) {
+ VisitLiteral(expr);
+}
+
+
+void AstTyper::VisitNumberLiteral(NumberLiteral* expr) {
+ VisitLiteral(expr);
+}
+
+
void AstTyper::VisitRegExpLiteral(RegExpLiteral* expr) {
NarrowType(expr, Bounds(Type::RegExp(zone())));
}
@@ -434,8 +444,8 @@ void AstTyper::VisitAssignment(Assignment* expr) {
expr->set_is_uninitialized(oracle()->StoreIsUninitialized(id));
if (!expr->IsUninitialized()) {
if (prop->key()->IsPropertyName()) {
- Literal* lit_key = prop->key()->AsLiteral();
- ASSERT(lit_key != NULL && lit_key->value()->IsString());
+ StringLiteral* lit_key = prop->key()->AsStringLiteral();
+ ASSERT(lit_key != NULL);
Handle<String> name = Handle<String>::cast(lit_key->value());
oracle()->AssignmentReceiverTypes(id, name, expr->GetReceiverTypes());
} else {
@@ -482,9 +492,9 @@ void AstTyper::VisitProperty(Property* expr) {
expr->set_is_uninitialized(oracle()->LoadIsUninitialized(id));
if (!expr->IsUninitialized()) {
if (expr->key()->IsPropertyName()) {
- Literal* lit_key = expr->key()->AsLiteral();
- ASSERT(lit_key != NULL && lit_key->value()->IsString());
- Handle<String> name = Handle<String>::cast(lit_key->value());
+ StringLiteral* lit_key = expr->key()->AsStringLiteral();
+ ASSERT(lit_key != NULL);
+ Handle<String> name = lit_key->string();
bool is_prototype;
oracle()->PropertyReceiverTypes(
id, name, expr->GetReceiverTypes(), &is_prototype);
« no previous file with comments | « src/prettyprinter.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698