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/crankshaft/typing.h" | 5 #include "src/crankshaft/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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 NarrowType(expr, Bounds(type)); | 390 NarrowType(expr, Bounds(type)); |
391 } | 391 } |
392 | 392 |
393 | 393 |
394 void AstTyper::VisitRegExpLiteral(RegExpLiteral* expr) { | 394 void AstTyper::VisitRegExpLiteral(RegExpLiteral* expr) { |
395 // TODO(rossberg): Reintroduce RegExp type. | 395 // TODO(rossberg): Reintroduce RegExp type. |
396 NarrowType(expr, Bounds(Type::Object(zone()))); | 396 NarrowType(expr, Bounds(Type::Object(zone()))); |
397 } | 397 } |
398 | 398 |
399 | 399 |
| 400 void AstTyper::VisitAssignmentPattern(AssignmentPattern* expr) { |
| 401 Visit(expr->expression()); |
| 402 } |
| 403 |
| 404 |
400 void AstTyper::VisitObjectLiteral(ObjectLiteral* expr) { | 405 void AstTyper::VisitObjectLiteral(ObjectLiteral* expr) { |
401 ZoneList<ObjectLiteral::Property*>* properties = expr->properties(); | 406 ZoneList<ObjectLiteral::Property*>* properties = expr->properties(); |
402 for (int i = 0; i < properties->length(); ++i) { | 407 for (int i = 0; i < properties->length(); ++i) { |
403 ObjectLiteral::Property* prop = properties->at(i); | 408 ObjectLiteral::Property* prop = properties->at(i); |
404 | 409 |
405 // Collect type feedback. | 410 // Collect type feedback. |
406 if ((prop->kind() == ObjectLiteral::Property::MATERIALIZED_LITERAL && | 411 if ((prop->kind() == ObjectLiteral::Property::MATERIALIZED_LITERAL && |
407 !CompileTimeValue::IsCompileTimeValue(prop->value())) || | 412 !CompileTimeValue::IsCompileTimeValue(prop->value())) || |
408 prop->kind() == ObjectLiteral::Property::COMPUTED) { | 413 prop->kind() == ObjectLiteral::Property::COMPUTED) { |
409 if (!prop->is_computed_name() && | 414 if (!prop->is_computed_name() && |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 void AstTyper::VisitImportDeclaration(ImportDeclaration* declaration) { | 818 void AstTyper::VisitImportDeclaration(ImportDeclaration* declaration) { |
814 } | 819 } |
815 | 820 |
816 | 821 |
817 void AstTyper::VisitExportDeclaration(ExportDeclaration* declaration) { | 822 void AstTyper::VisitExportDeclaration(ExportDeclaration* declaration) { |
818 } | 823 } |
819 | 824 |
820 | 825 |
821 } // namespace internal | 826 } // namespace internal |
822 } // namespace v8 | 827 } // namespace v8 |
OLD | NEW |