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

Side by Side Diff: src/ast.cc

Issue 6172001: Revert r6194: Clean up code for type feedback a bit.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ast.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 } 642 }
643 #endif 643 #endif
644 if (receiver_types_ != NULL && receiver_types_->length() > 0) { 644 if (receiver_types_ != NULL && receiver_types_->length() > 0) {
645 Handle<Map> type = receiver_types_->at(0); 645 Handle<Map> type = receiver_types_->at(0);
646 is_monomorphic_ = oracle->CallIsMonomorphic(this); 646 is_monomorphic_ = oracle->CallIsMonomorphic(this);
647 if (is_monomorphic_) is_monomorphic_ = ComputeTarget(type, name); 647 if (is_monomorphic_) is_monomorphic_ = ComputeTarget(type, name);
648 } 648 }
649 } 649 }
650 650
651 651
652 void BinaryOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
653 TypeInfo left = oracle->BinaryType(this, TypeFeedbackOracle::LEFT);
654 TypeInfo right = oracle->BinaryType(this, TypeFeedbackOracle::RIGHT);
655 is_smi_only_ = left.IsSmi() && right.IsSmi();
656 }
657
658
652 void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { 659 void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
653 TypeInfo info = oracle->CompareType(this); 660 TypeInfo left = oracle->CompareType(this, TypeFeedbackOracle::LEFT);
654 if (info.IsSmi()) { 661 TypeInfo right = oracle->CompareType(this, TypeFeedbackOracle::RIGHT);
662 if (left.IsSmi() && right.IsSmi()) {
655 compare_type_ = SMI_ONLY; 663 compare_type_ = SMI_ONLY;
656 } else if (info.IsNonPrimitive()) { 664 } else if (left.IsNonPrimitive() && right.IsNonPrimitive()) {
657 compare_type_ = OBJECT_ONLY; 665 compare_type_ = OBJECT_ONLY;
658 } else { 666 } else {
659 ASSERT(compare_type_ == NONE); 667 ASSERT(compare_type_ == NONE);
660 } 668 }
661 } 669 }
662 670
663 671
664 // ---------------------------------------------------------------------------- 672 // ----------------------------------------------------------------------------
665 // Implementation of AstVisitor 673 // Implementation of AstVisitor
666 674
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 1041
1034 CaseClause::CaseClause(Expression* label, 1042 CaseClause::CaseClause(Expression* label,
1035 ZoneList<Statement*>* statements, 1043 ZoneList<Statement*>* statements,
1036 int pos) 1044 int pos)
1037 : label_(label), 1045 : label_(label),
1038 statements_(statements), 1046 statements_(statements),
1039 position_(pos), 1047 position_(pos),
1040 compare_type_(NONE) {} 1048 compare_type_(NONE) {}
1041 1049
1042 } } // namespace v8::internal 1050 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698