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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 147 } |
148 | 148 |
149 | 149 |
150 // Insert a newly created value check as a replacement for map checks. | 150 // Insert a newly created value check as a replacement for map checks. |
151 HValue* HEscapeAnalysisPhase::NewMapCheckAndInsert(HCapturedObject* state, | 151 HValue* HEscapeAnalysisPhase::NewMapCheckAndInsert(HCapturedObject* state, |
152 HCheckMaps* mapcheck) { | 152 HCheckMaps* mapcheck) { |
153 Zone* zone = graph()->zone(); | 153 Zone* zone = graph()->zone(); |
154 HValue* value = state->map_value(); | 154 HValue* value = state->map_value(); |
155 // TODO(mstarzinger): This will narrow a map check against a set of maps | 155 // TODO(mstarzinger): This will narrow a map check against a set of maps |
156 // down to the first element in the set. Revisit and fix this. | 156 // down to the first element in the set. Revisit and fix this. |
157 Handle<Map> map_object = mapcheck->map_set()->first(); | 157 HCheckValue* check = HCheckValue::New( |
158 UniqueValueId map_id = mapcheck->map_unique_ids()->first(); | 158 zone, NULL, value, mapcheck->first_map(), false); |
159 HCheckValue* check = HCheckValue::New(zone, NULL, value, map_object, map_id); | |
160 check->InsertBefore(mapcheck); | 159 check->InsertBefore(mapcheck); |
161 return check; | 160 return check; |
162 } | 161 } |
163 | 162 |
164 | 163 |
165 // Performs a forward data-flow analysis of all loads and stores on the | 164 // Performs a forward data-flow analysis of all loads and stores on the |
166 // given captured allocation. This uses a reverse post-order iteration | 165 // given captured allocation. This uses a reverse post-order iteration |
167 // over affected basic blocks. All non-escaping instructions are handled | 166 // over affected basic blocks. All non-escaping instructions are handled |
168 // and replaced during the analysis. | 167 // and replaced during the analysis. |
169 void HEscapeAnalysisPhase::AnalyzeDataFlow(HInstruction* allocate) { | 168 void HEscapeAnalysisPhase::AnalyzeDataFlow(HInstruction* allocate) { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 void HEscapeAnalysisPhase::Run() { | 319 void HEscapeAnalysisPhase::Run() { |
321 // TODO(mstarzinger): We disable escape analysis with OSR for now, because | 320 // TODO(mstarzinger): We disable escape analysis with OSR for now, because |
322 // spill slots might be uninitialized. Needs investigation. | 321 // spill slots might be uninitialized. Needs investigation. |
323 if (graph()->has_osr()) return; | 322 if (graph()->has_osr()) return; |
324 CollectCapturedValues(); | 323 CollectCapturedValues(); |
325 PerformScalarReplacement(); | 324 PerformScalarReplacement(); |
326 } | 325 } |
327 | 326 |
328 | 327 |
329 } } // namespace v8::internal | 328 } } // namespace v8::internal |
OLD | NEW |