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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 190793015: Fix constant folding of %_IsMinusZero. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | « no previous file | test/mjsunit/constant-fold-control-instructions.js » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 3127 matching lines...) Expand 10 before | Expand all | Expand 10 after
3138 ChangeRepresentation(value()->representation()); 3138 ChangeRepresentation(value()->representation());
3139 } 3139 }
3140 3140
3141 3141
3142 bool HCompareMinusZeroAndBranch::KnownSuccessorBlock(HBasicBlock** block) { 3142 bool HCompareMinusZeroAndBranch::KnownSuccessorBlock(HBasicBlock** block) {
3143 if (FLAG_fold_constants && value()->IsConstant()) { 3143 if (FLAG_fold_constants && value()->IsConstant()) {
3144 HConstant* constant = HConstant::cast(value()); 3144 HConstant* constant = HConstant::cast(value());
3145 if (constant->HasDoubleValue()) { 3145 if (constant->HasDoubleValue()) {
3146 *block = IsMinusZero(constant->DoubleValue()) 3146 *block = IsMinusZero(constant->DoubleValue())
3147 ? FirstSuccessor() : SecondSuccessor(); 3147 ? FirstSuccessor() : SecondSuccessor();
3148 return true;
3148 } 3149 }
3149 return true;
3150 } 3150 }
3151 if (value()->representation().IsSmiOrInteger32()) { 3151 if (value()->representation().IsSmiOrInteger32()) {
3152 // A Smi or Integer32 cannot contain minus zero. 3152 // A Smi or Integer32 cannot contain minus zero.
3153 *block = SecondSuccessor(); 3153 *block = SecondSuccessor();
3154 return true; 3154 return true;
3155 } 3155 }
3156 *block = NULL; 3156 *block = NULL;
3157 return false; 3157 return false;
3158 } 3158 }
3159 3159
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
4543 break; 4543 break;
4544 case kExternalMemory: 4544 case kExternalMemory:
4545 stream->Add("[external-memory]"); 4545 stream->Add("[external-memory]");
4546 break; 4546 break;
4547 } 4547 }
4548 4548
4549 stream->Add("@%d", offset()); 4549 stream->Add("@%d", offset());
4550 } 4550 }
4551 4551
4552 } } // namespace v8::internal 4552 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/constant-fold-control-instructions.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698