Skip to content

Commit

Permalink
[vm] Use zone memory allocation in StreamingFlowGraphBuilder::BuildSw…
Browse files Browse the repository at this point in the history
…itchStatement

Change-Id: Ia01bec5941a3daefd4aed43c5951e9ab44f48d46
Reviewed-on: https://dart-review.googlesource.com/69700
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
  • Loading branch information
alexmarkov authored and commit-bot@chromium.org committed Aug 13, 2018
1 parent 8a05c94 commit 120f595
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 3 additions & 0 deletions runtime/vm/compiler/frontend/base_flow_graph_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class Fragment {
Fragment& operator<<=(Instruction* next);

Fragment closed();

private:
DISALLOW_ALLOCATION();
};

Fragment operator+(const Fragment& first, const Fragment& second);
Expand Down
7 changes: 2 additions & 5 deletions runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4809,8 +4809,8 @@ Fragment StreamingFlowGraphBuilder::BuildSwitchStatement() {
// of a jump due to:
// * `continue case_label`
// * `case e1: case e2: body`
Fragment* body_fragments = new Fragment[case_count];
intptr_t* case_expression_offsets = new intptr_t[case_count];
Fragment* body_fragments = Z->Alloc<Fragment>(case_count);
intptr_t* case_expression_offsets = Z->Alloc<intptr_t>(case_count);
int default_case = -1;

for (intptr_t i = 0; i < case_count; ++i) {
Expand Down Expand Up @@ -4992,9 +4992,6 @@ Fragment StreamingFlowGraphBuilder::BuildSwitchStatement() {
// default case.
}

delete[] body_fragments;
delete[] case_expression_offsets;

SetOffset(end_offset);
return Fragment(head_instructions.entry, current_instructions.current);
}
Expand Down

0 comments on commit 120f595

Please sign in to comment.