Chromium Code Reviews

Unified Diff: src/wasm/wasm-external-refs.cc

Issue 1853123002: [wasm] Refactoring of wasm-external-refs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/wasm/wasm-external-refs.cc
diff --git a/src/wasm/wasm-external-refs.h b/src/wasm/wasm-external-refs.cc
similarity index 73%
copy from src/wasm/wasm-external-refs.h
copy to src/wasm/wasm-external-refs.cc
index 4aa452bbf58b1647a500e38d022993580ae688a5..f30704a923d7dbbd4b6a49b3cf4f04cea2fe83ed 100644
--- a/src/wasm/wasm-external-refs.h
+++ b/src/wasm/wasm-external-refs.cc
@@ -2,38 +2,38 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef WASM_EXTERNAL_REFS_H
-#define WASM_EXTERNAL_REFS_H
+#include <math.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <limits>
+
+#include "src/wasm/wasm-external-refs.h"
namespace v8 {
namespace internal {
namespace wasm {
-static void f32_trunc_wrapper(float* param) { *param = truncf(*param); }
+void f32_trunc_wrapper(float* param) { *param = truncf(*param); }
-static void f32_floor_wrapper(float* param) { *param = floorf(*param); }
+void f32_floor_wrapper(float* param) { *param = floorf(*param); }
-static void f32_ceil_wrapper(float* param) { *param = ceilf(*param); }
+void f32_ceil_wrapper(float* param) { *param = ceilf(*param); }
-static void f32_nearest_int_wrapper(float* param) {
- *param = nearbyintf(*param);
-}
+void f32_nearest_int_wrapper(float* param) { *param = nearbyintf(*param); }
-static void f64_trunc_wrapper(double* param) { *param = trunc(*param); }
+void f64_trunc_wrapper(double* param) { *param = trunc(*param); }
-static void f64_floor_wrapper(double* param) { *param = floor(*param); }
+void f64_floor_wrapper(double* param) { *param = floor(*param); }
-static void f64_ceil_wrapper(double* param) { *param = ceil(*param); }
+void f64_ceil_wrapper(double* param) { *param = ceil(*param); }
-static void f64_nearest_int_wrapper(double* param) {
- *param = nearbyint(*param);
-}
+void f64_nearest_int_wrapper(double* param) { *param = nearbyint(*param); }
-static void int64_to_float32_wrapper(int64_t* input, float* output) {
+void int64_to_float32_wrapper(int64_t* input, float* output) {
*output = static_cast<float>(*input);
}
-static void uint64_to_float32_wrapper(uint64_t* input, float* output) {
+void uint64_to_float32_wrapper(uint64_t* input, float* output) {
#if V8_CC_MSVC
// With MSVC we use static_cast<float>(uint32_t) instead of
// static_cast<float>(uint64_t) to achieve round-to-nearest-ties-even
@@ -67,11 +67,11 @@ static void uint64_to_float32_wrapper(uint64_t* input, float* output) {
#endif
}
-static void int64_to_float64_wrapper(int64_t* input, double* output) {
+void int64_to_float64_wrapper(int64_t* input, double* output) {
*output = static_cast<double>(*input);
}
-static void uint64_to_float64_wrapper(uint64_t* input, double* output) {
+void uint64_to_float64_wrapper(uint64_t* input, double* output) {
#if V8_CC_MSVC
// With MSVC we use static_cast<double>(uint32_t) instead of
// static_cast<double>(uint64_t) to achieve round-to-nearest-ties-even
@@ -92,7 +92,7 @@ static void uint64_to_float64_wrapper(uint64_t* input, double* output) {
#endif
}
-static int32_t float32_to_int64_wrapper(float* input, int64_t* output) {
+int32_t float32_to_int64_wrapper(float* input, int64_t* output) {
// We use "<" here to check the upper bound because of rounding problems: With
// "<=" some inputs would be considered within int64 range which are actually
// not within int64 range.
@@ -104,7 +104,7 @@ static int32_t float32_to_int64_wrapper(float* input, int64_t* output) {
return 0;
}
-static int32_t float32_to_uint64_wrapper(float* input, uint64_t* output) {
+int32_t float32_to_uint64_wrapper(float* input, uint64_t* output) {
// We use "<" here to check the upper bound because of rounding problems: With
// "<=" some inputs would be considered within uint64 range which are actually
// not within uint64 range.
@@ -116,7 +116,7 @@ static int32_t float32_to_uint64_wrapper(float* input, uint64_t* output) {
return 0;
}
-static int32_t float64_to_int64_wrapper(double* input, int64_t* output) {
+int32_t float64_to_int64_wrapper(double* input, int64_t* output) {
// We use "<" here to check the upper bound because of rounding problems: With
// "<=" some inputs would be considered within int64 range which are actually
// not within int64 range.
@@ -128,7 +128,7 @@ static int32_t float64_to_int64_wrapper(double* input, int64_t* output) {
return 0;
}
-static int32_t float64_to_uint64_wrapper(double* input, uint64_t* output) {
+int32_t float64_to_uint64_wrapper(double* input, uint64_t* output) {
// We use "<" here to check the upper bound because of rounding problems: With
// "<=" some inputs would be considered within uint64 range which are actually
// not within uint64 range.
@@ -140,7 +140,7 @@ static int32_t float64_to_uint64_wrapper(double* input, uint64_t* output) {
return 0;
}
-static int32_t int64_div_wrapper(int64_t* dst, int64_t* src) {
+int32_t int64_div_wrapper(int64_t* dst, int64_t* src) {
if (*src == 0) {
return 0;
}
@@ -151,7 +151,7 @@ static int32_t int64_div_wrapper(int64_t* dst, int64_t* src) {
return 1;
}
-static int32_t int64_mod_wrapper(int64_t* dst, int64_t* src) {
+int32_t int64_mod_wrapper(int64_t* dst, int64_t* src) {
if (*src == 0) {
return 0;
}
@@ -159,7 +159,7 @@ static int32_t int64_mod_wrapper(int64_t* dst, int64_t* src) {
return 1;
}
-static int32_t uint64_div_wrapper(uint64_t* dst, uint64_t* src) {
+int32_t uint64_div_wrapper(uint64_t* dst, uint64_t* src) {
if (*src == 0) {
return 0;
}
@@ -167,7 +167,7 @@ static int32_t uint64_div_wrapper(uint64_t* dst, uint64_t* src) {
return 1;
}
-static int32_t uint64_mod_wrapper(uint64_t* dst, uint64_t* src) {
+int32_t uint64_mod_wrapper(uint64_t* dst, uint64_t* src) {
if (*src == 0) {
return 0;
}
@@ -177,5 +177,3 @@ static int32_t uint64_mod_wrapper(uint64_t* dst, uint64_t* src) {
} // namespace wasm
} // namespace internal
} // namespace v8
-
-#endif

Powered by Google App Engine