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( ...@@ -27,7 +27,7 @@ InstructionSelector::InstructionSelector(
EnableSwitchJumpTable enable_switch_jump_table, EnableSwitchJumpTable enable_switch_jump_table,
SourcePositionMode source_position_mode, Features features, SourcePositionMode source_position_mode, Features features,
EnableScheduling enable_scheduling, EnableScheduling enable_scheduling,
EnableSerialization enable_serialization, EnableRootsRelativeAddressing enable_roots_relative_addressing,
PoisoningMitigationLevel poisoning_level, EnableTraceTurboJson trace_turbo) PoisoningMitigationLevel poisoning_level, EnableTraceTurboJson trace_turbo)
: zone_(zone), : zone_(zone),
linkage_(linkage), linkage_(linkage),
...@@ -48,7 +48,7 @@ InstructionSelector::InstructionSelector( ...@@ -48,7 +48,7 @@ InstructionSelector::InstructionSelector(
virtual_register_rename_(zone), virtual_register_rename_(zone),
scheduler_(nullptr), scheduler_(nullptr),
enable_scheduling_(enable_scheduling), enable_scheduling_(enable_scheduling),
enable_serialization_(enable_serialization), enable_roots_relative_addressing_(enable_roots_relative_addressing),
enable_switch_jump_table_(enable_switch_jump_table), enable_switch_jump_table_(enable_switch_jump_table),
poisoning_level_(poisoning_level), poisoning_level_(poisoning_level),
frame_(frame), frame_(frame),
...@@ -420,7 +420,7 @@ void InstructionSelector::SetEffectLevel(Node* node, int effect_level) { ...@@ -420,7 +420,7 @@ void InstructionSelector::SetEffectLevel(Node* node, int effect_level) {
} }
bool InstructionSelector::CanAddressRelativeToRootsRegister() const { bool InstructionSelector::CanAddressRelativeToRootsRegister() const {
return enable_serialization_ == kDisableSerialization && return enable_roots_relative_addressing_ == kEnableRootsRelativeAddressing &&
CanUseRootsRegister(); CanUseRootsRegister();
} }
......
...@@ -251,7 +251,10 @@ class V8_EXPORT_PRIVATE InstructionSelector final { ...@@ -251,7 +251,10 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
enum SourcePositionMode { kCallSourcePositions, kAllSourcePositions }; enum SourcePositionMode { kCallSourcePositions, kAllSourcePositions };
enum EnableScheduling { kDisableScheduling, kEnableScheduling }; enum EnableScheduling { kDisableScheduling, kEnableScheduling };
enum EnableSerialization { kDisableSerialization, kEnableSerialization }; enum EnableRootsRelativeAddressing {
kDisableRootsRelativeAddressing,
kEnableRootsRelativeAddressing
};
enum EnableSwitchJumpTable { enum EnableSwitchJumpTable {
kDisableSwitchJumpTable, kDisableSwitchJumpTable,
kEnableSwitchJumpTable kEnableSwitchJumpTable
...@@ -268,7 +271,8 @@ class V8_EXPORT_PRIVATE InstructionSelector final { ...@@ -268,7 +271,8 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
EnableScheduling enable_scheduling = FLAG_turbo_instruction_scheduling EnableScheduling enable_scheduling = FLAG_turbo_instruction_scheduling
? kEnableScheduling ? kEnableScheduling
: kDisableScheduling, : kDisableScheduling,
EnableSerialization enable_serialization = kDisableSerialization, EnableRootsRelativeAddressing enable_roots_relative_addressing =
kDisableRootsRelativeAddressing,
PoisoningMitigationLevel poisoning_level = PoisoningMitigationLevel poisoning_level =
PoisoningMitigationLevel::kDontPoison, PoisoningMitigationLevel::kDontPoison,
EnableTraceTurboJson trace_turbo = kDisableTraceTurboJson); EnableTraceTurboJson trace_turbo = kDisableTraceTurboJson);
...@@ -433,8 +437,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final { ...@@ -433,8 +437,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
const std::map<NodeId, int> GetVirtualRegistersForTesting() const; const std::map<NodeId, int> GetVirtualRegistersForTesting() const;
// Check if we can generate loads and stores of ExternalConstants relative // 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 // to the roots register.
// compilation unit and the serializer is disabled.
bool CanAddressRelativeToRootsRegister() const; bool CanAddressRelativeToRootsRegister() const;
// Check if we can use the roots register to access GC roots. // Check if we can use the roots register to access GC roots.
bool CanUseRootsRegister() const; bool CanUseRootsRegister() const;
...@@ -706,7 +709,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final { ...@@ -706,7 +709,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
IntVector virtual_register_rename_; IntVector virtual_register_rename_;
InstructionScheduler* scheduler_; InstructionScheduler* scheduler_;
EnableScheduling enable_scheduling_; EnableScheduling enable_scheduling_;
EnableSerialization enable_serialization_; EnableRootsRelativeAddressing enable_roots_relative_addressing_;
EnableSwitchJumpTable enable_switch_jump_table_; EnableSwitchJumpTable enable_switch_jump_table_;
PoisoningMitigationLevel poisoning_level_; PoisoningMitigationLevel poisoning_level_;
......
...@@ -1646,8 +1646,8 @@ struct InstructionSelectionPhase { ...@@ -1646,8 +1646,8 @@ struct InstructionSelectionPhase {
? InstructionSelector::kEnableScheduling ? InstructionSelector::kEnableScheduling
: InstructionSelector::kDisableScheduling, : InstructionSelector::kDisableScheduling,
data->isolate()->serializer_enabled() data->isolate()->serializer_enabled()
? InstructionSelector::kEnableSerialization ? InstructionSelector::kDisableRootsRelativeAddressing
: InstructionSelector::kDisableSerialization, : InstructionSelector::kEnableRootsRelativeAddressing,
data->info()->GetPoisoningMitigationLevel(), data->info()->GetPoisoningMitigationLevel(),
data->info()->trace_turbo_json_enabled() data->info()->trace_turbo_json_enabled()
? InstructionSelector::kEnableTraceTurboJson ? InstructionSelector::kEnableTraceTurboJson
......
...@@ -41,13 +41,13 @@ InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build( ...@@ -41,13 +41,13 @@ InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build(
InstructionSequence sequence(test_->isolate(), test_->zone(), InstructionSequence sequence(test_->isolate(), test_->zone(),
instruction_blocks); instruction_blocks);
SourcePositionTable source_position_table(graph()); SourcePositionTable source_position_table(graph());
InstructionSelector selector(test_->zone(), node_count, &linkage, &sequence, InstructionSelector selector(
schedule, &source_position_table, nullptr, test_->zone(), node_count, &linkage, &sequence, schedule,
InstructionSelector::kEnableSwitchJumpTable, &source_position_table, nullptr,
source_position_mode, features, InstructionSelector::kEnableSwitchJumpTable, source_position_mode,
InstructionSelector::kDisableScheduling, features, InstructionSelector::kDisableScheduling,
InstructionSelector::kDisableSerialization, InstructionSelector::kEnableRootsRelativeAddressing,
PoisoningMitigationLevel::kPoisonAll); PoisoningMitigationLevel::kPoisonAll);
selector.SelectInstructions(); selector.SelectInstructions();
if (FLAG_trace_turbo) { if (FLAG_trace_turbo) {
PrintableInstructionSequence printable = {RegisterConfiguration::Default(), PrintableInstructionSequence printable = {RegisterConfiguration::Default(),
......
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