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

Unified Diff: src/IceSwitchLowering.h

Issue 1460003003: Fix race condition in jump table list creation (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add some missing consts Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceSwitchLowering.h
diff --git a/src/IceSwitchLowering.h b/src/IceSwitchLowering.h
index 8ac1842ca8f07c613173ad853185f378f4cfafa0..fc9c4a2d243de87c239dfc1fbe3abcd27ec3f55d 100644
--- a/src/IceSwitchLowering.h
+++ b/src/IceSwitchLowering.h
@@ -81,26 +81,23 @@ class JumpTableData {
JumpTableData &operator=(const JumpTableData &) = delete;
public:
- JumpTableData(IceString FuncName, SizeT Id, SizeT NumTargets)
- : FuncName(FuncName), Id(Id) {
- TargetOffsets.reserve(NumTargets);
- }
+ using TargetList = std::vector<intptr_t>;
+
+ JumpTableData(const IceString &FuncName, SizeT Id,
+ const TargetList &TargetOffsets)
+ : FuncName(FuncName), Id(Id), TargetOffsets(TargetOffsets) {}
JumpTableData(const JumpTableData &) = default;
JumpTableData(JumpTableData &&) = default;
JumpTableData &operator=(JumpTableData &&) = default;
- void pushTarget(intptr_t Offset) { TargetOffsets.emplace_back(Offset); }
-
const IceString &getFunctionName() const { return FuncName; }
SizeT getId() const { return Id; }
- const std::vector<intptr_t> &getTargetOffsets() const {
- return TargetOffsets;
- }
+ const TargetList &getTargetOffsets() const { return TargetOffsets; }
private:
IceString FuncName;
SizeT Id;
- std::vector<intptr_t> TargetOffsets;
+ TargetList TargetOffsets;
};
using JumpTableDataList = std::vector<JumpTableData>;
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698