Skip to content
This repository has been archived by the owner on Mar 25, 2018. It is now read-only.

Commit

Permalink
Revert of Release streamed script resources after it was compiled (pa…
Browse files Browse the repository at this point in the history
…tchset #1 id:1 of https://codereview.chromium.org/2297523002/ )

Reason for revert:
Seems to break webkit unit tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/9360
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064%20%28dbg%29/builds/5503

Original issue's description:
> Release streamed script resources after it was compiled
>
> Otherwise, we'd hold on to the resources until the embedder frees them
> which might take a long time
>
> R=marja@chromium.org,verwaest@chromium.org
> BUG=
>
> Committed: https://crrev.com/877dac34465c018bb534b7781fbe242ae4e33c32
> Cr-Commit-Position: refs/heads/master@{#38999}

TBR=marja@chromium.org,verwaest@chromium.org,jochen@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review-Url: https://codereview.chromium.org/2290173003
Cr-Commit-Position: refs/heads/master@{#39012}
  • Loading branch information
mi-ac authored and Commit bot committed Aug 30, 2016
1 parent c3e1b5f commit 08d1aa6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2194,11 +2194,10 @@ MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context,
}
has_pending_exception = result.is_null();
if (has_pending_exception) isolate->ReportPendingMessages();

source->Release();

RETURN_ON_FAILED_EXECUTION(Script);

source->info->clear_script(); // because script goes out of scope.

Local<UnboundScript> generic = ToApiHandle<UnboundScript>(result);
if (generic.IsEmpty()) return Local<Script>();
Local<Script> bound = generic->BindToCurrentContext();
Expand Down
8 changes: 0 additions & 8 deletions src/background-parsing-task.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ struct StreamedSource {
ScriptCompiler::StreamedSource::Encoding encoding)
: source_stream(source_stream), encoding(encoding) {}

void Release() {
parser.reset();
info.reset();
zone.reset();
cached_data.reset();
source_stream.reset();
}

// Internal implementation of v8::ScriptCompiler::StreamedSource.
std::unique_ptr<ScriptCompiler::ExternalSourceStream> source_stream;
ScriptCompiler::StreamedSource::Encoding encoding;
Expand Down

0 comments on commit 08d1aa6

Please sign in to comment.