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

Unified Diff: src/zone/zone.h

Issue 2461363002: [stubs]: Support 1->2 byte copies in CopyStringCharacters (Closed)
Patch Set: Review feedback Created 4 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/compiler/code-assembler.cc ('k') | test/cctest/test-code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/zone/zone.h
diff --git a/src/zone/zone.h b/src/zone/zone.h
index 892dfb7f5662a8b551a737535725435a2b39a4f8..4e3b96eb206e8ff1a247130600ea3ac5e341e3c8 100644
--- a/src/zone/zone.h
+++ b/src/zone/zone.h
@@ -160,6 +160,13 @@ class ZoneList final : public List<T, ZoneAllocationPolicy> {
ZoneList(int capacity, Zone* zone)
: List<T, ZoneAllocationPolicy>(capacity, ZoneAllocationPolicy(zone)) {}
+ // Construct a new ZoneList from a std::initializer_list
+ ZoneList(std::initializer_list<T> list, Zone* zone)
+ : List<T, ZoneAllocationPolicy>(static_cast<int>(list.size()),
+ ZoneAllocationPolicy(zone)) {
+ for (auto& i : list) Add(i, zone);
+ }
+
void* operator new(size_t size, Zone* zone) { return zone->New(size); }
// Construct a new ZoneList by copying the elements of the given ZoneList.
« no previous file with comments | « src/compiler/code-assembler.cc ('k') | test/cctest/test-code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698