Commit 250c58dd authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[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/+/1992439Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65662}
parent f4893bbe
...@@ -110,7 +110,7 @@ std::unique_ptr<WasmInstructionBuffer> WasmInstructionBuffer::New(size_t size) { ...@@ -110,7 +110,7 @@ std::unique_ptr<WasmInstructionBuffer> WasmInstructionBuffer::New(size_t size) {
// End of PIMPL interface WasmInstructionBuffer for WasmInstBufferImpl // End of PIMPL interface WasmInstructionBuffer for WasmInstBufferImpl
// static // static
ExecutionTier WasmCompilationUnit::GetDefaultExecutionTier( ExecutionTier WasmCompilationUnit::GetBaselineExecutionTier(
const WasmModule* module) { const WasmModule* module) {
// Liftoff does not support the special asm.js opcodes, thus always compile // Liftoff does not support the special asm.js opcodes, thus always compile
// asm.js modules with TurboFan. // asm.js modules with TurboFan.
......
...@@ -76,7 +76,7 @@ struct WasmCompilationResult { ...@@ -76,7 +76,7 @@ struct WasmCompilationResult {
class V8_EXPORT_PRIVATE WasmCompilationUnit final { class V8_EXPORT_PRIVATE WasmCompilationUnit final {
public: public:
static ExecutionTier GetDefaultExecutionTier(const WasmModule*); static ExecutionTier GetBaselineExecutionTier(const WasmModule*);
WasmCompilationUnit(int index, ExecutionTier tier) WasmCompilationUnit(int index, ExecutionTier tier)
: func_index_(index), tier_(tier) {} : func_index_(index), tier_(tier) {}
......
...@@ -668,17 +668,15 @@ ExecutionTierPair GetRequestedExecutionTiers( ...@@ -668,17 +668,15 @@ ExecutionTierPair GetRequestedExecutionTiers(
const WasmFeatures& enabled_features, uint32_t func_index) { const WasmFeatures& enabled_features, uint32_t func_index) {
ExecutionTierPair result; ExecutionTierPair result;
result.baseline_tier = WasmCompilationUnit::GetBaselineExecutionTier(module);
switch (compile_mode) { switch (compile_mode) {
case CompileMode::kRegular: case CompileMode::kRegular:
result.baseline_tier =
WasmCompilationUnit::GetDefaultExecutionTier(module);
result.top_tier = result.baseline_tier; result.top_tier = result.baseline_tier;
return result; return result;
case CompileMode::kTiering: case CompileMode::kTiering:
// Default tiering behaviour. // Default tiering behaviour.
result.baseline_tier = ExecutionTier::kLiftoff;
result.top_tier = ExecutionTier::kTurbofan; result.top_tier = ExecutionTier::kTurbofan;
// Check if compilation hints override default tiering behaviour. // Check if compilation hints override default tiering behaviour.
...@@ -711,9 +709,7 @@ ExecutionTierPair GetRequestedExecutionTiers( ...@@ -711,9 +709,7 @@ ExecutionTierPair GetRequestedExecutionTiers(
class CompilationUnitBuilder { class CompilationUnitBuilder {
public: public:
explicit CompilationUnitBuilder(NativeModule* native_module) explicit CompilationUnitBuilder(NativeModule* native_module)
: native_module_(native_module), : native_module_(native_module) {}
default_tier_(WasmCompilationUnit::GetDefaultExecutionTier(
native_module->module())) {}
void AddUnits(uint32_t func_index) { void AddUnits(uint32_t func_index) {
if (func_index < native_module_->module()->num_imported_functions) { if (func_index < native_module_->module()->num_imported_functions) {
...@@ -775,7 +771,6 @@ class CompilationUnitBuilder { ...@@ -775,7 +771,6 @@ class CompilationUnitBuilder {
} }
NativeModule* const native_module_; NativeModule* const native_module_;
const ExecutionTier default_tier_;
std::vector<WasmCompilationUnit> baseline_units_; std::vector<WasmCompilationUnit> baseline_units_;
std::vector<WasmCompilationUnit> tiering_units_; std::vector<WasmCompilationUnit> tiering_units_;
std::vector<std::shared_ptr<JSToWasmWrapperCompilationUnit>> std::vector<std::shared_ptr<JSToWasmWrapperCompilationUnit>>
......
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