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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 389 |
390 // Collect type feedback. | 390 // Collect type feedback. |
391 if ((prop->kind() == ObjectLiteral::Property::MATERIALIZED_LITERAL && | 391 if ((prop->kind() == ObjectLiteral::Property::MATERIALIZED_LITERAL && |
392 !CompileTimeValue::IsCompileTimeValue(prop->value())) || | 392 !CompileTimeValue::IsCompileTimeValue(prop->value())) || |
393 prop->kind() == ObjectLiteral::Property::COMPUTED) { | 393 prop->kind() == ObjectLiteral::Property::COMPUTED) { |
394 if (!prop->is_computed_name() && | 394 if (!prop->is_computed_name() && |
395 prop->key()->AsLiteral()->value()->IsInternalizedString() && | 395 prop->key()->AsLiteral()->value()->IsInternalizedString() && |
396 prop->emit_store()) { | 396 prop->emit_store()) { |
397 // Record type feed back for the property. | 397 // Record type feed back for the property. |
398 TypeFeedbackId id = prop->key()->AsLiteral()->LiteralFeedbackId(); | 398 TypeFeedbackId id = prop->key()->AsLiteral()->LiteralFeedbackId(); |
| 399 FeedbackVectorICSlot slot = prop->GetSlot(); |
399 SmallMapList maps; | 400 SmallMapList maps; |
400 oracle()->CollectReceiverTypes(id, &maps); | 401 if (FLAG_vector_stores) { |
| 402 oracle()->CollectReceiverTypes(slot, &maps); |
| 403 } else { |
| 404 oracle()->CollectReceiverTypes(id, &maps); |
| 405 } |
401 prop->set_receiver_type(maps.length() == 1 ? maps.at(0) | 406 prop->set_receiver_type(maps.length() == 1 ? maps.at(0) |
402 : Handle<Map>::null()); | 407 : Handle<Map>::null()); |
403 } | 408 } |
404 } | 409 } |
405 | 410 |
406 RECURSE(Visit(prop->value())); | 411 RECURSE(Visit(prop->value())); |
407 } | 412 } |
408 | 413 |
409 NarrowType(expr, Bounds(Type::Object(zone()))); | 414 NarrowType(expr, Bounds(Type::Object(zone()))); |
410 } | 415 } |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 break; | 610 break; |
606 default: | 611 default: |
607 UNREACHABLE(); | 612 UNREACHABLE(); |
608 } | 613 } |
609 } | 614 } |
610 | 615 |
611 | 616 |
612 void AstTyper::VisitCountOperation(CountOperation* expr) { | 617 void AstTyper::VisitCountOperation(CountOperation* expr) { |
613 // Collect type feedback. | 618 // Collect type feedback. |
614 TypeFeedbackId store_id = expr->CountStoreFeedbackId(); | 619 TypeFeedbackId store_id = expr->CountStoreFeedbackId(); |
| 620 FeedbackVectorICSlot slot = expr->CountSlot(); |
615 KeyedAccessStoreMode store_mode; | 621 KeyedAccessStoreMode store_mode; |
616 IcCheckType key_type; | 622 IcCheckType key_type; |
617 oracle()->GetStoreModeAndKeyType(store_id, &store_mode, &key_type); | 623 if (FLAG_vector_stores) { |
| 624 oracle()->GetStoreModeAndKeyType(slot, &store_mode, &key_type); |
| 625 oracle()->CountReceiverTypes(slot, expr->GetReceiverTypes()); |
| 626 } else { |
| 627 oracle()->GetStoreModeAndKeyType(store_id, &store_mode, &key_type); |
| 628 oracle()->CountReceiverTypes(store_id, expr->GetReceiverTypes()); |
| 629 } |
618 expr->set_store_mode(store_mode); | 630 expr->set_store_mode(store_mode); |
619 expr->set_key_type(key_type); | 631 expr->set_key_type(key_type); |
620 oracle()->CountReceiverTypes(store_id, expr->GetReceiverTypes()); | |
621 expr->set_type(oracle()->CountType(expr->CountBinOpFeedbackId())); | 632 expr->set_type(oracle()->CountType(expr->CountBinOpFeedbackId())); |
622 // TODO(rossberg): merge the count type with the generic expression type. | 633 // TODO(rossberg): merge the count type with the generic expression type. |
623 | 634 |
624 RECURSE(Visit(expr->expression())); | 635 RECURSE(Visit(expr->expression())); |
625 | 636 |
626 NarrowType(expr, Bounds(Type::SignedSmall(zone()), Type::Number(zone()))); | 637 NarrowType(expr, Bounds(Type::SignedSmall(zone()), Type::Number(zone()))); |
627 | 638 |
628 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 639 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
629 if (proxy != NULL && proxy->var()->IsStackAllocated()) { | 640 if (proxy != NULL && proxy->var()->IsStackAllocated()) { |
630 store_.Seq(variable_index(proxy->var()), Effect(expr->bounds())); | 641 store_.Seq(variable_index(proxy->var()), Effect(expr->bounds())); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 void AstTyper::VisitImportDeclaration(ImportDeclaration* declaration) { | 800 void AstTyper::VisitImportDeclaration(ImportDeclaration* declaration) { |
790 } | 801 } |
791 | 802 |
792 | 803 |
793 void AstTyper::VisitExportDeclaration(ExportDeclaration* declaration) { | 804 void AstTyper::VisitExportDeclaration(ExportDeclaration* declaration) { |
794 } | 805 } |
795 | 806 |
796 | 807 |
797 } // namespace internal | 808 } // namespace internal |
798 } // namespace v8 | 809 } // namespace v8 |
OLD | NEW |