OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compiler/escape-analysis.h" | 5 #include "src/compiler/escape-analysis.h" |
6 | 6 |
7 #include "src/base/flags.h" | 7 #include "src/base/flags.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
447 info_(zone), | 447 info_(zone), |
448 queue_(zone) { | 448 queue_(zone) { |
449 info_.resize(graph->NodeCount()); | 449 info_.resize(graph->NodeCount()); |
450 } | 450 } |
451 | 451 |
452 | 452 |
453 EscapeStatusAnalysis::~EscapeStatusAnalysis() {} | 453 EscapeStatusAnalysis::~EscapeStatusAnalysis() {} |
454 | 454 |
455 | 455 |
456 bool EscapeStatusAnalysis::HasEntry(Node* node) { | 456 bool EscapeStatusAnalysis::HasEntry(Node* node) { |
457 info_.resize(graph()->NodeCount()); | |
Benedikt Meurer
2015/12/16 17:53:56
How about
if (node->id() >= info_.size()) return
sigurds
2015/12/17 10:16:32
I want to get rid of the checks here, see comments
| |
457 return info_[node->id()] != kUnknown; | 458 return info_[node->id()] != kUnknown; |
458 } | 459 } |
459 | 460 |
460 | 461 |
461 bool EscapeStatusAnalysis::IsVirtual(Node* node) { | 462 bool EscapeStatusAnalysis::IsVirtual(Node* node) { |
462 if (node->id() >= info_.size()) { | 463 if (node->id() >= info_.size()) { |
463 return false; | 464 return false; |
464 } | 465 } |
465 return info_[node->id()] == kVirtual; | 466 return info_[node->id()] == kVirtual; |
466 } | 467 } |
467 | 468 |
468 | 469 |
469 bool EscapeStatusAnalysis::IsEscaped(Node* node) { | 470 bool EscapeStatusAnalysis::IsEscaped(Node* node) { |
470 return info_[node->id()] == kEscaped; | 471 return info_[node->id()] == kEscaped; |
Benedikt Meurer
2015/12/16 17:53:56
Isn't this subject to the same issue?
sigurds
2015/12/17 10:16:32
See comments in new patch set.
| |
471 } | 472 } |
472 | 473 |
473 | 474 |
474 bool EscapeStatusAnalysis::IsAllocation(Node* node) { | 475 bool EscapeStatusAnalysis::IsAllocation(Node* node) { |
475 return node->opcode() == IrOpcode::kAllocate || | 476 return node->opcode() == IrOpcode::kAllocate || |
476 node->opcode() == IrOpcode::kFinishRegion; | 477 node->opcode() == IrOpcode::kFinishRegion; |
477 } | 478 } |
478 | 479 |
479 | 480 |
480 bool EscapeStatusAnalysis::SetEscaped(Node* node) { | 481 bool EscapeStatusAnalysis::SetEscaped(Node* node) { |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1305 } | 1306 } |
1306 } | 1307 } |
1307 for (size_t n = 0; n < object_states.size(); n++) { | 1308 for (size_t n = 0; n < object_states.size(); n++) { |
1308 DebugPrintState(object_states[n]); | 1309 DebugPrintState(object_states[n]); |
1309 } | 1310 } |
1310 } | 1311 } |
1311 | 1312 |
1312 } // namespace compiler | 1313 } // namespace compiler |
1313 } // namespace internal | 1314 } // namespace internal |
1314 } // namespace v8 | 1315 } // namespace v8 |
OLD | NEW |