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

Side by Side Diff: src/hydrogen-escape-analysis.cc

Issue 257803012: Make escape analysis preserve all representations required by HCompareNumericAndBranch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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-escape-preserve-smi-representation.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 return check; 160 return check;
161 } 161 }
162 162
163 163
164 // Replace a field load with a given value, forcing Smi representation if 164 // Replace a field load with a given value, forcing Smi representation if
165 // necessary. 165 // necessary.
166 HValue* HEscapeAnalysisPhase::NewLoadReplacement( 166 HValue* HEscapeAnalysisPhase::NewLoadReplacement(
167 HLoadNamedField* load, HValue* load_value) { 167 HLoadNamedField* load, HValue* load_value) {
168 HValue* replacement = load_value; 168 HValue* replacement = load_value;
169 Representation representation = load->representation(); 169 Representation representation = load->representation();
170 if (representation.IsSmi()) { 170 if (representation.IsSmiOrInteger32() || representation.IsDouble()) {
171 Zone* zone = graph()->zone(); 171 Zone* zone = graph()->zone();
172 HInstruction* new_instr = 172 HInstruction* new_instr =
173 HForceRepresentation::New(zone, NULL, load_value, representation); 173 HForceRepresentation::New(zone, NULL, load_value, representation);
174 new_instr->InsertAfter(load); 174 new_instr->InsertAfter(load);
175 replacement = new_instr; 175 replacement = new_instr;
176 } 176 }
177 return replacement; 177 return replacement;
178 } 178 }
179 179
180 180
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 for (int i = 0; i < max_fixpoint_iteration_count; i++) { 342 for (int i = 0; i < max_fixpoint_iteration_count; i++) {
343 CollectCapturedValues(); 343 CollectCapturedValues();
344 if (captured_.is_empty()) break; 344 if (captured_.is_empty()) break;
345 PerformScalarReplacement(); 345 PerformScalarReplacement();
346 captured_.Clear(); 346 captured_.Clear();
347 } 347 }
348 } 348 }
349 349
350 350
351 } } // namespace v8::internal 351 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-escape-preserve-smi-representation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698