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

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

Issue 2225013002: Remove unused isolate parameter from NumberToSize and TryNumberToSize (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « src/runtime/runtime-futex.cc ('k') | src/runtime/runtime-strings.cc » ('j') | 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 70bc950150ae5b3c2719f480cfc438ab27350396..9542a4420a200383e088e202208fc9acd056789f 100644
--- a/src/runtime/runtime-simd.cc
+++ b/src/runtime/runtime-simd.cc
@@ -894,47 +894,47 @@ SIMD_FROM_BITS_TYPES(SIMD_FROM_BITS_FUNCTION)
// Common Load and Store Functions
-#define SIMD_LOAD(type, lane_type, lane_count, count, result) \
- static const int kLaneCount = lane_count; \
- DCHECK(args.length() == 2); \
- CONVERT_SIMD_ARG_HANDLE_THROW(JSTypedArray, tarray, 0); \
- SIMD_COERCE_INDEX(index, 1); \
- size_t bpe = tarray->element_size(); \
- uint32_t bytes = count * sizeof(lane_type); \
- size_t byte_length = NumberToSize(isolate, tarray->byte_length()); \
- if (index < 0 || index * bpe + bytes > byte_length) { \
- THROW_NEW_ERROR_RETURN_FAILURE( \
- isolate, NewRangeError(MessageTemplate::kInvalidSimdIndex)); \
- } \
- size_t tarray_offset = NumberToSize(isolate, tarray->byte_offset()); \
- uint8_t* tarray_base = \
- static_cast<uint8_t*>(tarray->GetBuffer()->backing_store()) + \
- tarray_offset; \
- lane_type lanes[kLaneCount] = {0}; \
- memcpy(lanes, tarray_base + index * bpe, bytes); \
+#define SIMD_LOAD(type, lane_type, lane_count, count, result) \
+ static const int kLaneCount = lane_count; \
+ DCHECK(args.length() == 2); \
+ CONVERT_SIMD_ARG_HANDLE_THROW(JSTypedArray, tarray, 0); \
+ SIMD_COERCE_INDEX(index, 1); \
+ size_t bpe = tarray->element_size(); \
+ uint32_t bytes = count * sizeof(lane_type); \
+ size_t byte_length = NumberToSize(tarray->byte_length()); \
+ if (index < 0 || index * bpe + bytes > byte_length) { \
+ THROW_NEW_ERROR_RETURN_FAILURE( \
+ isolate, NewRangeError(MessageTemplate::kInvalidSimdIndex)); \
+ } \
+ size_t tarray_offset = NumberToSize(tarray->byte_offset()); \
+ uint8_t* tarray_base = \
+ static_cast<uint8_t*>(tarray->GetBuffer()->backing_store()) + \
+ tarray_offset; \
+ lane_type lanes[kLaneCount] = {0}; \
+ memcpy(lanes, tarray_base + index * bpe, bytes); \
Handle<type> result = isolate->factory()->New##type(lanes);
-#define SIMD_STORE(type, lane_type, lane_count, count, a) \
- static const int kLaneCount = lane_count; \
- DCHECK(args.length() == 3); \
- CONVERT_SIMD_ARG_HANDLE_THROW(JSTypedArray, tarray, 0); \
- CONVERT_SIMD_ARG_HANDLE_THROW(type, a, 2); \
- SIMD_COERCE_INDEX(index, 1); \
- size_t bpe = tarray->element_size(); \
- uint32_t bytes = count * sizeof(lane_type); \
- size_t byte_length = NumberToSize(isolate, tarray->byte_length()); \
- if (index < 0 || byte_length < index * bpe + bytes) { \
- THROW_NEW_ERROR_RETURN_FAILURE( \
- isolate, NewRangeError(MessageTemplate::kInvalidSimdIndex)); \
- } \
- size_t tarray_offset = NumberToSize(isolate, tarray->byte_offset()); \
- uint8_t* tarray_base = \
- static_cast<uint8_t*>(tarray->GetBuffer()->backing_store()) + \
- tarray_offset; \
- lane_type lanes[kLaneCount]; \
- for (int i = 0; i < kLaneCount; i++) { \
- lanes[i] = a->get_lane(i); \
- } \
+#define SIMD_STORE(type, lane_type, lane_count, count, a) \
+ static const int kLaneCount = lane_count; \
+ DCHECK(args.length() == 3); \
+ CONVERT_SIMD_ARG_HANDLE_THROW(JSTypedArray, tarray, 0); \
+ CONVERT_SIMD_ARG_HANDLE_THROW(type, a, 2); \
+ SIMD_COERCE_INDEX(index, 1); \
+ size_t bpe = tarray->element_size(); \
+ uint32_t bytes = count * sizeof(lane_type); \
+ size_t byte_length = NumberToSize(tarray->byte_length()); \
+ if (index < 0 || byte_length < index * bpe + bytes) { \
+ THROW_NEW_ERROR_RETURN_FAILURE( \
+ isolate, NewRangeError(MessageTemplate::kInvalidSimdIndex)); \
+ } \
+ size_t tarray_offset = NumberToSize(tarray->byte_offset()); \
+ uint8_t* tarray_base = \
+ static_cast<uint8_t*>(tarray->GetBuffer()->backing_store()) + \
+ tarray_offset; \
+ lane_type lanes[kLaneCount]; \
+ for (int i = 0; i < kLaneCount; i++) { \
+ lanes[i] = a->get_lane(i); \
+ } \
memcpy(tarray_base + index * bpe, lanes, bytes);
#define SIMD_LOAD_FUNCTION(type, lane_type, lane_count) \
« no previous file with comments | « src/runtime/runtime-futex.cc ('k') | src/runtime/runtime-strings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698