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

Unified Diff: src/api.cc

Issue 974213002: Extract ParseInfo from CompilationInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/ast-numbering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 5d44fe3a0e0562fc963b0e4180676dcd7e0f4e91..31f877284ef72b3e3a0dc6651c078b19d4cbffa9 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1922,7 +1922,7 @@ MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context,
}
source->info->set_script(script);
- source->info->SetContext(isolate->native_context());
+ source->info->set_context(isolate->native_context());
// Do the parsing tasks which need to be done on the main thread. This will
// also handle parse errors.
@@ -1933,18 +1933,17 @@ MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context,
i::Handle<i::SharedFunctionInfo> result;
if (source->info->function() != nullptr) {
// Parsing has succeeded.
- result =
- i::Compiler::CompileStreamedScript(source->info.get(), str->length());
+ result = i::Compiler::CompileStreamedScript(script, source->info.get(),
+ str->length());
}
has_pending_exception = result.is_null();
if (has_pending_exception) isolate->ReportPendingMessages();
RETURN_ON_FAILED_EXECUTION(Script);
- raw_result = *result;
- // The Handle<Script> will go out of scope soon; make sure CompilationInfo
- // doesn't point to it.
- source->info->set_script(i::Handle<i::Script>());
- } // HandleScope goes out of scope.
+ source->info->clear_script(); // because script goes out of scope.
+ raw_result = *result; // TODO(titzer): use CloseAndEscape?
+ }
+
i::Handle<i::SharedFunctionInfo> result(raw_result, isolate);
Local<UnboundScript> generic = ToApiHandle<UnboundScript>(result);
if (generic.IsEmpty()) return Local<Script>();
« no previous file with comments | « no previous file | src/ast-numbering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698