[Turbofan] Simplified lowering to be done concurrently.
R=jarin@chromium.org BUG=v8:5428 Review-Url: https://codereview.chromium.org/2611523002 Cr-Commit-Position: refs/heads/master@{#42012}
This commit is contained in:
parent
5622bc15f1
commit
0663c225f8
@ -945,8 +945,8 @@ struct EscapeAnalysisPhase {
|
||||
}
|
||||
};
|
||||
|
||||
struct RepresentationSelectionPhase {
|
||||
static const char* phase_name() { return "representation selection"; }
|
||||
struct SimplifiedLoweringPhase {
|
||||
static const char* phase_name() { return "simplified lowering"; }
|
||||
|
||||
void Run(PipelineData* data, Zone* temp_zone) {
|
||||
SimplifiedLowering lowering(data->jsgraph(), temp_zone,
|
||||
@ -1553,11 +1553,22 @@ bool PipelineImpl::CreateGraph() {
|
||||
}
|
||||
}
|
||||
|
||||
// Select representations. This has to run w/o the Typer decorator, because
|
||||
// we cannot compute meaningful types anyways, and the computed types might
|
||||
// even conflict with the representation/truncation logic.
|
||||
Run<RepresentationSelectionPhase>();
|
||||
RunPrintAndVerify("Representations selected", true);
|
||||
// Do some hacky things to prepare generic lowering.
|
||||
Run<GenericLoweringPrepPhase>();
|
||||
|
||||
data->EndPhaseKind();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PipelineImpl::OptimizeGraph(Linkage* linkage) {
|
||||
PipelineData* data = this->data_;
|
||||
|
||||
// Perform simplified lowering. This has to run w/o the Typer decorator,
|
||||
// because we cannot compute meaningful types anyways, and the computed types
|
||||
// might even conflict with the representation/truncation logic.
|
||||
Run<SimplifiedLoweringPhase>();
|
||||
RunPrintAndVerify("Simplified lowering", true);
|
||||
|
||||
#ifdef DEBUG
|
||||
// From now on it is invalid to look at types on the nodes, because:
|
||||
@ -1576,17 +1587,6 @@ bool PipelineImpl::CreateGraph() {
|
||||
RunPrintAndVerify("Untyped", true);
|
||||
#endif
|
||||
|
||||
// Do some hacky things to prepare generic lowering.
|
||||
Run<GenericLoweringPrepPhase>();
|
||||
|
||||
data->EndPhaseKind();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PipelineImpl::OptimizeGraph(Linkage* linkage) {
|
||||
PipelineData* data = this->data_;
|
||||
|
||||
// Run generic lowering pass.
|
||||
Run<GenericLoweringPhase>();
|
||||
RunPrintAndVerify("Generic lowering", true);
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "src/base/bits.h"
|
||||
#include "src/code-factory.h"
|
||||
#include "src/compiler/machine-operator.h"
|
||||
#include "src/compiler/node-matchers.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
@ -694,8 +695,12 @@ Node* RepresentationChanger::GetBitRepresentationFor(
|
||||
// Eagerly fold representation changes for constants.
|
||||
switch (node->opcode()) {
|
||||
case IrOpcode::kHeapConstant: {
|
||||
Handle<HeapObject> value = OpParameter<Handle<HeapObject>>(node);
|
||||
return jsgraph()->Int32Constant(value->BooleanValue() ? 1 : 0);
|
||||
HeapObjectMatcher m(node);
|
||||
if (m.Is(factory()->false_value())) {
|
||||
return jsgraph()->Int32Constant(0);
|
||||
} else if (m.Is(factory()->true_value())) {
|
||||
return jsgraph()->Int32Constant(1);
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
@ -1109,17 +1109,14 @@ class RepresentationSelector {
|
||||
return kNoWriteBarrier;
|
||||
}
|
||||
if (value_type->IsHeapConstant()) {
|
||||
Handle<HeapObject> value_object = value_type->AsHeapConstant()->Value();
|
||||
RootIndexMap root_index_map(jsgraph_->isolate());
|
||||
int root_index = root_index_map.Lookup(*value_object);
|
||||
if (root_index != RootIndexMap::kInvalidRootIndex &&
|
||||
jsgraph_->isolate()->heap()->RootIsImmortalImmovable(root_index)) {
|
||||
// Write barriers are unnecessary for immortal immovable roots.
|
||||
return kNoWriteBarrier;
|
||||
}
|
||||
if (value_object->IsMap()) {
|
||||
// Write barriers for storing maps are cheaper.
|
||||
return kMapWriteBarrier;
|
||||
Heap::RootListIndex root_index;
|
||||
Heap* heap = jsgraph_->isolate()->heap();
|
||||
if (heap->IsRootHandle(value_type->AsHeapConstant()->Value(),
|
||||
&root_index)) {
|
||||
if (heap->RootIsImmortalImmovable(root_index)) {
|
||||
// Write barriers are unnecessary for immortal immovable roots.
|
||||
return kNoWriteBarrier;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (field_representation == MachineRepresentation::kTaggedPointer ||
|
||||
|
Loading…
Reference in New Issue
Block a user