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

Side by Side Diff: src/assembler.cc

Issue 7489045: ARM: Fast path for compare against constant. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 3 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
OLDNEW
1 // Copyright (c) 2011 Sun Microsystems Inc. 1 // Copyright (c) 2011 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 BUILTIN_FP_INT_CALL)); 1104 BUILTIN_FP_INT_CALL));
1105 } 1105 }
1106 1106
1107 1107
1108 static int native_compare_doubles(double y, double x) { 1108 static int native_compare_doubles(double y, double x) {
1109 if (x == y) return EQUAL; 1109 if (x == y) return EQUAL;
1110 return x < y ? LESS : GREATER; 1110 return x < y ? LESS : GREATER;
1111 } 1111 }
1112 1112
1113 1113
1114 bool EvalComparison(Token::Value op, double op1, double op2) {
1115 ASSERT(Token::IsCompareOp(op));
1116 switch (op) {
1117 case Token::EQ:
1118 case Token::EQ_STRICT: return (op1 == op2);
1119 case Token::NE: return (op1 != op2);
1120 case Token::LT: return (op1 < op2);
1121 case Token::GT: return (op1 > op2);
1122 case Token::LTE: return (op1 <= op2);
1123 case Token::GTE: return (op1 >= op2);
1124 default:
1125 UNREACHABLE();
1126 return false;
1127 }
1128 }
1129
1130
1114 ExternalReference ExternalReference::double_fp_operation( 1131 ExternalReference ExternalReference::double_fp_operation(
1115 Token::Value operation, Isolate* isolate) { 1132 Token::Value operation, Isolate* isolate) {
1116 typedef double BinaryFPOperation(double x, double y); 1133 typedef double BinaryFPOperation(double x, double y);
1117 BinaryFPOperation* function = NULL; 1134 BinaryFPOperation* function = NULL;
1118 switch (operation) { 1135 switch (operation) {
1119 case Token::ADD: 1136 case Token::ADD:
1120 function = &add_two_doubles; 1137 function = &add_two_doubles;
1121 break; 1138 break;
1122 case Token::SUB: 1139 case Token::SUB:
1123 function = &sub_two_doubles; 1140 function = &sub_two_doubles;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); 1222 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position);
1206 state_.written_position = state_.current_position; 1223 state_.written_position = state_.current_position;
1207 written = true; 1224 written = true;
1208 } 1225 }
1209 1226
1210 // Return whether something was written. 1227 // Return whether something was written.
1211 return written; 1228 return written;
1212 } 1229 }
1213 1230
1214 } } // namespace v8::internal 1231 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698