Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: src/IceTargetLoweringX86BaseImpl.h

Issue 1240323005: Avoid heap allocation for binary search work stack. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 4680 matching lines...) Expand 10 before | Expand all | Expand 10 after
4691 4691
4692 // A span is over the clusters 4692 // A span is over the clusters
4693 struct SearchSpan { 4693 struct SearchSpan {
4694 SearchSpan(SizeT Begin, SizeT Size, typename Traits::Insts::Label *Label) 4694 SearchSpan(SizeT Begin, SizeT Size, typename Traits::Insts::Label *Label)
4695 : Begin(Begin), Size(Size), Label(Label) {} 4695 : Begin(Begin), Size(Size), Label(Label) {}
4696 4696
4697 SizeT Begin; 4697 SizeT Begin;
4698 SizeT Size; 4698 SizeT Size;
4699 typename Traits::Insts::Label *Label; 4699 typename Traits::Insts::Label *Label;
4700 }; 4700 };
4701 std::stack<SearchSpan, std::deque<SearchSpan, CfgLocalAllocator<SearchSpan>>> 4701 // The stack will only grow to the height of the tree so 12 should be plenty
4702 SearchSpanStack; 4702 std::stack<SearchSpan, llvm::SmallVector<SearchSpan, 12>> SearchSpanStack;
4703 SearchSpanStack.emplace(0, CaseClusters.size(), nullptr); 4703 SearchSpanStack.emplace(0, CaseClusters.size(), nullptr);
4704 bool DoneCmp = false; 4704 bool DoneCmp = false;
4705 4705
4706 while (!SearchSpanStack.empty()) { 4706 while (!SearchSpanStack.empty()) {
4707 SearchSpan Span = SearchSpanStack.top(); 4707 SearchSpan Span = SearchSpanStack.top();
4708 SearchSpanStack.pop(); 4708 SearchSpanStack.pop();
4709 4709
4710 if (Span.Label != nullptr) 4710 if (Span.Label != nullptr)
4711 Context.insert(Span.Label); 4711 Context.insert(Span.Label);
4712 4712
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
5616 } 5616 }
5617 // the offset is not eligible for blinding or pooling, return the original 5617 // the offset is not eligible for blinding or pooling, return the original
5618 // mem operand 5618 // mem operand
5619 return MemOperand; 5619 return MemOperand;
5620 } 5620 }
5621 5621
5622 } // end of namespace X86Internal 5622 } // end of namespace X86Internal
5623 } // end of namespace Ice 5623 } // end of namespace Ice
5624 5624
5625 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H 5625 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698