| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |