Commit Graph

20 Commits

Author SHA1 Message Date
jpp
5331e3b616 [V8][asm.js] Adds support to global const variables.
This CL adds support for:
https://discourse.wicg.io/t/allow-const-global-variables/684

It allows global const variables to be used as if they were numeric
literals. For example:

  const f0 = fround(0);
  ...
  function foo() {
    var v = f0;  // no type annotation.
    ...
    return f0;  // no return type annotation.
  }

BUG= https://bugs.chromium.org/p/v8/issues/detail?id=5540

Review-Url: https://chromiumcodereview.appspot.com/2435823002
Cr-Commit-Position: refs/heads/master@{#40477}
2016-10-20 15:48:41 +00:00
verwaest
86ec092318 Get rid of ParseInfo::lazy
BUG=v8:5501

Review-Url: https://codereview.chromium.org/2406803003
Cr-Commit-Position: refs/heads/master@{#40160}
2016-10-11 10:37:09 +00:00
mstarzinger
18f287572e [parser] Remove obsolete ParseInfo::is_global flag.
R=marja@chromium.org

Review-Url: https://codereview.chromium.org/2392303004
Cr-Commit-Position: refs/heads/master@{#40070}
2016-10-07 08:30:01 +00:00
bradnelson
e901ccdd18 [wasm] [asm.js] Fix asm.js issues around floating point globals.
Allow fround to take values without dots for globals (the spec allows this
subtly).

Drop over-restrictive assert preventing floating point globals from working.

BUG=v8:4203
R=jpp@chromium.org,aseemgarg@chromium.org

Review-Url: https://codereview.chromium.org/2397823003
Cr-Commit-Position: refs/heads/master@{#40013}
2016-10-05 19:46:25 +00:00
rmcilroy
a06df1f21c [Parser] Don't internalize on-the-fly.
Avoid internalizing on-the-fly now that scope analysis and natives syntax
runtime calls no longer require internalized AST values. This should be
more efficient by avoiding extra branches on every AST value creation.

BUG=v8:5215, chromium:634953

Review-Url: https://codereview.chromium.org/2328593002
Cr-Commit-Position: refs/heads/master@{#39531}
2016-09-20 09:33:01 +00:00
marja
e34dfe04ea Include only stuff you need, part 9: variables.h
TBR=bmeurer@chromium.org
BUG=v8:5294

Review-Url: https://codereview.chromium.org/2324783002
Cr-Commit-Position: refs/heads/master@{#39304}
2016-09-09 10:55:50 +00:00
jpp
a60e182250 [Asm.js] Prevents assignments to immutables.
Adds a check so that module validation fails if there are any
assignments to immutable identifiers (e.g., module name, module
parameters, stdlib imports.)

BUG= https://bugs.chromium.org/p/chromium/issues/detail?id=640194

Review-Url: https://codereview.chromium.org/2268363002
Cr-Commit-Position: refs/heads/master@{#38838}
2016-08-23 18:08:42 +00:00
marja
f9d6076115 Cleanup: Move ParseInfo to a separate file.
This makes us able to get rid of dependencies to parser.h from places
which only need the ParseInfo, and also gets rid of the curious Parser
<-> Compiler circular dependency.

Also IWYUd where necessary.

BUG=

Review-Url: https://codereview.chromium.org/2268513002
Cr-Commit-Position: refs/heads/master@{#38777}
2016-08-22 11:33:58 +00:00
verwaest
923c45198a Make Variable::is_this always return the correct value
BUG=

Review-Url: https://codereview.chromium.org/2231813003
Cr-Commit-Position: refs/heads/master@{#38599}
2016-08-12 08:15:32 +00:00
verwaest
ff1c3cdb18 Separate Scope into DeclarationScope and Scope
This reduces peak zone memory usage by ~10% on codeload and ~5% on mandreel.

BUG=v8:5209

Committed: https://crrev.com/2648162dcfff622f8587cea2faa8c3af56456968
Review-Url: https://codereview.chromium.org/2209573002
Cr-Original-Commit-Position: refs/heads/master@{#38367}
Cr-Commit-Position: refs/heads/master@{#38390}
2016-08-05 14:34:04 +00:00
machenbach
2b6675c350 Revert of Separate Scope into DeclarationScope and Scope (patchset #13 id:240001 of https://codereview.chromium.org/2209573002/ )
Reason for revert:
[Sheriff] Make leak checker unhappy:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20debug/builds/10959

Original issue's description:
> Separate Scope into DeclarationScope and Scope
>
> This reduces peak zone memory usage by ~10% on codeload and ~5% on mandreel.
>
> BUG=v8:5209
>
> Committed: https://crrev.com/2648162dcfff622f8587cea2faa8c3af56456968
> Cr-Commit-Position: refs/heads/master@{#38367}

TBR=marja@chromium.org,mstarzinger@chromium.org,ahaas@chromium.org,adamk@chromium.org,verwaest@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5209

Review-Url: https://codereview.chromium.org/2212383003
Cr-Commit-Position: refs/heads/master@{#38380}
2016-08-05 12:37:23 +00:00
verwaest
2648162dcf Separate Scope into DeclarationScope and Scope
This reduces peak zone memory usage by ~10% on codeload and ~5% on mandreel.

BUG=v8:5209

Review-Url: https://codereview.chromium.org/2209573002
Cr-Commit-Position: refs/heads/master@{#38367}
2016-08-05 10:17:54 +00:00
jpp
060d984c94 [wasm][asm2wasm] Fixes a bug in 8-bit heap view accesses.
The bug was caused when validating expressions

X >> 0

for indexing into 8-bit heap views. If X was not an intish, the 'normal'
validation path would fail. That, however, left the type of X registered
in the AsmTyper::node_types_ member.

Later, in the 'lenient' code path for 8-bit views, the entire X >> 0
expression would be validated, which would cause X to be validated
again, at which point AsmTyper::SetTypeOf() would DCHECK because the
supplied node already had a type associated with it.

The fix was to simply FAIL() when X is not an intish. This is safe
because if X is not an intish, then

Validate(>>, !intish, FixNum)

will also fail.

BUG= https://bugs.chromium.org/p/chromium/issues/detail?id=628803
BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST= cctest/asmjs/test-asm-typer.cc
LOG= N

Review-Url: https://codereview.chromium.org/2181723002
Cr-Commit-Position: refs/heads/master@{#38053}
2016-07-26 14:05:05 +00:00
jpp
6f31bc9ce8 [wasm] ASM-2-WASM. Enforces switch default clause appearing last.
BUG= https://bugs.chromium.org/p/chromium/issues/detail?id=628803
BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST= cctest/asmjs/test-asm-typer.cc
LOG= N

Review-Url: https://codereview.chromium.org/2172603002
Cr-Commit-Position: refs/heads/master@{#37954}
2016-07-21 19:03:40 +00:00
jpp
d50998c480 V8. ASM-2-WASM. Enforces source code layout.
BUG= https://bugs.chromium.org/p/chromium/issues/detail?id=628450
BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST= cctest/asmjs/test-asm-typer.cc
TEST= mjsunit/wasm/*
LOG= N

Review-Url: https://codereview.chromium.org/2164273002
Cr-Commit-Position: refs/heads/master@{#37950}
2016-07-21 15:34:33 +00:00
jpp
a25e9c6f97 V8. ASM-2-WASM. Fixes issue 628446.
The issue was caused by a mishandling of "special" identifiers, i.e.,
the module's name, and the module's parameter.

BUG= https://bugs.chromium.org/p/chromium/issues/detail?id=628446
BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST= cctest/asmjs/test-asm-typer.cc
TEST= cctest/wasm/*
LOG=N

Review-Url: https://codereview.chromium.org/2147403002
Cr-Commit-Position: refs/heads/master@{#37800}
2016-07-15 16:10:25 +00:00
jpp
ca25c845e2 V8. ASM-2-WASM. Fixes import handling logic.
The asm typer would CHECK fail for imports like

var bogus = stdlib.<HeapViewType>

This CL changes this behavior so the typer reports a validation error
instead.

BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST=cctest/asmjs/test-asm-typer.cc
LOG=N

Review-Url: https://codereview.chromium.org/2152763002
Cr-Commit-Position: refs/heads/master@{#37777}
2016-07-14 16:44:26 +00:00
jpp
43d3187e7a V8. ASM-2-WASM. Small fixes.
1) Validation fails for literal indexes too large for accessing a given
heap type

2) Removes the special handling of FloatishDoubleQ, and FloatQDoubleQ;
the inheritance issue that required this special handling was fixed in
another CL.

3) Fix a macro name (from asm_* to ASM_*)

BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST=cctest/asmjs/test-asm-typer.cc
LOG=N

Review-Url: https://codereview.chromium.org/2150583003
Cr-Commit-Position: refs/heads/master@{#37776}
2016-07-14 16:40:59 +00:00
bradnelson
b0711ccc70 [wasm] Drop old typing-asm and its tests.
BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST= cctest/asmjs/test-asm-typer
LOG=N
R=jpp@chromium.org

Review-Url: https://codereview.chromium.org/2146853004
Cr-Commit-Position: refs/heads/master@{#37734}
2016-07-14 00:06:34 +00:00
jpp
974f4a8059 V8. ASM-2-WASM. Validator V2.
This is a rewrite of the ASM validator. This one follows the spec instead of using the AST visitors.

BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST=cctest/asmjs/test-asm-typer
TEST=cctest/asmjs/test-typing-asm
LOG=N

Review-Url: https://codereview.chromium.org/2071343003
Cr-Commit-Position: refs/heads/master@{#37694}
2016-07-12 23:12:08 +00:00