| 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/code-factory.h" | 5 #include "src/code-factory.h" |
| 6 #include "src/compilation-dependencies.h" | 6 #include "src/compilation-dependencies.h" |
| 7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
| 8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
| 9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
| 10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 } | 124 } |
| 125 return lowering_->Changed(node_); | 125 return lowering_->Changed(node_); |
| 126 } | 126 } |
| 127 | 127 |
| 128 Reduction ChangeToSpeculativeOperator(const Operator* op) { | 128 Reduction ChangeToSpeculativeOperator(const Operator* op) { |
| 129 DCHECK_EQ(1, op->EffectInputCount()); | 129 DCHECK_EQ(1, op->EffectInputCount()); |
| 130 DCHECK_EQ(1, op->EffectOutputCount()); | 130 DCHECK_EQ(1, op->EffectOutputCount()); |
| 131 DCHECK_EQ(false, OperatorProperties::HasContextInput(op)); | 131 DCHECK_EQ(false, OperatorProperties::HasContextInput(op)); |
| 132 DCHECK_EQ(1, op->ControlInputCount()); | 132 DCHECK_EQ(1, op->ControlInputCount()); |
| 133 DCHECK_EQ(1, op->ControlOutputCount()); | 133 DCHECK_EQ(1, op->ControlOutputCount()); |
| 134 DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(op)); | 134 DCHECK_EQ(0, OperatorProperties::GetFrameStateInputCount(op)); |
| 135 DCHECK_EQ(2, op->ValueInputCount()); | 135 DCHECK_EQ(2, op->ValueInputCount()); |
| 136 | 136 |
| 137 DCHECK_EQ(1, node_->op()->EffectInputCount()); | 137 DCHECK_EQ(1, node_->op()->EffectInputCount()); |
| 138 DCHECK_EQ(1, node_->op()->EffectOutputCount()); | 138 DCHECK_EQ(1, node_->op()->EffectOutputCount()); |
| 139 DCHECK_EQ(1, node_->op()->ControlInputCount()); | 139 DCHECK_EQ(1, node_->op()->ControlInputCount()); |
| 140 DCHECK_LT(1, node_->op()->ControlOutputCount()); | 140 DCHECK_LT(1, node_->op()->ControlOutputCount()); |
| 141 DCHECK_EQ(2, OperatorProperties::GetFrameStateInputCount(node_->op())); | 141 DCHECK_EQ(2, OperatorProperties::GetFrameStateInputCount(node_->op())); |
| 142 DCHECK_EQ(2, node_->op()->ValueInputCount()); | 142 DCHECK_EQ(2, node_->op()->ValueInputCount()); |
| 143 | 143 |
| 144 // Reconnect the control output to bypass the IfSuccess node and | 144 // Reconnect the control output to bypass the IfSuccess node and |
| 145 // possibly disconnect from the IfException node. | 145 // possibly disconnect from the IfException node. |
| 146 for (Edge edge : node_->use_edges()) { | 146 for (Edge edge : node_->use_edges()) { |
| 147 Node* const user = edge.from(); | 147 Node* const user = edge.from(); |
| 148 DCHECK(!user->IsDead()); | 148 DCHECK(!user->IsDead()); |
| 149 if (NodeProperties::IsControlEdge(edge)) { | 149 if (NodeProperties::IsControlEdge(edge)) { |
| 150 if (user->opcode() == IrOpcode::kIfSuccess) { | 150 if (user->opcode() == IrOpcode::kIfSuccess) { |
| 151 user->ReplaceUses(node_); | 151 user->ReplaceUses(node_); |
| 152 user->Kill(); | 152 user->Kill(); |
| 153 } else { | 153 } else { |
| 154 DCHECK_EQ(user->opcode(), IrOpcode::kIfException); | 154 DCHECK_EQ(user->opcode(), IrOpcode::kIfException); |
| 155 edge.UpdateTo(jsgraph()->Dead()); | 155 edge.UpdateTo(jsgraph()->Dead()); |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 | 159 |
| 160 // Remove the lazy bailout frame state and the context. | 160 // Remove both bailout frame states and the context. |
| 161 node_->RemoveInput(NodeProperties::FirstFrameStateIndex(node_) + 1); |
| 161 node_->RemoveInput(NodeProperties::FirstFrameStateIndex(node_)); | 162 node_->RemoveInput(NodeProperties::FirstFrameStateIndex(node_)); |
| 162 node_->RemoveInput(NodeProperties::FirstContextIndex(node_)); | 163 node_->RemoveInput(NodeProperties::FirstContextIndex(node_)); |
| 163 | 164 |
| 164 NodeProperties::ChangeOp(node_, op); | 165 NodeProperties::ChangeOp(node_, op); |
| 165 | 166 |
| 166 // Update the type to number. | 167 // Update the type to number. |
| 167 Type* node_type = NodeProperties::GetType(node_); | 168 Type* node_type = NodeProperties::GetType(node_); |
| 168 NodeProperties::SetType(node_, | 169 NodeProperties::SetType(node_, |
| 169 Type::Intersect(node_type, Type::Number(), zone())); | 170 Type::Intersect(node_type, Type::Number(), zone())); |
| 170 | 171 |
| (...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1973 } | 1974 } |
| 1974 | 1975 |
| 1975 | 1976 |
| 1976 CompilationDependencies* JSTypedLowering::dependencies() const { | 1977 CompilationDependencies* JSTypedLowering::dependencies() const { |
| 1977 return dependencies_; | 1978 return dependencies_; |
| 1978 } | 1979 } |
| 1979 | 1980 |
| 1980 } // namespace compiler | 1981 } // namespace compiler |
| 1981 } // namespace internal | 1982 } // namespace internal |
| 1982 } // namespace v8 | 1983 } // namespace v8 |
| OLD | NEW |