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

Unified Diff: src/compiler.cc

Issue 1206573004: Debugger: use list to find shared function info in a script. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix liveedit Created 5 years, 6 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.h » ('j') | src/debug.cc » ('J')
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 9092fb5a65edb8b8389971700643d890806a1eb7..8107055001ef0a0db38cb99b7f4efe535b17480e 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1019,8 +1019,7 @@ void Compiler::CompileForLiveEdit(Handle<Script> script) {
VMState<COMPILER> state(info.isolate());
// Get rid of old list of shared function infos.
- script->set_shared_function_infos(Smi::FromInt(0));
-
+ info.MarkAsFirstCompile();
info.parse_info()->set_global();
if (!Parser::ParseStatic(info.parse_info())) return;
@@ -1343,11 +1342,14 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
FunctionLiteral* literal, Handle<Script> script,
CompilationInfo* outer_info) {
// Precondition: code has been parsed and scopes have been analyzed.
+ Isolate* isolate = outer_info->isolate();
MaybeHandle<SharedFunctionInfo> maybe_existing;
if (outer_info->is_first_compile()) {
// On the first compile, there are no existing shared function info for
- // inner functions yet, so do not try to find them.
- DCHECK(script->FindSharedFunctionInfo(literal).is_null());
+ // inner functions yet, so do not try to find them. All bets are off for
+ // live edit though.
+ DCHECK(script->FindSharedFunctionInfo(literal).is_null() ||
+ isolate->debug()->live_edit_enabled());
} else {
maybe_existing = script->FindSharedFunctionInfo(literal);
}
@@ -1368,8 +1370,6 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
if (outer_info->will_serialize()) info.PrepareForSerializing();
if (outer_info->is_first_compile()) info.MarkAsFirstCompile();
- Isolate* isolate = info.isolate();
- Factory* factory = isolate->factory();
LiveEditFunctionTracker live_edit_tracker(isolate, literal);
// Determine if the function can be lazily compiled. This is necessary to
// allow some of our builtin JS files to be lazily compiled. These
@@ -1424,9 +1424,10 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
if (maybe_existing.is_null()) {
// Create a shared function info object.
- Handle<SharedFunctionInfo> result = factory->NewSharedFunctionInfo(
- literal->name(), literal->materialized_literal_count(), literal->kind(),
- info.code(), scope_info, info.feedback_vector());
+ Handle<SharedFunctionInfo> result =
+ isolate->factory()->NewSharedFunctionInfo(
+ literal->name(), literal->materialized_literal_count(),
+ literal->kind(), info.code(), scope_info, info.feedback_vector());
SharedFunctionInfo::InitFromFunctionLiteral(result, literal);
SharedFunctionInfo::SetScript(result, script);
« no previous file with comments | « no previous file | src/debug.h » ('j') | src/debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698