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

Side by Side Diff: src/compiler.cc

Issue 342019: Add binary operations to fast compiler. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 1 month 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/arm/fast-codegen-arm.cc ('k') | src/fast-codegen.h » ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 } 842 }
843 843
844 844
845 void CodeGenSelector::VisitCountOperation(CountOperation* expr) { 845 void CodeGenSelector::VisitCountOperation(CountOperation* expr) {
846 BAILOUT("CountOperation"); 846 BAILOUT("CountOperation");
847 } 847 }
848 848
849 849
850 void CodeGenSelector::VisitBinaryOperation(BinaryOperation* expr) { 850 void CodeGenSelector::VisitBinaryOperation(BinaryOperation* expr) {
851 switch (expr->op()) { 851 switch (expr->op()) {
852 case Token::COMMA:
853 VisitAsEffect(expr->left());
854 CHECK_BAILOUT;
855 Visit(expr->right()); // Location is the same as the parent location.
856 break;
857
852 case Token::OR: 858 case Token::OR:
853 VisitAsValue(expr->left()); 859 VisitAsValue(expr->left());
854 CHECK_BAILOUT; 860 CHECK_BAILOUT;
855 // The location for the right subexpression is the same as for the 861 // The location for the right subexpression is the same as for the
856 // whole expression so we call Visit directly. 862 // whole expression so we call Visit directly.
857 Visit(expr->right()); 863 Visit(expr->right());
858 break; 864 break;
859 865
866 case Token::ADD:
867 case Token::SUB:
868 case Token::DIV:
869 case Token::MOD:
870 case Token::MUL:
871 case Token::BIT_OR:
872 case Token::BIT_AND:
873 case Token::BIT_XOR:
874 case Token::SHL:
875 case Token::SHR:
876 case Token::SAR:
877 VisitAsValue(expr->left());
878 CHECK_BAILOUT;
879 VisitAsValue(expr->right());
880 break;
881
860 default: 882 default:
861 BAILOUT("Unsupported binary operation"); 883 BAILOUT("Unsupported binary operation");
862 } 884 }
863 expr->set_location(location_); 885 expr->set_location(location_);
864 } 886 }
865 887
866 888
867 void CodeGenSelector::VisitCompareOperation(CompareOperation* expr) { 889 void CodeGenSelector::VisitCompareOperation(CompareOperation* expr) {
868 BAILOUT("CompareOperation"); 890 BAILOUT("CompareOperation");
869 } 891 }
870 892
871 893
872 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { 894 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) {
873 BAILOUT("ThisFunction"); 895 BAILOUT("ThisFunction");
874 } 896 }
875 897
876 #undef BAILOUT 898 #undef BAILOUT
877 #undef CHECK_BAILOUT 899 #undef CHECK_BAILOUT
878 900
879 901
880 } } // namespace v8::internal 902 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/fast-codegen-arm.cc ('k') | src/fast-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698