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 { ...@@ -93,7 +93,7 @@ class GraphAssemblerLabel {
template <typename... Reps> template <typename... Reps>
explicit GraphAssemblerLabel(GraphAssemblerLabelType is_deferred, explicit GraphAssemblerLabel(GraphAssemblerLabelType is_deferred,
size_t merge_count, Reps... reps) Reps... reps)
: is_deferred_(is_deferred == GraphAssemblerLabelType::kDeferred) { : is_deferred_(is_deferred == GraphAssemblerLabelType::kDeferred) {
STATIC_ASSERT(VarCount == sizeof...(reps)); STATIC_ASSERT(VarCount == sizeof...(reps));
MachineRepresentation reps_array[] = {MachineRepresentation::kNone, MachineRepresentation reps_array[] = {MachineRepresentation::kNone,
...@@ -130,28 +130,23 @@ class GraphAssembler { ...@@ -130,28 +130,23 @@ class GraphAssembler {
void Reset(Node* effect, Node* control); void Reset(Node* effect, Node* control);
// Create non-deferred label with statically known number of incoming // Create label.
// gotos/branches. template <typename... Reps>
template <size_t MergeCount, typename... Reps> static GraphAssemblerLabel<sizeof...(Reps)> MakeLabelFor(
static GraphAssemblerLabel<sizeof...(Reps)> MakeLabel(Reps... reps) { GraphAssemblerLabelType is_deferred, Reps... reps) {
return GraphAssemblerLabel<sizeof...(Reps)>( return GraphAssemblerLabel<sizeof...(Reps)>(is_deferred, reps...);
GraphAssemblerLabelType::kNonDeferred, MergeCount, reps...);
} }
// Create deferred label with statically known number of incoming // Convenience wrapper for creating non-deferred labels.
// gotos/branches. template <typename... Reps>
template <size_t MergeCount, typename... Reps> static GraphAssemblerLabel<sizeof...(Reps)> MakeLabel(Reps... reps) {
static GraphAssemblerLabel<sizeof...(Reps)> MakeDeferredLabel(Reps... reps) { return MakeLabelFor(GraphAssemblerLabelType::kNonDeferred, reps...);
return GraphAssemblerLabel<sizeof...(Reps)>(
GraphAssemblerLabelType::kDeferred, MergeCount, reps...);
} }
// Create label with number of incoming branches supplied at runtime. // Convenience wrapper for creating deferred labels.
template <typename... Reps> template <typename... Reps>
GraphAssemblerLabel<sizeof...(Reps)> MakeLabelFor( static GraphAssemblerLabel<sizeof...(Reps)> MakeDeferredLabel(Reps... reps) {
GraphAssemblerLabelType is_deferred, size_t merge_count, Reps... reps) { return MakeLabelFor(GraphAssemblerLabelType::kDeferred, reps...);
return GraphAssemblerLabel<sizeof...(Reps)>(is_deferred, merge_count,
reps...);
} }
// Value creation. // Value creation.
......
...@@ -195,8 +195,8 @@ void MemoryOptimizer::VisitAllocate(Node* node, AllocationState const* state) { ...@@ -195,8 +195,8 @@ void MemoryOptimizer::VisitAllocate(Node* node, AllocationState const* state) {
group->Add(value); group->Add(value);
state = AllocationState::Open(group, state_size, top, zone()); state = AllocationState::Open(group, state_size, top, zone());
} else { } else {
auto call_runtime = __ MakeDeferredLabel<1>(); auto call_runtime = __ MakeDeferredLabel();
auto done = __ MakeLabel<2>(MachineType::PointerRepresentation()); auto done = __ MakeLabel(MachineType::PointerRepresentation());
// Setup a mutable reservation size node; will be patched as we fold // Setup a mutable reservation size node; will be patched as we fold
// additional allocations into this new group. // additional allocations into this new group.
...@@ -252,8 +252,8 @@ void MemoryOptimizer::VisitAllocate(Node* node, AllocationState const* state) { ...@@ -252,8 +252,8 @@ void MemoryOptimizer::VisitAllocate(Node* node, AllocationState const* state) {
state = AllocationState::Open(group, object_size, top, zone()); state = AllocationState::Open(group, object_size, top, zone());
} }
} else { } else {
auto call_runtime = __ MakeDeferredLabel<1>(); auto call_runtime = __ MakeDeferredLabel();
auto done = __ MakeLabel<2>(MachineRepresentation::kTaggedPointer); auto done = __ MakeLabel(MachineRepresentation::kTaggedPointer);
// Load allocation top and limit. // Load allocation top and limit.
Node* top = 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