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 2709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2720 CHECK(stack_it == frame_it->end()); | 2720 CHECK(stack_it == frame_it->end()); |
2721 } | 2721 } |
2722 | 2722 |
2723 | 2723 |
2724 Deoptimizer::DeoptInfo Deoptimizer::GetDeoptInfo(Code* code, Address pc) { | 2724 Deoptimizer::DeoptInfo Deoptimizer::GetDeoptInfo(Code* code, Address pc) { |
2725 SourcePosition last_position = SourcePosition::Unknown(); | 2725 SourcePosition last_position = SourcePosition::Unknown(); |
2726 DeoptimizeReason last_reason = DeoptimizeReason::kNoReason; | 2726 DeoptimizeReason last_reason = DeoptimizeReason::kNoReason; |
2727 int last_deopt_id = kNoDeoptimizationId; | 2727 int last_deopt_id = kNoDeoptimizationId; |
2728 int mask = RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) | | 2728 int mask = RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) | |
2729 RelocInfo::ModeMask(RelocInfo::DEOPT_ID) | | 2729 RelocInfo::ModeMask(RelocInfo::DEOPT_ID) | |
2730 RelocInfo::ModeMask(RelocInfo::DEOPT_POSITION); | 2730 RelocInfo::ModeMask(RelocInfo::DEOPT_SCRIPT_OFFSET) | |
| 2731 RelocInfo::ModeMask(RelocInfo::DEOPT_INLINING_ID); |
2731 for (RelocIterator it(code, mask); !it.done(); it.next()) { | 2732 for (RelocIterator it(code, mask); !it.done(); it.next()) { |
2732 RelocInfo* info = it.rinfo(); | 2733 RelocInfo* info = it.rinfo(); |
2733 if (info->pc() >= pc) { | 2734 if (info->pc() >= pc) { |
2734 return DeoptInfo(last_position, last_reason, last_deopt_id); | 2735 return DeoptInfo(last_position, last_reason, last_deopt_id); |
2735 } | 2736 } |
2736 if (info->rmode() == RelocInfo::DEOPT_POSITION) { | 2737 if (info->rmode() == RelocInfo::DEOPT_SCRIPT_OFFSET) { |
2737 int raw_position = static_cast<int>(info->data()); | 2738 int script_offset = static_cast<int>(info->data()); |
2738 last_position = raw_position ? SourcePosition::FromRaw(raw_position) | 2739 it.next(); |
2739 : SourcePosition::Unknown(); | 2740 DCHECK(it.rinfo()->rmode() == RelocInfo::DEOPT_INLINING_ID); |
| 2741 int inlining_id = static_cast<int>(it.rinfo()->data()); |
| 2742 last_position = SourcePosition(script_offset, inlining_id); |
2740 } else if (info->rmode() == RelocInfo::DEOPT_ID) { | 2743 } else if (info->rmode() == RelocInfo::DEOPT_ID) { |
2741 last_deopt_id = static_cast<int>(info->data()); | 2744 last_deopt_id = static_cast<int>(info->data()); |
2742 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { | 2745 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { |
2743 last_reason = static_cast<DeoptimizeReason>(info->data()); | 2746 last_reason = static_cast<DeoptimizeReason>(info->data()); |
2744 } | 2747 } |
2745 } | 2748 } |
2746 return DeoptInfo(SourcePosition::Unknown(), DeoptimizeReason::kNoReason, -1); | 2749 return DeoptInfo(SourcePosition::Unknown(), DeoptimizeReason::kNoReason, -1); |
2747 } | 2750 } |
2748 | 2751 |
2749 | 2752 |
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4014 CHECK(value_info->IsMaterializedObject()); | 4017 CHECK(value_info->IsMaterializedObject()); |
4015 | 4018 |
4016 value_info->value_ = | 4019 value_info->value_ = |
4017 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 4020 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
4018 } | 4021 } |
4019 } | 4022 } |
4020 } | 4023 } |
4021 | 4024 |
4022 } // namespace internal | 4025 } // namespace internal |
4023 } // namespace v8 | 4026 } // namespace v8 |
OLD | NEW |