OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 ASSERT(check_type_ != RECEIVER_MAP_CHECK); | 658 ASSERT(check_type_ != RECEIVER_MAP_CHECK); |
659 holder_ = Handle<JSObject>( | 659 holder_ = Handle<JSObject>( |
660 oracle->GetPrototypeForPrimitiveCheck(check_type_)); | 660 oracle->GetPrototypeForPrimitiveCheck(check_type_)); |
661 map = Handle<Map>(holder_->map()); | 661 map = Handle<Map>(holder_->map()); |
662 } | 662 } |
663 is_monomorphic_ = ComputeTarget(map, name); | 663 is_monomorphic_ = ComputeTarget(map, name); |
664 } | 664 } |
665 } | 665 } |
666 | 666 |
667 | 667 |
668 void BinaryOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | |
669 TypeInfo left = oracle->BinaryType(this, TypeFeedbackOracle::LEFT); | |
670 TypeInfo right = oracle->BinaryType(this, TypeFeedbackOracle::RIGHT); | |
671 is_smi_only_ = left.IsSmi() && right.IsSmi(); | |
672 } | |
673 | |
674 | |
675 void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 668 void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
676 TypeInfo left = oracle->CompareType(this, TypeFeedbackOracle::LEFT); | 669 TypeInfo info = oracle->CompareType(this); |
677 TypeInfo right = oracle->CompareType(this, TypeFeedbackOracle::RIGHT); | 670 if (info.IsSmi()) { |
678 if (left.IsSmi() && right.IsSmi()) { | |
679 compare_type_ = SMI_ONLY; | 671 compare_type_ = SMI_ONLY; |
680 } else if (left.IsNonPrimitive() && right.IsNonPrimitive()) { | 672 } else if (info.IsNonPrimitive()) { |
681 compare_type_ = OBJECT_ONLY; | 673 compare_type_ = OBJECT_ONLY; |
682 } else { | 674 } else { |
683 ASSERT(compare_type_ == NONE); | 675 ASSERT(compare_type_ == NONE); |
684 } | 676 } |
685 } | 677 } |
686 | 678 |
687 | 679 |
688 // ---------------------------------------------------------------------------- | 680 // ---------------------------------------------------------------------------- |
689 // Implementation of AstVisitor | 681 // Implementation of AstVisitor |
690 | 682 |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 | 1049 |
1058 CaseClause::CaseClause(Expression* label, | 1050 CaseClause::CaseClause(Expression* label, |
1059 ZoneList<Statement*>* statements, | 1051 ZoneList<Statement*>* statements, |
1060 int pos) | 1052 int pos) |
1061 : label_(label), | 1053 : label_(label), |
1062 statements_(statements), | 1054 statements_(statements), |
1063 position_(pos), | 1055 position_(pos), |
1064 compare_type_(NONE) {} | 1056 compare_type_(NONE) {} |
1065 | 1057 |
1066 } } // namespace v8::internal | 1058 } } // namespace v8::internal |
OLD | NEW |