OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/typing.h" | 5 #include "src/typing.h" |
6 | 6 |
7 #include "src/frames.h" | 7 #include "src/frames.h" |
8 #include "src/frames-inl.h" | 8 #include "src/frames-inl.h" |
9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
10 #include "src/parser.h" // for CompileTimeValue; TODO(rossberg): should move | 10 #include "src/parser.h" // for CompileTimeValue; TODO(rossberg): should move |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 } | 387 } |
388 | 388 |
389 | 389 |
390 void AstTyper::VisitLiteral(Literal* expr) { | 390 void AstTyper::VisitLiteral(Literal* expr) { |
391 Type* type = Type::Constant(expr->value(), zone()); | 391 Type* type = Type::Constant(expr->value(), zone()); |
392 NarrowType(expr, Bounds(type)); | 392 NarrowType(expr, Bounds(type)); |
393 } | 393 } |
394 | 394 |
395 | 395 |
396 void AstTyper::VisitRegExpLiteral(RegExpLiteral* expr) { | 396 void AstTyper::VisitRegExpLiteral(RegExpLiteral* expr) { |
397 NarrowType(expr, Bounds(Type::RegExp(zone()))); | 397 // TODO(rossberg): Reintroduce RegExp type. |
| 398 NarrowType(expr, Bounds(Type::Object(zone()))); |
398 } | 399 } |
399 | 400 |
400 | 401 |
401 void AstTyper::VisitObjectLiteral(ObjectLiteral* expr) { | 402 void AstTyper::VisitObjectLiteral(ObjectLiteral* expr) { |
402 ZoneList<ObjectLiteral::Property*>* properties = expr->properties(); | 403 ZoneList<ObjectLiteral::Property*>* properties = expr->properties(); |
403 for (int i = 0; i < properties->length(); ++i) { | 404 for (int i = 0; i < properties->length(); ++i) { |
404 ObjectLiteral::Property* prop = properties->at(i); | 405 ObjectLiteral::Property* prop = properties->at(i); |
405 | 406 |
406 // Collect type feedback. | 407 // Collect type feedback. |
407 if ((prop->kind() == ObjectLiteral::Property::MATERIALIZED_LITERAL && | 408 if ((prop->kind() == ObjectLiteral::Property::MATERIALIZED_LITERAL && |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 void AstTyper::VisitModuleUrl(ModuleUrl* module) { | 806 void AstTyper::VisitModuleUrl(ModuleUrl* module) { |
806 } | 807 } |
807 | 808 |
808 | 809 |
809 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { | 810 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { |
810 RECURSE(Visit(stmt->body())); | 811 RECURSE(Visit(stmt->body())); |
811 } | 812 } |
812 | 813 |
813 | 814 |
814 } } // namespace v8::internal | 815 } } // namespace v8::internal |
OLD | NEW |