Commit 0b14b8a1 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[cleanup] Remove 'typedef struct' and 'typedef enum'

Just use standard C++ syntax to define structs and enums instead.

R=ahaas@chromium.org

Bug: v8:9183
Change-Id: Ibae1643bd1dc74267cdd14ec45a36fc65bf0ab4b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1631410Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61889}
parent 1276640a
...@@ -55,11 +55,10 @@ CounterType Counter::type() { ...@@ -55,11 +55,10 @@ CounterType Counter::type() {
return type_; return type_;
} }
struct CounterDescriptor {
typedef struct {
const char* name; const char* name;
CounterType type; CounterType type;
} CounterDescriptor; };
static const CounterDescriptor kCounterList[] = { static const CounterDescriptor kCounterList[] = {
{"Instruction", Cumulative}, {"Instruction", Cumulative},
......
...@@ -859,11 +859,11 @@ enum ShouldThrow { ...@@ -859,11 +859,11 @@ enum ShouldThrow {
}; };
// The Store Buffer (GC). // The Store Buffer (GC).
typedef enum { enum StoreBufferEvent {
kStoreBufferFullEvent, kStoreBufferFullEvent,
kStoreBufferStartScanningPagesEvent, kStoreBufferStartScanningPagesEvent,
kStoreBufferScanningPageEvent kStoreBufferScanningPageEvent
} StoreBufferEvent; };
using StoreBufferCallback = void (*)(Heap* heap, MemoryChunk* page, using StoreBufferCallback = void (*)(Heap* heap, MemoryChunk* page,
StoreBufferEvent event); StoreBufferEvent event);
......
...@@ -1708,7 +1708,7 @@ static void CreateDWARFSections(CodeDescription* desc, Zone* zone, ...@@ -1708,7 +1708,7 @@ static void CreateDWARFSections(CodeDescription* desc, Zone* zone,
// Binary GDB JIT Interface as described in // Binary GDB JIT Interface as described in
// http://sourceware.org/gdb/onlinedocs/gdb/Declarations.html // http://sourceware.org/gdb/onlinedocs/gdb/Declarations.html
extern "C" { extern "C" {
typedef enum { JIT_NOACTION = 0, JIT_REGISTER_FN, JIT_UNREGISTER_FN } JITAction; enum JITAction { JIT_NOACTION = 0, JIT_REGISTER_FN, JIT_UNREGISTER_FN };
struct JITCodeEntry { struct JITCodeEntry {
JITCodeEntry* next_; JITCodeEntry* next_;
......
...@@ -31,23 +31,23 @@ bool RegisterUnwindInfoForExceptionHandlingOnly() { ...@@ -31,23 +31,23 @@ bool RegisterUnwindInfoForExceptionHandlingOnly() {
* From Windows SDK ehdata.h, which does not compile with Clang. * From Windows SDK ehdata.h, which does not compile with Clang.
* See https://msdn.microsoft.com/en-us/library/ddssxxy8.aspx. * See https://msdn.microsoft.com/en-us/library/ddssxxy8.aspx.
*/ */
typedef union _UNWIND_CODE { union UNWIND_CODE {
struct { struct {
unsigned char CodeOffset; unsigned char CodeOffset;
unsigned char UnwindOp : 4; unsigned char UnwindOp : 4;
unsigned char OpInfo : 4; unsigned char OpInfo : 4;
}; };
uint16_t FrameOffset; uint16_t FrameOffset;
} UNWIND_CODE, *PUNWIND_CODE; };
typedef struct _UNWIND_INFO { struct UNWIND_INFO {
unsigned char Version : 3; unsigned char Version : 3;
unsigned char Flags : 5; unsigned char Flags : 5;
unsigned char SizeOfProlog; unsigned char SizeOfProlog;
unsigned char CountOfCodes; unsigned char CountOfCodes;
unsigned char FrameRegister : 4; unsigned char FrameRegister : 4;
unsigned char FrameOffset : 4; unsigned char FrameOffset : 4;
} UNWIND_INFO, *PUNWIND_INFO; };
struct V8UnwindData { struct V8UnwindData {
UNWIND_INFO unwind_info; UNWIND_INFO unwind_info;
......
...@@ -39,12 +39,12 @@ inline int inlineUTF8SequenceLength(char b0) { ...@@ -39,12 +39,12 @@ inline int inlineUTF8SequenceLength(char b0) {
static const unsigned char firstByteMark[7] = {0x00, 0x00, 0xC0, 0xE0, static const unsigned char firstByteMark[7] = {0x00, 0x00, 0xC0, 0xE0,
0xF0, 0xF8, 0xFC}; 0xF0, 0xF8, 0xFC};
typedef enum { enum ConversionResult {
conversionOK, // conversion successful conversionOK, // conversion successful
sourceExhausted, // partial character in source, but hit end sourceExhausted, // partial character in source, but hit end
targetExhausted, // insuff. room in target for conversion targetExhausted, // insuff. room in target for conversion
sourceIllegal // source sequence is illegal/malformed sourceIllegal // source sequence is illegal/malformed
} ConversionResult; };
ConversionResult convertUTF16ToUTF8(const UChar** sourceStart, ConversionResult convertUTF16ToUTF8(const UChar** sourceStart,
const UChar* sourceEnd, char** targetStart, const UChar* sourceEnd, char** targetStart,
......
...@@ -73,29 +73,29 @@ using zx_thread_state_general_regs_t = zx_arm64_general_regs_t; ...@@ -73,29 +73,29 @@ using zx_thread_state_general_regs_t = zx_arm64_general_regs_t;
using mcontext_t = struct sigcontext; using mcontext_t = struct sigcontext;
typedef struct ucontext { struct ucontext_t {
uint32_t uc_flags; uint32_t uc_flags;
struct ucontext* uc_link; struct ucontext* uc_link;
stack_t uc_stack; stack_t uc_stack;
mcontext_t uc_mcontext; mcontext_t uc_mcontext;
// Other fields are not used by V8, don't define them here. // Other fields are not used by V8, don't define them here.
} ucontext_t; };
#elif defined(__aarch64__) #elif defined(__aarch64__)
using mcontext_t = struct sigcontext; using mcontext_t = struct sigcontext;
typedef struct ucontext { struct ucontext_t {
uint64_t uc_flags; uint64_t uc_flags;
struct ucontext *uc_link; struct ucontext *uc_link;
stack_t uc_stack; stack_t uc_stack;
mcontext_t uc_mcontext; mcontext_t uc_mcontext;
// Other fields are not used by V8, don't define them here. // Other fields are not used by V8, don't define them here.
} ucontext_t; };
#elif defined(__mips__) #elif defined(__mips__)
// MIPS version of sigcontext, for Android bionic. // MIPS version of sigcontext, for Android bionic.
typedef struct { struct mcontext_t {
uint32_t regmask; uint32_t regmask;
uint32_t status; uint32_t status;
uint64_t pc; uint64_t pc;
...@@ -114,50 +114,50 @@ typedef struct { ...@@ -114,50 +114,50 @@ typedef struct {
uint32_t lo2; uint32_t lo2;
uint32_t hi3; uint32_t hi3;
uint32_t lo3; uint32_t lo3;
} mcontext_t; };
typedef struct ucontext { struct ucontext_t {
uint32_t uc_flags; uint32_t uc_flags;
struct ucontext* uc_link; struct ucontext* uc_link;
stack_t uc_stack; stack_t uc_stack;
mcontext_t uc_mcontext; mcontext_t uc_mcontext;
// Other fields are not used by V8, don't define them here. // Other fields are not used by V8, don't define them here.
} ucontext_t; };
#elif defined(__i386__) #elif defined(__i386__)
// x86 version for Android. // x86 version for Android.
typedef struct { struct mcontext_t {
uint32_t gregs[19]; uint32_t gregs[19];
void* fpregs; void* fpregs;
uint32_t oldmask; uint32_t oldmask;
uint32_t cr2; uint32_t cr2;
} mcontext_t; };
typedef uint32_t kernel_sigset_t[2]; // x86 kernel uses 64-bit signal masks using kernel_sigset_t = uint32_t[2]; // x86 kernel uses 64-bit signal masks
typedef struct ucontext { struct ucontext_t {
uint32_t uc_flags; uint32_t uc_flags;
struct ucontext* uc_link; struct ucontext* uc_link;
stack_t uc_stack; stack_t uc_stack;
mcontext_t uc_mcontext; mcontext_t uc_mcontext;
// Other fields are not used by V8, don't define them here. // Other fields are not used by V8, don't define them here.
} ucontext_t; };
enum { REG_EBP = 6, REG_ESP = 7, REG_EIP = 14 }; enum { REG_EBP = 6, REG_ESP = 7, REG_EIP = 14 };
#elif defined(__x86_64__) #elif defined(__x86_64__)
// x64 version for Android. // x64 version for Android.
typedef struct { struct mcontext_t {
uint64_t gregs[23]; uint64_t gregs[23];
void* fpregs; void* fpregs;
uint64_t __reserved1[8]; uint64_t __reserved1[8];
} mcontext_t; };
typedef struct ucontext { struct ucontext_t {
uint64_t uc_flags; uint64_t uc_flags;
struct ucontext *uc_link; struct ucontext *uc_link;
stack_t uc_stack; stack_t uc_stack;
mcontext_t uc_mcontext; mcontext_t uc_mcontext;
// Other fields are not used by V8, don't define them here. // Other fields are not used by V8, don't define them here.
} ucontext_t; };
enum { REG_RBP = 10, REG_RSP = 15, REG_RIP = 16 }; enum { REG_RBP = 10, REG_RSP = 15, REG_RIP = 16 };
#endif #endif
......
...@@ -291,7 +291,7 @@ class Simulator : public SimulatorBase { ...@@ -291,7 +291,7 @@ class Simulator : public SimulatorBase {
// MSA Data Format // MSA Data Format
enum MSADataFormat { MSA_VECT = 0, MSA_BYTE, MSA_HALF, MSA_WORD, MSA_DWORD }; enum MSADataFormat { MSA_VECT = 0, MSA_BYTE, MSA_HALF, MSA_WORD, MSA_DWORD };
typedef union { union msa_reg_t {
int8_t b[kMSALanesByte]; int8_t b[kMSALanesByte];
uint8_t ub[kMSALanesByte]; uint8_t ub[kMSALanesByte];
int16_t h[kMSALanesHalf]; int16_t h[kMSALanesHalf];
...@@ -300,7 +300,7 @@ class Simulator : public SimulatorBase { ...@@ -300,7 +300,7 @@ class Simulator : public SimulatorBase {
uint32_t uw[kMSALanesWord]; uint32_t uw[kMSALanesWord];
int64_t d[kMSALanesDword]; int64_t d[kMSALanesDword];
uint64_t ud[kMSALanesDword]; uint64_t ud[kMSALanesDword];
} msa_reg_t; };
// Read and write memory. // Read and write memory.
inline uint32_t ReadBU(int32_t addr); inline uint32_t ReadBU(int32_t addr);
......
...@@ -302,7 +302,7 @@ class Simulator : public SimulatorBase { ...@@ -302,7 +302,7 @@ class Simulator : public SimulatorBase {
// MSA Data Format // MSA Data Format
enum MSADataFormat { MSA_VECT = 0, MSA_BYTE, MSA_HALF, MSA_WORD, MSA_DWORD }; enum MSADataFormat { MSA_VECT = 0, MSA_BYTE, MSA_HALF, MSA_WORD, MSA_DWORD };
typedef union { union msa_reg_t {
int8_t b[kMSALanesByte]; int8_t b[kMSALanesByte];
uint8_t ub[kMSALanesByte]; uint8_t ub[kMSALanesByte];
int16_t h[kMSALanesHalf]; int16_t h[kMSALanesHalf];
...@@ -311,7 +311,7 @@ class Simulator : public SimulatorBase { ...@@ -311,7 +311,7 @@ class Simulator : public SimulatorBase {
uint32_t uw[kMSALanesWord]; uint32_t uw[kMSALanesWord];
int64_t d[kMSALanesDword]; int64_t d[kMSALanesDword];
uint64_t ud[kMSALanesDword]; uint64_t ud[kMSALanesDword];
} msa_reg_t; };
// Read and write memory. // Read and write memory.
inline uint32_t ReadBU(int64_t addr); inline uint32_t ReadBU(int64_t addr);
......
...@@ -156,11 +156,11 @@ TEST(3) { ...@@ -156,11 +156,11 @@ TEST(3) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct T {
int i; int i;
char c; char c;
int16_t s; int16_t s;
} T; };
T t; T t;
Assembler assm(AssemblerOptions{}); Assembler assm(AssemblerOptions{});
...@@ -208,7 +208,7 @@ TEST(4) { ...@@ -208,7 +208,7 @@ TEST(4) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct T {
double a; double a;
double b; double b;
double c; double c;
...@@ -225,7 +225,7 @@ TEST(4) { ...@@ -225,7 +225,7 @@ TEST(4) {
float p; float p;
float x; float x;
float y; float y;
} T; };
T t; T t;
// Create a function that accepts &t, and loads, manipulates, and stores // Create a function that accepts &t, and loads, manipulates, and stores
...@@ -599,7 +599,7 @@ TEST(8) { ...@@ -599,7 +599,7 @@ TEST(8) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct D {
double a; double a;
double b; double b;
double c; double c;
...@@ -608,10 +608,10 @@ TEST(8) { ...@@ -608,10 +608,10 @@ TEST(8) {
double f; double f;
double g; double g;
double h; double h;
} D; };
D d; D d;
typedef struct { struct F {
float a; float a;
float b; float b;
float c; float c;
...@@ -620,7 +620,7 @@ TEST(8) { ...@@ -620,7 +620,7 @@ TEST(8) {
float f; float f;
float g; float g;
float h; float h;
} F; };
F f; F f;
// Create a function that uses vldm/vstm to move some double and // Create a function that uses vldm/vstm to move some double and
...@@ -703,7 +703,7 @@ TEST(9) { ...@@ -703,7 +703,7 @@ TEST(9) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct D {
double a; double a;
double b; double b;
double c; double c;
...@@ -712,10 +712,10 @@ TEST(9) { ...@@ -712,10 +712,10 @@ TEST(9) {
double f; double f;
double g; double g;
double h; double h;
} D; };
D d; D d;
typedef struct { struct F {
float a; float a;
float b; float b;
float c; float c;
...@@ -724,7 +724,7 @@ TEST(9) { ...@@ -724,7 +724,7 @@ TEST(9) {
float f; float f;
float g; float g;
float h; float h;
} F; };
F f; F f;
// Create a function that uses vldm/vstm to move some double and // Create a function that uses vldm/vstm to move some double and
...@@ -811,7 +811,7 @@ TEST(10) { ...@@ -811,7 +811,7 @@ TEST(10) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct D {
double a; double a;
double b; double b;
double c; double c;
...@@ -820,10 +820,10 @@ TEST(10) { ...@@ -820,10 +820,10 @@ TEST(10) {
double f; double f;
double g; double g;
double h; double h;
} D; };
D d; D d;
typedef struct { struct F {
float a; float a;
float b; float b;
float c; float c;
...@@ -832,7 +832,7 @@ TEST(10) { ...@@ -832,7 +832,7 @@ TEST(10) {
float f; float f;
float g; float g;
float h; float h;
} F; };
F f; F f;
// Create a function that uses vldm/vstm to move some double and // Create a function that uses vldm/vstm to move some double and
...@@ -915,12 +915,12 @@ TEST(11) { ...@@ -915,12 +915,12 @@ TEST(11) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct I {
int32_t a; int32_t a;
int32_t b; int32_t b;
int32_t c; int32_t c;
int32_t d; int32_t d;
} I; };
I i; I i;
i.a = 0xABCD0001; i.a = 0xABCD0001;
...@@ -996,7 +996,7 @@ TEST(13) { ...@@ -996,7 +996,7 @@ TEST(13) {
return; return;
} }
typedef struct { struct T {
double a; double a;
double b; double b;
double c; double c;
...@@ -1008,7 +1008,7 @@ TEST(13) { ...@@ -1008,7 +1008,7 @@ TEST(13) {
double k; double k;
uint32_t low; uint32_t low;
uint32_t high; uint32_t high;
} T; };
T t; T t;
// Create a function that accepts &t, and loads, manipulates, and stores // Create a function that accepts &t, and loads, manipulates, and stores
...@@ -1114,14 +1114,14 @@ TEST(14) { ...@@ -1114,14 +1114,14 @@ TEST(14) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct T {
double left; double left;
double right; double right;
double add_result; double add_result;
double sub_result; double sub_result;
double mul_result; double mul_result;
double div_result; double div_result;
} T; };
T t; T t;
// Create a function that makes the four basic operations. // Create a function that makes the four basic operations.
...@@ -1224,7 +1224,7 @@ TEST(15) { ...@@ -1224,7 +1224,7 @@ TEST(15) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct T {
uint32_t src0; uint32_t src0;
uint32_t src1; uint32_t src1;
uint32_t src2; uint32_t src2;
...@@ -1298,7 +1298,7 @@ TEST(15) { ...@@ -1298,7 +1298,7 @@ TEST(15) {
uint32_t vtrnd8a[2], vtrnd8b[2], vtrnd16a[2], vtrnd16b[2], vtrnd32a[2], uint32_t vtrnd8a[2], vtrnd8b[2], vtrnd16a[2], vtrnd16b[2], vtrnd32a[2],
vtrnd32b[2]; vtrnd32b[2];
uint32_t vtbl[2], vtbx[2]; uint32_t vtbl[2], vtbx[2];
} T; };
T t; T t;
// Create a function that accepts &t, and loads, manipulates, and stores // Create a function that accepts &t, and loads, manipulates, and stores
...@@ -2263,7 +2263,7 @@ TEST(16) { ...@@ -2263,7 +2263,7 @@ TEST(16) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct T {
uint32_t src0; uint32_t src0;
uint32_t src1; uint32_t src1;
uint32_t src2; uint32_t src2;
...@@ -2272,7 +2272,7 @@ TEST(16) { ...@@ -2272,7 +2272,7 @@ TEST(16) {
uint32_t dst2; uint32_t dst2;
uint32_t dst3; uint32_t dst3;
uint32_t dst4; uint32_t dst4;
} T; };
T t; T t;
// Create a function that accepts &t, and loads, manipulates, and stores // Create a function that accepts &t, and loads, manipulates, and stores
...@@ -2712,10 +2712,10 @@ TEST(rbit) { ...@@ -2712,10 +2712,10 @@ TEST(rbit) {
if (CpuFeatures::IsSupported(ARMv7)) { if (CpuFeatures::IsSupported(ARMv7)) {
CpuFeatureScope scope(&assm, ARMv7); CpuFeatureScope scope(&assm, ARMv7);
typedef struct { struct T {
uint32_t input; uint32_t input;
uint32_t result; uint32_t result;
} T; };
T t; T t;
__ ldr(r1, MemOperand(r0, offsetof(T, input))); __ ldr(r1, MemOperand(r0, offsetof(T, input)));
...@@ -2889,14 +2889,14 @@ TEST(ARMv8_float32_vrintX) { ...@@ -2889,14 +2889,14 @@ TEST(ARMv8_float32_vrintX) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct T {
float input; float input;
float ar; float ar;
float nr; float nr;
float mr; float mr;
float pr; float pr;
float zr; float zr;
} T; };
T t; T t;
// Create a function that accepts &t, and loads, manipulates, and stores // Create a function that accepts &t, and loads, manipulates, and stores
...@@ -2989,14 +2989,14 @@ TEST(ARMv8_vrintX) { ...@@ -2989,14 +2989,14 @@ TEST(ARMv8_vrintX) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct T {
double input; double input;
double ar; double ar;
double nr; double nr;
double mr; double mr;
double pr; double pr;
double zr; double zr;
} T; };
T t; T t;
// Create a function that accepts &t, and loads, manipulates, and stores // Create a function that accepts &t, and loads, manipulates, and stores
...@@ -3620,11 +3620,11 @@ TEST(unaligned_loads) { ...@@ -3620,11 +3620,11 @@ TEST(unaligned_loads) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct T {
uint32_t ldrh; uint32_t ldrh;
uint32_t ldrsh; uint32_t ldrsh;
uint32_t ldr; uint32_t ldr;
} T; };
T t; T t;
Assembler assm(AssemblerOptions{}); Assembler assm(AssemblerOptions{});
...@@ -3728,14 +3728,14 @@ TEST(vswp) { ...@@ -3728,14 +3728,14 @@ TEST(vswp) {
HandleScope scope(isolate); HandleScope scope(isolate);
Assembler assm(AssemblerOptions{}); Assembler assm(AssemblerOptions{});
typedef struct { struct T {
uint64_t vswp_d0; uint64_t vswp_d0;
uint64_t vswp_d1; uint64_t vswp_d1;
uint64_t vswp_d30; uint64_t vswp_d30;
uint64_t vswp_d31; uint64_t vswp_d31;
uint32_t vswp_q4[4]; uint32_t vswp_q4[4];
uint32_t vswp_q5[4]; uint32_t vswp_q5[4];
} T; };
T t; T t;
__ stm(db_w, sp, r4.bit() | r5.bit() | r6.bit() | r7.bit() | lr.bit()); __ stm(db_w, sp, r4.bit() | r5.bit() | r6.bit() | r7.bit() | lr.bit());
......
This diff is collapsed.
This diff is collapsed.
...@@ -158,11 +158,11 @@ TEST(3) { ...@@ -158,11 +158,11 @@ TEST(3) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct T {
int i; int i;
char c; char c;
int16_t s; int16_t s;
} T; };
T t; T t;
Assembler assm(AssemblerOptions{}); Assembler assm(AssemblerOptions{});
...@@ -233,7 +233,7 @@ TEST(4) { ...@@ -233,7 +233,7 @@ TEST(4) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct T {
double a; double a;
double b; double b;
double c; double c;
...@@ -247,7 +247,7 @@ TEST(4) { ...@@ -247,7 +247,7 @@ TEST(4) {
double n; double n;
float x; float x;
float y; float y;
} T; };
T t; T t;
// Create a function that accepts &t, and loads, manipulates, and stores // Create a function that accepts &t, and loads, manipulates, and stores
...@@ -623,7 +623,7 @@ TEST(8) { ...@@ -623,7 +623,7 @@ TEST(8) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct D {
double a; double a;
double b; double b;
double c; double c;
...@@ -632,10 +632,10 @@ TEST(8) { ...@@ -632,10 +632,10 @@ TEST(8) {
double f; double f;
double g; double g;
double h; double h;
} D; };
D d; D d;
typedef struct { struct F {
float a; float a;
float b; float b;
float c; float c;
...@@ -644,7 +644,7 @@ TEST(8) { ...@@ -644,7 +644,7 @@ TEST(8) {
float f; float f;
float g; float g;
float h; float h;
} F; };
F f; F f;
// Create a function that uses vldm/vstm to move some double and // Create a function that uses vldm/vstm to move some double and
...@@ -734,7 +734,7 @@ TEST(9) { ...@@ -734,7 +734,7 @@ TEST(9) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct D {
double a; double a;
double b; double b;
double c; double c;
...@@ -743,10 +743,10 @@ TEST(9) { ...@@ -743,10 +743,10 @@ TEST(9) {
double f; double f;
double g; double g;
double h; double h;
} D; };
D d; D d;
typedef struct { struct F {
float a; float a;
float b; float b;
float c; float c;
...@@ -755,7 +755,7 @@ TEST(9) { ...@@ -755,7 +755,7 @@ TEST(9) {
float f; float f;
float g; float g;
float h; float h;
} F; };
F f; F f;
// Create a function that uses vldm/vstm to move some double and // Create a function that uses vldm/vstm to move some double and
...@@ -849,7 +849,7 @@ TEST(10) { ...@@ -849,7 +849,7 @@ TEST(10) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct D {
double a; double a;
double b; double b;
double c; double c;
...@@ -858,10 +858,10 @@ TEST(10) { ...@@ -858,10 +858,10 @@ TEST(10) {
double f; double f;
double g; double g;
double h; double h;
} D; };
D d; D d;
typedef struct { struct F {
float a; float a;
float b; float b;
float c; float c;
...@@ -870,7 +870,7 @@ TEST(10) { ...@@ -870,7 +870,7 @@ TEST(10) {
float f; float f;
float g; float g;
float h; float h;
} F; };
F f; F f;
// Create a function that uses vldm/vstm to move some double and // Create a function that uses vldm/vstm to move some double and
...@@ -960,12 +960,12 @@ TEST(11) { ...@@ -960,12 +960,12 @@ TEST(11) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
typedef struct { struct I {
int32_t a; int32_t a;
int32_t b; int32_t b;
int32_t c; int32_t c;
int32_t d; int32_t d;
} I; };
I i; I i;
i.a = 0xABCD0001; i.a = 0xABCD0001;
......
...@@ -58,7 +58,7 @@ TEST(ExtractLane) { ...@@ -58,7 +58,7 @@ TEST(ExtractLane) {
buffer->CreateView()); buffer->CreateView());
MacroAssembler* masm = &assembler; // Create a pointer for the __ macro. MacroAssembler* masm = &assembler; // Create a pointer for the __ macro.
typedef struct { struct T {
int32_t i32x4_low[4]; int32_t i32x4_low[4];
int32_t i32x4_high[4]; int32_t i32x4_high[4];
int32_t i16x8_low[8]; int32_t i16x8_low[8];
...@@ -69,7 +69,7 @@ TEST(ExtractLane) { ...@@ -69,7 +69,7 @@ TEST(ExtractLane) {
int32_t f32x4_high[4]; int32_t f32x4_high[4];
int32_t i8x16_low_d[16]; int32_t i8x16_low_d[16];
int32_t i8x16_high_d[16]; int32_t i8x16_high_d[16];
} T; };
T t; T t;
__ stm(db_w, sp, r4.bit() | r5.bit() | lr.bit()); __ stm(db_w, sp, r4.bit() | r5.bit() | lr.bit());
...@@ -196,7 +196,7 @@ TEST(ReplaceLane) { ...@@ -196,7 +196,7 @@ TEST(ReplaceLane) {
buffer->CreateView()); buffer->CreateView());
MacroAssembler* masm = &assembler; // Create a pointer for the __ macro. MacroAssembler* masm = &assembler; // Create a pointer for the __ macro.
typedef struct { struct T {
int32_t i32x4_low[4]; int32_t i32x4_low[4];
int32_t i32x4_high[4]; int32_t i32x4_high[4];
int16_t i16x8_low[8]; int16_t i16x8_low[8];
...@@ -205,7 +205,7 @@ TEST(ReplaceLane) { ...@@ -205,7 +205,7 @@ TEST(ReplaceLane) {
int8_t i8x16_high[16]; int8_t i8x16_high[16];
int32_t f32x4_low[4]; int32_t f32x4_low[4];
int32_t f32x4_high[4]; int32_t f32x4_high[4];
} T; };
T t; T t;
__ stm(db_w, sp, r4.bit() | r5.bit() | r6.bit() | r7.bit() | lr.bit()); __ stm(db_w, sp, r4.bit() | r5.bit() | r6.bit() | r7.bit() | lr.bit());
......
...@@ -67,10 +67,10 @@ void DecodeIncrementally(const std::vector<byte>& bytes, ...@@ -67,10 +67,10 @@ void DecodeIncrementally(const std::vector<byte>& bytes,
TEST(UnicodeTest, Utf16BufferReuse) { TEST(UnicodeTest, Utf16BufferReuse) {
// Not enough continuation bytes before string ends. // Not enough continuation bytes before string ends.
typedef struct { struct TestCase {
std::vector<byte> bytes; std::vector<byte> bytes;
std::vector<unibrow::uchar> unicode_expected; std::vector<unibrow::uchar> unicode_expected;
} TestCase; };
TestCase data[] = { TestCase data[] = {
{{0x00}, {0x0}}, {{0x00}, {0x0}},
...@@ -112,10 +112,10 @@ TEST(UnicodeTest, IncrementalUTF8DecodingVsNonIncrementalUtf8Decoding) { ...@@ -112,10 +112,10 @@ TEST(UnicodeTest, IncrementalUTF8DecodingVsNonIncrementalUtf8Decoding) {
// Unfortunately, V8 has two UTF-8 decoders. This test checks that they // Unfortunately, V8 has two UTF-8 decoders. This test checks that they
// produce the same result. This test was inspired by // produce the same result. This test was inspired by
// https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt . // https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt .
typedef struct { struct TestCase {
std::vector<byte> bytes; std::vector<byte> bytes;
std::vector<unibrow::uchar> unicode_expected; std::vector<unibrow::uchar> unicode_expected;
} TestCase; };
TestCase data[] = { TestCase data[] = {
// Correct UTF-8 text. // Correct UTF-8 text.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment