Commit 52b3cb99 authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

[foozzie] Detect endianness when using an arrayType

Whenever we use an "arrayType" that is stored as multiple bytes,
the host machine's endianness becomes apparent in the result.
This Cl adds the functionality to check the result based on the
host machine's endianness.

Change-Id: Ie96e8dd04b7e209127eff67ee06e1fa0ee5bc290
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2063861Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#66343}
parent ebbaf2b7
......@@ -68,5 +68,11 @@ function testArrayType(arrayType, pattern) {
testSameOptimized(pattern, create);
}
var isBigEndian = new Uint8Array(new Uint32Array([0xABCD]).buffer)[0] === 0xAB;
testArrayType(Float32Array, [1065353216]);
testArrayType(Float64Array, [0, 1072693248]);
if (isBigEndian){
testArrayType(Float64Array, [1072693248, 0]);
}
else {
testArrayType(Float64Array, [0, 1072693248]);
}
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