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 <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 12989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13000 | 13000 |
13001 void Script::SetEvalOrigin(Handle<Script> script, | 13001 void Script::SetEvalOrigin(Handle<Script> script, |
13002 Handle<SharedFunctionInfo> outer_info, | 13002 Handle<SharedFunctionInfo> outer_info, |
13003 int eval_position) { | 13003 int eval_position) { |
13004 if (eval_position == kNoSourcePosition) { | 13004 if (eval_position == kNoSourcePosition) { |
13005 // If the position is missing, attempt to get the code offset from the | 13005 // If the position is missing, attempt to get the code offset from the |
13006 // current activation. Do not translate the code offset into source | 13006 // current activation. Do not translate the code offset into source |
13007 // position, but store it as negative value for lazy translation. | 13007 // position, but store it as negative value for lazy translation. |
13008 StackTraceFrameIterator it(script->GetIsolate()); | 13008 StackTraceFrameIterator it(script->GetIsolate()); |
13009 if (!it.done() && it.is_javascript()) { | 13009 if (!it.done() && it.is_javascript()) { |
13010 FrameSummary summary = FrameSummary::GetFirst(it.javascript_frame()); | 13010 FrameSummary summary = FrameSummary::GetTop(it.javascript_frame()); |
13011 script->set_eval_from_shared(summary.AsJavaScript().function()->shared()); | 13011 script->set_eval_from_shared(summary.AsJavaScript().function()->shared()); |
13012 script->set_eval_from_position(-summary.code_offset()); | 13012 script->set_eval_from_position(-summary.code_offset()); |
13013 return; | 13013 return; |
13014 } | 13014 } |
13015 eval_position = 0; | 13015 eval_position = 0; |
13016 } | 13016 } |
13017 script->set_eval_from_shared(*outer_info); | 13017 script->set_eval_from_shared(*outer_info); |
13018 script->set_eval_from_position(eval_position); | 13018 script->set_eval_from_position(eval_position); |
13019 } | 13019 } |
13020 | 13020 |
(...skipping 6895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19916 // depend on this. | 19916 // depend on this. |
19917 return DICTIONARY_ELEMENTS; | 19917 return DICTIONARY_ELEMENTS; |
19918 } | 19918 } |
19919 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 19919 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
19920 return kind; | 19920 return kind; |
19921 } | 19921 } |
19922 } | 19922 } |
19923 | 19923 |
19924 } // namespace internal | 19924 } // namespace internal |
19925 } // namespace v8 | 19925 } // namespace v8 |
OLD | NEW |