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 12967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12978 void Script::SetEvalOrigin(Handle<Script> script, | 12978 void Script::SetEvalOrigin(Handle<Script> script, |
12979 Handle<SharedFunctionInfo> outer_info, | 12979 Handle<SharedFunctionInfo> outer_info, |
12980 int eval_position) { | 12980 int eval_position) { |
12981 if (eval_position == kNoSourcePosition) { | 12981 if (eval_position == kNoSourcePosition) { |
12982 // If the position is missing, attempt to get the code offset from the | 12982 // If the position is missing, attempt to get the code offset from the |
12983 // current activation. Do not translate the code offset into source | 12983 // current activation. Do not translate the code offset into source |
12984 // position, but store it as negative value for lazy translation. | 12984 // position, but store it as negative value for lazy translation. |
12985 StackTraceFrameIterator it(script->GetIsolate()); | 12985 StackTraceFrameIterator it(script->GetIsolate()); |
12986 if (!it.done() && it.is_javascript()) { | 12986 if (!it.done() && it.is_javascript()) { |
12987 FrameSummary summary = FrameSummary::GetFirst(it.javascript_frame()); | 12987 FrameSummary summary = FrameSummary::GetFirst(it.javascript_frame()); |
12988 script->set_eval_from_shared(summary.function()->shared()); | 12988 script->set_eval_from_shared(summary.AsJavaScript().function()->shared()); |
12989 script->set_eval_from_position(-summary.code_offset()); | 12989 script->set_eval_from_position(-summary.code_offset()); |
12990 return; | 12990 return; |
12991 } | 12991 } |
12992 eval_position = 0; | 12992 eval_position = 0; |
12993 } | 12993 } |
12994 script->set_eval_from_shared(*outer_info); | 12994 script->set_eval_from_shared(*outer_info); |
12995 script->set_eval_from_position(eval_position); | 12995 script->set_eval_from_position(eval_position); |
12996 } | 12996 } |
12997 | 12997 |
12998 int Script::GetEvalPosition() { | 12998 int Script::GetEvalPosition() { |
(...skipping 6950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19949 // depend on this. | 19949 // depend on this. |
19950 return DICTIONARY_ELEMENTS; | 19950 return DICTIONARY_ELEMENTS; |
19951 } | 19951 } |
19952 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 19952 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
19953 return kind; | 19953 return kind; |
19954 } | 19954 } |
19955 } | 19955 } |
19956 | 19956 |
19957 } // namespace internal | 19957 } // namespace internal |
19958 } // namespace v8 | 19958 } // namespace v8 |
OLD | NEW |