[wasm] Fix compilation tiers for TurboFan-only

If --no-liftoff is passed, we should never compile with Liftoff,
independent of the --wasm-tier-up flag.
The current logic hard-coded Liftoff as baseline tier and TurboFan as
top tier for the tiering case.

Drive-by: Remove unused {default_tier_} field from
          {CompilationUnitBuilder}.

R=ahaas@chromium.org

Bug: chromium:1040061
Change-Id: I65bc5e4aad85396e3b952b41cfe1150f6cd29890
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1992439
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65662}
This commit is contained in:
Clemens Backes 2020-01-09 13:25:37 +01:00 committed by Commit Bot
parent f4893bbef5
commit 250c58ddf0
3 changed files with 4 additions and 9 deletions

View File

@ -110,7 +110,7 @@ std::unique_ptr<WasmInstructionBuffer> WasmInstructionBuffer::New(size_t size) {
// End of PIMPL interface WasmInstructionBuffer for WasmInstBufferImpl
// static
ExecutionTier WasmCompilationUnit::GetDefaultExecutionTier(
ExecutionTier WasmCompilationUnit::GetBaselineExecutionTier(
const WasmModule* module) {
// Liftoff does not support the special asm.js opcodes, thus always compile
// asm.js modules with TurboFan.

View File

@ -76,7 +76,7 @@ struct WasmCompilationResult {
class V8_EXPORT_PRIVATE WasmCompilationUnit final {
public:
static ExecutionTier GetDefaultExecutionTier(const WasmModule*);
static ExecutionTier GetBaselineExecutionTier(const WasmModule*);
WasmCompilationUnit(int index, ExecutionTier tier)
: func_index_(index), tier_(tier) {}

View File

@ -668,17 +668,15 @@ ExecutionTierPair GetRequestedExecutionTiers(
const WasmFeatures& enabled_features, uint32_t func_index) {
ExecutionTierPair result;
result.baseline_tier = WasmCompilationUnit::GetBaselineExecutionTier(module);
switch (compile_mode) {
case CompileMode::kRegular:
result.baseline_tier =
WasmCompilationUnit::GetDefaultExecutionTier(module);
result.top_tier = result.baseline_tier;
return result;
case CompileMode::kTiering:
// Default tiering behaviour.
result.baseline_tier = ExecutionTier::kLiftoff;
result.top_tier = ExecutionTier::kTurbofan;
// Check if compilation hints override default tiering behaviour.
@ -711,9 +709,7 @@ ExecutionTierPair GetRequestedExecutionTiers(
class CompilationUnitBuilder {
public:
explicit CompilationUnitBuilder(NativeModule* native_module)
: native_module_(native_module),
default_tier_(WasmCompilationUnit::GetDefaultExecutionTier(
native_module->module())) {}
: native_module_(native_module) {}
void AddUnits(uint32_t func_index) {
if (func_index < native_module_->module()->num_imported_functions) {
@ -775,7 +771,6 @@ class CompilationUnitBuilder {
}
NativeModule* const native_module_;
const ExecutionTier default_tier_;
std::vector<WasmCompilationUnit> baseline_units_;
std::vector<WasmCompilationUnit> tiering_units_;
std::vector<std::shared_ptr<JSToWasmWrapperCompilationUnit>>