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

Side by Side Diff: src/IceGlobalContext.cpp

Issue 1860473002: Subzero. Refactors Switch Lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: git pull Created 4 years, 8 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 | « src/IceGlobalContext.h ('k') | src/IceInst.h » ('j') | 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/IceGlobalContext.cpp - Global context defs -------------===// 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===//
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 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 // Create a random number generator for jump tables reordering, considering 865 // Create a random number generator for jump tables reordering, considering
866 // jump tables as pooled constants. 866 // jump tables as pooled constants.
867 RandomNumberGenerator RNG(getFlags().getRandomSeed(), 867 RandomNumberGenerator RNG(getFlags().getRandomSeed(),
868 RPE_PooledConstantReordering); 868 RPE_PooledConstantReordering);
869 RandomShuffle(JumpTables.begin(), JumpTables.end(), 869 RandomShuffle(JumpTables.begin(), JumpTables.end(),
870 [&RNG](uint64_t N) { return (uint32_t)RNG.next(N); }); 870 [&RNG](uint64_t N) { return (uint32_t)RNG.next(N); });
871 } 871 }
872 return JumpTables; 872 return JumpTables;
873 } 873 }
874 874
875 JumpTableData & 875 void GlobalContext::addJumpTableData(JumpTableData JumpTable) {
876 GlobalContext::addJumpTable(GlobalString FuncName, SizeT Id, 876 getJumpTableList()->emplace_back(std::move(JumpTable));
877 const JumpTableData::TargetList &TargetList) {
878 auto JumpTableList = getJumpTableList();
879 JumpTableList->emplace_back(FuncName, Id, TargetList);
880 return JumpTableList->back();
881 } 877 }
882 878
883 TimerStackIdT GlobalContext::newTimerStackID(const std::string &Name) { 879 TimerStackIdT GlobalContext::newTimerStackID(const std::string &Name) {
884 if (!BuildDefs::timers()) 880 if (!BuildDefs::timers())
885 return 0; 881 return 0;
886 auto Timers = getTimers(); 882 auto Timers = getTimers();
887 TimerStackIdT NewID = Timers->size(); 883 TimerStackIdT NewID = Timers->size();
888 Timers->push_back(TimerStack(Name)); 884 Timers->push_back(TimerStack(Name));
889 return NewID; 885 return NewID;
890 } 886 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 void TimerMarker::pushCfg(const Cfg *Func) { 1008 void TimerMarker::pushCfg(const Cfg *Func) {
1013 Ctx = Func->getContext(); 1009 Ctx = Func->getContext();
1014 Active = Func->getFocusedTiming() || getFlags().getSubzeroTimingEnabled(); 1010 Active = Func->getFocusedTiming() || getFlags().getSubzeroTimingEnabled();
1015 if (Active) 1011 if (Active)
1016 Ctx->pushTimer(ID, StackID); 1012 Ctx->pushTimer(ID, StackID);
1017 } 1013 }
1018 1014
1019 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); 1015 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS);
1020 1016
1021 } // end of namespace Ice 1017 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceInst.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698