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