| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/frames.h" | 5 #include "src/frames.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
| 10 #include "src/ast/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1006 if (frame_opcode == Translation::JS_FRAME) { | 1006 if (frame_opcode == Translation::JS_FRAME) { |
| 1007 Code* code = shared_info->code(); | 1007 Code* code = shared_info->code(); |
| 1008 DeoptimizationOutputData* const output_data = | 1008 DeoptimizationOutputData* const output_data = |
| 1009 DeoptimizationOutputData::cast(code->deoptimization_data()); | 1009 DeoptimizationOutputData::cast(code->deoptimization_data()); |
| 1010 unsigned const entry = | 1010 unsigned const entry = |
| 1011 Deoptimizer::GetOutputInfo(output_data, bailout_id, shared_info); | 1011 Deoptimizer::GetOutputInfo(output_data, bailout_id, shared_info); |
| 1012 code_offset = FullCodeGenerator::PcField::decode(entry); | 1012 code_offset = FullCodeGenerator::PcField::decode(entry); |
| 1013 abstract_code = AbstractCode::cast(code); | 1013 abstract_code = AbstractCode::cast(code); |
| 1014 } else { | 1014 } else { |
| 1015 DCHECK_EQ(frame_opcode, Translation::INTERPRETED_FRAME); | 1015 DCHECK_EQ(frame_opcode, Translation::INTERPRETED_FRAME); |
| 1016 code_offset = bailout_id.ToInt(); | 1016 // BailoutId points to the next bytecode in the bytecode aray. Subtract |
| 1017 // 1 to get the end of current bytecode. |
| 1018 code_offset = bailout_id.ToInt() - 1; |
| 1017 abstract_code = AbstractCode::cast(shared_info->bytecode_array()); | 1019 abstract_code = AbstractCode::cast(shared_info->bytecode_array()); |
| 1018 } | 1020 } |
| 1019 FrameSummary summary(receiver, function, abstract_code, code_offset, | 1021 FrameSummary summary(receiver, function, abstract_code, code_offset, |
| 1020 is_constructor); | 1022 is_constructor); |
| 1021 frames->Add(summary); | 1023 frames->Add(summary); |
| 1022 is_constructor = false; | 1024 is_constructor = false; |
| 1023 } else if (frame_opcode == Translation::CONSTRUCT_STUB_FRAME) { | 1025 } else if (frame_opcode == Translation::CONSTRUCT_STUB_FRAME) { |
| 1024 // The next encountered JS_FRAME will be marked as a constructor call. | 1026 // The next encountered JS_FRAME will be marked as a constructor call. |
| 1025 it.Skip(Translation::NumberOfOperandsFor(frame_opcode)); | 1027 it.Skip(Translation::NumberOfOperandsFor(frame_opcode)); |
| 1026 DCHECK(!is_constructor); | 1028 DCHECK(!is_constructor); |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1667 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1669 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
| 1668 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1670 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
| 1669 list.Add(frame, zone); | 1671 list.Add(frame, zone); |
| 1670 } | 1672 } |
| 1671 return list.ToVector(); | 1673 return list.ToVector(); |
| 1672 } | 1674 } |
| 1673 | 1675 |
| 1674 | 1676 |
| 1675 } // namespace internal | 1677 } // namespace internal |
| 1676 } // namespace v8 | 1678 } // namespace v8 |
| OLD | NEW |