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

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

Issue 23075003: Fix bug in HPhi::SimplifyConstantInput (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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-phi-truncation.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 3713 matching lines...) Expand 10 before | Expand all | Expand 10 after
3724 for (int i = 0; i < OperandCount(); ++i) { 3724 for (int i = 0; i < OperandCount(); ++i) {
3725 HConstant* operand = HConstant::cast(OperandAt(i)); 3725 HConstant* operand = HConstant::cast(OperandAt(i));
3726 if (operand->HasInteger32Value()) { 3726 if (operand->HasInteger32Value()) {
3727 continue; 3727 continue;
3728 } else if (operand->HasDoubleValue()) { 3728 } else if (operand->HasDoubleValue()) {
3729 HConstant* integer_input = 3729 HConstant* integer_input =
3730 HConstant::New(graph->zone(), graph->GetInvalidContext(), 3730 HConstant::New(graph->zone(), graph->GetInvalidContext(),
3731 DoubleToInt32(operand->DoubleValue())); 3731 DoubleToInt32(operand->DoubleValue()));
3732 integer_input->InsertAfter(operand); 3732 integer_input->InsertAfter(operand);
3733 SetOperandAt(i, integer_input); 3733 SetOperandAt(i, integer_input);
3734 } else if (operand == graph->GetConstantTrue()) { 3734 } else if (operand->HasBooleanValue()) {
3735 SetOperandAt(i, graph->GetConstant1()); 3735 SetOperandAt(i, operand->BooleanValue() ? graph->GetConstant1()
3736 } else { 3736 : graph->GetConstant0());
3737 // This catches |false|, |undefined|, strings and objects. 3737 } else if (operand->ImmortalImmovable()) {
3738 SetOperandAt(i, graph->GetConstant0()); 3738 SetOperandAt(i, graph->GetConstant0());
3739 } 3739 }
3740 } 3740 }
3741 // Overwrite observed input representations because they are likely Tagged. 3741 // Overwrite observed input representations because they are likely Tagged.
3742 for (HUseIterator it(uses()); !it.Done(); it.Advance()) { 3742 for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
3743 HValue* use = it.value(); 3743 HValue* use = it.value();
3744 if (use->IsBinaryOperation()) { 3744 if (use->IsBinaryOperation()) {
3745 HBinaryOperation::cast(use)->set_observed_input_representation( 3745 HBinaryOperation::cast(use)->set_observed_input_representation(
3746 it.index(), Representation::Smi()); 3746 it.index(), Representation::Smi());
3747 } 3747 }
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
3997 break; 3997 break;
3998 case kExternalMemory: 3998 case kExternalMemory:
3999 stream->Add("[external-memory]"); 3999 stream->Add("[external-memory]");
4000 break; 4000 break;
4001 } 4001 }
4002 4002
4003 stream->Add("@%d", offset()); 4003 stream->Add("@%d", offset());
4004 } 4004 }
4005 4005
4006 } } // namespace v8::internal 4006 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | test/mjsunit/regress/regress-phi-truncation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698