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

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

Issue 195063002: Fix bug in constant folding object comparisons. (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 | « src/hydrogen-instructions.h ('k') | test/mjsunit/regress/regress-346587.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 3038 matching lines...) Expand 10 before | Expand all | Expand 10 after
3049 void HCompareObjectEqAndBranch::PrintDataTo(StringStream* stream) { 3049 void HCompareObjectEqAndBranch::PrintDataTo(StringStream* stream) {
3050 left()->PrintNameTo(stream); 3050 left()->PrintNameTo(stream);
3051 stream->Add(" "); 3051 stream->Add(" ");
3052 right()->PrintNameTo(stream); 3052 right()->PrintNameTo(stream);
3053 HControlInstruction::PrintDataTo(stream); 3053 HControlInstruction::PrintDataTo(stream);
3054 } 3054 }
3055 3055
3056 3056
3057 bool HCompareObjectEqAndBranch::KnownSuccessorBlock(HBasicBlock** block) { 3057 bool HCompareObjectEqAndBranch::KnownSuccessorBlock(HBasicBlock** block) {
3058 if (FLAG_fold_constants && left()->IsConstant() && right()->IsConstant()) { 3058 if (FLAG_fold_constants && left()->IsConstant() && right()->IsConstant()) {
3059 *block = HConstant::cast(left())->Equals(HConstant::cast(right())) 3059 *block = HConstant::cast(left())->DataEquals(HConstant::cast(right()))
3060 ? FirstSuccessor() : SecondSuccessor(); 3060 ? FirstSuccessor() : SecondSuccessor();
3061 return true; 3061 return true;
3062 } 3062 }
3063 *block = NULL; 3063 *block = NULL;
3064 return false; 3064 return false;
3065 } 3065 }
3066 3066
3067 3067
3068 bool ConstantIsObject(HConstant* constant, Isolate* isolate) { 3068 bool ConstantIsObject(HConstant* constant, Isolate* isolate) {
3069 if (constant->HasNumberValue()) return false; 3069 if (constant->HasNumberValue()) return false;
(...skipping 1473 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 | « src/hydrogen-instructions.h ('k') | test/mjsunit/regress/regress-346587.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698