| 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/effect-control-linearizer.h" | 5 #include "src/compiler/effect-control-linearizer.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.h" |
| 9 #include "src/compiler/compiler-source-position-table.h" | 9 #include "src/compiler/compiler-source-position-table.h" |
| 10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 break; | 642 break; |
| 643 case IrOpcode::kCheckMaps: | 643 case IrOpcode::kCheckMaps: |
| 644 state = LowerCheckMaps(node, frame_state, *effect, *control); | 644 state = LowerCheckMaps(node, frame_state, *effect, *control); |
| 645 break; | 645 break; |
| 646 case IrOpcode::kCheckNumber: | 646 case IrOpcode::kCheckNumber: |
| 647 state = LowerCheckNumber(node, frame_state, *effect, *control); | 647 state = LowerCheckNumber(node, frame_state, *effect, *control); |
| 648 break; | 648 break; |
| 649 case IrOpcode::kCheckString: | 649 case IrOpcode::kCheckString: |
| 650 state = LowerCheckString(node, frame_state, *effect, *control); | 650 state = LowerCheckString(node, frame_state, *effect, *control); |
| 651 break; | 651 break; |
| 652 case IrOpcode::kCheckInternalizedString: |
| 653 state = |
| 654 LowerCheckInternalizedString(node, frame_state, *effect, *control); |
| 655 break; |
| 652 case IrOpcode::kCheckIf: | 656 case IrOpcode::kCheckIf: |
| 653 state = LowerCheckIf(node, frame_state, *effect, *control); | 657 state = LowerCheckIf(node, frame_state, *effect, *control); |
| 654 break; | 658 break; |
| 655 case IrOpcode::kCheckedInt32Add: | 659 case IrOpcode::kCheckedInt32Add: |
| 656 state = LowerCheckedInt32Add(node, frame_state, *effect, *control); | 660 state = LowerCheckedInt32Add(node, frame_state, *effect, *control); |
| 657 break; | 661 break; |
| 658 case IrOpcode::kCheckedInt32Sub: | 662 case IrOpcode::kCheckedInt32Sub: |
| 659 state = LowerCheckedInt32Sub(node, frame_state, *effect, *control); | 663 state = LowerCheckedInt32Sub(node, frame_state, *effect, *control); |
| 660 break; | 664 break; |
| 661 case IrOpcode::kCheckedInt32Div: | 665 case IrOpcode::kCheckedInt32Div: |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 graph()->NewNode(machine()->Uint32LessThan(), value_instance_type, | 1287 graph()->NewNode(machine()->Uint32LessThan(), value_instance_type, |
| 1284 jsgraph()->Uint32Constant(FIRST_NONSTRING_TYPE)); | 1288 jsgraph()->Uint32Constant(FIRST_NONSTRING_TYPE)); |
| 1285 control = effect = graph()->NewNode( | 1289 control = effect = graph()->NewNode( |
| 1286 common()->DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType), check1, | 1290 common()->DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType), check1, |
| 1287 frame_state, effect, control); | 1291 frame_state, effect, control); |
| 1288 | 1292 |
| 1289 return ValueEffectControl(value, effect, control); | 1293 return ValueEffectControl(value, effect, control); |
| 1290 } | 1294 } |
| 1291 | 1295 |
| 1292 EffectControlLinearizer::ValueEffectControl | 1296 EffectControlLinearizer::ValueEffectControl |
| 1297 EffectControlLinearizer::LowerCheckInternalizedString(Node* node, |
| 1298 Node* frame_state, |
| 1299 Node* effect, |
| 1300 Node* control) { |
| 1301 Node* value = node->InputAt(0); |
| 1302 |
| 1303 Node* check0 = ObjectIsSmi(value); |
| 1304 control = effect = |
| 1305 graph()->NewNode(common()->DeoptimizeIf(DeoptimizeReason::kSmi), check0, |
| 1306 frame_state, effect, control); |
| 1307 |
| 1308 Node* value_map = effect = graph()->NewNode( |
| 1309 simplified()->LoadField(AccessBuilder::ForMap()), value, effect, control); |
| 1310 Node* value_instance_type = effect = graph()->NewNode( |
| 1311 simplified()->LoadField(AccessBuilder::ForMapInstanceType()), value_map, |
| 1312 effect, control); |
| 1313 |
| 1314 Node* check1 = graph()->NewNode( |
| 1315 machine()->Word32Equal(), |
| 1316 graph()->NewNode( |
| 1317 machine()->Word32And(), value_instance_type, |
| 1318 jsgraph()->Int32Constant(kIsNotStringMask | kIsNotInternalizedMask)), |
| 1319 jsgraph()->Int32Constant(kInternalizedTag)); |
| 1320 control = effect = graph()->NewNode( |
| 1321 common()->DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType), check1, |
| 1322 frame_state, effect, control); |
| 1323 |
| 1324 return ValueEffectControl(value, effect, control); |
| 1325 } |
| 1326 |
| 1327 EffectControlLinearizer::ValueEffectControl |
| 1293 EffectControlLinearizer::LowerCheckIf(Node* node, Node* frame_state, | 1328 EffectControlLinearizer::LowerCheckIf(Node* node, Node* frame_state, |
| 1294 Node* effect, Node* control) { | 1329 Node* effect, Node* control) { |
| 1295 Node* value = node->InputAt(0); | 1330 Node* value = node->InputAt(0); |
| 1296 | 1331 |
| 1297 control = effect = | 1332 control = effect = |
| 1298 graph()->NewNode(common()->DeoptimizeUnless(DeoptimizeReason::kNoReason), | 1333 graph()->NewNode(common()->DeoptimizeUnless(DeoptimizeReason::kNoReason), |
| 1299 value, frame_state, effect, control); | 1334 value, frame_state, effect, control); |
| 1300 | 1335 |
| 1301 return ValueEffectControl(value, effect, control); | 1336 return ValueEffectControl(value, effect, control); |
| 1302 } | 1337 } |
| (...skipping 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3585 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3620 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
| 3586 Operator::kEliminatable); | 3621 Operator::kEliminatable); |
| 3587 to_number_operator_.set(common()->Call(desc)); | 3622 to_number_operator_.set(common()->Call(desc)); |
| 3588 } | 3623 } |
| 3589 return to_number_operator_.get(); | 3624 return to_number_operator_.get(); |
| 3590 } | 3625 } |
| 3591 | 3626 |
| 3592 } // namespace compiler | 3627 } // namespace compiler |
| 3593 } // namespace internal | 3628 } // namespace internal |
| 3594 } // namespace v8 | 3629 } // namespace v8 |
| OLD | NEW |