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/js-native-context-specialization.h" | 5 #include "src/compiler/js-native-context-specialization.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
10 #include "src/compiler/access-builder.h" | 10 #include "src/compiler/access-builder.h" |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 // type checks failed, or one of the assumptions inside one of the cases | 404 // type checks failed, or one of the assumptions inside one of the cases |
405 // failes (i.e. failing prototype chain check). | 405 // failes (i.e. failing prototype chain check). |
406 // TODO(bmeurer): Consider falling back to IC here if deoptimization is | 406 // TODO(bmeurer): Consider falling back to IC here if deoptimization is |
407 // disabled. | 407 // disabled. |
408 int const exit_control_count = static_cast<int>(exit_controls.size()); | 408 int const exit_control_count = static_cast<int>(exit_controls.size()); |
409 Node* exit_control = | 409 Node* exit_control = |
410 (exit_control_count == 1) | 410 (exit_control_count == 1) |
411 ? exit_controls.front() | 411 ? exit_controls.front() |
412 : graph()->NewNode(common()->Merge(exit_control_count), | 412 : graph()->NewNode(common()->Merge(exit_control_count), |
413 exit_control_count, &exit_controls.front()); | 413 exit_control_count, &exit_controls.front()); |
414 Node* deoptimize = graph()->NewNode(common()->Deoptimize(), frame_state, | 414 Node* deoptimize = |
415 exit_effect, exit_control); | 415 graph()->NewNode(common()->Deoptimize(DeoptimizeKind::kEager), |
| 416 frame_state, exit_effect, exit_control); |
416 // TODO(bmeurer): This should be on the AdvancedReducer somehow. | 417 // TODO(bmeurer): This should be on the AdvancedReducer somehow. |
417 NodeProperties::MergeControlToEnd(graph(), common(), deoptimize); | 418 NodeProperties::MergeControlToEnd(graph(), common(), deoptimize); |
418 | 419 |
419 // Generate the final merge point for all (polymorphic) branches. | 420 // Generate the final merge point for all (polymorphic) branches. |
420 int const control_count = static_cast<int>(controls.size()); | 421 int const control_count = static_cast<int>(controls.size()); |
421 if (control_count == 0) { | 422 if (control_count == 0) { |
422 value = effect = control = jsgraph()->Dead(); | 423 value = effect = control = jsgraph()->Dead(); |
423 } else if (control_count == 1) { | 424 } else if (control_count == 1) { |
424 value = values.front(); | 425 value = values.front(); |
425 effect = effects.front(); | 426 effect = effects.front(); |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 // type checks failed, or one of the assumptions inside one of the cases | 832 // type checks failed, or one of the assumptions inside one of the cases |
832 // failes (i.e. failing prototype chain check). | 833 // failes (i.e. failing prototype chain check). |
833 // TODO(bmeurer): Consider falling back to IC here if deoptimization is | 834 // TODO(bmeurer): Consider falling back to IC here if deoptimization is |
834 // disabled. | 835 // disabled. |
835 int const exit_control_count = static_cast<int>(exit_controls.size()); | 836 int const exit_control_count = static_cast<int>(exit_controls.size()); |
836 Node* exit_control = | 837 Node* exit_control = |
837 (exit_control_count == 1) | 838 (exit_control_count == 1) |
838 ? exit_controls.front() | 839 ? exit_controls.front() |
839 : graph()->NewNode(common()->Merge(exit_control_count), | 840 : graph()->NewNode(common()->Merge(exit_control_count), |
840 exit_control_count, &exit_controls.front()); | 841 exit_control_count, &exit_controls.front()); |
841 Node* deoptimize = graph()->NewNode(common()->Deoptimize(), frame_state, | 842 Node* deoptimize = |
842 exit_effect, exit_control); | 843 graph()->NewNode(common()->Deoptimize(DeoptimizeKind::kEager), |
| 844 frame_state, exit_effect, exit_control); |
843 // TODO(bmeurer): This should be on the AdvancedReducer somehow. | 845 // TODO(bmeurer): This should be on the AdvancedReducer somehow. |
844 NodeProperties::MergeControlToEnd(graph(), common(), deoptimize); | 846 NodeProperties::MergeControlToEnd(graph(), common(), deoptimize); |
845 | 847 |
846 // Generate the final merge point for all (polymorphic) branches. | 848 // Generate the final merge point for all (polymorphic) branches. |
847 int const control_count = static_cast<int>(controls.size()); | 849 int const control_count = static_cast<int>(controls.size()); |
848 if (control_count == 0) { | 850 if (control_count == 0) { |
849 value = effect = control = jsgraph()->Dead(); | 851 value = effect = control = jsgraph()->Dead(); |
850 } else if (control_count == 1) { | 852 } else if (control_count == 1) { |
851 value = values.front(); | 853 value = values.front(); |
852 effect = effects.front(); | 854 effect = effects.front(); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 } | 1017 } |
1016 | 1018 |
1017 | 1019 |
1018 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 1020 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
1019 return jsgraph()->simplified(); | 1021 return jsgraph()->simplified(); |
1020 } | 1022 } |
1021 | 1023 |
1022 } // namespace compiler | 1024 } // namespace compiler |
1023 } // namespace internal | 1025 } // namespace internal |
1024 } // namespace v8 | 1026 } // namespace v8 |
OLD | NEW |