Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Unified Diff: src/builtins.cc

Issue 1854713002: Correctly annotate eval origin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.cc ('k') | src/compiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 760bb8e786b38e4c88809900efded5238c72d60f..a7d5aea37c3ac7a1370f1506fdca76ca49cc4ec2 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -2067,11 +2067,22 @@ MaybeHandle<JSFunction> CompileString(Handle<Context> context,
}
// Compile source string in the native context.
- Handle<SharedFunctionInfo> outer_info(native_context->closure()->shared(),
- isolate);
+ StackTraceFrameIterator it(isolate);
+ int eval_scope_position = 0;
+ int eval_position = RelocInfo::kNoPosition;
+ Handle<SharedFunctionInfo> outer_info;
+ if (!it.done() && it.is_javascript()) {
+ FrameSummary summary = FrameSummary::GetFirst(it.javascript_frame());
+ eval_position =
+ summary.abstract_code()->SourcePosition(summary.code_offset());
+ outer_info = Handle<SharedFunctionInfo>(summary.function()->shared());
+ } else {
+ outer_info =
+ Handle<SharedFunctionInfo>(native_context->closure()->shared());
+ }
return Compiler::GetFunctionFromEval(source, outer_info, native_context,
- SLOPPY, restriction,
- RelocInfo::kNoPosition);
+ SLOPPY, restriction, eval_scope_position,
+ eval_position);
}
} // namespace
« no previous file with comments | « src/api.cc ('k') | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698