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

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

Issue 148573005: A64: Synchronize with r16249. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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 | « src/hydrogen-dce.cc ('k') | src/hydrogen-gvn.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 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 HCapturedObject* state = NewState(previous); 103 HCapturedObject* state = NewState(previous);
104 for (int index = 0; index < number_of_values_; index++) { 104 for (int index = 0; index < number_of_values_; index++) {
105 HValue* operand = old_state->OperandAt(index); 105 HValue* operand = old_state->OperandAt(index);
106 state->SetOperandAt(index, operand); 106 state->SetOperandAt(index, operand);
107 } 107 }
108 return state; 108 return state;
109 } 109 }
110 110
111 111
112 // Insert a newly created phi into the given block and fill all incoming 112 // Insert a newly created phi into the given block and fill all incoming
113 // edges with the given value. The merge index is chosen so that it is 113 // edges with the given value.
114 // unique for this particular scalar replacement index.
115 HPhi* HEscapeAnalysisPhase::NewPhiAndInsert( 114 HPhi* HEscapeAnalysisPhase::NewPhiAndInsert(
116 HBasicBlock* block, HValue* incoming_value, int index) { 115 HBasicBlock* block, HValue* incoming_value, int index) {
117 Zone* zone = graph()->zone(); 116 Zone* zone = graph()->zone();
118 HBasicBlock* pred = block->predecessors()->first(); 117 HPhi* phi = new(zone) HPhi(HPhi::kInvalidMergedIndex, zone);
119 int phi_index = pred->last_environment()->length() + cumulative_values_;
120 HPhi* phi = new(zone) HPhi(phi_index + index, zone);
121 for (int i = 0; i < block->predecessors()->length(); i++) { 118 for (int i = 0; i < block->predecessors()->length(); i++) {
122 phi->AddInput(incoming_value); 119 phi->AddInput(incoming_value);
123 } 120 }
124 block->AddPhi(phi); 121 block->AddPhi(phi);
125 return phi; 122 return phi;
126 } 123 }
127 124
128 125
129 // Performs a forward data-flow analysis of all loads and stores on the 126 // Performs a forward data-flow analysis of all loads and stores on the
130 // given captured allocation. This uses a reverse post-order iteration 127 // given captured allocation. This uses a reverse post-order iteration
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 HCheckHeapObject* check = HCheckHeapObject::cast(instr); 205 HCheckHeapObject* check = HCheckHeapObject::cast(instr);
209 if (check->value() != allocate) continue; 206 if (check->value() != allocate) continue;
210 check->DeleteAndReplaceWith(NULL); 207 check->DeleteAndReplaceWith(NULL);
211 break; 208 break;
212 } 209 }
213 case HValue::kCheckMaps: { 210 case HValue::kCheckMaps: {
214 HCheckMaps* mapcheck = HCheckMaps::cast(instr); 211 HCheckMaps* mapcheck = HCheckMaps::cast(instr);
215 if (mapcheck->value() != allocate) continue; 212 if (mapcheck->value() != allocate) continue;
216 // TODO(mstarzinger): This approach breaks if the tracked map value 213 // TODO(mstarzinger): This approach breaks if the tracked map value
217 // is not a HConstant. Find a repro test case and fix this. 214 // is not a HConstant. Find a repro test case and fix this.
215 for (HUseIterator it(mapcheck->uses()); !it.Done(); it.Advance()) {
216 if (!it.value()->IsLoadNamedField()) continue;
217 HLoadNamedField* load = HLoadNamedField::cast(it.value());
218 ASSERT(load->typecheck() == mapcheck);
219 load->ClearTypeCheck();
220 }
218 ASSERT(mapcheck->HasNoUses()); 221 ASSERT(mapcheck->HasNoUses());
222
219 mapcheck->DeleteAndReplaceWith(NULL); 223 mapcheck->DeleteAndReplaceWith(NULL);
220 break; 224 break;
221 } 225 }
222 default: 226 default:
223 // Nothing to see here, move along ... 227 // Nothing to see here, move along ...
224 break; 228 break;
225 } 229 }
226 } 230 }
227 231
228 // Propagate the block state forward to all successor blocks. 232 // Propagate the block state forward to all successor blocks.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 AnalyzeDataFlow(allocate); 287 AnalyzeDataFlow(allocate);
284 288
285 cumulative_values_ += number_of_values_; 289 cumulative_values_ += number_of_values_;
286 ASSERT(allocate->HasNoUses()); 290 ASSERT(allocate->HasNoUses());
287 ASSERT(!allocate->IsLinked()); 291 ASSERT(!allocate->IsLinked());
288 } 292 }
289 } 293 }
290 294
291 295
292 } } // namespace v8::internal 296 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-dce.cc ('k') | src/hydrogen-gvn.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698