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

Side by Side Diff: src/hydrogen.cc

Issue 16656002: Take all uses into account to clear int32 truncation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Space man Created 7 years, 6 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/regress/regress-int32-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 3177 matching lines...) Expand 10 before | Expand all | Expand 10 after
3188 } 3188 }
3189 3189
3190 for (int i = 0; i < phi_list()->length(); i++) { 3190 for (int i = 0; i < phi_list()->length(); i++) {
3191 HPhi* phi = phi_list()->at(i); 3191 HPhi* phi = phi_list()->at(i);
3192 for (HUseIterator it(phi->uses()); !it.Done(); it.Advance()) { 3192 for (HUseIterator it(phi->uses()); !it.Done(); it.Advance()) {
3193 // If a Phi is used as a non-truncating int32 or as a double, 3193 // If a Phi is used as a non-truncating int32 or as a double,
3194 // clear its "truncating" flag. 3194 // clear its "truncating" flag.
3195 HValue* use = it.value(); 3195 HValue* use = it.value();
3196 Representation input_representation = 3196 Representation input_representation =
3197 use->RequiredInputRepresentation(it.index()); 3197 use->RequiredInputRepresentation(it.index());
3198 if ((input_representation.IsInteger32() && 3198 if (!input_representation.IsInteger32() ||
3199 !use->CheckFlag(HValue::kTruncatingToInt32)) || 3199 !use->CheckFlag(HValue::kTruncatingToInt32)) {
3200 input_representation.IsDouble()) {
3201 if (FLAG_trace_representation) { 3200 if (FLAG_trace_representation) {
3202 PrintF("#%d Phi is not truncating because of #%d %s\n", 3201 PrintF("#%d Phi is not truncating because of #%d %s\n",
3203 phi->id(), it.value()->id(), it.value()->Mnemonic()); 3202 phi->id(), it.value()->id(), it.value()->Mnemonic());
3204 } 3203 }
3205 phi->ClearFlag(HValue::kTruncatingToInt32); 3204 phi->ClearFlag(HValue::kTruncatingToInt32);
3206 worklist.Add(phi, zone()); 3205 worklist.Add(phi, zone());
3207 break; 3206 break;
3208 } 3207 }
3209 } 3208 }
3210 } 3209 }
(...skipping 8390 matching lines...) Expand 10 before | Expand all | Expand 10 after
11601 } 11600 }
11602 } 11601 }
11603 11602
11604 #ifdef DEBUG 11603 #ifdef DEBUG
11605 if (graph_ != NULL) graph_->Verify(false); // No full verify. 11604 if (graph_ != NULL) graph_->Verify(false); // No full verify.
11606 if (allocator_ != NULL) allocator_->Verify(); 11605 if (allocator_ != NULL) allocator_->Verify();
11607 #endif 11606 #endif
11608 } 11607 }
11609 11608
11610 } } // namespace v8::internal 11609 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-int32-truncation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698