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

Unified Diff: src/compiler.cc

Issue 2742713003: [debugger] correctly annotate scripts with debug id. (Closed)
Patch Set: address comments 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..fded1e2b86e014c35828cf823df420d5d2090dc1 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());
@@ -1509,17 +1505,17 @@ MaybeHandle<JSFunction> Compiler::GetFunctionFromEval(
CompilationCache* compilation_cache = isolate->compilation_cache();
InfoVectorPair eval_result = compilation_cache->LookupEval(
source, outer_info, context, language_mode, position);
- Handle<SharedFunctionInfo> shared_info;
- if (eval_result.has_shared()) {
- shared_info = Handle<SharedFunctionInfo>(eval_result.shared(), isolate);
- }
Handle<Cell> vector;
if (eval_result.has_vector()) {
vector = Handle<Cell>(eval_result.vector(), isolate);
}
+ Handle<SharedFunctionInfo> shared_info;
Handle<Script> script;
- if (!eval_result.has_shared()) {
+ if (eval_result.has_shared()) {
+ shared_info = Handle<SharedFunctionInfo>(eval_result.shared(), isolate);
+ script = Handle<Script>(Script::cast(shared_info->script()), isolate);
+ } else {
script = isolate->factory()->NewScript(source);
if (isolate->NeedsSourcePositionsForProfiling()) {
Script::InitLineEnds(script);
@@ -1690,13 +1686,14 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
if (CodeSerializer::Deserialize(isolate, *cached_data, source)
.ToHandle(&inner_result)) {
// Promote to per-isolate compilation cache.
- // TODO(mvstanton): create a feedback vector array here.
DCHECK(inner_result->is_compiled());
Handle<FeedbackVector> feedback_vector =
FeedbackVector::New(isolate, inner_result);
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