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

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, 10 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') | src/background-parsing-task.h » ('J')
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 cb30a5319d0538e487b59e5527a013ea8e9a63b4..f2b28b93d7935680b01e362407a7ad586662b8c9 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1873,7 +1873,7 @@ Local<Script> ScriptCompiler::Compile(Isolate* v8_isolate,
origin.ResourceIsEmbedderDebugScript()->IsTrue());
}
source->info->set_script(script);
- source->info->SetContext(isolate->native_context());
+ source->info->set_context(isolate->native_context());
EXCEPTION_PREAMBLE(isolate);
@@ -1887,18 +1887,17 @@ Local<Script> ScriptCompiler::Compile(Isolate* v8_isolate,
i::Handle<i::SharedFunctionInfo>::null();
if (source->info->function() != NULL) {
// 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();
EXCEPTION_BAILOUT_CHECK(isolate, Local<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()) {
« no previous file with comments | « no previous file | src/ast-numbering.cc » ('j') | src/background-parsing-task.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698