Reviewers: Michael Starzinger,

Description:
Fix presubmit errors in runtime-simd.cc.

[email protected]
BUG=

Please review this at https://codereview.chromium.org/1263363002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+16, -12 lines):
  M src/runtime/runtime-simd.cc


Index: src/runtime/runtime-simd.cc
diff --git a/src/runtime/runtime-simd.cc b/src/runtime/runtime-simd.cc
index 90f1904f77001c0a266376a5d70b40b1e38246b7..ffb29c0586c2754e20c7874e1423357725b8a291 100644
--- a/src/runtime/runtime-simd.cc
+++ b/src/runtime/runtime-simd.cc
@@ -19,10 +19,11 @@

 #define SIMD_CREATE_NUMERIC_FUNCTION(type, lane_type, lane_count) \
   RUNTIME_FUNCTION(Runtime_Create##type) {                        \
+    static const int kLaneCount = lane_count;                     \
     HandleScope scope(isolate);                                   \
-    DCHECK(args.length() == lane_count);                          \
-    lane_type lanes[lane_count];                                  \
-    for (int i = 0; i < lane_count; i++) {                        \
+    DCHECK(args.length() == kLaneCount);                          \
+    lane_type lanes[kLaneCount];                                  \
+    for (int i = 0; i < kLaneCount; i++) {                        \
       CONVERT_NUMBER_ARG_HANDLE_CHECKED(number, i);               \
       lanes[i] = ConvertNumber<lane_type>(number->Number());      \
     }                                                             \
@@ -31,10 +32,11 @@

 #define SIMD_CREATE_BOOLEAN_FUNCTION(type, lane_count) \
   RUNTIME_FUNCTION(Runtime_Create##type) {             \
+    static const int kLaneCount = lane_count;          \
     HandleScope scope(isolate);                        \
-    DCHECK(args.length() == lane_count);               \
-    bool lanes[lane_count];                            \
-    for (int i = 0; i < lane_count; i++) {             \
+    DCHECK(args.length() == kLaneCount);               \
+    bool lanes[kLaneCount];                            \
+    for (int i = 0; i < kLaneCount; i++) {             \
       lanes[i] = args[i]->BooleanValue();              \
     }                                                  \
     return *isolate->factory()->New##type(lanes);      \
@@ -58,13 +60,14 @@

 #define SIMD_REPLACE_NUMERIC_LANE_FUNCTION(type, lane_type, lane_count) \
   RUNTIME_FUNCTION(Runtime_##type##ReplaceLane) {                       \
+    static const int kLaneCount = lane_count;                           \
     HandleScope scope(isolate);                                         \
     DCHECK(args.length() == 3);                                         \
     CONVERT_ARG_HANDLE_CHECKED(type, simd, 0);                          \
-    CONVERT_SIMD_LANE_ARG_CHECKED(lane, 1, lane_count);                 \
+    CONVERT_SIMD_LANE_ARG_CHECKED(lane, 1, kLaneCount);                 \
     CONVERT_NUMBER_ARG_HANDLE_CHECKED(number, 2);                       \
-    lane_type lanes[lane_count];                                        \
-    for (int i = 0; i < lane_count; i++) {                              \
+    lane_type lanes[kLaneCount];                                        \
+    for (int i = 0; i < kLaneCount; i++) {                              \
       lanes[i] = simd->get_lane(i);                                     \
     }                                                                   \
     lanes[lane] = ConvertNumber<lane_type>(number->Number());           \
@@ -74,12 +77,13 @@

 #define SIMD_REPLACE_BOOLEAN_LANE_FUNCTION(type, lane_count)    \
   RUNTIME_FUNCTION(Runtime_##type##ReplaceLane) {               \
+    static const int kLaneCount = lane_count;                   \
     HandleScope scope(isolate);                                 \
     DCHECK(args.length() == 3);                                 \
     CONVERT_ARG_HANDLE_CHECKED(type, simd, 0);                  \
-    CONVERT_SIMD_LANE_ARG_CHECKED(lane, 1, lane_count);         \
-    bool lanes[lane_count];                                     \
-    for (int i = 0; i < lane_count; i++) {                      \
+    CONVERT_SIMD_LANE_ARG_CHECKED(lane, 1, kLaneCount);         \
+    bool lanes[kLaneCount];                                     \
+    for (int i = 0; i < kLaneCount; i++) {                      \
       lanes[i] = simd->get_lane(i);                             \
     }                                                           \
     lanes[lane] = args[2]->BooleanValue();                      \


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to