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

Unified Diff: src/factory.cc

Issue 1293533003: [simd.js] Macro-ize more SIMD code (1). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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
« src/code-stubs-hydrogen.cc ('K') | « src/factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 8d01918e292902edad3c807ae65c5cabd172b4aa..db11ebb390dc5cc6bfbf08e51958cc2cff5a83e7 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1056,51 +1056,14 @@ Handle<HeapNumber> Factory::NewHeapNumber(double value,
}
-Handle<Float32x4> Factory::NewFloat32x4(float lanes[4],
- PretenureFlag pretenure) {
- CALL_HEAP_FUNCTION(isolate(),
- isolate()->heap()->AllocateFloat32x4(lanes, pretenure),
- Float32x4);
-}
-
-
-Handle<Int32x4> Factory::NewInt32x4(int32_t lanes[4], PretenureFlag pretenure) {
- CALL_HEAP_FUNCTION(
- isolate(), isolate()->heap()->AllocateInt32x4(lanes, pretenure), Int32x4);
-}
-
-
-Handle<Bool32x4> Factory::NewBool32x4(bool lanes[4], PretenureFlag pretenure) {
- CALL_HEAP_FUNCTION(isolate(),
- isolate()->heap()->AllocateBool32x4(lanes, pretenure),
- Bool32x4);
-}
-
-
-Handle<Int16x8> Factory::NewInt16x8(int16_t lanes[8], PretenureFlag pretenure) {
- CALL_HEAP_FUNCTION(
- isolate(), isolate()->heap()->AllocateInt16x8(lanes, pretenure), Int16x8);
-}
-
-
-Handle<Bool16x8> Factory::NewBool16x8(bool lanes[8], PretenureFlag pretenure) {
- CALL_HEAP_FUNCTION(isolate(),
- isolate()->heap()->AllocateBool16x8(lanes, pretenure),
- Bool16x8);
-}
-
-
-Handle<Int8x16> Factory::NewInt8x16(int8_t lanes[16], PretenureFlag pretenure) {
- CALL_HEAP_FUNCTION(
- isolate(), isolate()->heap()->AllocateInt8x16(lanes, pretenure), Int8x16);
-}
-
-
-Handle<Bool8x16> Factory::NewBool8x16(bool lanes[16], PretenureFlag pretenure) {
- CALL_HEAP_FUNCTION(isolate(),
- isolate()->heap()->AllocateBool8x16(lanes, pretenure),
- Bool8x16);
-}
+#define SIMD128_NEW_DEF(TYPE, Type, type, lane_count, lane_type) \
+ Handle<Type> Factory::New##Type(lane_type lanes[lane_count], \
+ PretenureFlag pretenure) { \
+ CALL_HEAP_FUNCTION( \
+ isolate(), isolate()->heap()->Allocate##Type(lanes, pretenure), Type); \
+ }
+SIMD128_TYPES(SIMD128_NEW_DEF)
+#undef SIMD128_NEW_DEF
Handle<Object> Factory::NewError(Handle<JSFunction> constructor,
« src/code-stubs-hydrogen.cc ('K') | « src/factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698