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

Unified Diff: src/runtime/runtime-simd.cc

Issue 1263363002: Fix presubmit errors in runtime-simd.cc. (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(); \
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698