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

Side by Side Diff: src/hydrogen.cc

Issue 9286002: Eliminate overflow check after integer add and sub if result is truncated to int32. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Eliminate overflow check after integer add and sub if result is truncated to int32. Created 8 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 | src/hydrogen-instructions.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 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 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after
2060 if (phi->representation().IsInteger32()) { 2060 if (phi->representation().IsInteger32()) {
2061 phi->SetFlag(HValue::kTruncatingToInt32); 2061 phi->SetFlag(HValue::kTruncatingToInt32);
2062 } 2062 }
2063 } 2063 }
2064 bool change = true; 2064 bool change = true;
2065 while (change) { 2065 while (change) {
2066 change = false; 2066 change = false;
2067 for (int i = 0; i < phi_list()->length(); i++) { 2067 for (int i = 0; i < phi_list()->length(); i++) {
2068 HPhi* phi = phi_list()->at(i); 2068 HPhi* phi = phi_list()->at(i);
2069 if (!phi->CheckFlag(HValue::kTruncatingToInt32)) continue; 2069 if (!phi->CheckFlag(HValue::kTruncatingToInt32)) continue;
2070 for (HUseIterator it(phi->uses()); !it.Done(); it.Advance()) { 2070 if (!phi->CheckUsesForFlag(HValue::kTruncatingToInt32)) {
2071 HValue* use = it.value(); 2071 phi->ClearFlag(HValue::kTruncatingToInt32);
2072 if (!use->CheckFlag(HValue::kTruncatingToInt32)) { 2072 change = true;
2073 phi->ClearFlag(HValue::kTruncatingToInt32);
2074 change = true;
2075 break;
2076 }
2077 } 2073 }
2078 } 2074 }
2079 } 2075 }
2080 2076
2081 for (int i = 0; i < blocks_.length(); ++i) { 2077 for (int i = 0; i < blocks_.length(); ++i) {
2082 // Process phi instructions first. 2078 // Process phi instructions first.
2083 const ZoneList<HPhi*>* phis = blocks_[i]->phis(); 2079 const ZoneList<HPhi*>* phis = blocks_[i]->phis();
2084 for (int j = 0; j < phis->length(); j++) { 2080 for (int j = 0; j < phis->length(); j++) {
2085 InsertRepresentationChangesForValue(phis->at(j)); 2081 InsertRepresentationChangesForValue(phis->at(j));
2086 } 2082 }
(...skipping 5934 matching lines...) Expand 10 before | Expand all | Expand 10 after
8021 } 8017 }
8022 } 8018 }
8023 8019
8024 #ifdef DEBUG 8020 #ifdef DEBUG
8025 if (graph_ != NULL) graph_->Verify(false); // No full verify. 8021 if (graph_ != NULL) graph_->Verify(false); // No full verify.
8026 if (allocator_ != NULL) allocator_->Verify(); 8022 if (allocator_ != NULL) allocator_->Verify();
8027 #endif 8023 #endif
8028 } 8024 }
8029 8025
8030 } } // namespace v8::internal 8026 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698