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 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2501 bool has_construct_stub) { | 2501 bool has_construct_stub) { |
2502 FrameDescription* output_frame = deoptimizer->output_[frame_index]; | 2502 FrameDescription* output_frame = deoptimizer->output_[frame_index]; |
2503 function_ = output_frame->GetFunction(); | 2503 function_ = output_frame->GetFunction(); |
2504 context_ = reinterpret_cast<Object*>(output_frame->GetContext()); | 2504 context_ = reinterpret_cast<Object*>(output_frame->GetContext()); |
2505 has_construct_stub_ = has_construct_stub; | 2505 has_construct_stub_ = has_construct_stub; |
2506 expression_count_ = output_frame->GetExpressionCount(); | 2506 expression_count_ = output_frame->GetExpressionCount(); |
2507 expression_stack_ = new Object* [expression_count_]; | 2507 expression_stack_ = new Object* [expression_count_]; |
2508 // Get the source position using the unoptimized code. | 2508 // Get the source position using the unoptimized code. |
2509 Address pc = reinterpret_cast<Address>(output_frame->GetPc()); | 2509 Address pc = reinterpret_cast<Address>(output_frame->GetPc()); |
2510 Code* code = Code::cast(deoptimizer->isolate()->FindCodeObject(pc)); | 2510 Code* code = Code::cast(deoptimizer->isolate()->FindCodeObject(pc)); |
2511 source_position_ = code->SourcePosition(pc); | 2511 int offset = static_cast<int>(pc - code->instruction_start()); |
| 2512 source_position_ = code->SourcePosition(offset); |
2512 | 2513 |
2513 for (int i = 0; i < expression_count_; i++) { | 2514 for (int i = 0; i < expression_count_; i++) { |
2514 Object* value = output_frame->GetExpression(i); | 2515 Object* value = output_frame->GetExpression(i); |
2515 // Replace materialization markers with the undefined value. | 2516 // Replace materialization markers with the undefined value. |
2516 if (value == deoptimizer->isolate()->heap()->arguments_marker()) { | 2517 if (value == deoptimizer->isolate()->heap()->arguments_marker()) { |
2517 value = deoptimizer->isolate()->heap()->undefined_value(); | 2518 value = deoptimizer->isolate()->heap()->undefined_value(); |
2518 } | 2519 } |
2519 SetExpression(i, value); | 2520 SetExpression(i, value); |
2520 } | 2521 } |
2521 | 2522 |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3710 DCHECK(value_info->IsMaterializedObject()); | 3711 DCHECK(value_info->IsMaterializedObject()); |
3711 | 3712 |
3712 value_info->value_ = | 3713 value_info->value_ = |
3713 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 3714 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
3714 } | 3715 } |
3715 } | 3716 } |
3716 } | 3717 } |
3717 | 3718 |
3718 } // namespace internal | 3719 } // namespace internal |
3719 } // namespace v8 | 3720 } // namespace v8 |
OLD | NEW |