| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/objects.h" | 5 #include "src/objects.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <iomanip> | 8 #include <iomanip> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 12636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12647 } | 12647 } |
| 12648 | 12648 |
| 12649 void Script::SetEvalOrigin(Handle<Script> script, | 12649 void Script::SetEvalOrigin(Handle<Script> script, |
| 12650 Handle<SharedFunctionInfo> outer_info, | 12650 Handle<SharedFunctionInfo> outer_info, |
| 12651 int eval_position) { | 12651 int eval_position) { |
| 12652 if (eval_position == RelocInfo::kNoPosition) { | 12652 if (eval_position == RelocInfo::kNoPosition) { |
| 12653 // If the position is missing, attempt to get the code offset from the | 12653 // If the position is missing, attempt to get the code offset from the |
| 12654 // current activation. Do not translate the code offset into source | 12654 // current activation. Do not translate the code offset into source |
| 12655 // position, but store it as negative value for lazy translation. | 12655 // position, but store it as negative value for lazy translation. |
| 12656 StackTraceFrameIterator it(script->GetIsolate()); | 12656 StackTraceFrameIterator it(script->GetIsolate()); |
| 12657 |
| 12658 // Skip the topmost builtin exit frame. |
| 12659 if (!it.done() && it.is_builtin_exit()) { |
| 12660 it.Advance(); |
| 12661 } |
| 12662 |
| 12657 if (!it.done() && it.is_javascript()) { | 12663 if (!it.done() && it.is_javascript()) { |
| 12658 FrameSummary summary = FrameSummary::GetFirst(it.javascript_frame()); | 12664 FrameSummary summary = FrameSummary::GetFirst(it.javascript_frame()); |
| 12659 script->set_eval_from_shared(summary.function()->shared()); | 12665 script->set_eval_from_shared(summary.function()->shared()); |
| 12660 script->set_eval_from_position(-summary.code_offset()); | 12666 script->set_eval_from_position(-summary.code_offset()); |
| 12661 return; | 12667 return; |
| 12662 } | 12668 } |
| 12663 eval_position = 0; | 12669 eval_position = 0; |
| 12664 } | 12670 } |
| 12665 script->set_eval_from_shared(*outer_info); | 12671 script->set_eval_from_shared(*outer_info); |
| 12666 script->set_eval_from_position(eval_position); | 12672 script->set_eval_from_position(eval_position); |
| (...skipping 6184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18851 } else { | 18857 } else { |
| 18852 // Old-style generators. | 18858 // Old-style generators. |
| 18853 int offset = continuation(); | 18859 int offset = continuation(); |
| 18854 CHECK(0 <= offset && offset < function()->code()->instruction_size()); | 18860 CHECK(0 <= offset && offset < function()->code()->instruction_size()); |
| 18855 return function()->code()->SourcePosition(offset); | 18861 return function()->code()->SourcePosition(offset); |
| 18856 } | 18862 } |
| 18857 } | 18863 } |
| 18858 | 18864 |
| 18859 } // namespace internal | 18865 } // namespace internal |
| 18860 } // namespace v8 | 18866 } // namespace v8 |
| OLD | NEW |