Commit 635edafa authored by mtrofin's avatar mtrofin Committed by Commit bot

Revert of [wasm] simpler detection if we compiled asm-wasm (patchset #1 id:1...

Revert of [wasm] simpler detection if we compiled asm-wasm (patchset #1 id:1 of https://codereview.chromium.org/2582583002/ )

Reason for revert:
https://build.chromium.org/p/client.v8/builders/V8%20Mac%20GC%20Stress/builds/10384

Original issue's description:
> [wasm] simpler detection if we compiled asm-wasm
>
> BUG=643595
>
> Review-Url: https://codereview.chromium.org/2582583002
> Cr-Commit-Position: refs/heads/master@{#41738}
> Committed: https://chromium.googlesource.com/v8/v8/+/cb433bed0b940a7073b5215e6684b940eec54edd

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

Review-Url: https://codereview.chromium.org/2582623002
Cr-Commit-Position: refs/heads/master@{#41739}
parent cb433bed
...@@ -1366,12 +1366,22 @@ bool CodeGenerationFromStringsAllowed(Isolate* isolate, ...@@ -1366,12 +1366,22 @@ bool CodeGenerationFromStringsAllowed(Isolate* isolate,
} }
} }
bool ContainsAsmModule(Handle<Script> script) { bool ContainsAsmModule(const Scope* scope, Zone* zone) {
WeakFixedArray::Iterator iter(script->shared_function_infos()); DCHECK_NOT_NULL(scope);
DisallowHeapAllocation no_gc; DCHECK_NOT_NULL(zone);
ZoneQueue<const Scope*> worklist(zone);
while (SharedFunctionInfo* info = iter.Next<SharedFunctionInfo>()) { // We assume scopes form a tree, so no need to check for cycles
if (info->HasAsmWasmData()) return true; worklist.push(scope);
while (!worklist.empty()) {
const Scope* s = worklist.front();
worklist.pop();
if (s->IsAsmModule()) {
return true;
}
for (const Scope* child = s->inner_scope(); child != nullptr;
child = child->sibling()) {
worklist.push(child);
}
} }
return false; return false;
} }
...@@ -1518,7 +1528,7 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript( ...@@ -1518,7 +1528,7 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
compilation_cache->PutScript(source, context, language_mode, result); compilation_cache->PutScript(source, context, language_mode, result);
if (FLAG_serialize_toplevel && if (FLAG_serialize_toplevel &&
compile_options == ScriptCompiler::kProduceCodeCache && compile_options == ScriptCompiler::kProduceCodeCache &&
!ContainsAsmModule(script)) { !ContainsAsmModule(info.scope(), &zone)) {
HistogramTimerScope histogram_timer( HistogramTimerScope histogram_timer(
isolate->counters()->compile_serialize()); isolate->counters()->compile_serialize());
RuntimeCallTimerScope runtimeTimer(isolate, RuntimeCallTimerScope runtimeTimer(isolate,
......
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