OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/bit-vector.h" | 5 #include "src/bit-vector.h" |
6 #include "src/compiler/instruction.h" | 6 #include "src/compiler/instruction.h" |
7 #include "src/compiler/register-allocator-verifier.h" | 7 #include "src/compiler/register-allocator-verifier.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 if (moves == nullptr) return; | 275 if (moves == nullptr) return; |
276 | 276 |
277 CHECK(map_for_moves_.empty()); | 277 CHECK(map_for_moves_.empty()); |
278 for (MoveOperands* move : *moves) { | 278 for (MoveOperands* move : *moves) { |
279 if (move->IsEliminated() || move->IsRedundant()) continue; | 279 if (move->IsEliminated() || move->IsRedundant()) continue; |
280 auto it = map_.find(move->source()); | 280 auto it = map_.find(move->source()); |
281 // The RHS of a parallel move should have been already assessed. | 281 // The RHS of a parallel move should have been already assessed. |
282 CHECK(it != map_.end()); | 282 CHECK(it != map_.end()); |
283 // The LHS of a parallel move should not have been assigned in this | 283 // The LHS of a parallel move should not have been assigned in this |
284 // parallel move. | 284 // parallel move. |
285 // TODO(mtrofin): this check fails when generating code for | 285 CHECK(map_for_moves_.find(move->destination()) == map_for_moves_.end()); |
286 // CodeStubAssembler::ChangeUint32ToTagged. | |
287 // CHECK(map_for_moves_.find(move->destination()) == map_for_moves_.end()); | |
288 // Copy the assessment to the destination. | 286 // Copy the assessment to the destination. |
289 map_for_moves_[move->destination()] = it->second; | 287 map_for_moves_[move->destination()] = it->second; |
290 } | 288 } |
291 for (auto pair : map_for_moves_) { | 289 for (auto pair : map_for_moves_) { |
292 map_[pair.first] = pair.second; | 290 map_[pair.first] = pair.second; |
293 } | 291 } |
294 map_for_moves_.clear(); | 292 map_for_moves_.clear(); |
295 } | 293 } |
296 | 294 |
297 void BlockAssessments::DropRegisters() { | 295 void BlockAssessments::DropRegisters() { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 | 409 |
412 switch (contribution->kind()) { | 410 switch (contribution->kind()) { |
413 case Final: | 411 case Final: |
414 ValidateFinalAssessment( | 412 ValidateFinalAssessment( |
415 block_id, current_operand, current_assessments, | 413 block_id, current_operand, current_assessments, |
416 FinalAssessment::cast(contribution), expected); | 414 FinalAssessment::cast(contribution), expected); |
417 break; | 415 break; |
418 case Pending: { | 416 case Pending: { |
419 // This happens if we have a diamond feeding into another one, and | 417 // This happens if we have a diamond feeding into another one, and |
420 // the inner one never being used - other than for carrying the value. | 418 // the inner one never being used - other than for carrying the value. |
421 PendingAssessment* next = PendingAssessment::cast(contribution); | 419 const PendingAssessment* next = PendingAssessment::cast(contribution); |
422 if (seen.find(pred) == seen.end()) { | 420 if (seen.find(pred) == seen.end()) { |
423 worklist.push({next, expected}); | 421 worklist.push({next, expected}); |
424 seen.insert(pred); | 422 seen.insert(pred); |
425 } | 423 } |
426 // Note that we do not want to finalize pending assessments at the | 424 // Note that we do not want to finalize pending assessments at the |
427 // beginning of a block - which is the information we'd have | 425 // beginning of a block - which is the information we'd have |
428 // available here. This is because this operand may be reused to | 426 // available here. This is because this operand may be reused to |
429 // define | 427 // define |
430 // duplicate phis. | 428 // duplicate phis. |
431 break; | 429 break; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 new (zone()) FinalAssessment(vreg, pending); | 551 new (zone()) FinalAssessment(vreg, pending); |
554 break; | 552 break; |
555 } | 553 } |
556 } | 554 } |
557 } | 555 } |
558 } | 556 } |
559 | 557 |
560 } // namespace compiler | 558 } // namespace compiler |
561 } // namespace internal | 559 } // namespace internal |
562 } // namespace v8 | 560 } // namespace v8 |
OLD | NEW |