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

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

Issue 23811011: Tweak HConstant::EmitAtUses() to eliminate useless constant generation (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: refine after danno's comment Created 7 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
« no previous file with comments | « no previous file | no next file » | 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 2508 matching lines...) Expand 10 before | Expand all | Expand 10 after
2519 r = Representation::Tagged(); 2519 r = Representation::Tagged();
2520 } 2520 }
2521 } 2521 }
2522 set_representation(r); 2522 set_representation(r);
2523 SetFlag(kUseGVN); 2523 SetFlag(kUseGVN);
2524 } 2524 }
2525 2525
2526 2526
2527 bool HConstant::EmitAtUses() { 2527 bool HConstant::EmitAtUses() {
2528 ASSERT(IsLinked()); 2528 ASSERT(IsLinked());
2529 if (block()->graph()->has_osr()) { 2529 if (block()->graph()->has_osr() &&
2530 return block()->graph()->IsStandardConstant(this); 2530 block()->graph()->IsStandardConstant(this)) {
2531 return true;
2531 } 2532 }
2533 if (UseCount() == 0) return true;
2532 if (IsCell()) return false; 2534 if (IsCell()) return false;
2533 if (representation().IsDouble()) return false; 2535 if (representation().IsDouble()) return false;
2534 return true; 2536 return true;
2535 } 2537 }
2536 2538
2537 2539
2538 HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const { 2540 HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const {
2539 if (r.IsSmi() && !has_smi_value_) return NULL; 2541 if (r.IsSmi() && !has_smi_value_) return NULL;
2540 if (r.IsInteger32() && !has_int32_value_) return NULL; 2542 if (r.IsInteger32() && !has_int32_value_) return NULL;
2541 if (r.IsDouble() && !has_double_value_) return NULL; 2543 if (r.IsDouble() && !has_double_value_) return NULL;
(...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after
4238 break; 4240 break;
4239 case kExternalMemory: 4241 case kExternalMemory:
4240 stream->Add("[external-memory]"); 4242 stream->Add("[external-memory]");
4241 break; 4243 break;
4242 } 4244 }
4243 4245
4244 stream->Add("@%d", offset()); 4246 stream->Add("@%d", offset());
4245 } 4247 }
4246 4248
4247 } } // namespace v8::internal 4249 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698