Commit Graph

13 Commits

Author SHA1 Message Date
bradnelson
0e8b7ec8b1 Remove wasm compile time option and enable wasm behind a runtime flag.
Deferring enabling of tests to separate per platform CLs.

R=machenbach@chromium.org,titzer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1553083003

Cr-Commit-Position: refs/heads/master@{#33123}
2016-01-05 18:06:54 +00:00
ahaas
dcac1f144e [wasm] Fixed float-to-int32 conversion to match the spec.
The new implementation detects if the input value is outside i32 range
and traps it that case.

The range check is done as follows:
The input value is converted to int32 and then back to float. If the
result is the same as the truncated input value, then the input value
is within int32 range.

R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/1537393003

Cr-Commit-Position: refs/heads/master@{#32984}
2015-12-21 10:53:16 +00:00
bradnelson
d9ffa30563 Fixing more wasm warnings.
R=ahaas@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1536663002

Cr-Commit-Position: refs/heads/master@{#32952}
2015-12-17 14:55:16 +00:00
bradnelson
879b21a43a Have WasmModule free it's own memory.
Make WasmModule free it's own memory, avoid mixing stack and
heap allocations in tests. This fixes several memory leaks.

Fix several signed compare issues.
Fix several floating point warnings.

Don't setup heap as external, as then the GC can't collect it.

Disable some tests that fail under ASAN.

R=ahaas@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1538543002

Cr-Commit-Position: refs/heads/master@{#32948}
2015-12-17 13:27:34 +00:00
ahaas
0794c3c9b9 [turbofan] Fixed the second return value of TryTruncateFloatXXToUint64.
As required by the spec, the second return value now returns success
also for the range between 0 and -1 where the conversion results in 0.

R=bradnelson@chromium.org, mstarzinger@chromium.org, v8-arm-ports@googlegroups.com, v8-mips-ports@googlegroups.com

Review URL: https://codereview.chromium.org/1533503002

Cr-Commit-Position: refs/heads/master@{#32936}
2015-12-17 10:24:54 +00:00
ahaas
2358a5be4c [turbofan] Fixed a bug in TryTruncateFloatXXToInt64 with INT64_MIN.
On x64 and arm64 TryTruncateFloatXXToInt64 incorrectly failed when the
input was INT64_MIN.

R=bradnelson@chromium.org, mstarzinger@chromium.org, v8-arm-ports@googlegroups.com

Review URL: https://codereview.chromium.org/1526293002

Cr-Commit-Position: refs/heads/master@{#32908}
2015-12-16 15:34:34 +00:00
ahaas
7ae140fe91 [wasm] Fixed FxxNeg for inputs of NaN.
The new implementation also changes the sign bit if the input is NaN.
(https://github.com/WebAssembly/v8-native-prototype/issues/99)

R=bradnelson@chromium.org

Review URL: https://codereview.chromium.org/1532513002

Cr-Commit-Position: refs/heads/master@{#32894}
2015-12-16 11:45:30 +00:00
ahaas
13412d6693 [wasm] Fixed a problem with float32 stack parameters on 32 bit machines.
The code generation for pushing call parameters on the stack does not
distinguish between float32 and float64 parameters because both are
stored in the same registers. Therefore float32 parameters require two
words on the stack.  The wasm linkage, however, only considered one word
on the stack for float32 parameters, which caused the problem that
float32 parameters were not located correctly on the stack. I fixed the
problem by considering two words for float32 parameters on the stack.

R=bradnelson@chromium.org

Review URL: https://codereview.chromium.org/1529773003

Cr-Commit-Position: refs/heads/master@{#32893}
2015-12-16 11:43:52 +00:00
ahaas
973bc260c5 [wasm] Fixed a wasm test on ia32.
The test Run_Wasm_StoreMem_offset_oob contained an I64STORE instruction,
which is not yet implemented on 32 bit platforms. I turned off those
parts of the test on 32 bit platforms which contain I64 instructions.

R=bradnelson@chromium.org

Review URL: https://codereview.chromium.org/1526573002

Cr-Commit-Position: refs/heads/master@{#32842}
2015-12-14 14:55:21 +00:00
ahaas
746cd5f856 [wasm] Fixed FxxMin and FxxMax for cases where one operand is NaN.
R=titzer@chromium.org

Review URL: https://codereview.chromium.org/1519823002

Cr-Commit-Position: refs/heads/master@{#32811}
2015-12-11 16:40:07 +00:00
ahaas
3ee4c36089 [wasm] Fixed F32Neg and F64Neg for -0.0.
R=titzer@chromium.org

Review URL: https://codereview.chromium.org/1516143004

Cr-Commit-Position: refs/heads/master@{#32802}
2015-12-11 15:30:15 +00:00
ahaas
d83057b4ce [wasm] Change the return type of traps for tests, and added ftoi64 instructions.
Before this change traps always returned a 32 bit word in tests. With this
change traps return either a 32 bit word or a64 bit word, depending on the size
of the actual return value of the test.

Additionally this CL implements the wasm instructions I64SCONVERTF32,
I64UCONVERTF32, I64SCONVERTF64, and I64UCONVERTF64.

R=titzer@chromium.org

Review URL: https://codereview.chromium.org/1519013003

Cr-Commit-Position: refs/heads/master@{#32800}
2015-12-11 14:54:20 +00:00
titzer
4c5b3609fd Initial import of v8-native WASM.
As discussed in person, this adds the code from v8-native-prototype into
V8 proper, guarded by GYP flags that do not build the code by default.
Passing wasm=on to 'make' or setting v8_wasm as a GYP flag activates
building of this code.

An additional header file is added to and exported from the compiler
directory, src/compiler/wasm-compiler.h. This exposes a limited interface
with opaque Node and Graph types to the decoder to build TF graphs, as
well as functions to compile WASM graphs.

The mjsunit tests added are blacklisted because they fail without the
WASM object exposed to JS, which is also disabled by the build config
option.

This corresponds closely to 5981e06ebc, with some formatting fixes and moving some files into src/compiler.

R=mstarzinger@chromium.org, bradnelson@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1504713014

Cr-Commit-Position: refs/heads/master@{#32794}
2015-12-11 12:27:05 +00:00