Commit e1b7ac80 authored by Hiroshige Hayashizaki's avatar Hiroshige Hayashizaki Committed by Commit Bot

Do not use Resource in SelectCompileFunction()

Bug: 788828
Change-Id: I45d9450cacce9613440496493a40098352dec4c7
Reviewed-on: https://chromium-review.googlesource.com/786530
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520847}
parent df91473f
...@@ -375,20 +375,15 @@ static CompileFn SelectCompileFunction( ...@@ -375,20 +375,15 @@ static CompileFn SelectCompileFunction(
// Select a compile function for a streaming compile. // Select a compile function for a streaming compile.
CompileFn SelectCompileFunction(V8CacheOptions cache_options, CompileFn SelectCompileFunction(V8CacheOptions cache_options,
ScriptResource* resource, CachedMetadataHandler* cache_handler,
ScriptStreamer* streamer) { ScriptStreamer* streamer) {
// We don't stream scripts which don't have a Resource.
DCHECK(resource);
// Failed resources should never get this far.
DCHECK(!resource->ErrorOccurred());
DCHECK(streamer->IsFinished()); DCHECK(streamer->IsFinished());
DCHECK(!streamer->StreamingSuppressed()); DCHECK(!streamer->StreamingSuppressed());
// Streaming compilation may involve use of code cache. // Streaming compilation may involve use of code cache.
// TODO(leszeks): Add compile timer to streaming compilation. // TODO(leszeks): Add compile timer to streaming compilation.
return WTF::Bind(PostStreamCompile, cache_options, return WTF::Bind(PostStreamCompile, cache_options,
WrapPersistent(resource->CacheHandler()), WrapPersistent(cache_handler), WrapPersistent(streamer));
WrapPersistent(streamer));
} }
} // namespace } // namespace
...@@ -496,7 +491,7 @@ v8::MaybeLocal<v8::Script> V8ScriptRunner::CompileScript( ...@@ -496,7 +491,7 @@ v8::MaybeLocal<v8::Script> V8ScriptRunner::CompileScript(
} }
CompileFn compile_fn = CompileFn compile_fn =
streamer ? SelectCompileFunction(cache_options, resource, streamer) streamer ? SelectCompileFunction(cache_options, cache_handler, streamer)
: SelectCompileFunction(cache_options, cache_handler, code, : SelectCompileFunction(cache_options, cache_handler, code,
no_handler_reason); no_handler_reason);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment