Commit Graph

6748 Commits

Author SHA1 Message Date
bmeurer
a0484bc611 [compiler] Properly guard the speculative optimizations for instanceof.
Add a general feedback slot for instanceof similar to what we already have
for for-in, which basically has a fast (indicated by the uninitialized
sentinel) and a slow (indicated by the megamorphic sentinel) mode. Now
we can only take the fast path when the feedback slot says it hasn't
seen any funky inputs and nothing funky appeared in the prototype chain.
In the TurboFan code we also deoptimize whenever we see a funky object
(i.e. a proxy or an object that requires access checks) in the prototype
chain (similar to what Crankshaft already did).

Drive-by-fix: Also make Crankshaft respect the mode and therefore
address the deopt loop in Crankshaft around instanceof.

We might want to introduce an InstanceOfIC mechanism at some point and
track the map of the right-hand side.

BUG=v8:5267
R=mvstanton@chromium.org

Review-Url: https://codereview.chromium.org/2370693002
Cr-Commit-Position: refs/heads/master@{#39718}
2016-09-26 12:32:33 +00:00
mvstanton
a10c69f093 Revert "[turbofan] Cleanup: Type only has a semantic dimension."
Reverted for stability reasons.

BUG=chromium:649967
TBR=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2366313002
Cr-Commit-Position: refs/heads/master@{#39716}
2016-09-26 12:02:17 +00:00
neis
f9e9a01661 [modules] Simplify treatment of empty imports.
There's no reason (anymore) to have empty imports in special_imports.  Remove
them from there and rename special_imports to namespace_imports to be more
precise.

R=adamk@chromium.org
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2368613002
Cr-Commit-Position: refs/heads/master@{#39693}
2016-09-23 19:36:04 +00:00
littledan
713e247e7d Add method on Value::IsAsyncFunction to detect async functions
DevTools wants to be able to detect async functions in order to print
their synopsis better in stack traces and tooltips. This patch provides a
simple method to do the check.

BUG=v8:4483

Review-Url: https://codereview.chromium.org/2365833002
Cr-Commit-Position: refs/heads/master@{#39687}
2016-09-23 18:31:33 +00:00
machenbach
e1eee748dd Revert of [wasm] Master CL for Binary 0xC changes. (patchset #26 id:490001 of https://codereview.chromium.org/2345593003/ )
Reason for revert:
Main suspect for tsan:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/11893

Also changes layout tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/10036

+mips builder:
https://build.chromium.org/p/client.v8.ports/builders/V8%20Mips%20-%20builder/builds/4032

Original issue's description:
> [wasm] Master CL for Binary 0xC changes.
>
> [0xC] Convert to stack machine semantics.
> [0xC] Use section codes instead of names.
> [0xC] Add elements section decoding.
> [0xC] Decoding of globals section.
> [0xC] Decoding of memory section.
> [0xC] Decoding of imports section.
> [0xC] Decoding of exports section.
> [0xC] Decoding of data section.
> [0xC] Remove CallImport bytecode.
> [0xC] Function bodies have an implicit block.
> [0xC] Remove the bottom label from loops.
> [0xC] Add signatures to blocks.
> [0xC] Remove arities from branches.
> Add tests for init expression decoding.
> Rework compilation of import wrappers and how they are patched.
> Rework function indices in debugging.
> Fix ASM->WASM builder for stack machine.
> Reorganize asm.js foreign functions due to import indices change.
>
> R=ahaas@chromium.org,rossberg@chromium.org,bradnelson@chromium.org
> BUG=chromium:575167
> LOG=Y
>
> Committed: https://crrev.com/76eb976a67273b8c03c744f64ad850b0432554b9
> Cr-Commit-Position: refs/heads/master@{#39678}

TBR=ahaas@chromium.org,bradnelson@chromium.org,mtrofin@chromium.org,rossberg@chromium.org,bradnelson@google.com,titzer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:575167

Review-Url: https://codereview.chromium.org/2361053004
Cr-Commit-Position: refs/heads/master@{#39685}
2016-09-23 17:58:24 +00:00
bmeurer
0702ea3000 [turbofan] Don't take into account source size for inlining heuristics.
The source size is not a real indicator for whether or not to inline a
certain function.

R=ishell@chromium.org, jarin@chromium.org
BUG=v8:3354,v8:5267

Committed: 1b33028607
Review-Url: https://codereview.chromium.org/2361813002
Cr-Commit-Position: refs/heads/master@{#39681}
2016-09-23 16:23:34 +00:00
titzer
76eb976a67 [wasm] Master CL for Binary 0xC changes.
[0xC] Convert to stack machine semantics.
[0xC] Use section codes instead of names.
[0xC] Add elements section decoding.
[0xC] Decoding of globals section.
[0xC] Decoding of memory section.
[0xC] Decoding of imports section.
[0xC] Decoding of exports section.
[0xC] Decoding of data section.
[0xC] Remove CallImport bytecode.
[0xC] Function bodies have an implicit block.
[0xC] Remove the bottom label from loops.
[0xC] Add signatures to blocks.
[0xC] Remove arities from branches.
Add tests for init expression decoding.
Rework compilation of import wrappers and how they are patched.
Rework function indices in debugging.
Fix ASM->WASM builder for stack machine.
Reorganize asm.js foreign functions due to import indices change.

R=ahaas@chromium.org,rossberg@chromium.org,bradnelson@chromium.org
BUG=chromium:575167
LOG=Y

Review-Url: https://codereview.chromium.org/2345593003
Cr-Commit-Position: refs/heads/master@{#39678}
2016-09-23 15:56:54 +00:00
jacob.bramley
73518a9070 [arm] Clean up use of IsSupported and IsEnabled.
CpuFeatures::IsSupported(feature) indicates that the feature is
available on the target. AssemblerBase::IsEnabled(feature) indicates
that we've checked for support (using CpuFeatureScope). The main benefit
is that we can test on (for example) ARMv8, but have some assurance that
we won't generate ARMv8 instructions on ARMv7 targets.

This patch simply cleans up the usage, which had become inconsistent.
The instruction emission functions now check not only that their
dependent features are supported, but also that we've verified that
using CpuFeatureScope.

BUG=

Review-Url: https://codereview.chromium.org/2360243002
Cr-Commit-Position: refs/heads/master@{#39676}
2016-09-23 15:29:22 +00:00
marja
83207f4853 Fix test-parsing/InnerAssignment.
It looks like it tried to trigger lazy inner function parsing by
inserting a comment into an inner function.

1) We don't have lazy inner functions yet.
2) Even if we had, there's no way this heuristic could trigger laziness:
we need to do the laziness decision upfront, without looking at the
contents / size of the function.
3) Some of the combinations were weird: lazy_outer but non-lazy inner?

In the current heuristics, only the total script size affects laziness;
in particular, it doesn't matter where the long comment is.

R=mstarzinger@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2364003002
Cr-Commit-Position: refs/heads/master@{#39673}
2016-09-23 14:30:32 +00:00
verwaest
7f025eb626 Remove ARGUMENTS_VARIABLE and fix crankshaft to properly detect the arguments object and keep it alive when inlining .apply
BUG=

Review-Url: https://codereview.chromium.org/2367483003
Cr-Commit-Position: refs/heads/master@{#39670}
2016-09-23 14:27:02 +00:00
mvstanton
648ac44056 [turbofan] Cleanup: Type only has a semantic dimension.
BUG=

Review-Url: https://codereview.chromium.org/2366433003
Cr-Commit-Position: refs/heads/master@{#39666}
2016-09-23 13:28:13 +00:00
ivica.bogosavljevic
7d48278119 MIPS: Fix compilation failures due to warnings on mips32r1
BUG=

Review-Url: https://codereview.chromium.org/2359923003
Cr-Commit-Position: refs/heads/master@{#39664}
2016-09-23 13:23:52 +00:00
vogelheim
295bafd4bc [parser] Use Back2() where appropriate.
R=marja@chromium.org
BUG=v8:4947

Review-Url: https://codereview.chromium.org/2366573002
Cr-Commit-Position: refs/heads/master@{#39662}
2016-09-23 13:16:19 +00:00
machenbach
99160dc1c1 Revert of [turbofan] Don't take into account source size for inlining heuristics. (patchset #4 id:60001 of https://codereview.chromium.org/2361813002/ )
Reason for revert:
timeouts on windows:
https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20debug/builds/12504

Original issue's description:
> [turbofan] Don't take into account source size for inlining heuristics.
>
> The source size is not a real indicator for whether or not to inline a
> certain function.
>
> R=ishell@chromium.org, jarin@chromium.org
> BUG=v8:3354,v8:5267
>
> Committed: 1b33028607

TBR=ishell@chromium.org,jarin@chromium.org,bmeurer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:3354,v8:5267

Review-Url: https://codereview.chromium.org/2362853003
Cr-Commit-Position: refs/heads/master@{#39661}
2016-09-23 12:43:45 +00:00
Benedikt Meurer
1b33028607 [turbofan] Don't take into account source size for inlining heuristics.
The source size is not a real indicator for whether or not to inline a
certain function.

R=ishell@chromium.org, jarin@chromium.org
BUG=v8:3354,v8:5267

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

Cr-Commit-Position: refs/heads/master@{#39659}
2016-09-23 11:47:19 +00:00
Benedikt Meurer
d2626e30d9 [interpreter] Fix word32 vs word64 bug in CodeStubAssembler::UpdateFeedback.
R=epertoso@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#39658}
2016-09-23 11:41:11 +00:00
hablich
b88a848faf Revert of Replaced different means of zone pooling/reusing by one zone segment pool (patchset #3 id:120001 of https://codereview.chromium.org/2348303002/ )
Reason for revert:
Blocks Roll https://codereview.chromium.org/2366733002/

Original issue's description:
> Replaced different means of zone pooling/reusing by one zone segment pool
>
> BUG=v8:5409
>
> Committed: https://crrev.com/a124feb0760896c8be61de08004a08c3bc9b4b3f
> Cr-Commit-Position: refs/heads/master@{#39633}

TBR=mstarzinger@chromium.org,verwaest@chromium.org,heimbuef@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5409

Review-Url: https://codereview.chromium.org/2360403003
Cr-Commit-Position: refs/heads/master@{#39651}
2016-09-23 06:02:46 +00:00
adamk
3bbd11c233 [modules] Do path resolution relative to each module file in d8
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2361593002
Cr-Commit-Position: refs/heads/master@{#39646}
2016-09-22 21:03:42 +00:00
mvstanton
d52451ec86 [turbofan] Remove the representation dimension from Type.
BUG=

Review-Url: https://codereview.chromium.org/2359153002
Cr-Commit-Position: refs/heads/master@{#39641}
2016-09-22 18:35:19 +00:00
chiniforooshan
d537582d6f Re-enable TestEventInContext
https://codereview.chromium.org/2253973003 is landed. The V8
macro can be changed accordingly now and the test can be enabled
again.

BUG=647986

Review-Url: https://codereview.chromium.org/2360083005
Cr-Commit-Position: refs/heads/master@{#39636}
2016-09-22 16:31:14 +00:00
heimbuef
a124feb076 Replaced different means of zone pooling/reusing by one zone segment pool
BUG=v8:5409

Review-Url: https://codereview.chromium.org/2348303002
Cr-Commit-Position: refs/heads/master@{#39633}
2016-09-22 15:35:13 +00:00
mvstanton
e13a825b6e [turbofan] Eliminate uses of representation dimension of Type.
BUG=

Review-Url: https://codereview.chromium.org/2355253002
Cr-Commit-Position: refs/heads/master@{#39621}
2016-09-22 10:33:25 +00:00
caitp
5784773feb [builtins] move String.prototype[@@iterator] to C++ builtin
BUG=v8:5388
R=bmeurer@chromium.org, adamk@chromium.org
TBR=hpayer@chromium.org

Review-Url: https://codereview.chromium.org/2348493003
Cr-Commit-Position: refs/heads/master@{#39598}
2016-09-21 14:18:00 +00:00
machenbach
a8951a96ab [gn] Add gn support to gcmole
This also adds sources missing for PPC and x87, fixes a few
missing files in gyp due to wrong quotation and a few that
were simply not included.

The gn files are now authoritative, but the gcmole gyp and
gn source lists are enforced to match exactly.

This additional enforcement helped finding the bugs above
and will be removed when we deprecate the gyp files.

BUG=614645
NOTRY=true

Review-Url: https://codereview.chromium.org/2352103002
Cr-Commit-Position: refs/heads/master@{#39592}
2016-09-21 11:45:24 +00:00
ahaas
698bbe418a [wasm] Set up Table and Memory constructors
Set up Wasm Table and Memory constructors

This only provides skeletons so far: the constructors work, but the
types are not wired up with the import/export mechanism yet; methods are
still nops.

Also, fix errors generated from Wasm to be proper Error/TypeError
instances instead of just strings.

I took over this CL from rossberg@chromium.org. The original CL is
https://codereview.chromium.org/2342623002

R=titzer@chromium.org, rossberg@chromium.org

Review-Url: https://codereview.chromium.org/2350643003
Cr-Commit-Position: refs/heads/master@{#39588}
2016-09-21 10:40:32 +00:00
vogelheim
a2b8b6e7db Handle Utf-8 BOM at beginning of an Utf-8 stream.
(This should enable to drop the BOM handling in the Blink bindings.)

R=marja@chromium.org
BUG=v8:4947

Review-Url: https://codereview.chromium.org/2354973002
Cr-Commit-Position: refs/heads/master@{#39579}
2016-09-21 08:40:10 +00:00
ivica.bogosavljevic
ade29503dd Fix compilation failure with GCC 5
BUG=

Review-Url: https://codereview.chromium.org/2353943002
Cr-Commit-Position: refs/heads/master@{#39576}
2016-09-21 07:18:46 +00:00
adamk
cf127e8144 [modules] Expand API to allow linking and use it in d8
This patch gives the ability for the embedder to ask for the
module requests of a module, and to pass a ResolveCallback
into Module::Instantiate().

In d8, I've implemented a simple module_map that's used
along with this API to allow loading, compiling, instantiating,
and evaluating a whole tree of modules.

No path resolution is yet implemented, meaning that all
import paths are relative to whatever directory d8 runs
in. And no imports are linked to the exports of the
requested module.

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2351113004
Cr-Commit-Position: refs/heads/master@{#39569}
2016-09-20 23:39:41 +00:00
klaasb
5deb0bc157 [interpreter] Inline FastCloneShallowArrayStub into bytecode handler
The CreateArrayLiteral bytecode handler now directly inlines the FastCloneShallowArrayStub.

BUG=v8:4280

Review-Url: https://codereview.chromium.org/2341743003
Cr-Commit-Position: refs/heads/master@{#39562}
2016-09-20 18:04:50 +00:00
heimbuef
7a4f8e4d83 Moved zones and zone related stuff in its own directory.
This is some initial cleanup to keep /src clean. The
AccountingAllocator is actually exclusively used by zones and this
common subfolder makes that more clear.

BUG=v8:5409

Review-Url: https://codereview.chromium.org/2344143003
Cr-Commit-Position: refs/heads/master@{#39558}
2016-09-20 16:08:07 +00:00
mvstanton
b88d132f4c [TypeFeedbackVector] special ic slots for interpreter compare/binary ops.
Full code uses patching ICs for this feedback, and the interpreter uses
the type feedback vector. It's a good idea to code the vector slots
appropriately as ICs so that the runtime profiler can better gauge if
the function is ready for tiering up from Ignition to TurboFan.

As is, the feedback is stored in "general" slots which can't be
characterized by the runtime profiler into feedback states.

This CL addresses that problem. Note that it's also important to
carefully exclude these slots from the profiler's consideration when
determining if you want to optimize from Full code.

BUG=

Review-Url: https://codereview.chromium.org/2342853002
Cr-Commit-Position: refs/heads/master@{#39555}
2016-09-20 13:54:51 +00:00
vogelheim
05a00a93b1 Simplify Scanner bookmarking.
- Eliminates *all* copies in the process.
- Moves (nearly) all functionality into Scanner::BookmarkScope.
- Significant code reduction.

[Needs to be rebased once crrev.com/2347883002 lands. All changes in *parser* are from that CL.]

R=marja@chromium.org
BUG=v8:4947

Review-Url: https://codereview.chromium.org/2341323002
Cr-Commit-Position: refs/heads/master@{#39554}
2016-09-20 13:48:04 +00:00
klaasb
e2455873e6 Port FastCloneShallowArrayStub to Turbofan
Refactors CodeStubAssembler::AllocateJSArray to share code.

BUG=chromium:608675

Review-Url: https://codereview.chromium.org/2304573004
Cr-Commit-Position: refs/heads/master@{#39550}
2016-09-20 12:36:28 +00:00
leszeks
044a62be6c [interpreter] Add fast path for dynamic global lookups
Adds a fast path for loading DYNAMIC_GLOBAL variables, which are lookup
variables that can be globally loaded, without calling the runtime, as long as
there was no context extension by a sloppy eval along their context chain.

BUG=v8:5263

Review-Url: https://codereview.chromium.org/2347143002
Cr-Commit-Position: refs/heads/master@{#39537}
2016-09-20 10:31:52 +00:00
vogelheim
b36c60cce8 Remove legacy API on Utf16CharacterStream.
BUG=v8:4947

Review-Url: https://codereview.chromium.org/2347883002
Cr-Commit-Position: refs/heads/master@{#39533}
2016-09-20 09:44:00 +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
bradnelson
7e07d3f669 [wasm] asm.js: Add asm_wasm variant to test asm.js->wasm pipeline.
BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
BUG= https://bugs.chromium.org/p/v8/issues/detail?id=5406
LOG=N
R=mstarzinger@chromium.org,machenbach@chromium.org

Review-Url: https://codereview.chromium.org/2309833003
Cr-Commit-Position: refs/heads/master@{#39521}
2016-09-19 23:57:13 +00:00
neis
c5785bfb92 [modules] Explicitly keep track of module requests.
We must keep track of the exact order in which modules are requested.
To do so, maintain a map from module specifiers to position while
parsing (in ModuleDescriptor). Descriptor entries now refer to that
position rather than the string.  When generating the ModuleInfo, turn
this map into an array of specifiers. We don't need the map anymore
later on, so we do not reconstruct it when deserializing again.

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2353633002
Cr-Commit-Position: refs/heads/master@{#39519}
2016-09-19 22:08:20 +00:00
vogelheim
d8eeaed3f9 Behold, a unit test for Scanner::BookmarkScope (& scanner bookmarking).
This is in preparation for upcmoming scanner + bookmarking cleanups.

Also, drive-by fix for setting a bookmark close to the end of the stream,
when the look-ahead character (c0_) is kEndOfInput, which the bookmarking
logic also used as kNoBookmark.

R=marja@chomium.org
BUG=v8:4947

Review-Url: https://codereview.chromium.org/2345053003
Cr-Commit-Position: refs/heads/master@{#39507}
2016-09-19 16:51:05 +00:00
chiniforooshan
04c8a36849 Comment out TestEventInContext
The test does not compile with https://codereview.chromium.org/2253973003.
I will comment it out, land the mentioned patch, fix the compile error
(a simple one-liner), and enable the test again.

BUG=647986

Review-Url: https://codereview.chromium.org/2348063002
Cr-Commit-Position: refs/heads/master@{#39505}
2016-09-19 15:03:13 +00:00
jochen
d7ef0b8c97 Fix BUILD.gn files and add presubmit step
Remove files that were removed from the build files but never deleted.

R=machenbach@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2346103002
Cr-Commit-Position: refs/heads/master@{#39499}
2016-09-19 10:59:41 +00:00
petermarshall
95cc98c99c [builtins] Move StringLastIndexOf to a builtin.
BUG=v8:5364

Review-Url: https://codereview.chromium.org/2339123002
Cr-Commit-Position: refs/heads/master@{#39498}
2016-09-19 10:22:55 +00:00
gdeepti
dd3b14b7b4 [wasm] Fix test-run-wasm-module tests in debug mode.
test-run-wasm-module cctests broken in debug since recent refactoring changes for moving Compilation/Instantiation off the module object (https://codereview.chromium.org/2320723005). The problem here is that SetupIsolateForWasm tries to add the same property to a module_object multiple times and hits a DCHECK when this property is found on a lookup.
 - Fixed to use the setup method only once when CcTest::InitIsolateOnce is used.
 - Move setup method to test as this is only used for cctests/fuzzers. The install method should take care of this in the regular JS pipeline.

 R=mtrofin@chromium.org, ahaas@chromium.org

Review-Url: https://codereview.chromium.org/2342263002
Cr-Commit-Position: refs/heads/master@{#39484}
2016-09-17 01:31:07 +00:00
bakkot
e68258bd15 [AST] Add method to concatenate AstRawStrings
Normally the parser just uses AstConsStrings to concatenate, but some
types require an AstRawString. This patch adds an AstValueFactory
method which produces one from two AstRawStrings.

Review-Url: https://codereview.chromium.org/2348783002
Cr-Commit-Position: refs/heads/master@{#39482}
2016-09-16 23:49:37 +00:00
vogelheim
8d00743438 Also build parsing/test-scanner-streams.
crrev.com/2339933002 and crrev.com/2314663002 were overlapping, so
this slipped through the cracks.

R=jochen@chromium.org
BUG=v8:4947, chromium:646794

Review-Url: https://codereview.chromium.org/2343093002
Cr-Commit-Position: refs/heads/master@{#39474}
2016-09-16 14:00:07 +00:00
leszeks
66d2e1fc22 [interpreter] Add a fast path for dynamic local load
Adds a fast path for loading DYNAMIC_LOCAL variables, which are lookup
variables that can be context loaded, without calling the runtime, as
long as there was no context extension by a sloppy eval along their
context chain.

BUG=v8:5263

Review-Url: https://codereview.chromium.org/2343633002
Cr-Commit-Position: refs/heads/master@{#39473}
2016-09-16 13:27:19 +00:00
vogelheim
642d6d314c Rework scanner-character-streams.
- Smaller, more consistent streams API (Advance, Back, pos, Seek)
- Remove implementations from the header, in favor of creation functions.

Observe:
- Performance:
  - All Utf16CharacterStream methods have an inlinable V8_LIKELY w/ a
    body of only a few instructions. I expect most calls to end up there.
  - There used to be performance problems w/ bookmarking, particularly
    with copying too much data on SetBookmark w/ UTF-8 streaming streams.
    All those copies are gone.
  - The old streaming streams implementation used to copy data even for
    2-byte input. It no longer does.
  - The only remaining 'slow' method is the Seek(.) slow case for utf-8
    streaming streams. I don't expect this to be called a lot; and even if,
    I expect it to be offset by the gains in the (vastly more frequent)
    calls to the other methods or the 'fast path'.
  - If it still bothers us, there are several ways to speed it up.
- API & code cleanliness:
  - I want to remove the 'old' API in a follow-up CL, which should mostly
    delete code, or replace it 1:1.
  - In a 2nd follow-up I want to delete much of the UTF-8 handling in Blink
    for streaming streams.
  - The "bookmark" is now always implemented (and mostly very fast), so we
    should be able to use it for more things.
- Testing & correctness:
  - The unit tests now cover all stream implementations,
    and are pretty good and triggering all the edge cases.
  - Vastly more DCHECKs of the invariants.

BUG=v8:4947

Review-Url: https://codereview.chromium.org/2314663002
Cr-Commit-Position: refs/heads/master@{#39464}
2016-09-16 08:29:52 +00:00
bakkot
fe6b76d491 Class fields, part 1 (parsing and infrastructure)
This is one part of a WIP implementation of the stage-2 proposal to add
fields to classes: https://github.com/tc39/proposal-class-public-fields

See design doc:
https://docs.google.com/document/d/1WRtNm3ZLNJT1WVr8aq4RJuByYgfuAFAhj20LwTW6JVE/

This adds support for parsing fields in classes, including
infrastructure. In particular, it adds:
* Two booleans on function literal AST nodes
* Two compiler hints on SharedFunctionInfos representing said bools
* A new type of ClassLiteralProperty, FIELD
* Parser support for the syntax
* Syntax tests
* A flag to enable it.

Currently the fields are parsed and then droppped. Subsequent
patches will add semantics, mostly by desugaring in the parser and
the remainder in the non-crankshaft backends.

BUG=v8:5367

Review-Url: https://codereview.chromium.org/2315733003
Cr-Commit-Position: refs/heads/master@{#39459}
2016-09-16 00:42:46 +00:00
jochen
65aa596f1e Only pass the outer scope info with ParseInfo
We don't need the context anymore for parsing, the scope info chain is
enough.

BUG=v8:5215
R=marja@chromium.org,jgruber@chromium.org,mstarzinger@chromium.org

Review-Url: https://codereview.chromium.org/2342443004
Cr-Commit-Position: refs/heads/master@{#39457}
2016-09-15 19:47:31 +00:00
jochen
94492437d9 Fully deserialize the scope chain after parsing, not before
To avoid a dependency on the heap during parsing, we only create a scope chain
without linking to the associated ScopeInfo objects before parsing. This is
enough to avoid special cases during parsing of arrow functions / eval.

Looking at the outer scope's variables during parsing was only needed for hosting
sloppy block functions inside eval. To be able to do this now, we hoist for the
outer-most eval scope after parsing, in DeclarationScope::Analyze.

DeclarationScope::Analyze is also where we replace the outer scope chain with the
fully deserialized version, so variables can be resolved.

Also, this unifies background and foreground thread parsing, as we don't have to
worry about ScopeInfos getting accessed before we're back on the main thread.

BUG=v8:5215
R=verwaest@chromium.org,marja@chromium.org,adamk@chromium.org

Review-Url: https://codereview.chromium.org/2306413002
Cr-Commit-Position: refs/heads/master@{#39452}
2016-09-15 16:41:26 +00:00