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

Side by Side Diff: src/IceAssemblerX86BaseImpl.h

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 | « no previous file | src/IceGlobalContext.cpp » ('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/IceAssemblerX86BaseImpl.h - base x86 assembler -*- C++ -*-=// 1 //===- subzero/src/IceAssemblerX86BaseImpl.h - base x86 assembler -*- C++ -*-=//
2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 // 5 //
6 // Modified by the Subzero authors. 6 // Modified by the Subzero authors.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // The Subzero Code Generator 10 // The Subzero Code Generator
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 typename AssemblerX86Base<TraitsType>::Label * 56 typename AssemblerX86Base<TraitsType>::Label *
57 AssemblerX86Base<TraitsType>::getOrCreateLabel(SizeT Number, 57 AssemblerX86Base<TraitsType>::getOrCreateLabel(SizeT Number,
58 LabelVector &Labels) { 58 LabelVector &Labels) {
59 Label *L = nullptr; 59 Label *L = nullptr;
60 if (Number == Labels.size()) { 60 if (Number == Labels.size()) {
61 L = new (this->allocate<Label>()) Label(); 61 L = new (this->allocate<Label>()) Label();
62 Labels.push_back(L); 62 Labels.push_back(L);
63 return L; 63 return L;
64 } 64 }
65 if (Number > Labels.size()) { 65 if (Number > Labels.size()) {
66 Labels.resize(Number + 1); 66 Utils::reserveAndResize(Labels, Number + 1);
67 } 67 }
68 L = Labels[Number]; 68 L = Labels[Number];
69 if (!L) { 69 if (!L) {
70 L = new (this->allocate<Label>()) Label(); 70 L = new (this->allocate<Label>()) Label();
71 Labels[Number] = L; 71 Labels[Number] = L;
72 } 72 }
73 return L; 73 return L;
74 } 74 }
75 75
76 template <typename TraitsType> 76 template <typename TraitsType>
(...skipping 3458 matching lines...) Expand 10 before | Expand all | Expand 10 after
3535 (void)shifter; 3535 (void)shifter;
3536 if (Ty == IceType_i16) 3536 if (Ty == IceType_i16)
3537 emitOperandSizeOverride(); 3537 emitOperandSizeOverride();
3538 emitRexB(Ty, operand.rm()); 3538 emitRexB(Ty, operand.rm());
3539 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); 3539 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3);
3540 emitOperand(rm, operand); 3540 emitOperand(rm, operand);
3541 } 3541 }
3542 3542
3543 } // end of namespace X86NAMESPACE 3543 } // end of namespace X86NAMESPACE
3544 } // end of namespace Ice 3544 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | src/IceGlobalContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698