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

Unified Diff: src/compiler.cc

Issue 2742713003: [debugger] correctly annotate scripts with debug id. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | src/debug/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 4e944f7fcda41fdde7cbd60e7f5931be9dfc69bd..5bdde7df4166ed1bac429895cb95084cecca4381 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1149,10 +1149,6 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
Handle<Script> script = parse_info->script();
- // TODO(svenpanne) Obscure place for this, perhaps move to OnBeforeCompile?
- FixedArray* array = isolate->native_context()->embedder_data();
- script->set_context_data(array->get(v8::Context::kDebugIdIndex));
-
Handle<SharedFunctionInfo> result;
{ VMState<COMPILER> state(info->isolate());
@@ -1510,15 +1506,16 @@ MaybeHandle<JSFunction> Compiler::GetFunctionFromEval(
InfoVectorPair eval_result = compilation_cache->LookupEval(
source, outer_info, context, language_mode, position);
Handle<SharedFunctionInfo> shared_info;
+ Handle<Script> script;
if (eval_result.has_shared()) {
jgruber 2017/03/10 08:29:34 Nit: Maybe we could merge this if block with the c
Yang 2017/03/13 08:46:27 Done.
shared_info = Handle<SharedFunctionInfo>(eval_result.shared(), isolate);
+ script = Handle<Script>(Script::cast(shared_info->script()), isolate);
}
Handle<Cell> vector;
if (eval_result.has_vector()) {
vector = Handle<Cell>(eval_result.vector(), isolate);
}
- Handle<Script> script;
if (!eval_result.has_shared()) {
script = isolate->factory()->NewScript(source);
if (isolate->NeedsSourcePositionsForProfiling()) {
@@ -1697,6 +1694,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
vector = isolate->factory()->NewCell(feedback_vector);
compilation_cache->PutScript(source, context, language_mode,
inner_result, vector);
+ Handle<Script> script(Script::cast(inner_result->script()), isolate);
+ isolate->debug()->OnAfterCompile(script);
return inner_result;
}
// Deserializer failed. Fall through to compile.
« no previous file with comments | « no previous file | src/debug/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698