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 2633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2644 } | 2644 } |
2645 | 2645 |
2646 | 2646 |
2647 Deoptimizer::DeoptInfo Deoptimizer::GetDeoptInfo(Code* code, Address pc) { | 2647 Deoptimizer::DeoptInfo Deoptimizer::GetDeoptInfo(Code* code, Address pc) { |
2648 SourcePosition last_position = SourcePosition::Unknown(); | 2648 SourcePosition last_position = SourcePosition::Unknown(); |
2649 Deoptimizer::DeoptReason last_reason = Deoptimizer::kNoReason; | 2649 Deoptimizer::DeoptReason last_reason = Deoptimizer::kNoReason; |
2650 int mask = RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) | | 2650 int mask = RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) | |
2651 RelocInfo::ModeMask(RelocInfo::POSITION); | 2651 RelocInfo::ModeMask(RelocInfo::POSITION); |
2652 for (RelocIterator it(code, mask); !it.done(); it.next()) { | 2652 for (RelocIterator it(code, mask); !it.done(); it.next()) { |
2653 RelocInfo* info = it.rinfo(); | 2653 RelocInfo* info = it.rinfo(); |
2654 if (info->pc() >= pc) return DeoptInfo(last_position, NULL, last_reason); | 2654 if (info->pc() >= pc) return DeoptInfo(last_position, last_reason); |
2655 if (info->rmode() == RelocInfo::POSITION) { | 2655 if (info->rmode() == RelocInfo::POSITION) { |
2656 int raw_position = static_cast<int>(info->data()); | 2656 int raw_position = static_cast<int>(info->data()); |
2657 last_position = raw_position ? SourcePosition::FromRaw(raw_position) | 2657 last_position = raw_position ? SourcePosition::FromRaw(raw_position) |
2658 : SourcePosition::Unknown(); | 2658 : SourcePosition::Unknown(); |
2659 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { | 2659 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { |
2660 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data()); | 2660 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data()); |
2661 } | 2661 } |
2662 } | 2662 } |
2663 return DeoptInfo(SourcePosition::Unknown(), NULL, Deoptimizer::kNoReason); | 2663 return DeoptInfo(SourcePosition::Unknown(), Deoptimizer::kNoReason); |
2664 } | 2664 } |
2665 | 2665 |
2666 | 2666 |
2667 // static | 2667 // static |
2668 TranslatedValue TranslatedValue::NewArgumentsObject(TranslatedState* container, | 2668 TranslatedValue TranslatedValue::NewArgumentsObject(TranslatedState* container, |
2669 int length, | 2669 int length, |
2670 int object_index) { | 2670 int object_index) { |
2671 TranslatedValue slot(container, kArgumentsObject); | 2671 TranslatedValue slot(container, kArgumentsObject); |
2672 slot.materialization_info_ = {object_index, length}; | 2672 slot.materialization_info_ = {object_index, length}; |
2673 return slot; | 2673 return slot; |
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3811 CHECK(value_info->IsMaterializedObject()); | 3811 CHECK(value_info->IsMaterializedObject()); |
3812 | 3812 |
3813 value_info->value_ = | 3813 value_info->value_ = |
3814 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 3814 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
3815 } | 3815 } |
3816 } | 3816 } |
3817 } | 3817 } |
3818 | 3818 |
3819 } // namespace internal | 3819 } // namespace internal |
3820 } // namespace v8 | 3820 } // namespace v8 |
OLD | NEW |