[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/1113742
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54016}
This commit is contained in:
Ben L. Titzer 2018-06-25 17:02:40 +02:00 committed by Commit Bot
parent 7ef7290765
commit 588e179449
4 changed files with 20 additions and 17 deletions

View File

@ -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();
}

View File

@ -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_;

View File

@ -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

View File

@ -41,13 +41,13 @@ 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,
PoisoningMitigationLevel::kPoisonAll);
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) {
PrintableInstructionSequence printable = {RegisterConfiguration::Default(),