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 "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/ast/prettyprinter.h" | 8 #include "src/ast/prettyprinter.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/disasm.h" | 10 #include "src/disasm.h" |
(...skipping 2742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2753 return deopt_messages_[deopt_reason]; | 2753 return deopt_messages_[deopt_reason]; |
2754 } | 2754 } |
2755 | 2755 |
2756 | 2756 |
2757 Deoptimizer::DeoptInfo Deoptimizer::GetDeoptInfo(Code* code, Address pc) { | 2757 Deoptimizer::DeoptInfo Deoptimizer::GetDeoptInfo(Code* code, Address pc) { |
2758 SourcePosition last_position = SourcePosition::Unknown(); | 2758 SourcePosition last_position = SourcePosition::Unknown(); |
2759 Deoptimizer::DeoptReason last_reason = Deoptimizer::kNoReason; | 2759 Deoptimizer::DeoptReason last_reason = Deoptimizer::kNoReason; |
2760 int last_deopt_id = Deoptimizer::DeoptInfo::kNoDeoptId; | 2760 int last_deopt_id = Deoptimizer::DeoptInfo::kNoDeoptId; |
2761 int mask = RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) | | 2761 int mask = RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) | |
2762 RelocInfo::ModeMask(RelocInfo::DEOPT_ID) | | 2762 RelocInfo::ModeMask(RelocInfo::DEOPT_ID) | |
2763 RelocInfo::ModeMask(RelocInfo::POSITION); | 2763 RelocInfo::ModeMask(RelocInfo::DEOPT_POSITION); |
2764 for (RelocIterator it(code, mask); !it.done(); it.next()) { | 2764 for (RelocIterator it(code, mask); !it.done(); it.next()) { |
2765 RelocInfo* info = it.rinfo(); | 2765 RelocInfo* info = it.rinfo(); |
2766 if (info->pc() >= pc) { | 2766 if (info->pc() >= pc) { |
2767 return DeoptInfo(last_position, last_reason, last_deopt_id); | 2767 return DeoptInfo(last_position, last_reason, last_deopt_id); |
2768 } | 2768 } |
2769 if (info->rmode() == RelocInfo::POSITION) { | 2769 if (info->rmode() == RelocInfo::DEOPT_POSITION) { |
2770 int raw_position = static_cast<int>(info->data()); | 2770 int raw_position = static_cast<int>(info->data()); |
2771 last_position = raw_position ? SourcePosition::FromRaw(raw_position) | 2771 last_position = raw_position ? SourcePosition::FromRaw(raw_position) |
2772 : SourcePosition::Unknown(); | 2772 : SourcePosition::Unknown(); |
2773 } else if (info->rmode() == RelocInfo::DEOPT_ID) { | 2773 } else if (info->rmode() == RelocInfo::DEOPT_ID) { |
2774 last_deopt_id = static_cast<int>(info->data()); | 2774 last_deopt_id = static_cast<int>(info->data()); |
2775 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { | 2775 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { |
2776 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data()); | 2776 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data()); |
2777 } | 2777 } |
2778 } | 2778 } |
2779 return DeoptInfo(SourcePosition::Unknown(), Deoptimizer::kNoReason, -1); | 2779 return DeoptInfo(SourcePosition::Unknown(), Deoptimizer::kNoReason, -1); |
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4021 CHECK(value_info->IsMaterializedObject()); | 4021 CHECK(value_info->IsMaterializedObject()); |
4022 | 4022 |
4023 value_info->value_ = | 4023 value_info->value_ = |
4024 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 4024 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
4025 } | 4025 } |
4026 } | 4026 } |
4027 } | 4027 } |
4028 | 4028 |
4029 } // namespace internal | 4029 } // namespace internal |
4030 } // namespace v8 | 4030 } // namespace v8 |
OLD | NEW |