OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/deoptimizer.h" | 5 #include "src/deoptimizer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 BailoutState state = | 1017 BailoutState state = |
1018 goto_catch_handler | 1018 goto_catch_handler |
1019 ? BailoutState::TOS_REGISTER | 1019 ? BailoutState::TOS_REGISTER |
1020 : FullCodeGenerator::BailoutStateField::decode(pc_and_state); | 1020 : FullCodeGenerator::BailoutStateField::decode(pc_and_state); |
1021 output_frame->SetState(Smi::FromInt(static_cast<int>(state))); | 1021 output_frame->SetState(Smi::FromInt(static_cast<int>(state))); |
1022 | 1022 |
1023 // Clear the context register. The context might be a de-materialized object | 1023 // Clear the context register. The context might be a de-materialized object |
1024 // and will be materialized by {Runtime_NotifyDeoptimized}. For additional | 1024 // and will be materialized by {Runtime_NotifyDeoptimized}. For additional |
1025 // safety we use Smi(0) instead of the potential {arguments_marker} here. | 1025 // safety we use Smi(0) instead of the potential {arguments_marker} here. |
1026 if (is_topmost) { | 1026 if (is_topmost) { |
1027 intptr_t context_value = reinterpret_cast<intptr_t>(Smi::FromInt(0)); | 1027 intptr_t context_value = reinterpret_cast<intptr_t>(Smi::kZero); |
1028 Register context_reg = JavaScriptFrame::context_register(); | 1028 Register context_reg = JavaScriptFrame::context_register(); |
1029 output_frame->SetRegister(context_reg.code(), context_value); | 1029 output_frame->SetRegister(context_reg.code(), context_value); |
1030 } | 1030 } |
1031 | 1031 |
1032 // Set the continuation for the topmost frame. | 1032 // Set the continuation for the topmost frame. |
1033 if (is_topmost) { | 1033 if (is_topmost) { |
1034 Builtins* builtins = isolate_->builtins(); | 1034 Builtins* builtins = isolate_->builtins(); |
1035 Code* continuation = builtins->builtin(Builtins::kNotifyDeoptimized); | 1035 Code* continuation = builtins->builtin(Builtins::kNotifyDeoptimized); |
1036 if (bailout_type_ == LAZY) { | 1036 if (bailout_type_ == LAZY) { |
1037 continuation = builtins->builtin(Builtins::kNotifyLazyDeoptimized); | 1037 continuation = builtins->builtin(Builtins::kNotifyLazyDeoptimized); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 Register constant_pool_reg = | 1285 Register constant_pool_reg = |
1286 InterpretedFrame::constant_pool_pointer_register(); | 1286 InterpretedFrame::constant_pool_pointer_register(); |
1287 output_frame->SetRegister(constant_pool_reg.code(), constant_pool_value); | 1287 output_frame->SetRegister(constant_pool_reg.code(), constant_pool_value); |
1288 } | 1288 } |
1289 } | 1289 } |
1290 | 1290 |
1291 // Clear the context register. The context might be a de-materialized object | 1291 // Clear the context register. The context might be a de-materialized object |
1292 // and will be materialized by {Runtime_NotifyDeoptimized}. For additional | 1292 // and will be materialized by {Runtime_NotifyDeoptimized}. For additional |
1293 // safety we use Smi(0) instead of the potential {arguments_marker} here. | 1293 // safety we use Smi(0) instead of the potential {arguments_marker} here. |
1294 if (is_topmost) { | 1294 if (is_topmost) { |
1295 intptr_t context_value = reinterpret_cast<intptr_t>(Smi::FromInt(0)); | 1295 intptr_t context_value = reinterpret_cast<intptr_t>(Smi::kZero); |
1296 Register context_reg = JavaScriptFrame::context_register(); | 1296 Register context_reg = JavaScriptFrame::context_register(); |
1297 output_frame->SetRegister(context_reg.code(), context_value); | 1297 output_frame->SetRegister(context_reg.code(), context_value); |
1298 } | 1298 } |
1299 | 1299 |
1300 // Set the continuation for the topmost frame. | 1300 // Set the continuation for the topmost frame. |
1301 if (is_topmost) { | 1301 if (is_topmost) { |
1302 Code* continuation = builtins->builtin(Builtins::kNotifyDeoptimized); | 1302 Code* continuation = builtins->builtin(Builtins::kNotifyDeoptimized); |
1303 if (bailout_type_ == LAZY) { | 1303 if (bailout_type_ == LAZY) { |
1304 continuation = builtins->builtin(Builtins::kNotifyLazyDeoptimized); | 1304 continuation = builtins->builtin(Builtins::kNotifyLazyDeoptimized); |
1305 } else if (bailout_type_ == SOFT) { | 1305 } else if (bailout_type_ == SOFT) { |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1652 Register constant_pool_reg = | 1652 Register constant_pool_reg = |
1653 JavaScriptFrame::constant_pool_pointer_register(); | 1653 JavaScriptFrame::constant_pool_pointer_register(); |
1654 output_frame->SetRegister(constant_pool_reg.code(), fp_value); | 1654 output_frame->SetRegister(constant_pool_reg.code(), fp_value); |
1655 } | 1655 } |
1656 } | 1656 } |
1657 | 1657 |
1658 // Clear the context register. The context might be a de-materialized object | 1658 // Clear the context register. The context might be a de-materialized object |
1659 // and will be materialized by {Runtime_NotifyDeoptimized}. For additional | 1659 // and will be materialized by {Runtime_NotifyDeoptimized}. For additional |
1660 // safety we use Smi(0) instead of the potential {arguments_marker} here. | 1660 // safety we use Smi(0) instead of the potential {arguments_marker} here. |
1661 if (is_topmost) { | 1661 if (is_topmost) { |
1662 intptr_t context_value = reinterpret_cast<intptr_t>(Smi::FromInt(0)); | 1662 intptr_t context_value = reinterpret_cast<intptr_t>(Smi::kZero); |
1663 Register context_reg = JavaScriptFrame::context_register(); | 1663 Register context_reg = JavaScriptFrame::context_register(); |
1664 output_frame->SetRegister(context_reg.code(), context_value); | 1664 output_frame->SetRegister(context_reg.code(), context_value); |
1665 } | 1665 } |
1666 | 1666 |
1667 // Set the continuation for the topmost frame. | 1667 // Set the continuation for the topmost frame. |
1668 if (is_topmost) { | 1668 if (is_topmost) { |
1669 Builtins* builtins = isolate_->builtins(); | 1669 Builtins* builtins = isolate_->builtins(); |
1670 DCHECK_EQ(LAZY, bailout_type_); | 1670 DCHECK_EQ(LAZY, bailout_type_); |
1671 Code* continuation = builtins->builtin(Builtins::kNotifyLazyDeoptimized); | 1671 Code* continuation = builtins->builtin(Builtins::kNotifyLazyDeoptimized); |
1672 output_frame->SetContinuation( | 1672 output_frame->SetContinuation( |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1836 Register constant_pool_reg = | 1836 Register constant_pool_reg = |
1837 JavaScriptFrame::constant_pool_pointer_register(); | 1837 JavaScriptFrame::constant_pool_pointer_register(); |
1838 output_frame->SetRegister(constant_pool_reg.code(), fp_value); | 1838 output_frame->SetRegister(constant_pool_reg.code(), fp_value); |
1839 } | 1839 } |
1840 } | 1840 } |
1841 | 1841 |
1842 // Clear the context register. The context might be a de-materialized object | 1842 // Clear the context register. The context might be a de-materialized object |
1843 // and will be materialized by {Runtime_NotifyDeoptimized}. For additional | 1843 // and will be materialized by {Runtime_NotifyDeoptimized}. For additional |
1844 // safety we use Smi(0) instead of the potential {arguments_marker} here. | 1844 // safety we use Smi(0) instead of the potential {arguments_marker} here. |
1845 if (is_topmost) { | 1845 if (is_topmost) { |
1846 intptr_t context_value = reinterpret_cast<intptr_t>(Smi::FromInt(0)); | 1846 intptr_t context_value = reinterpret_cast<intptr_t>(Smi::kZero); |
1847 Register context_reg = JavaScriptFrame::context_register(); | 1847 Register context_reg = JavaScriptFrame::context_register(); |
1848 output_frame->SetRegister(context_reg.code(), context_value); | 1848 output_frame->SetRegister(context_reg.code(), context_value); |
1849 } | 1849 } |
1850 | 1850 |
1851 // Set the continuation for the topmost frame. | 1851 // Set the continuation for the topmost frame. |
1852 if (is_topmost) { | 1852 if (is_topmost) { |
1853 Builtins* builtins = isolate_->builtins(); | 1853 Builtins* builtins = isolate_->builtins(); |
1854 DCHECK_EQ(LAZY, bailout_type_); | 1854 DCHECK_EQ(LAZY, bailout_type_); |
1855 Code* continuation = builtins->builtin(Builtins::kNotifyLazyDeoptimized); | 1855 Code* continuation = builtins->builtin(Builtins::kNotifyLazyDeoptimized); |
1856 output_frame->SetContinuation( | 1856 output_frame->SetContinuation( |
(...skipping 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4018 CHECK(value_info->IsMaterializedObject()); | 4018 CHECK(value_info->IsMaterializedObject()); |
4019 | 4019 |
4020 value_info->value_ = | 4020 value_info->value_ = |
4021 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 4021 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
4022 } | 4022 } |
4023 } | 4023 } |
4024 } | 4024 } |
4025 | 4025 |
4026 } // namespace internal | 4026 } // namespace internal |
4027 } // namespace v8 | 4027 } // namespace v8 |
OLD | NEW |