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

Unified Diff: src/heap/heap.cc

Issue 2692933002: Revert of Remove SIMD.js from V8. (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/objects-visiting.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 7d6033617c03c72152ff5395a6eaef20930921c4..352816c3892c3fccbb2453cbfeb454c6a9a2e2de 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -2267,6 +2267,11 @@
mutable_heap_number)
ALLOCATE_PRIMITIVE_MAP(SYMBOL_TYPE, Symbol::kSize, symbol,
Context::SYMBOL_FUNCTION_INDEX)
+#define ALLOCATE_SIMD128_MAP(TYPE, Type, type, lane_count, lane_type) \
+ ALLOCATE_PRIMITIVE_MAP(SIMD128_VALUE_TYPE, Type::kSize, type, \
+ Context::TYPE##_FUNCTION_INDEX)
+ SIMD128_TYPES(ALLOCATE_SIMD128_MAP)
+#undef ALLOCATE_SIMD128_MAP
ALLOCATE_MAP(FOREIGN_TYPE, Foreign::kSize, foreign)
ALLOCATE_PRIMITIVE_MAP(ODDBALL_TYPE, Oddball::kSize, boolean,
@@ -2431,6 +2436,32 @@
HeapObject::cast(result)->set_map_no_write_barrier(map);
return result;
}
+
+#define SIMD_ALLOCATE_DEFINITION(TYPE, Type, type, lane_count, lane_type) \
+ AllocationResult Heap::Allocate##Type(lane_type lanes[lane_count], \
+ PretenureFlag pretenure) { \
+ int size = Type::kSize; \
+ STATIC_ASSERT(Type::kSize <= kMaxRegularHeapObjectSize); \
+ \
+ AllocationSpace space = SelectSpace(pretenure); \
+ \
+ HeapObject* result = nullptr; \
+ { \
+ AllocationResult allocation = \
+ AllocateRaw(size, space, kSimd128Unaligned); \
+ if (!allocation.To(&result)) return allocation; \
+ } \
+ \
+ result->set_map_no_write_barrier(type##_map()); \
+ Type* instance = Type::cast(result); \
+ for (int i = 0; i < lane_count; i++) { \
+ instance->set_lane(i, lanes[i]); \
+ } \
+ return result; \
+ }
+SIMD128_TYPES(SIMD_ALLOCATE_DEFINITION)
+#undef SIMD_ALLOCATE_DEFINITION
+
AllocationResult Heap::AllocateCell(Object* value) {
int size = Cell::kSize;
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/objects-visiting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698