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

Side by Side Diff: src/ast.cc

Issue 6075012: 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
659 void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { 652 void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
660 TypeInfo left = oracle->CompareType(this, TypeFeedbackOracle::LEFT); 653 TypeInfo info = oracle->CompareType(this);
661 TypeInfo right = oracle->CompareType(this, TypeFeedbackOracle::RIGHT); 654 if (info.IsSmi()) {
662 if (left.IsSmi() && right.IsSmi()) {
663 compare_type_ = SMI_ONLY; 655 compare_type_ = SMI_ONLY;
664 } else if (left.IsNonPrimitive() && right.IsNonPrimitive()) { 656 } else if (info.IsNonPrimitive()) {
665 compare_type_ = OBJECT_ONLY; 657 compare_type_ = OBJECT_ONLY;
666 } else { 658 } else {
667 ASSERT(compare_type_ == NONE); 659 ASSERT(compare_type_ == NONE);
668 } 660 }
669 } 661 }
670 662
671 663
672 // ---------------------------------------------------------------------------- 664 // ----------------------------------------------------------------------------
673 // Implementation of AstVisitor 665 // Implementation of AstVisitor
674 666
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 1033
1042 CaseClause::CaseClause(Expression* label, 1034 CaseClause::CaseClause(Expression* label,
1043 ZoneList<Statement*>* statements, 1035 ZoneList<Statement*>* statements,
1044 int pos) 1036 int pos)
1045 : label_(label), 1037 : label_(label),
1046 statements_(statements), 1038 statements_(statements),
1047 position_(pos), 1039 position_(pos),
1048 compare_type_(NONE) {} 1040 compare_type_(NONE) {}
1049 1041
1050 } } // namespace v8::internal 1042 } } // 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