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

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: Fixes typo in comment. 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
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 Ctx = Func->getContext(); 1006 Ctx = Func->getContext();
1011 Active = 1007 Active =
1012 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); 1008 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled();
1013 if (Active) 1009 if (Active)
1014 Ctx->pushTimer(ID, StackID); 1010 Ctx->pushTimer(ID, StackID);
1015 } 1011 }
1016 1012
1017 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); 1013 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS);
1018 1014
1019 } // end of namespace Ice 1015 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698