Commit 5c9f4f98 authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by Commit Bot

[turbofan] Graph assembler label: no need for explicit merge count anymore.

Bug: v8:5267
Change-Id: Ib103fbc3cabaac191dde817724308b19361c443b
Reviewed-on: https://chromium-review.googlesource.com/640385Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47670}
parent a529f128
This diff is collapsed.
......@@ -93,7 +93,7 @@ class GraphAssemblerLabel {
template <typename... Reps>
explicit GraphAssemblerLabel(GraphAssemblerLabelType is_deferred,
size_t merge_count, Reps... reps)
Reps... reps)
: is_deferred_(is_deferred == GraphAssemblerLabelType::kDeferred) {
STATIC_ASSERT(VarCount == sizeof...(reps));
MachineRepresentation reps_array[] = {MachineRepresentation::kNone,
......@@ -130,28 +130,23 @@ class GraphAssembler {
void Reset(Node* effect, Node* control);
// Create non-deferred label with statically known number of incoming
// gotos/branches.
template <size_t MergeCount, typename... Reps>
static GraphAssemblerLabel<sizeof...(Reps)> MakeLabel(Reps... reps) {
return GraphAssemblerLabel<sizeof...(Reps)>(
GraphAssemblerLabelType::kNonDeferred, MergeCount, reps...);
// Create label.
template <typename... Reps>
static GraphAssemblerLabel<sizeof...(Reps)> MakeLabelFor(
GraphAssemblerLabelType is_deferred, Reps... reps) {
return GraphAssemblerLabel<sizeof...(Reps)>(is_deferred, reps...);
}
// Create deferred label with statically known number of incoming
// gotos/branches.
template <size_t MergeCount, typename... Reps>
static GraphAssemblerLabel<sizeof...(Reps)> MakeDeferredLabel(Reps... reps) {
return GraphAssemblerLabel<sizeof...(Reps)>(
GraphAssemblerLabelType::kDeferred, MergeCount, reps...);
// Convenience wrapper for creating non-deferred labels.
template <typename... Reps>
static GraphAssemblerLabel<sizeof...(Reps)> MakeLabel(Reps... reps) {
return MakeLabelFor(GraphAssemblerLabelType::kNonDeferred, reps...);
}
// Create label with number of incoming branches supplied at runtime.
// Convenience wrapper for creating deferred labels.
template <typename... Reps>
GraphAssemblerLabel<sizeof...(Reps)> MakeLabelFor(
GraphAssemblerLabelType is_deferred, size_t merge_count, Reps... reps) {
return GraphAssemblerLabel<sizeof...(Reps)>(is_deferred, merge_count,
reps...);
static GraphAssemblerLabel<sizeof...(Reps)> MakeDeferredLabel(Reps... reps) {
return MakeLabelFor(GraphAssemblerLabelType::kDeferred, reps...);
}
// Value creation.
......
......@@ -195,8 +195,8 @@ void MemoryOptimizer::VisitAllocate(Node* node, AllocationState const* state) {
group->Add(value);
state = AllocationState::Open(group, state_size, top, zone());
} else {
auto call_runtime = __ MakeDeferredLabel<1>();
auto done = __ MakeLabel<2>(MachineType::PointerRepresentation());
auto call_runtime = __ MakeDeferredLabel();
auto done = __ MakeLabel(MachineType::PointerRepresentation());
// Setup a mutable reservation size node; will be patched as we fold
// additional allocations into this new group.
......@@ -252,8 +252,8 @@ void MemoryOptimizer::VisitAllocate(Node* node, AllocationState const* state) {
state = AllocationState::Open(group, object_size, top, zone());
}
} else {
auto call_runtime = __ MakeDeferredLabel<1>();
auto done = __ MakeLabel<2>(MachineRepresentation::kTaggedPointer);
auto call_runtime = __ MakeDeferredLabel();
auto done = __ MakeLabel(MachineRepresentation::kTaggedPointer);
// Load allocation top and limit.
Node* top =
......
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