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

Side by Side Diff: src/full-codegen.cc

Issue 7887037: Nuke CompareToNull AST node. (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
« no previous file with comments | « src/full-codegen.h ('k') | src/hydrogen.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 void BreakableStatementChecker::VisitBinaryOperation(BinaryOperation* expr) { 238 void BreakableStatementChecker::VisitBinaryOperation(BinaryOperation* expr) {
239 Visit(expr->left()); 239 Visit(expr->left());
240 if (expr->op() != Token::AND && 240 if (expr->op() != Token::AND &&
241 expr->op() != Token::OR) { 241 expr->op() != Token::OR) {
242 Visit(expr->right()); 242 Visit(expr->right());
243 } 243 }
244 } 244 }
245 245
246 246
247 void BreakableStatementChecker::VisitCompareToNull(CompareToNull* expr) {
248 Visit(expr->expression());
249 }
250
251
252 void BreakableStatementChecker::VisitCompareOperation(CompareOperation* expr) { 247 void BreakableStatementChecker::VisitCompareOperation(CompareOperation* expr) {
253 Visit(expr->left()); 248 Visit(expr->left());
254 Visit(expr->right()); 249 Visit(expr->right());
255 } 250 }
256 251
257 252
258 void BreakableStatementChecker::VisitThisFunction(ThisFunction* expr) { 253 void BreakableStatementChecker::VisitThisFunction(ThisFunction* expr) {
259 } 254 }
260 255
261 256
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 __ PopTryHandler(); 1313 __ PopTryHandler();
1319 *stack_depth = 0; 1314 *stack_depth = 0;
1320 return previous_; 1315 return previous_;
1321 } 1316 }
1322 1317
1323 1318
1324 bool FullCodeGenerator::TryLiteralCompare(CompareOperation* compare, 1319 bool FullCodeGenerator::TryLiteralCompare(CompareOperation* compare,
1325 Label* if_true, 1320 Label* if_true,
1326 Label* if_false, 1321 Label* if_false,
1327 Label* fall_through) { 1322 Label* fall_through) {
1323 bool is_strict = compare->op() == Token::EQ_STRICT;
1328 Expression *expr; 1324 Expression *expr;
1329 Handle<String> check; 1325 Handle<String> check;
1330 if (compare->IsLiteralCompareTypeof(&expr, &check)) { 1326 if (compare->IsLiteralCompareTypeof(&expr, &check)) {
1331 EmitLiteralCompareTypeof(expr, check, if_true, if_false, fall_through); 1327 EmitLiteralCompareTypeof(expr, check, if_true, if_false, fall_through);
1332 return true; 1328 return true;
1333 } 1329 }
1334 1330
1335 if (compare->IsLiteralCompareUndefined(&expr)) { 1331 if (compare->IsLiteralCompareUndefined(&expr)) {
1336 EmitLiteralCompareUndefined(expr, if_true, if_false, fall_through); 1332 EmitLiteralCompareUndefined(expr, if_true, if_false, fall_through);
1337 return true; 1333 return true;
1338 } 1334 }
1339 1335
1336 if (compare->IsLiteralCompareNull(&expr)) {
1337 EmitLiteralCompareNull(expr, is_strict, if_true, if_false, fall_through);
1338 return true;
1339 }
1340
1340 return false; 1341 return false;
1341 } 1342 }
1342 1343
1343 1344
1344 #undef __ 1345 #undef __
1345 1346
1346 1347
1347 } } // namespace v8::internal 1348 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/full-codegen.h ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698