Commit 588e1794 authored by Ben L. Titzer's avatar Ben L. Titzer Committed by Commit Bot

[compiler] Rename Instruction::kEnableSerialization

The option to "enable serialization" actually only enables the
roots-relative register addressing. In the spirit of expressing specific
behaviors rather than isolate-wide modes, rename this flag to what
it actually does.

R=bmeurer@chromium.org

Change-Id: Iacbad8064c8f38b364db2a0bdd0e83ef4a265867
Reviewed-on: https://chromium-review.googlesource.com/1113742Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54016}
parent 7ef72907
......@@ -27,7 +27,7 @@ InstructionSelector::InstructionSelector(
EnableSwitchJumpTable enable_switch_jump_table,
SourcePositionMode source_position_mode, Features features,
EnableScheduling enable_scheduling,
EnableSerialization enable_serialization,
EnableRootsRelativeAddressing enable_roots_relative_addressing,
PoisoningMitigationLevel poisoning_level, EnableTraceTurboJson trace_turbo)
: zone_(zone),
linkage_(linkage),
......@@ -48,7 +48,7 @@ InstructionSelector::InstructionSelector(
virtual_register_rename_(zone),
scheduler_(nullptr),
enable_scheduling_(enable_scheduling),
enable_serialization_(enable_serialization),
enable_roots_relative_addressing_(enable_roots_relative_addressing),
enable_switch_jump_table_(enable_switch_jump_table),
poisoning_level_(poisoning_level),
frame_(frame),
......@@ -420,7 +420,7 @@ void InstructionSelector::SetEffectLevel(Node* node, int effect_level) {
}
bool InstructionSelector::CanAddressRelativeToRootsRegister() const {
return enable_serialization_ == kDisableSerialization &&
return enable_roots_relative_addressing_ == kEnableRootsRelativeAddressing &&
CanUseRootsRegister();
}
......
......@@ -251,7 +251,10 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
enum SourcePositionMode { kCallSourcePositions, kAllSourcePositions };
enum EnableScheduling { kDisableScheduling, kEnableScheduling };
enum EnableSerialization { kDisableSerialization, kEnableSerialization };
enum EnableRootsRelativeAddressing {
kDisableRootsRelativeAddressing,
kEnableRootsRelativeAddressing
};
enum EnableSwitchJumpTable {
kDisableSwitchJumpTable,
kEnableSwitchJumpTable
......@@ -268,7 +271,8 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
EnableScheduling enable_scheduling = FLAG_turbo_instruction_scheduling
? kEnableScheduling
: kDisableScheduling,
EnableSerialization enable_serialization = kDisableSerialization,
EnableRootsRelativeAddressing enable_roots_relative_addressing =
kDisableRootsRelativeAddressing,
PoisoningMitigationLevel poisoning_level =
PoisoningMitigationLevel::kDontPoison,
EnableTraceTurboJson trace_turbo = kDisableTraceTurboJson);
......@@ -433,8 +437,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
const std::map<NodeId, int> GetVirtualRegistersForTesting() const;
// Check if we can generate loads and stores of ExternalConstants relative
// to the roots register, i.e. if both a root register is available for this
// compilation unit and the serializer is disabled.
// to the roots register.
bool CanAddressRelativeToRootsRegister() const;
// Check if we can use the roots register to access GC roots.
bool CanUseRootsRegister() const;
......@@ -706,7 +709,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
IntVector virtual_register_rename_;
InstructionScheduler* scheduler_;
EnableScheduling enable_scheduling_;
EnableSerialization enable_serialization_;
EnableRootsRelativeAddressing enable_roots_relative_addressing_;
EnableSwitchJumpTable enable_switch_jump_table_;
PoisoningMitigationLevel poisoning_level_;
......
......@@ -1646,8 +1646,8 @@ struct InstructionSelectionPhase {
? InstructionSelector::kEnableScheduling
: InstructionSelector::kDisableScheduling,
data->isolate()->serializer_enabled()
? InstructionSelector::kEnableSerialization
: InstructionSelector::kDisableSerialization,
? InstructionSelector::kDisableRootsRelativeAddressing
: InstructionSelector::kEnableRootsRelativeAddressing,
data->info()->GetPoisoningMitigationLevel(),
data->info()->trace_turbo_json_enabled()
? InstructionSelector::kEnableTraceTurboJson
......
......@@ -41,12 +41,12 @@ InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build(
InstructionSequence sequence(test_->isolate(), test_->zone(),
instruction_blocks);
SourcePositionTable source_position_table(graph());
InstructionSelector selector(test_->zone(), node_count, &linkage, &sequence,
schedule, &source_position_table, nullptr,
InstructionSelector::kEnableSwitchJumpTable,
source_position_mode, features,
InstructionSelector::kDisableScheduling,
InstructionSelector::kDisableSerialization,
InstructionSelector selector(
test_->zone(), node_count, &linkage, &sequence, schedule,
&source_position_table, nullptr,
InstructionSelector::kEnableSwitchJumpTable, source_position_mode,
features, InstructionSelector::kDisableScheduling,
InstructionSelector::kEnableRootsRelativeAddressing,
PoisoningMitigationLevel::kPoisonAll);
selector.SelectInstructions();
if (FLAG_trace_turbo) {
......
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