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

Side by Side Diff: src/IceGlobalContext.cpp

Issue 1783113002: Subzero: Improve the behavior of resizing vectors. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 9 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/IceAssemblerX86BaseImpl.h ('k') | src/IceUtils.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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 emitQueueBlockingPush(Item); 368 emitQueueBlockingPush(Item);
369 // The Cfg now gets deleted as Func goes out of scope. 369 // The Cfg now gets deleted as Func goes out of scope.
370 } 370 }
371 } 371 }
372 372
373 namespace { 373 namespace {
374 374
375 // Ensure Pending is large enough that Pending[Index] is valid. 375 // Ensure Pending is large enough that Pending[Index] is valid.
376 void resizePending(std::vector<EmitterWorkItem *> &Pending, uint32_t Index) { 376 void resizePending(std::vector<EmitterWorkItem *> &Pending, uint32_t Index) {
377 if (Index >= Pending.size()) 377 if (Index >= Pending.size())
378 Pending.resize(Index + 1); 378 Utils::reserveAndResize(Pending, Index + 1);
379 } 379 }
380 380
381 } // end of anonymous namespace 381 } // end of anonymous namespace
382 382
383 void GlobalContext::emitFileHeader() { 383 void GlobalContext::emitFileHeader() {
384 TimerMarker T1(Ice::TimerStack::TT_emitAsm, this); 384 TimerMarker T1(Ice::TimerStack::TT_emitAsm, this);
385 if (getFlags().getOutFileType() == FT_Elf) { 385 if (getFlags().getOutFileType() == FT_Elf) {
386 getObjectWriter()->writeInitialELFHeader(); 386 getObjectWriter()->writeInitialELFHeader();
387 } else { 387 } else {
388 if (!BuildDefs::dump()) { 388 if (!BuildDefs::dump()) {
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 Ctx = Func->getContext(); 914 Ctx = Func->getContext();
915 Active = 915 Active =
916 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); 916 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled();
917 if (Active) 917 if (Active)
918 Ctx->pushTimer(ID, StackID); 918 Ctx->pushTimer(ID, StackID);
919 } 919 }
920 920
921 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); 921 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS);
922 922
923 } // end of namespace Ice 923 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceAssemblerX86BaseImpl.h ('k') | src/IceUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698