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