Commit Graph

5976 Commits

Author SHA1 Message Date
ahaas
40bdbef975 [wasm] Int64Lowering of Int64Mul on ia32 and arm.
Int64Mul is lowered to a new turbofan operator, Int32MulPair. The new
operator takes 4 inputs an generates 2 outputs. The inputs are the low
word of the left input, high word of the left input, the low word of the
right input, and high word of the right input. The ouputs are the low
and high word of the result of the multiplication.

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

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

Cr-Commit-Position: refs/heads/master@{#35131}
2016-03-30 10:40:06 +00:00
ahaas
682df6dd33 [wasm] New attempt to implement the Int64Lowering of phis.
The new implementation deals with cycles in the TF graph in two steps:
1) The lowering of phis is delayed to avoid cyclic dependencies.
2) The replacement nodes of phis are created already when the phi is
   pushed onto the stack so that other nodes can use these replacements
   for their lowering.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35126}
2016-03-30 08:14:35 +00:00
ulan
bc272e9f7c Represent speed in GCTracer functions as double instead of int.
This avoids redundant casts, loss of precision, and potential overflows.

BUG=chromium:597310
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#35113}
2016-03-29 17:34:41 +00:00
ulan
c42b2c4493 Refactor the ring buffer in GCTracer.
Now instead of saving all event details in the ring buffer,
we save only the bytes and duration.

This reduces the GCTracer size from 20K to 3K and simplifies code.

BUG=chromium:597310
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#35104}
2016-03-29 12:52:05 +00:00
titzer
c9f59780f7 [wasm] Fix arm64 frame alignment.
In JavaScript code and stubs, JSSP mirrors the CSP but may be unaligned.
    But in WASM code only CSP is used, like native code, and it must be
    aligned.
    Calls into WASM from JS need to carefully align the C stack
    pointer (csp) and restore the previous JSSP, while calls from WASM
    to JS need to compute a new JSSP and restore their CSP after the
    call.

R=ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35096}
2016-03-29 11:42:48 +00:00
bmeurer
36ead519c8 [builtins] Provide Math.floor as TurboFan builtin.
This way we avoid the second deoptimization for the Math.floor and
Math.ceil builtins when -0 is involved. We still deoptimize the inlined
Crankshaft version in various cases, that's a separate issue.

The algorithm used for implement CodeStubAssembler::Float64Floor is
vaguely based on the fast math version used in the libm of various BSDs,
but had to be reengineered to match the EcmaScript specification.

R=epertoso@chromium.org
BUG=v8:2890, v8:4059
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35083}
2016-03-28 17:31:43 +00:00
adamk
06403470e3 Remove --harmony-regexps flag
It's been on since M49. Also moved tests from harmony -> es6,
one of which was merged with another test of the same name.

While moving stuff over to regexp.js, I also noticed that there
were unused calls to %FunctionSetName and %SetNativeFlag (those
calls are already handled by InstallGetter()).

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

Cr-Commit-Position: refs/heads/master@{#35076}
2016-03-25 23:02:11 +00:00
balazs.kilvady
d4a391bb7a MIPS: Support r6 min, max floating point instructions.
Use macro instructions for min, max ops to get the same functionality on
pre-r6 and r6 targets.

BUG=
TEST=mjsunit/math-min-max, cctest/test-macro-assembler-mips64/min_max_nan, cctest/test-macro-assembler-mips/min_max_nan, cctest/test-assembler-mips64/min_max, cctest/test-assembler-mips/min_max

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

Cr-Commit-Position: refs/heads/master@{#35073}
2016-03-25 16:51:23 +00:00
littledan
97fce6214e Check for proper types from error handling code
A bug in error printing meant that we failed to do proper type checks
before calling into C++ code, which could lead to RUNTIME_ASSERT
failures if methods are called on alternative receivers. This patch
adds the right type checks.

BUG=chromium:596718
LOG=Y
R=adamk

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

Cr-Commit-Position: refs/heads/master@{#35069}
2016-03-25 02:10:02 +00:00
littledan
92a571e546 Add ES2015 RegExp full subclassing semantics behind a flag
This patch implements ES2015 RegExp subclassing semantics, namely the
hardest part where RegExp.prototype.exec and certain flag getters can
be overridden in order to provide different behavior. This change is
hidden behind a new flag, --harmony-regexp-exec. The flag guards the
behavior by installing entirely different implementations of the
methods which follow the new semantics.

Preliminary performance tests show a 3-4x regression in the Octane
RegExp benchmark. The new code doesn't call out into several fast
paths that the old code supported, so this is expected.

The patch is tested mostly by test262, where most RegExp tests are fixed,
with the exception of deliberate spec violations for web compatibility,
and for the 'sticky' flag, which is not dynamically read by this patch
in all cases but rather statically compiled into the RegExp. The latter
will require a follow-on patch to implement. A small additional set of
tests verifies one particular case, mostly to check whether the flag
mechanism works.

R=adamk,yangguo@chromium.org
LOG=Y
BUG=v8:4602

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

Cr-Commit-Position: refs/heads/master@{#35068}
2016-03-24 22:27:21 +00:00
rmcilroy
838cea4e4e [Interpreter] Make ignition compiler eagerly.
Makes --ignition cause eager compilation if we aren't building the startup
snapshot.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35066}
2016-03-24 18:38:24 +00:00
rmcilroy
bdf953b5cc Revert of [Interpreter] Remove separate Ignition snapshot. (patchset #2 id:20001 of https://codereview.chromium.org/1833643002/ )
Reason for revert:
Makes nosnap bots timeout due to having to rebuild bytecode handlers.

Original issue's description:
> [Interpreter] Remove separate Ignition snapshot.
>
> Removes the seperate Ignition snapshot and build the Ignition bytecode
> handlers in the default snapshot.
>
> BUG=v8:4280
> LOG=N
>
> Committed: https://crrev.com/1798f3fe84faff32ba44e09f6aed79245dd98d80
> Cr-Commit-Position: refs/heads/master@{#35058}

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

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

Cr-Commit-Position: refs/heads/master@{#35059}
2016-03-24 17:13:10 +00:00
rmcilroy
1798f3fe84 [Interpreter] Remove separate Ignition snapshot.
Removes the seperate Ignition snapshot and build the Ignition bytecode
handlers in the default snapshot.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35058}
2016-03-24 13:42:12 +00:00
ulan
bb9b74e754 Add memory pressure notification API
Based on CL 1777883002.

BUG=chromium:590975
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#35053}
2016-03-24 09:53:11 +00:00
bmeurer
1abd78979c [turbofan] Introduce proper abstractions for ToNumber truncations.
Introduce TruncateTaggedToFloat64 and TruncateTaggedToWord32 into the
CodeStubAssembler, which encapsulates the ToNumber truncation and
returns the resulting number as either Float64 or further truncated to
Word32.

R=jarin@chromium.org
BUG=v8:4587
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35051}
2016-03-24 06:06:47 +00:00
littledan
7f108b655b Implement ES2015 labelled function declaration restrictions
ES#sec-islabelledfunction specifies that labelled function declarations
may not occur as the body of a control flow construct such as an if
statement. This patch implements those restrictions, which also
eliminates a previous case resulting in a DCHECK failure which is now
a SyntaxError.

BUG=chromium:595309
R=adamk
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#35049}
2016-03-24 01:59:47 +00:00
bradnelson
942ed11488 Properly handle unsigned literals, fix typing issue with unary +.
Properly convert unsigned literals.
Forbid using unary + on a kAsmInt.
Forbid multiplies other than * 1.0 as being equivalent to unary +.

BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST=test-asm-validator,asm-wasm
R=titzer@chromium.org,aseemgarg@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35046}
2016-03-23 23:21:21 +00:00
danno
a827400025 Ensure Schedules generated by the RawMachineAssembler are in edge-split form
This CL adds an extra pass before calculating the special RPO
order in the custom RawMachineAssembler pipeline that
walks through the schedule and inserts extra blocks to
guarantee that the control flow graph is in split edge form. It
also propagates deferred block marks forward to these new
blocks if appropriate.

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

Cr-Commit-Position: refs/heads/master@{#35014}
2016-03-23 07:37:14 +00:00
adamk
ed18aa65ea Remove support for legacy const, part 1
Now that ES2015 const has shipped, in Chrome 49, legacy const declarations
are no more. This lets us remove a bunch of code from many parts of the
codebase.

In this patch, I remove parser support for generating legacy const variables
from const declarations. This also removes the special "illegal declaration"
bit from Scope, which has ripples into all compiler backends.

Also gone are any tests which relied on legacy const declarations.

Note that we do still generate a Variable in mode CONST_LEGACY in one case:
function name bindings in sloppy mode. The likely fix there is to add a new
Variable::Kind for this case and handle it appropriately for stores in each
backend, but I leave that for a later patch to make this one completely
subtractive.

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

Cr-Commit-Position: refs/heads/master@{#35002}
2016-03-22 17:52:13 +00:00
bmeurer
43fe7d6854 [builtins] Add support for JS builtins written in TurboFan.
This CL adds support for builtins with JavaScript linkage written using
the TurboFan CodeStubAssembler, but with a JSCall descriptor (which was
already supported thanks to a previous patch by Ben Smith). As a first
example, we convert the Math.sqrt builtin and thereby get rid of the
%_MathSqrt intrinsic, which causes trouble for the representation
selection pass in the JavaScript pipeline.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34989}
2016-03-22 13:25:54 +00:00
epertoso
d158bf14b3 [Interpreter] TurboFan implementation of intrinsics.
Introduces a bytecode whose handler executes the equivalent of %_IsArray and %_IsJSReceiver without a runtime call.

BUG=v8:4822
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#34983}
2016-03-22 11:36:05 +00:00
mythria
27338320f4 [Interpreter] Fixes CopyBytecodeArray to copy interrupt_budget field.
Fixes CopyBytecodeArray to set the interrupt_budget field.

BUG=v8:4280,v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34982}
2016-03-22 11:05:21 +00:00
jarin
e1bd9af173 [turbofan] Add more sanity checks to representation inference.
The CL also add guard nodes to places where we assume that certain
values are numbers.

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

Cr-Commit-Position: refs/heads/master@{#34977}
2016-03-22 06:50:52 +00:00
bmeurer
1d0df88b11 [intrinsics] Remove unused intrinsic %_IncrementStatsCounter.
This was once meant to be used for JavaScript code stubs, but since we
found a better way to do code stubs using TurboFan, we don't need this
runtime entry and intrinsic anymore.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34976}
2016-03-22 06:35:39 +00:00
zhengxing.li
400f6c5038 X87: Extends testb and cmpb/cmpw instruction support in the ia32 assembler.
port 22523f25b1 (r34925)

  original commit message:
  This is in preparation for a CL that does the equivalent of http://crrev.com/1780193003 for ia32.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34974}
2016-03-22 05:39:56 +00:00
bradnelson
cca5c3f630 Fix conversion to float32, typing issue, split apart asm-wasm tests.
Add missing conversions from other types to f32 in fround.
Restrict fround() to only float, double, signed, unsigned (no unions / intish).
Restrict Bitwise operations to intish, particularly |0, when not applied to a foreign function.

Adding more exhaustive tests of stdlib Math, move to a separate file.
Adding tests of interesting values for the stdlib asm.js functions.

BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST=test-asm-validator,asm-wasm
R=titzer@chromium.org,rossberg@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34967}
2016-03-21 20:34:40 +00:00
adamk
249bf75e0c Remove runtime flags for Proxy and Reflect
Both of them shipped in Chrome 49 without incident.

Also move relevant tests from harmony/ to es6/.

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

Cr-Commit-Position: refs/heads/master@{#34964}
2016-03-21 19:40:02 +00:00
vogelheim
09ac4f295c Revert of Parser: Make skipping HTML comments optional. (patchset #6 id:140001 of https://codereview.chromium.org/1801203002/ )
Reason for revert:
Violates ES6 spec (crbug.com/4850), and implementation was over-eager. Will revert for now.

Original issue's description:
> Parser: Make skipping HTML comments optional.
>
> API change: This adds a new flag skip_html_comments to v8::ScriptOriginOptions. This flag controls whether V8 will attempt to honour HTML-style comments in JS sources.
>
> (That is: Gracefully ignore <!-- ... ---> in JS sources, which was a popular technique in the early days of JavaScript, to prevent non-JS-enabled browsers from displaying script sources to uses.)
>
> The flag defaults to 'true' when using v8::ScriptOrigin constructor, which preserves the existing behaviour. Embedders which are happy with the existing behaviour will thus not need any changes.
>
> BUG=chromium:573887
> LOG=Y
>
> Committed: https://crrev.com/91d344288aa51ed03eaaa1cb3e368ac1e82f0173
> Cr-Commit-Position: refs/heads/master@{#34904}

TBR=jochen@chromium.org,rossberg@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=chromium:573887, v8:4850
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#34958}
2016-03-21 17:50:22 +00:00
oth
48d082af38 [interpreter] Add support for scalable operands.
This change introduces wide prefix bytecodes to support wide (16-bit)
and extra-wide (32-bit) operands. It retires the previous
wide-bytecodes and reduces the number of operand types.

Operands are now either scalable or fixed size. Scalable operands
increase in width when a bytecode is prefixed with wide or extra-wide.

The bytecode handler table is extended to 256*3 entries. The
first 256 entries are used for bytecodes with 8-bit operands,
the second 256 entries are used for bytecodes with operands that
scale to 16-bits, and the third group of 256 entries are used for
bytecodes with operands that scale to 32-bits.

LOG=N
BUG=v8:4747,v8:4280

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

Cr-Commit-Position: refs/heads/master@{#34955}
2016-03-21 17:09:49 +00:00
jyan
faaf8512bf S390: Disable gcc generation of mul-add in cctests
Generated code performs distinct floating multiply and add/subtract
operations. Tests fail when GCC uses mul-add to calculate the
expected result since these instructions provide higher accuracy due
to the lack of an intermediate round.

R=machenbach@chromium.org, mbrandy@us.ibm.com, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34953}
2016-03-21 16:43:35 +00:00
machenbach
6734df936a [test] Skip some flaky cpu profiler tests on windows.
BUG=v8:2999,v8:4751
LOG=n
NOTRY=true
TBR=hablich@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34943}
2016-03-21 14:17:56 +00:00
mstarzinger
f1d04af52f [interpreter] Prepare for shipping --harmony-instanceof.
R=rmcilroy@chromium.org
TEST=cctest/test-interpreter/InterpreterInstanceOf
BUG=v8:4447
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34933}
2016-03-21 12:09:05 +00:00
epertoso
22523f25b1 Extends testb and cmpb/cmpw instruction support in the ia32 assembler.
This is in preparation for a CL that does the equivalent of http://crrev.com/1780193003 for ia32.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34925}
2016-03-21 10:09:26 +00:00
bmeurer
b7aa4c3ab3 [stubs] Split ToNumberStub into reusable subparts.
Split ToNumberStub into the entry ToNumberStub, and two new stubs,
StringToNumberStub and NonNumberToNumberStub, which can be used when we
already know something about the input (i.e. in various branches of the
code stubs, or in TurboFan graphs).

Also introduce an appropriate StringToNumber simplified operator for
TurboFan, that is pure and is lowered to an invocation of the newly
added StringToNumberStub.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34922}
2016-03-21 09:05:49 +00:00
jarin
811137ffe5 [turbofan] Use the type from the typer instead of computing new type in representation inference.
Review URL: https://codereview.chromium.org/1799023003

Cr-Commit-Position: refs/heads/master@{#34917}
2016-03-21 06:29:43 +00:00
bradnelson
e7f7d2c943 Number lines in test-asm-validator from 1.
Dropping newlines in the test macros used in test-asm-validator.
This will make the tests number from 1, rather than 39,
making them easier to read.

LOG=N
BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=test-asm-validator
R=aseemgarg@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34907}
2016-03-18 23:15:34 +00:00
vogelheim
91d344288a Parser: Make skipping HTML comments optional.
API change: This adds a new flag skip_html_comments to v8::ScriptOriginOptions. This flag controls whether V8 will attempt to honour HTML-style comments in JS sources.

(That is: Gracefully ignore <!-- ... ---> in JS sources, which was a popular technique in the early days of JavaScript, to prevent non-JS-enabled browsers from displaying script sources to uses.)

The flag defaults to 'true' when using v8::ScriptOrigin constructor, which preserves the existing behaviour. Embedders which are happy with the existing behaviour will thus not need any changes.

BUG=chromium:573887
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#34904}
2016-03-18 17:24:19 +00:00
caitpotter88
17c92fe6bb [es7] implement exponentiation operator proposal
Implements Stage 4 proposal from http://rwaldron.github.io/exponentiation-operator/,
without adding any knowledge of the feature to compiler backends.

BUG=v8:3915
LOG=Y
R=adamk@chromium.org, rossberg@chromium.org, littledan@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34890}
2016-03-18 13:54:05 +00:00
Ilija.Pavlovic
a4e5d1541a MIPS64: Fix test Cvt_s_uw_Trunc_uw_s.
The higher word (bits 32 - 63) of FPU register is set on zero before
storing result.

TEST=cctest/test-macro-assembler-mips64/Cvt_s_uw_Trunc_uw_s
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34889}
2016-03-18 13:22:03 +00:00
mstarzinger
8ba35e73ba [compiler] Remove redundant unoptimized compile trigger.
The trigger point in question is by now obsolete. The optimized compile
job will itself ensure that deoptimization support is present on the
incoming SharedFunctionInfo, this will make sure to produce baseline
code when necessary. The ScopeInfo is also installed at that point in
time.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34887}
2016-03-18 12:09:30 +00:00
akos.palfi
2bc32f222b Update cctest.status file for big-endian.
Adjust the status file after https://codereview.chromium.org/1784343004

Also removed the tests that are not failing anymore on big-endian.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34886}
2016-03-18 11:47:34 +00:00
mlippautz
0395c50c60 Reland of "[platform] Change default platform max thread pool size 4 -> 8"
This reverts commit 4857110ce6.

This change was flushing out another issue which is fixed in
  https://codereview.chromium.org/1783283003/

BUG=v8:2999
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34874}
2016-03-17 20:22:50 +00:00
yangguo
6e8958fff4 [serializer] ensure that immortal immovable roots are correctly deserialized.
Immortal immovable roots must be allocated on the first page of the space.
If serializing the root list exceeds the first page, immortal immovable root
objects might end up outside of the first page. That could cause missing
write barriers.

We now iterate the root list twice. The first time we only serialize immortal
immovable root objects. The second time we serialize the rest.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34859}
2016-03-17 13:16:25 +00:00
mvstanton
d47a4063c0 ES6: Object.setPrototypeOf(func, null) breaks instanceof
The way desugared instanceof called OrdinaryHasInstance if the lookup of
@@hasInstance failed was incorrect.

BUG=v8:4774
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34855}
2016-03-17 12:41:07 +00:00
ahaas
122862f6e9 [wasm] Turn on tests for float-to-int conversion in test-run-wasm-64.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34854}
2016-03-17 12:39:25 +00:00
mlippautz
da3b266150 [heap] Move to two-level free-list
Before this CL, free memory (FreeSpace) has been managed through a global free
list that contains single-linked lists of FreeSpace nodes for each size class.

We move away from this approach to a global two-level doubly-linked list that
refers to singly-linked lists of FreeSpace nodes on the corresponding pages.
This way we can refill on a page-level granularity. Furthermore, it also enables
constant-time eviction of pages from the free list.

BUG=chromium:524425
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34853}
2016-03-17 11:11:05 +00:00
yangguo
f507bc1c72 [serializer] Add API to warm up startup snapshot with an additional script.
A startup snapshot is considered cold when it does not contain any
function code. We can now create a warm startup snapshot from a cold one
by running a warm-up script. Functions exercised by the warm-up script
are compiled and its code included in the warm startup snapshot. Side
effects caused by the warm-up script does not persist.

R=vogelheim@chromium.org
BUG=v8:4836
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#34849}
2016-03-17 10:34:16 +00:00
zhengxing.li
b9b55bdc9e X87: Assembler changes for enabling GrowHeap in Wasm
port e1a7c1e76c (r34836)

  original commit message:
   - New RelocInfo mode WASM_MEMORY_REFERENCE as a marker for wasm code objects that need to be relocated on a heap change
   - RelocInfo mode recorded for immediates that use the memory buffer as base
   - Tests to verify address patching works

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34845}
2016-03-17 08:40:08 +00:00
caitpotter88
14188ea07f [parser] report illegal token error in ParseMemberExpressionContinuation()
Report correct error message when a scanner error occurs while parsing a tagged
template within an expression context.

BUG=v8:4829, v8:3230
LOG=N
R=adamk@chromium.org, littledan@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34839}
2016-03-16 20:26:00 +00:00
gdeepti
e1a7c1e76c Assembler changes for enabling GrowHeap in Wasm
- New RelocInfo mode WASM_MEMORY_REFERENCE as a marker for wasm code objects that need to be relocated on a heap change
 - RelocInfo mode recorded for immediates that use the memory buffer as base
 - Tests to verify address patching works

BUG=

Committed: https://crrev.com/cc815b69c17da368107ed77306a5bb161170c834
Cr-Commit-Position: refs/heads/master@{#34831}

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

Cr-Commit-Position: refs/heads/master@{#34836}
2016-03-16 18:15:49 +00:00
machenbach
894bc100c3 Revert of Assembler changes for enabling GrowHeap in Wasm (patchset #13 id:260001 of https://codereview.chromium.org/1759873002/ )
Reason for revert:
Breaks compile:
https://build.chromium.org/p/client.v8/builders/V8%20Mac64/builds/7740

Probably had outdated tryjobs

Original issue's description:
> Assembler changes for enabling GrowHeap in Wasm
>  - New RelocInfo mode WASM_MEMORY_REFERENCE as a marker for wasm code objects that need to be relocated on a heap change
>  - RelocInfo mode recorded for immediates that use the memory buffer as base
>  - Tests to verify address patching works
>
> BUG=
>
> Committed: https://crrev.com/cc815b69c17da368107ed77306a5bb161170c834
> Cr-Commit-Position: refs/heads/master@{#34831}

TBR=titzer@chromium.org,yangguo@chromium.org,bradnelson@chromium.org,bradnelson@google.com,marija.antic@imgtec.com,gdeepti@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34832}
2016-03-16 17:28:44 +00:00
gdeepti
cc815b69c1 Assembler changes for enabling GrowHeap in Wasm
- New RelocInfo mode WASM_MEMORY_REFERENCE as a marker for wasm code objects that need to be relocated on a heap change
 - RelocInfo mode recorded for immediates that use the memory buffer as base
 - Tests to verify address patching works

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34831}
2016-03-16 17:11:42 +00:00
mythria
2fefc4827e [Interpreter] Pops the context to the correct level on return.
We need to pop the context to correct level on return as well. This was incorrectly
removed in this cl: https://codereview.chromium.org/1768123002/. For example
when we have a try-catch-finally block and catch does a return, the return
does not happen immediately. It should execute finally block before it
returns. Return statement should pop the context to the correct level as
expected by finally block.

BUG=594369,v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34822}
2016-03-16 15:52:53 +00:00
mbrandy
eb0a2324a1 PPC: [wasm] Int64Lowering of Int64Sub.
Port 33c08596e1

Original commit message:
    Int64Sub is lowered to a new turbofan operator, Int32SubPair. The new
    operator takes 4 inputs an generates 2 outputs. The inputs are the low
    word of the left input, high word of the left input, the low word of the
    right input, and high word of the right input. The ouputs are the low
    and high word of the result of the subtraction.

    The implementation is very similar to the implementation of Int64Add.

R=ahaas@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34821}
2016-03-16 15:26:25 +00:00
yangguo
4513e07787 Reland of Allow Math.random to be called when creating a custom startup snapshot. (patchset #1 id:1 of https://codereview.chromium.org/1798863003/ )
Reason for revert:
This seems not to change performance.

Original issue's description:
> Revert of Allow Math.random to be called when creating a custom startup snapshot. (patchset #2 id:20001 of https://codereview.chromium.org/1780173002/ )
>
> Reason for revert:
> Regresses performance on base64 benchmark.
>
> Original issue's description:
> > Allow Math.random to be called when creating a custom startup snapshot.
> >
> > R=jkummerow@chromium.org
> > BUG=v8:4810
> > LOG=N
> >
> > Committed: https://crrev.com/6a7ec6a3bf779cdd41c66a768fd7a37195ed7b7f
> > Cr-Commit-Position: refs/heads/master@{#34705}
>
> TBR=jkummerow@chromium.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=v8:4810, chromium:594484
> LOG=N
>
> Committed: https://crrev.com/b7be51cd33bc81d768dbf5632ba0c68843448e37
> Cr-Commit-Position: refs/heads/master@{#34739}

TBR=jkummerow@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=v8:4810, chromium:594484
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34820}
2016-03-16 15:03:05 +00:00
rmcilroy
18109232c1 [Interpreter] Add bytecode generator expectations for super calls.
BUG=v8:4682
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34819}
2016-03-16 14:42:55 +00:00
zhengxing.li
43f65e89f2 X87: Change the test case for X87 Run_WasmF32SConvertI64/Run_WasmF64SConvertI64.
The CL #34701 (https://codereview.chromium.org/1779123002/) added the Run_WasmF32SConvertI64/Run_WasmF64SConvertI64 test cases and X87 failed at them.

  The reason is same as the CL #33630 (Issue 1649323002: X87: Change the test case for X87 RunRoundInt32ToFloat32), please refer: https://codereview.chromium.org/1649323002.

  Here is the key comments from CL #33630:
  Some new test cases use CheckFloatEq(...) and CheckDoubleEq(...) function for result check. When GCC compiling the CheckFloatEq() and CheckDoubleEq() function,
  those inlined functions has different behavior comparing with GCC ia32 build and x87 build.
  The major difference is sse float register still has single precision rounding semantic. While X87 register has no such rounding precsion semantic when directly use register value.
  The V8 turbofan JITTed has exactly same result in both X87 and IA32 port.

  For CHECK_EQ(a, b) function, if a and b are double or float, it will has similar behaviors like CheckFloatEq(...) and CheckDoubleEq(...) function when compiled by GCC and causes the test case fail.

  So we add the following sentence to do type case to keep the same precision for Run_WasmF32SConvertI64/Run_WasmF64SConvertI64. Such as: volatile double expect = static_cast<float>(*i).

  ahaas put those codes in CHECK_FLOAT_EQ and CHECK_DOUBLE_EQ macros in CL #34534 (https://codereview.chromium.org/1773513002 ).

  So this CL replaced the CHECK_EQ in Run_WasmF32SConvertI64/Run_WasmF64SConvertI64 to CHECK_FLOAT_EQ/CHECK_DOUBLE_EQ for x87 can pass Run_WasmF32SConvertI64/Run_WasmF64SConvertI64 tests.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34813}
2016-03-16 13:14:21 +00:00
ahaas
7f19628a5b [wasm] Int64Lowering of Word64Ctz.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34811}
2016-03-16 12:16:00 +00:00
ahaas
5c16cac96d [wasm] Int64Lowering of Word64Clz.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34809}
2016-03-16 11:03:07 +00:00
ahaas
33c08596e1 [wasm] Int64Lowering of Int64Sub on ia32 and arm.
Int64Sub is lowered to a new turbofan operator, Int32SubPair. The new
operator takes 4 inputs an generates 2 outputs. The inputs are the low
word of the left input, high word of the left input, the low word of the
right input, and high word of the right input. The ouputs are the low
and high word of the result of the subtraction.

The implementation is very similar to the implementation of Int64Add.

@v8-arm-ports: please take a careful look at the implementation of sbc
in the simulator.

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

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

Cr-Commit-Position: refs/heads/master@{#34808}
2016-03-16 10:58:05 +00:00
machenbach
7f363d5d47 [test] Remove feature to mark flaky tests.
The feature was removed from the bots a while ago. It was
superseeded by the flaky-test detection which reruns tests.

Remaining tests still marked as flaky most certainly pass
since a while.

Referencing all the bugs whose expectations lines get
removed by this.

BUG=v8:3838,v8:3525,v8:3125
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34804}
2016-03-16 07:35:47 +00:00
zhengxing.li
7e66b57acb X87: [wasm] Int64Lowering of Int64Add on ia32 and arm.
port 1b23079936 (r34747)

  original commit message:
  Int64Add is lowered to a new turbofan operator, Int32AddPair. The new
  operator takes 4 inputs an generates 2 outputs. The inputs are the low
  word of the left input, high word of the left input, the low word of the
  right input, and high word of the right input. The ouputs are the low
  and high word of the result of the addition.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34803}
2016-03-16 03:14:25 +00:00
adamk
108efd7f54 Remove Scope::scope_contains_with_ bit
This part of Scope has existed since V8's initial check in, but from what
I can tell it's not required to implement "with". The only tests that
depend upon it are tests of the debugger and the Scope mirrors, but the
resulting test behavior after removing the bit still seems perfectly
reasonable to me. In fact, with the included fix for scope name collection,
the scope mirror is actually improved with this change.

As a bi-product, this fixes the attached bug, about the contains_with
bit having inconsistent values in some arrow function compilation
scenarios.

BUG=chromium:592353
LOG=n
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

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

Cr-Commit-Position: refs/heads/master@{#34802}
2016-03-15 22:41:59 +00:00
jyan
3b5e84ab0e S390: Initial test changes and files checkin.
R=danno@chromium.org,jkummerow@chromium.org,jochen@chromium.org,joransiu@ca.ibm.com,michael_dawson@ca.ibm.com,mbrandy@us.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34795}
2016-03-15 18:09:36 +00:00
mythria
c838363251 [Interpreter] Updates InlineTwice in test-run-inlining to match other tests.
Updates InlineTwice to declare a function and then return a function
instead of using function expressions by wrapping a function with '('
and ')'. The earlier implementation would cause the function to
compile immediately instead of lazy compile. Also updates cctest.status

BUG=v8:4280,v8:4837,v8:4680
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34790}
2016-03-15 14:28:57 +00:00
jyan
6b503884ae S390: Check in OWNER file on to s390 directory
R=danno@chromium.org,jkummerow@chromium.org,jochen@chromium.org,joransiu@ca.ibm.com,michael_dawson@ca.ibm.com,mbrandy@us.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34789}
2016-03-15 14:25:38 +00:00
ahaas
ccbf004293 [wasm] Int64Lowering of F64ReinterpretI64.
The implementation is done by storing to and then loading from memory.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34785}
2016-03-15 12:46:51 +00:00
ahaas
b484cc12f3 [wasm] Int64Lowering of I64ReinterpretF64.
The implementation is done by storing to and loading from memory.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34784}
2016-03-15 12:18:12 +00:00
ahaas
3a2cc90cb4 [wasm] Turn off tests for mips and x87.
The tests require the implementation of Int32PairAdd and Word32PairShl.

R=titzer@chromium.org, v8-mips-ports@googlegroups.com

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

Cr-Commit-Position: refs/heads/master@{#34782}
2016-03-15 11:04:47 +00:00
yangguo
d0d73999a1 [interpreter, debugger] fix remaining cctest failures.
R=rmcilroy@chromium.org, vogelheim@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34781}
2016-03-15 11:01:09 +00:00
ishell
2ee59e5e28 [turbofan] Fix double object allocation when inlining a construct call of a derived class or an Api function.
Review URL: https://codereview.chromium.org/1798373002

Cr-Commit-Position: refs/heads/master@{#34780}
2016-03-15 11:01:08 +00:00
ahaas
2e6f3e8607 [wasm] Int64Lowering of Word64Popcnt.
Word64Popcnt is lowered to Word32Popcnt(low-word) + Word32Popcnt(high_word).
Since the optional Word64Popcnt operator does not exist on 32 bit platforms,
I introduced a new operator "Word64PopcntPlaceholder" which is generated
in the WasmCompiler and then lowered in the Int64Lowering.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34777}
2016-03-15 10:42:08 +00:00
machenbach
6d44d1db66 [Ignition] Skip tests.
BUG=v8:4280
LOG=n
TBR=rmcilroy@chromium.org, mstarzinger@chromium.org
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#34772}
2016-03-15 09:27:45 +00:00
ahaas
049341f054 [wasm] Implementation of Word32PairShr and Word32PairSar on arm.
Implementation of https://codereview.chromium.org/1768233002 on arm.

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

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

Cr-Commit-Position: refs/heads/master@{#34769}
2016-03-15 07:17:38 +00:00
ahaas
29e0e8e9e3 [wasm] Int64Lowering of I64Div and I64Rem.
On 32-bit systems these instructions are compiled to calls to
C functions. The TF node for the function call is already generated in
the wasm compiler, the lowering of the I64 parameters is done in the
Int64Lowering. We use the return value of the C function to determine
whether the calculation should trap or not.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34768}
2016-03-15 06:52:53 +00:00
ahaas
c4c34eba30 [wasm] Int64Lowering: changing to DFS.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34767}
2016-03-15 06:27:00 +00:00
adamk
5a202cce6e Remove --harmony-modules flag and let embedder decide when modules are used
Modules already have a separate entrypoint into the engine (at the moment,
this is v8::ScriptCompiler::CompileModule, though that will change to
something like ParseModule). This meant that requiring a commandline flag
simply added an extra complexity burden on embedders. By removing the v8
flag, this lets embedders use their own flagging mechanism (such as d8's
"--module", or Blink's RuntimeEnabledFeatures) to control whether
modules are to be used.

Also remove old modules tests that were being skipped (since they test
very old, pre-ES2015 modules syntax).

R=littledan@chromium.org
BUG=v8:1569, chromium:594639
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#34764}
2016-03-15 00:45:00 +00:00
yangguo
bae3efface [serializer] add options to compile eagerly and pre-age for code cache.
R=vogelheim@chromium.org
BUG=chromium:594551
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34761}
2016-03-14 18:57:04 +00:00
titzer
ad91d1c6ca [wasm] Add I64Eqz operator.
R=ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34757}
2016-03-14 17:55:22 +00:00
bradnelson
ace6f1364a Fixing +fround(x) in asm typer.
The rules for handling foreign functions were interfering with handling
of standard functions (such as fround).

Adding more tests around abs()

BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST=test-asm-validator,asm-wasm
R=titzer@chromium.org,rossberg@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34756}
2016-03-14 17:29:25 +00:00
ahaas
2ddfe43a44 [wasm] Fixed register allocation for Word32PairShl on arm.
The previous register allocation allowed invalid register aliasing in
cases where in the TF graph the node was used for multiple inputs of the
Word32PairShl node.

Additionally I renamed PairLsl to LslPair in the code generation for
consistency.

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

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

Cr-Commit-Position: refs/heads/master@{#34755}
2016-03-14 17:24:10 +00:00
ahaas
1b23079936 [wasm] Int64Lowering of Int64Add on ia32 and arm.
Int64Add is lowered to a new turbofan operator, Int32AddPair. The new
operator takes 4 inputs an generates 2 outputs. The inputs are the low
word of the left input, high word of the left input, the low word of the
right input, and high word of the right input. The ouputs are the low
and high word of the result of the addition.

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

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

Cr-Commit-Position: refs/heads/master@{#34747}
2016-03-14 15:34:19 +00:00
martyn.capewell
2cd9877b6d [turbofan] ARM: Reduce out-of-line NaN code size
Reduce the amount of code generated for OutOfLineLoadFloat* by computing
sqrt(-1) rather than move the NaN as an immediate. Add support for single
precision floating point immediate moves to enable this.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34746}
2016-03-14 15:31:04 +00:00
hpayer
ad51e8b1e8 [heap] Black allocation.
When black allocation is active, all objects allocated in old space are allocated black. Important: With that change, you cannot assume anymore that new objects are white right after their allocation. Currently, black allocation is enabled when incremental marking is started.

This feature can be turned off via flag: --noblack-allocation

BUG=chromium:561449
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34743}
2016-03-14 14:03:01 +00:00
titzer
4233050f77 [wasm] Refactor tests for i64.
Move all tests that use i64 values into test-run-wasm-64.cc. Introduce
macros that enable tests as they are implemented on 32 bit platforms.

R=ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34742}
2016-03-14 13:24:36 +00:00
yangguo
b7be51cd33 Revert of Allow Math.random to be called when creating a custom startup snapshot. (patchset #2 id:20001 of https://codereview.chromium.org/1780173002/ )
Reason for revert:
Regresses performance on base64 benchmark.

Original issue's description:
> Allow Math.random to be called when creating a custom startup snapshot.
>
> R=jkummerow@chromium.org
> BUG=v8:4810
> LOG=N
>
> Committed: https://crrev.com/6a7ec6a3bf779cdd41c66a768fd7a37195ed7b7f
> Cr-Commit-Position: refs/heads/master@{#34705}

TBR=jkummerow@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=v8:4810, chromium:594484
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34739}
2016-03-14 10:27:19 +00:00
ahaas
d57d14b978 [wasm] Int64Lowering of I64XConvertFXX instructions.
On 32-bit systems I64XConvertFXX instructions are compiled to calls to
C functions. The TF node for the function call is already generated in
the wasm compiler, the lowering of the I64 parameter is done in the
Int64Lowering. We use the return value of the C function to determine
whether the conversion should trap or not.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34738}
2016-03-14 10:14:18 +00:00
adamk
b16fc86389 Remove --harmony-tostring runtime flag
ES2015 Object.prototype.toString semantics were enabled in version 4.9,
which has been in stable Chrome for nearly two weeks at this point.

R=littledan@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34732}
2016-03-11 18:20:48 +00:00
mythria
d1e3b72ede [Interpreter] Fixes cctest/test-serialize/SerializeInternalReference for ignition.
Updates cctest.status and also updates the test
cctest/test-serialize/SerializeInternalReference to return success when
FLAG_ignition is true. This test tests for internal references and is not
relevant for interpreter.

BUG=v8:4280,v8:4680
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34723}
2016-03-11 13:35:49 +00:00
vogelheim
de4f3d3eff Fix expression positions for for-loops.
FullCodegen generates 2 statement positions for the loop init block, like so:

  for(var i = 0; i....
      ^   ^

This change removes the first of those, updates unit tests,
and removes text expectations for Ignition.

---
An alternative would be to emulate the existing behaviour in Ignition, but:
- The new behaviour seems more logical,
- Ignition generates no bytecodes for the 'var', meaning there is no code position to attach the break position to.

BUG=v8:4690
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#34717}
2016-03-11 12:02:51 +00:00
yangguo
6a7ec6a3bf Allow Math.random to be called when creating a custom startup snapshot.
R=jkummerow@chromium.org
BUG=v8:4810
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34705}
2016-03-11 08:08:30 +00:00
ahaas
0d3c78d118 [wasm] I'm adding the float-to-int64 tests again.
R=binji@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34701}
2016-03-11 07:10:22 +00:00
adamk
dea9559457 Remove destructuring and default arguments runtime flags
These flags have been on by default since version 4.9, which has been
in stable Chrome for over a week now, demonstrating that they're
here to stay.

Also moved the tests out of harmony/ and into es6/.

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

Cr-Commit-Position: refs/heads/master@{#34692}
2016-03-10 23:22:30 +00:00
balazs.kilvady
04a735c7e7 MIPS: Improve Lsa/Dlsa implementations.
Make the low level assembler implementation exact and protected to disallow explicit usage.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34673}
2016-03-10 13:41:34 +00:00
mstarzinger
899105c0bc [compiler] Sidestep the interpreter for generator functions.
This ensures the interpreter is not tasked with compiling generator
functions. It currently does not support suspending activations at
yielding points, but we still want to be able to activate it for the
rest of JavaScript in the meantime.

R=rmcilroy@chromium.org
BUG=v8:4681
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34672}
2016-03-10 13:21:51 +00:00
rossberg
4614c7caaf [strong] Remove all remainders of strong mode
R=mstarzinger@chromium.org,bmeurer@chromium.org,adamk@chromium.org
BUG=v8:3956
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#34669}
2016-03-10 12:45:42 +00:00
jfb
abbdca947f wasm: use strings for section names
This will require an equivalent sexpr-wasm change.

See:
https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#high-level-structure

R=titzer@chromium.org, binji@chronium.org

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

Cr-Commit-Position: refs/heads/master@{#34668}
2016-03-10 12:37:19 +00:00
jacob.bramley
6b6236587d [arm] Basic simulation of msr and mrs.
Only CPSR_f is supported, and then only for the flags that we actually
simulate (NZCV). This isn't currently used, but will be useful for some
tests.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34662}
2016-03-10 11:39:04 +00:00
yangguo
fe92166111 [serializer] allow test-serialize/PartialSerializerCustomContext to optimize.
Previously, optimization has been disabled because of an assertion
failure, which requires the context to be linked into the weak native
context list of the heap.

R=jkummerow@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34661}
2016-03-10 11:18:50 +00:00
yangguo
a65edb8be6 Improve test-serialize test cases.
Changes include:
 - better test coverage for builds with snapshot
 - write snapshot blobs to buffer instead of test serialization files
 - renamed tests

R=machenbach@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34657}
2016-03-10 09:58:26 +00:00
zhengxing.li
25279332c7 X87: [wasm] Int64Lowering of I64ShrU and I64ShrS on ia32.
port 240b7db9c7 (r34630)

  original commit message:
  I implemented I64ShrU and I64ShrS the same as I64Shl in https://codereview.chromium.org/1756863002

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34656}
2016-03-10 09:39:41 +00:00
neis
3062af70eb Implement iterator finalization in array destructuring.
We must close the iterator whenever the destructuring didn't exhaust it, unless an iterator operation (eg. next) threw.  We do this by wrapping the iterator use in a try-catch-finally similar to the desugaring of for-of.

This is behind --harmony-iterator-close.

R=adamk@chromium.org
BUG=v8:3566
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#34654}
2016-03-10 09:34:36 +00:00
binji
ca0dbaece0 [wasm] All strings are length-prefixed and inline
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34637}
2016-03-09 18:56:30 +00:00
titzer
f99624a98e [wasm] Encode immediates to Load and Store as varint.
R=binji@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34635}
2016-03-09 18:54:43 +00:00
ahaas
240b7db9c7 [wasm] Int64Lowering of I64ShrU and I64ShrS on ia32.
I implemented I64ShrU and I64ShrS the same as I64Shl in https://codereview.chromium.org/1756863002

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34630}
2016-03-09 16:38:43 +00:00
ahaas
d7ddd35c29 [wasm] Int64Lowering of I64XConvertI32.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34629}
2016-03-09 16:21:08 +00:00
yangguo
d1f68f776e [regexp] fix bogus assertion in CharacterRange constructor.
The CharacterRange constructor checks the input for validity. However,
CharacterRange::Singleton also uses the constructor and may have
kEndMarker as input, causing the check to fail.

The solution is to move the check to CharacterRange::Range and
consistently use it across the code base.

R=jkummerow@chromium.org
BUG=chromium:593282
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34626}
2016-03-09 15:55:38 +00:00
Ilija.Pavlovic
b29846c283 MIPS: Tests for convert and truncate instructions.
Implementation new test cases for conversion instructions Cvt_s_uw,
Cvt_s_ul, Cvt_d_ul and truncate instructions Trunc_uw_s, Trunc_ul_s,
Trunc_ul_d, Trunc_l_d, Trunc_l_ud, Trunc_w_d.

TEST=cctest/test-macro-assembler-mips/cvt_s_w_Trunc_uw_s, others
     cctest/test-macro-assembler-mips64/Cvt_s_uw_Trunc_uw_s, others
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34618}
2016-03-09 12:44:23 +00:00
mythria
e260bd5356 [Interpreter] Fixes a bug when popping context to correct level on break/continue.
The current implementation does not consider the case when the context of
the control scope and the current context differ. It is possible that they are
different in some cases for example: with statements. This cl fixes this.

BUG=v8:4280,v8:4680
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34609}
2016-03-09 11:05:49 +00:00
binji
78f6f838f0 [Wasm] Convert many of the fixed-size values to LEB128.
This CL modifies the following to be LEB128:
* Function table indices
* Import table signature indices
* Export table function indices
* Function signature param count
* br/br_if break depth
* br_table target count
* block/loop expression count

Still to do:
* Import/export names (LEB128 count + inline data)
* Data segments (LEB128 offset + size + inline data)
* Function header stuff (should seperate into function sig and body sections)
* Memory access alignment + offset (still discussing)

BUG=
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34603}
2016-03-08 22:56:18 +00:00
verwaest
fd40570419 Don't do any special normalization if a boilerplate contains function literals.
This mechanism was used to ensure that functions ended up as constants on the map of prototypes defined using object literals, e.g.,:

function.prototype = {
  method: function() { ... }
}

Nowadays we treat prototypes specially, and make all their functions constants when an object turns prototype. Hence this special custom code isn't necessary anymore.

This also affects boilerplates that do not become prototypes. Their functions will not be constants but fields instead. Calling their methods will slow down. However, multiple instances of the same boilerplate will stay monomorphic. We'll have to see what the impact is for such objects, but preliminary benchmarks do not show this as an important regression.

BUG=chromium:593008
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34602}
2016-03-08 22:13:49 +00:00
titzer
d61a0c5a4a [wasm] Support a two-level namespace for imports.
R=binji@chromium.org,dschuff@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34600}
2016-03-08 19:57:10 +00:00
verwaest
7736102034 Add GetProperty/GetElement to JSReceiver and use it where possible
Also move GetProperty with string-name to JSReceiver

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34596}
2016-03-08 17:30:42 +00:00
zhengxing.li
8f506ac6a6 X87: [wasm] Int64Lowering of I64Shl on ia32.
port ddc626e1cf (r34546)

  original commit message:
  I64Shl is lowered to a new turbofan operator, WasmWord64Shl. The new
  operator takes 3 inputs, the low-word input, the high-word input, and
  the shift, and produces 2 output, the low-word output and the high-word
  output.

  At the moment I implemented the lowering only for ia32, but I think the
  CL is already big enough. I will add the other platforms in separate
  CLs.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34591}
2016-03-08 15:02:56 +00:00
mstarzinger
46bd989a3a [compiler] Unify naming of methods in compiler API.
This is a pure refactoring and renaming of methods in the compiler API
with the goal to increase readability. Also the compiler API is moved to
the top of the file, as it is the central piece in that file.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34579}
2016-03-08 12:09:10 +00:00
yangguo
5586ff666e [interpreter, debugger] add some missing statement positions.
R=rmcilroy@chromium.org, vogelheim@chromium.org
BUG=v8:4690
LOG=N

Committed: https://crrev.com/4a7722c9930a42ba0e8feeece286d74834211a7e
Cr-Commit-Position: refs/heads/master@{#34569}

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

Cr-Commit-Position: refs/heads/master@{#34573}
2016-03-08 09:09:15 +00:00
yangguo
059c163695 Revert of [interpreter, debugger] add some missing statement positions. (patchset #1 id:1 of https://codereview.chromium.org/1770773002/ )
Reason for revert:
failing tests with ignition.

Original issue's description:
> [interpreter, debugger] add some missing statement positions.
>
> R=rmcilroy@chromium.org, vogelheim@chromium.org
> BUG=v8:4690
> LOG=N
>
> Committed: https://crrev.com/4a7722c9930a42ba0e8feeece286d74834211a7e
> Cr-Commit-Position: refs/heads/master@{#34569}

TBR=rmcilroy@chromium.org,vogelheim@chromium.org,mstarzinger@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4690

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

Cr-Commit-Position: refs/heads/master@{#34570}
2016-03-08 08:30:28 +00:00
yangguo
4a7722c993 [interpreter, debugger] add some missing statement positions.
R=rmcilroy@chromium.org, vogelheim@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34569}
2016-03-08 07:53:02 +00:00
titzer
835c5e6beb [wasm] Rework encoding of local declarations.
Local declarations were previously encoded as an optional set of
4 uint16 values as part of the function declaration. This CL
implements the current design of moving these declarations to
a list of pairs of (type, count) that is part of the body.

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

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

Cr-Commit-Position: refs/heads/master@{#34564}
2016-03-07 21:05:15 +00:00
ahaas
5446dab6cb [turbofan] Implementation of Word32PairShl on arm.
Implementation of https://codereview.chromium.org/1756863002 on arm.

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

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

Cr-Commit-Position: refs/heads/master@{#34557}
2016-03-07 18:47:11 +00:00
ahaas
ddc626e1cf [wasm] Int64Lowering of I64Shl on ia32.
I64Shl is lowered to a new turbofan operator, WasmWord64Shl. The new
operator takes 3 inputs, the low-word input, the high-word input, and
the shift, and produces 2 output, the low-word output and the high-word
output.

At the moment I implemented the lowering only for ia32, but I think the
CL is already big enough. I will add the other platforms in separate
CLs.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34546}
2016-03-07 15:19:44 +00:00
zhengxing.li
e906c9caef X87: Disable the test-run-profiler/Inlining test case for X87.
The CL #34376 (https://codereview.chromium.org/1740073002 ) added the Inlining test case and X87 failed at it.

  The reason is:
  For TEST(Inlining) test case, when level3 function is inlined, the key optimized crankshaft code will like below code normally:
  ............
  0x21d53b7f    63  ff571b         call [edi+0x1b]           <-----------  should call action() here
                    ;;; <@32,#27> lazy-bailout
                    ;;; <@36,#31> ---- B3 ----
                    ;;; <@37,#31> gap
  0x21d53b82    66  89c1           mov ecx,eax               <-----------  Both the inlined function’s pc_offset from DeoptimizationInputData and the pc_offset from sample stack points to here, the same pc address
  ............

  So the TEST(Inlining) test case can get the expected inlined code entry and pass..

  In fact, the exact code sequence should like the following in crankshaft:
  ............
  0x21d53b7f    63  ff571b         call [edi+0x1b]                 <-----------  should call action()
  0xxxxxxxxx    xxxx               GenerateBodyInstructionPost()   <-----------  the pc_offset from sample stack points to here
                    ;;; <@32,#27> lazy-bailout
                    ;;; <@36,#31> ---- B3 ----
                    ;;; <@37,#31> gap
  0x21d53b82    66  89c1           mov ecx,eax                     <-----------  the inlined function’s pc_offset from DeoptimizationInputData points to here.
  ............

  For most of architectures in V8, the GenerateBodyInstructionPost()  is empty, so both the inlined function’s pc_offset from DeoptimizationInputData and the pc_offset from sample stack points to  the same pc address .

  But if some architecture has special requirement and need to put some instruction after call instruction, the GenerateBodyInstructionPost() will do that work and generate instructions,  the inlined function’s pc_offset from DeoptimizationInputData and The pc_offset  from sample stack will points to  the different  pc address, the TEST(Inlining) test case can’t get the expected inlined code entry and failed.

  For all current architectures in v8, only x87 have this requirement.

  After communicated with Alexei Filippov <alph@chromium.org> in E-mail, we decided to disable the Inlining test case for x87 now and try to find a solution.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34544}
2016-03-07 14:57:06 +00:00
yangguo
9113402b53 [debugger] break at each initialization in a multiple var declaration.
R=rossberg@chromium.org
BUG=v8:4807
LOG=N

Committed: https://crrev.com/ee98147ea0d994bcfb0d14d43f490ee828d2426f
Cr-Commit-Position: refs/heads/master@{#34531}

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

Cr-Commit-Position: refs/heads/master@{#34540}
2016-03-07 13:41:18 +00:00
machenbach
c6dbb071a3 Revert of [debugger] break at each initialization in a multiple var declaration. (patchset #1 id:1 of https://codereview.chromium.org/1768973002/ )
Reason for revert:
[Sheriff] Breaks layout tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/5160

Original issue's description:
> [debugger] break at each initialization in a multiple var declaration.
>
> R=rossberg@chromium.org
> BUG=v8:4807
> LOG=N
>
> Committed: https://crrev.com/ee98147ea0d994bcfb0d14d43f490ee828d2426f
> Cr-Commit-Position: refs/heads/master@{#34531}

TBR=rossberg@chromium.org,yangguo@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4807

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

Cr-Commit-Position: refs/heads/master@{#34538}
2016-03-07 12:53:55 +00:00
ahaas
a5d4188849 x87: fix the use of CheckFloatEq and CheckDoubleEq in test.
Instead of using CheckFloatEq and CheckDoubleEq directly, I introduced
a macro which first stores the expected result in a volatile variable.

Here are some comments of previous CLs:

The reason is same as the CL #31808 (issue 1430943002, X87: Change the test case for X87 float operations), please refer: https://codereview.chromium.org/1430943002/.

  Here is the key comments from CL #31808
  Some new test cases use CheckFloatEq(...) and CheckDoubleEq(...) function for result check. When GCC compiling the CheckFloatEq() and CheckDoubleEq() function,
  those inlined functions has different behavior comparing with GCC ia32 build and x87 build.
  The major difference is sse float register still has single precision rounding semantic. While X87 register has no such rounding precsion semantic when directly use register value.
  The V8 turbofan JITTed has exactly same result in both X87 and IA32 port.

  So we add the following sentence to do type cast to keep the same precision for RunCallInt64ToFloat32/RunCallInt64ToFloat64. Such as: volatile double expect = static_cast<float>(*i).

R=titzer@chromium.org, weiliang.lin@intel.com

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

Cr-Commit-Position: refs/heads/master@{#34534}
2016-03-07 12:30:23 +00:00
yangguo
ee98147ea0 [debugger] break at each initialization in a multiple var declaration.
R=rossberg@chromium.org
BUG=v8:4807
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34531}
2016-03-07 12:00:16 +00:00
mythria
e06d57b05d [Interpreter] Removes TestNotEqualsStrict bytecode from interpreter.
TestNotEqualsStrict is converted to a TestEqualsStrict and logical not
by the parser. Also, CompareIC does not have an implementation for
TestNotEqualsStrict. Hence, removing this bytecode.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34527}
2016-03-07 10:50:44 +00:00
neis
f24dffea4c Get rid of the different kinds of yield in the AST & full-codegen.
Now there is just one kind, corresponding to what was called "initial" before.
Replacement for "suspend": when the parser sees a yield in JS code, it
will turn it into a Yield node but wrap its argument in an iterator result
object.  Replacement for "final": the parser simply inserts a return statement
instead.

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

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

Cr-Commit-Position: refs/heads/master@{#34515}
2016-03-06 09:20:12 +00:00
titzer
bcfa400306 [wasm] Remove TableSwitch and replace with br_table.
R=rossberg@chromium.org,binji@chromium.org,bradnelson@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34511}
2016-03-04 23:49:09 +00:00
binji
af193e7534 [wasm] Update {i32,i64}.const to use signed leb128
Reland of https://codereview.chromium.org/1765673002

R=titzer@chromium.org
R=bradnelson@chromium.org
LOG=n
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34506}
2016-03-04 19:06:34 +00:00
mbrandy
9f8c21164c Additional fixes for external callback logging in profiler.
For platforms that use function descriptors (currently AIX and
PPC64BE), log an external callback's entrypoint address rather than
its function descriptor address.

R=jkummerow@chromium.org, michael_dawson@ca.ibm.com
TEST=cctest/test-cpu-profiler/JsNativeJsSample
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34505}
2016-03-04 18:57:30 +00:00
dgozman
9a1387f6a9 Introduce v8::MicrotasksScope.
This scope is used to control microtasks execution when MicrotasksPolicy::kScoped is engaged.

Attempt #2. First one was reverted due to chromium breakage: SetAutorunMicrotasks(false) was broken.

BUG=chromium:585949
LOG=Y
TEST=ScopedMicrotasks

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

Cr-Commit-Position: refs/heads/master@{#34504}
2016-03-04 17:42:17 +00:00
machenbach
12b196490f Revert of Reland "[api] Don't go to javascript to construct API functions" (patchset #1 id:1 of https://codereview.chromium.org/1756973002/ )
Reason for revert:
[Sheriff] Breaks blink tests. Please fix upstream first.
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/5125

Original issue's description:
> Reland "[api] Don't go to javascript to construct API functions"
>
> BUG=
> R=verwaest@chromium.org
>
> Committed: https://crrev.com/d5d4f0b80f585878130bffb40ff8e960646823d8
> Cr-Commit-Position: refs/heads/master@{#34496}

TBR=verwaest@chromium.org,bmeurer@chromium.org,jochen@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34502}
2016-03-04 15:55:15 +00:00
verwaest
433fd6c078 [runtime] Clean up symbol access in identity hash code
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34497}
2016-03-04 14:39:10 +00:00
jochen
d5d4f0b80f Reland "[api] Don't go to javascript to construct API functions"
BUG=
R=verwaest@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34496}
2016-03-04 14:03:49 +00:00
verwaest
6fecd1795d [LookupIterator] Avoid additional descriptor lookup in TransitionToAccessorProperty
BUG=588893, 325923
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34493}
2016-03-04 12:19:03 +00:00
ahaas
b1e345905a [wasm] Int64Lowering of FXXXConvertI64 instructions.
On 32-bit systems FXXXConvertI64 instructions are compiled to calls to
C functions. The TF node for the function call is already generated in
the wasm compiler, the lowering of the I64 parameter is done in the
Int64Lowering.

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

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

Cr-Commit-Position: refs/heads/master@{#34487}
2016-03-04 09:51:49 +00:00
bmeurer
5912e0f014 [compiler] Introduce code stubs for string relational comparisons.
Add StringLessThanStub, StringLessThanOrEqualStub, StringGreaterThanStub
and StringGreaterThanOrEqualStub, based on the CodeStubAssembler, and
hook them up with TurboFan (and Ignition). The stubs are currently
essentially comparable with the StringCompareStub, which is now
obsolete. We can later extend these stubs to cover more interesting
cases (i.e. two byte sequential string comparisons, etc.).

R=epertoso@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34485}
2016-03-04 09:39:30 +00:00
machenbach
ec0f451b64 Revert of [wasm] Update {i32,i64}.const to use signed leb128 (patchset #3 id:40001 of https://codereview.chromium.org/1765673002/ )
Reason for revert:
[Sheriff] Breaks chromium win compile:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Win/builds/3844/steps/compile/logs/stdio

Original issue's description:
> [wasm] Update {i32,i64}.const to use signed leb128
>
> R=titzer@chromium.org
> R=bradnelson@chromium.org
> LOG=n
>
> Committed: https://crrev.com/4b613a67e0aa4e073946f5f0dd95ee9366c8ca86
> Cr-Commit-Position: refs/heads/master@{#34471}

TBR=bradnelson@chromium.org,titzer@chromium.org,binji@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#34482}
2016-03-04 09:03:30 +00:00
machenbach
043345a621 Revert of Introduce v8::MicrotasksScope. (patchset #6 id:100001 of https://codereview.chromium.org/1741893003/ )
Reason for revert:
[Sheriff] Speculative. Seems to break a bunch of webkit tests and causes timeouts:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/5103

Please rebase upstream if intended.

Original issue's description:
> Introduce v8::MicrotasksScope.
>
> This scope is used to control microtasks execution when MicrotasksPolicy::kScoped is engaged.
>
> BUG=chromium:585949
> LOG=Y
> TEST=ScopedMicrotasks
>
> Committed: https://crrev.com/db77cec242dbdf8ee26da8232fa930270429f253
> Cr-Commit-Position: refs/heads/master@{#34472}

TBR=jochen@chromium.org,adamk@chromium.org,dgozman@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:585949

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

Cr-Commit-Position: refs/heads/master@{#34480}
2016-03-04 07:31:17 +00:00
adamk
edeaab7da0 Ship ES2015 Function.name reform
BUG=v8:3699, chromium:588803
LOG=y
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel

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

Cr-Commit-Position: refs/heads/master@{#34474}
2016-03-04 04:04:13 +00:00
dgozman
db77cec242 Introduce v8::MicrotasksScope.
This scope is used to control microtasks execution when MicrotasksPolicy::kScoped is engaged.

BUG=chromium:585949
LOG=Y
TEST=ScopedMicrotasks

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

Cr-Commit-Position: refs/heads/master@{#34472}
2016-03-04 04:02:37 +00:00
binji
4b613a67e0 [wasm] Update {i32,i64}.const to use signed leb128
R=titzer@chromium.org
R=bradnelson@chromium.org
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34471}
2016-03-04 00:12:45 +00:00
littledan
0e7f095c6d Restrict FunctionDeclarations in Statement position
ES2015 generally bans FunctionDeclarations in positions which expect a Statement,
as opposed to a StatementListItem, such as a FunctionDeclaration which constitutes
the body of a for loop. However, Annex B 3.2 and 3.4 make exceptions for labeled
function declarations and function declarations as the body of an if statement in
sloppy mode, in the latter case specifying that the semantics are as if the
function declaration occurred in a block. Chrome has historically permitted
further extensions, for the body of any flow control construct.

This patch addresses both the syntactic and semantic mismatches between V8 and
the spec. For the semantic mismatch, function declarations as the body of if
statements change from unconditionally hoisting in certain cases to acquiring
the sloppy mode function in block semantics (based on Annex B 3.3). For the
extra syntax permitted, this patch adds a flag,
--harmony-restrictive-declarations, which excludes disallowed function declaration
cases. A new UseCounter, LegacyFunctionDeclaration, is added to count how often
function declarations occur as the body of other constructs in sloppy mode. With
this patch, the code generally follows the form of the specification with respect
to parsing FunctionDeclarations, rather than allowing them in arbitrary Statement
positions, and makes it more clear where our extensions occur.

BUG=v8:4647
R=adamk
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#34470}
2016-03-03 21:34:26 +00:00
alan.li
4c57e05d5f MIPS64: Fix 'Fix 'MIPS: use DAHI/DATH for li macro on mips64r6.''
This CL fixes the bugs caused by the following CL:
50a394d -- MIPS64: Fix 'MIPS: use DAHI/DATH for li macro on mips64r6.'
  Port 1f5b84e467
  MIPS: use DAHI/DATH for li macro on mips64r6.

LUI instruction would sign extend into higher 32bits, in that case we might need to use DAHI, DATI to overwrite the extension.

The bug will occur when we are loading some addresses such as 0x00007fffffffxxxx.

BUG=
TEST=test-run-native-calls/Run_Int32_Select_*, test-run-native-calls/Run_Int32_WeightedSum_*, test-run-native-calls/Run_Int32_WeightedSum_*, test-run-native-calls/Run_Int32_Select_*

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

Cr-Commit-Position: refs/heads/master@{#34467}
2016-03-03 18:55:02 +00:00
bmeurer
2689548e38 [compiler] Introduce StringEqualStub and StringNotEqualStub.
These new stubs perform exactly the same job as the string equality case
for the CompareIC, but are platform independent and usable outside of
fullcodegen and Crankshaft. We use them in the StrictEqualStub and the
StrictNotEqualStub instead of falling back to the runtime immediately
for String comparisons, and we also use them in TurboFan to perform
String equality or inequality comparisons.

These stubs currently handle only internalized and one byte strings w/o
going to C++, but it should be easy to add support for more string cases
later, i.e. utilizing already flattened cons strings or comparing two
byte strings as well.

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

Cr-Commit-Position: refs/heads/master@{#34459}
2016-03-03 10:18:49 +00:00
weiliang.lin
9d0cf920bd [wasm] add rotate opcodes
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34455}
2016-03-03 05:11:10 +00:00
bradnelson
c6abc94f8f Allow negation of doubles in asm typer.
BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=mjsunit/asm-wasm
R=titzer@chromium.org,aseemgarg@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34449}
2016-03-02 23:45:15 +00:00
mbrandy
0ed04d2352 Add cctest/test-run-wasm-64/Run_WasmInt64* to skip list for big-endian
Newly added tests cause failures on 32-bit bigendian and are skipped
until a solution is found.

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

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

Cr-Commit-Position: refs/heads/master@{#34447}
2016-03-02 21:49:20 +00:00
ahaas
2d090b11d0 [wasm] Removed dead code.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34442}
2016-03-02 18:00:25 +00:00
machenbach
76876b9ae9 [test] Remove dependent commands.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34428}
2016-03-02 13:14:13 +00:00
mstarzinger
9fd5261d7f [interpreter] Make optimized code map more flexible.
This relaxes the constraints of the optimized code map in order to be
able to update existing entries. It also simplifies the interface a
little bit. We can now insert an entry for a newly allocated literals
array together with previously cached context-independent code.

R=mvstanton@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34427}
2016-03-02 12:36:00 +00:00
epertoso
820e27f98d [turbofan] Adds an Allocate macro to the CodeStubAssembler.
The macro is currently used by AllocateHeapNumberStub and AllocateMutableHeapNumberStub, which are now turbofan code stubs.
It can be used to allocate objects in the new or old space, optionally with double alignment.

BUG=588692
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#34424}
2016-03-02 12:16:48 +00:00
rmcilroy
d58201589b [Interpreter] Log source positions for bytecode arrays.
Add support to log source position offsets to the profiler. As part of
this change PositionsRecorder is split into two, with the subset needed
by log.cc moved into log.h and the remainder kept in assembler.h as
AssemblerPositionsRecorder. The interpreter's source position table
builder is updated to log positions when the profiler is active.

BUG=v8:4766
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34416}
2016-03-02 02:10:53 +00:00
binji
b9aa3ce764 CodeStubAssembler can generate code for builtins
This will be used for generating the Atomics builtins.

BUG=v8:4614
R=jarin@chromium.org
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#34413}
2016-03-01 22:05:34 +00:00
fmeawad
f3fcdcfa1a [Tracing] Remove deprecated AddTraceEvent
This should land after the chromium CL that starts using the new AddTraceEvent lands
(https://codereview.chromium.org/1742603004/)

BUG=4565
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34412}
2016-03-01 21:20:48 +00:00
bradnelson
2a9a770c2a Convert float64 to float32 when coerced with a heapf32 assignment.
BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=mjsunit/asm-wasm
R=titzer@chromium.org,aseemgarg@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34404}
2016-03-01 18:07:19 +00:00
mstarzinger
00e9447ad3 Remove the global Strength enum class completely.
R=bmeurer@chromium.org
BUG=v8:3956
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34398}
2016-03-01 16:06:04 +00:00
mythria
dbf5fffd2d [Interpreter] Fixes PushArgsAndConstruct builtin to not store any data outside esp.
In ia32 PushArgsAndConstruct builtin, we run out of registers and need to
temporarily store the data in the stack. In the earlier implementation,
a location outside the esp was used. This causes a problem if there is a
interrupt/signals which would use the same stack and corrupt the data that
is above the esp. This cl fixes it by pushing it onto the stack so that
the stack pointer is updated and hence the corruption will not happen. We
reuse the slot meant for receiver as a temporary store.

TBR=rmcilroy@chromium.org
BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34397}
2016-03-01 15:20:10 +00:00
yangguo
6f17848caa [serializer] split up src/snapshot/serialize.*
R=rossberg@chromium.org, ulan@chromium.org, vogelheim@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34395}
2016-03-01 14:44:08 +00:00
yangguo
21622ddae4 [debugger, interpreter] add break location at if-statement.
R=mstarzinger@chromium.org, vogelheim@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34394}
2016-03-01 14:26:04 +00:00
mythria
844e410d5c [Interpreter] Adds translation of optimized frame to bytecode offset in FrameSummary
Adds the translation from optimized frame to bytecode offset
in FrameSummary. For interpreter, the bailout id represents the bytecode
array offset. So we can directly use the bailout id as the code offset
in the FrameSummary. Also updates mjsunit.status with more information
about failing tests.

BUG=v8:4280, v8:4689
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34393}
2016-03-01 14:15:29 +00:00
nikolaos
86a9ef31c7 Fix bug with multiple directives in the preparser
The preparser should ignore "use strong" if the --strong_mode flag
is not turned on, but this should not stop processing subsequent
directives.

R=rossberg@chromium.org
BUG=
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34392}
2016-03-01 13:59:08 +00:00
bmeurer
0cb8a1b774 [interpreter] Properly collect for-in slow mode feedback.
Similar to fullcodegen, Ignition now also marks a for-in statement as
slow (via the TypeFeedbackVector) when we have to call %ForInFilter,
i.e. we either have no enumeration cache or the receiver map changes
during an iteration of the for-in map.

R=mstarzinger@chromium.org
BUG=v8:3650
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34391}
2016-03-01 13:55:58 +00:00
yangguo
7b693cc4ab [interpreter] Fix test-serialize/SerializeToplevelIsolates.
R=rmcilroy@chromium.org
BUG=v8:4680
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34389}
2016-03-01 13:47:07 +00:00
yangguo
d9fe836dd4 [debugger] fix break locations for assignments and return.
We used to emit debug break location on block entry. This cannot be
ported to the interpreted as we do not emit bytecode for block entry.
This made no sense to begin with though, but accidentally added
break locations for var declarations.

With this change, the debugger no longer breaks at var declarations
without initialization. This is in accordance with the fact that the
interpreter does not emit bytecode for uninitialized var declarations.

Also fix the bytecode to match full-codegen's behavior wrt return
positions:
- there is a break location before the return statement, with the source
  position of the return statement.
- right before the actual return, there is another break location. The
  source position points to the end of the function.

R=rmcilroy@chromium.org, vogelheim@chromium.org
TBR=rossberg@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34388}
2016-03-01 12:47:55 +00:00
ssanfilippo
dc71deb077 [Interpreter] Silence runtime errors in generate-bytecode-expectations.
Runtime errors will be suppressed in --rebaseline mode, unless the
--verbose flag is passed.

The reasoning behind (rebaseline && !verbose) and not just (verbose)
is to suppress harmless noise while updating the expectation for
existing, known good snippets, without hiding actually relevant
errors when the tool is used to write new expectation files.

In fact, some tests are supposed to produce a runtime error, which
might nevertheless alarm a developer who is just --rebaseline'ing.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34385}
2016-03-01 10:43:22 +00:00
alph
b01cd96eb5 Make CPU profiler unwind the inlined functions stack.
BUG=575466
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34376}
2016-03-01 06:00:08 +00:00
verwaest
4d659edfcd Disable flaky SampleWhenFrameIsNotSetup
BUG=v8:2999, v8:4751
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34360}
2016-02-29 12:14:17 +00:00
verwaest
d5cb0ce4e9 Move hasOwnProperty to builtins.cc
This gets rid of the JavaScript wrapper. That way we can more quickly handle non-JSReceivers and indexed properties; and don't need to optimize the JavaScript wrapper either.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34356}
2016-02-29 10:55:35 +00:00
baptiste.afsa
c7339e6ee4 [arm64] Make sure that memory allocated for assembler tests is executable.
Fix some crashes when tests are run on real hardware.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34355}
2016-02-29 10:52:34 +00:00
baptiste.afsa
27a75f7ad0 [arm64] Prevent the compiler to use fmadd/fmsub while compiling cctest.
This ensures that the generated code output will match the reference code output
and fixes some failures when running tests natively.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34354}
2016-02-29 09:16:14 +00:00
titzer
008888c8cb [wasm] Allocate WasmModule and WasmModuleInstance vectors inline.
R=bradnelson@chromium.org,ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34351}
2016-02-28 19:05:42 +00:00
titzer
06241221a6 [wasm] Add a magic word and a version number to the binary.
R=binji@chromium.org,jfb@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34346}
2016-02-28 00:37:29 +00:00
titzer
8344687c76 [wasm] Properly plumb the origin of the WASM module from asm.js translation.
R=bradnelson@chromium.org,aseemgarg@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34345}
2016-02-27 20:40:06 +00:00
bmeurer
fb59ea3334 [compiler] Drop the CompareNilIC.
Since both null and undefined are also marked as undetectable now, we
can just test that bit instead of having the CompareNilIC try to collect
feedback to speed up the general case (without the undetectable bit
being used).

Drive-by-fix: Update the type system to match the new handling of
undetectable in the runtime.

R=danno@chromium.org

Committed: https://crrev.com/666aec0348c8793e61c8633dee7ad29a514239ba
Cr-Commit-Position: refs/heads/master@{#34237}

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

Cr-Commit-Position: refs/heads/master@{#34344}
2016-02-27 19:13:46 +00:00
mstarzinger
239ed8ffa8 Remove strong mode support from materialized literals.
R=bmeurer@chromium.org
BUG=v8:3956
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34333}
2016-02-26 17:45:01 +00:00
fmeawad
567e58390d Reland: Add Scoped Context Info (Isolate) to V8 Traces
This patch adds the newly added support for contexts in V8 Tracing, as well
as use it to mark all the entry points for a V8 Isolate.

Update for reland: The current tracing interface needs to be updated (AddTraceEvent),
but the embedders need to migrate to the new version before removing the old version.
(Reland of: https://codereview.chromium.org/1686233002)

The revert happened because the 2 signatures of the old and new AddTraceEvent where different
so it threw an overload-virtual error on cross arm debug. This issue is temporary, and to solve
it, I added an implementation of the old and new everywhere until the embedder implements the new.

BUG=v8:4565
LOG=N

R=jochen@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34332}
2016-02-26 17:25:30 +00:00
rmcilroy
a0fdb33f1c [Interpreter] Rebaseline ForOf bytecode generator tests.
Rebaselines ForOf bytecodes after shipping iterator finalization in https://codereview.chromium.org/1738463003/.

TBR=adamk@chromium.org
BUG=v8:3566,v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34329}
2016-02-26 14:22:28 +00:00
jochen
6a7e866134 [api] Speed up template instantiation cache a bit.
The keys are always positive integers, so use an
UnseededNumberDictionary to store them instead of an ObjectHashTable

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34325}
2016-02-26 12:23:45 +00:00
ssanfilippo
e039f63a4f [Interpreter] Multiple input files for generate-bytecode-expectations.
When operating in --rebaseline mode, each of the files will be updated.
In --raw-js mode, all the expectations will be written to the same file.
In default mode no more than one input file is accepted.

On POSIX systems, --rebaseline will autodiscover golden files when run
from the project root and no input file is provided.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34324}
2016-02-26 12:04:24 +00:00
bmeurer
58ab990aa8 [turbofan] Bailout if LoadBuffer typing assumption doesn't hold.
The LoadBuffer operator that is used for asm.js heap access claims to
return only the appropriate typed array type, but out of bounds access
could make it return undefined. So far we tried to "repair" the graph
later if we see that our assumption was wrong, and for various reasons
that worked for some time. But now that wrong type information that is
propagated earlier is picked up appropriately and thus we generate wrong
code, i.e. we in the repro case we feed NaN into ChangeFloat64Uint32 and
thus get 2147483648 instead of 0 (with proper JS truncation).

This was always considered a temporary hack until we have a proper
asm.js pipeline, but since we still run asm.js through the generic
JavaScript pipeline, we have to address this now. Quickfix is to just
bailout from the pipeline when we see that the LoadBuffer type was
wrong, i.e. the result of LoadBuffer is not properly truncated and thus
undefined or NaN would be observable.

R=mstarzinger@chromium.org, jarin@chromium.org
BUG=chromium:589792
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#34322}
2016-02-26 11:06:30 +00:00
rmcilroy
cb29f9cdbc [Interpreter] Add support for cpu profiler logging.
Adds support for cpu profiler logging to the interpreter. Modifies the
the API to be passed AbstractCode objects instead of Code objects, and
adds extra functions to AbstractCode which is required by log.cc and
cpu-profiler.cc.

The main change in sampler.cc is to determine if a stack frame is an
interpreter stack frame, and if so, use the bytecode address as the pc
for that frame. This allows sampling of bytecode functions. This
requires adding support to SafeStackIterator to determine if a frame is
interpreted, which we do by checking the PC against pre-stored addresses
for the start and end of interpreter entry builtins.

Also removes CodeDeleteEvents which are dead code and haven't
been reported for some time.

Still to do is tracking source positions which will be done in a
followup CL.

BUG=v8:4766
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34321}
2016-02-26 11:04:55 +00:00
bmeurer
06fe8afe7f [interpreter] ToObject never yields null.
We don't need to compare the result of ToObject against null, since
ToObject will always yield a proper receiver (or throw a TypeError).

R=rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34318}
2016-02-26 08:47:09 +00:00
adamk
fca68bac47 Revert of [compiler] Drop the CompareNilIC. (patchset #4 id:60001 of https://codereview.chromium.org/1722193002/ )
Reason for revert:
Speculative revert in attempt to fix #2 crasher on canary.

Original issue's description:
> [compiler] Drop the CompareNilIC.
>
> Since both null and undefined are also marked as undetectable now, we
> can just test that bit instead of having the CompareNilIC try to collect
> feedback to speed up the general case (without the undetectable bit
> being used).
>
> Drive-by-fix: Update the type system to match the new handling of
> undetectable in the runtime.
>
> R=danno@chromium.org
>
> Committed: https://crrev.com/666aec0348c8793e61c8633dee7ad29a514239ba
> Cr-Commit-Position: refs/heads/master@{#34237}

TBR=danno@chromium.org,verwaest@chromium.org,bmeurer@chromium.org
LOG=y
BUG=chromium:589897
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#34308}
2016-02-26 00:16:54 +00:00
littledan
227fd1d4ed Ship ES2015 iterator finalization
This patch moves iterator finalization (calling .return() when a
for-of loop exits early) to shipping. The only part of this feature
which is currently known to be missing is destructuring--.return()
should be also be called when destructuring with an array which
does not end in a rest pattern, but it currently does not. The rest
of this feature, including calling .return() from certain builtins,
is implemented.

R=adamk
BUG=v8:3566
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#34307}
2016-02-25 23:16:53 +00:00
dgozman
66b87c00b8 Introduce MicrotasksCompletedCallback.
This calback is run after an attempt to run microtasks.

BUG=chromium:585949
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#34305}
2016-02-25 19:49:53 +00:00
ulan
01b8fc894b Reland "Replace slots buffer with remembered set. (patchset #14 id:250001 of https://codereview.chromium.org/1703823002/ )"
This reverts commit 9146bc5e20.

This contains a fix for the following crash:
1. We record slots for a fixed array.
2. We trim the fixed array, so that some recorded slots are now in free space.
3. During mark-compact we sweep the page with the fixed array. Now free list items contain memory with recorded slots.
4. We evacuate a byte array using the new free list items.
5. We iterate slots that are now inside the byte array and crash.

BUG=chromium:589413,chromium:578883
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#34302}
2016-02-25 17:29:22 +00:00
mstarzinger
bbd60c5d71 [interpreter] Enable tests on x64-debug that no longer fail.
R=rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34299}
2016-02-25 16:45:53 +00:00
mattloring
7bc1577a0b Fix iterator (std::vector) invalidation during sampling heap profile retrieval
It is possible for JS objects to be allocated while we are retrieving the
profile. These JS objects can in turn end up getting sampled by the profiler.
Adding these to the profile data structures invalidates the iterators that
are presently in flight. This change prevents such concurrent modifications
from affecting the retrieve operation.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34298}
2016-02-25 16:08:55 +00:00
mstarzinger
6acee6ee59 [interpreter] Make setting of function data more resilient.
This adds explicit setters for the SharedFunctionInfo::function_data
field. Such setters are safer because they allow for explicit checking
of which values are allowed, and they improve readability because the
intended semantics become clear for each call-site. Also fix a cctest
case along the way.

R=rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34297}
2016-02-25 16:07:24 +00:00
ulan
c5142d863b Clear recorded slots when creating filler objects.
BUG=chromium:589413
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#34295}
2016-02-25 14:37:20 +00:00
mstarzinger
ee4225fd0f [interpreter] Remove wholesale skipping of strong mode tests.
By now the deprecation of strong mode is far enough along that the
support present in the interpreter matches the support in the other
compilers. Special expectations aren't needed anymore.

R=rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34293}
2016-02-25 13:50:54 +00:00
ahaas
fab253109d [wasm] I added comparison operators to the Int64Lowering.
Comparison operators are lowered using to a lexicographic ordering, e.g.
(a,b) <= (c,d) <<>> (a < c) | (a == c) & (b <= d).

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34287}
2016-02-25 12:15:54 +00:00
ssanfilippo
6ae030590d [Interpreter] Refactor bytecode generator test suite.
Bytecode expectations have been moved to external (.golden) files,
one per test. Each test in the suite builds a representation of the
the compiled bytecode using BytecodeExpectationsPrinter. The output is
then compared to the golden file. If the comparision fails, a textual
diff can be used to identify the discrepancies.

Only the test snippets are left in the cc file, which also allows to
make it more compact and meaningful. Leaving the snippets in the cc
file was a deliberate choice to allow keeping the "truth" about the
tests in the cc file, which will rarely change, as opposed to golden
files.

Golden files can be generated and kept up to date using
generate-bytecode-expectations, which also means that the test suite
can be batch updated whenever the bytecode or golden format changes.

The golden format has been slightly amended (no more comments about
`void*`, add size of the bytecode array) following the consideration
made while converting the tests.

There is also a fix: BytecodeExpectationsPrinter::top_level_ was left
uninitialized, leading to undefined behaviour.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34285}
2016-02-25 12:07:19 +00:00
ahaas
a6619c2c44 [wasm] Enable I64Neq on 32 bit platforms.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34279}
2016-02-25 10:12:42 +00:00
ahaas
5dc96ae28d [wasm] mips: Turn off signalling NaN tests on mips and mips64.
I turn the test off for now. The problem is that mips does not deal with
signalling NaNs as expected.

@v8-mips-ports: Could it be that the mips simulator deals differently
with signalling NaNs than the actual hardware? The implementation that
is tested in these tests assumes that sNaN * 1.0 = qNaN, where the bits
of sNaN and qNaN are equal except for the most significant mantissa bit.
This assumption holds for the simulator, but seems not to hold for actual
mips hardware. Do you know more about that?

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

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

Cr-Commit-Position: refs/heads/master@{#34278}
2016-02-25 09:50:38 +00:00
bmeurer
f97ed07e3a [builtins] Migrate a bunch of Math builtins to C++.
Migrate Math.imul, Math.fround, Math.acos, Math.asin and Math.atan to
C++ builtins, as these ones call into C++ anyway and so there's no
need to have this extra wrapper around it.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34274}
2016-02-25 08:07:07 +00:00
mythria
eb358178f8 Revert of [Interpreter] Implements calls through CallICStub in the interpreter. (patchset #15 id:270001 of https://codereview.chromium.org/1688283003/ )
Reason for revert:
It is not a good idea to call CallICStub from the builtin. It might be sensitive to the frame structure. Constructing a internal frame might cause problems. It is much better to inline the code  related to the type feedback vector into the builtin.

Original issue's description:
> [Interpreter] Implements calls through CallICStub in the interpreter.
>
> Calls are implemented through CallICStub to collect type feedback. Adds
> a new builtin called InterpreterPushArgsAndCallIC that pushes the
> arguments onto stack and calls CallICStub.
>
> Also adds two new bytecodes CallIC and CallICWide to indicate calls have to
> go through CallICStub.
>
> MIPS port contributed by balazs.kilvady.
>
> BUG=v8:4280, v8:4680
> LOG=N
>
> Committed: https://crrev.com/20362a2214c11a0f2ea5141b6a79e09458939cec
> Cr-Commit-Position: refs/heads/master@{#34244}

TBR=rmcilroy@chromium.org,mvstanton@chromium.org,mstarzinger@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4280, v8:4680

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

Cr-Commit-Position: refs/heads/master@{#34252}
2016-02-24 15:16:19 +00:00
ahaas
18d9da0dcf [wasm] I added I64Eq to the Int64Lowering.
(a EQ b) is lowered to ((low(a) XOR low(b)) OR (high(a) XOR high(b))) EQ 0

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34249}
2016-02-24 12:09:34 +00:00
mythria
20362a2214 [Interpreter] Implements calls through CallICStub in the interpreter.
Calls are implemented through CallICStub to collect type feedback. Adds
a new builtin called InterpreterPushArgsAndCallIC that pushes the
arguments onto stack and calls CallICStub.

Also adds two new bytecodes CallIC and CallICWide to indicate calls have to
go through CallICStub.

MIPS port contributed by balazs.kilvady.

BUG=v8:4280, v8:4680
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34244}
2016-02-24 11:01:27 +00:00
ahaas
a8d5d17659 [wasm] Added I64Xor to the Int64Lowering.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34241}
2016-02-24 09:52:52 +00:00
machenbach
5108907495 [Ignition] Skip test.
Failed after:
https://codereview.chromium.org/1706343002

TBR=ofrobots@google.com, mattloring@google.com, rmcilroy@chromium.org
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#34240}
2016-02-24 09:51:21 +00:00
ulan
9146bc5e20 Revert of Replace slots buffer with remembered set. (patchset #14 id:250001 of https://codereview.chromium.org/1703823002/ )
Reason for revert:
Revert because of canary crashes: crbug.com/589413

Original issue's description:
> Replace slots buffer with remembered set.
>
> Slots pointing to evacuation candidates are now recorded in the new RememberedSet<OLD_TO_OLD>.
>
> The remembered set is extended to support typed slots.
>
> During parallel evacuation all migration slots are recorded in local slots buffers.
> After evacuation all local slots are added to the remembered set.
>
> BUG=chromium:578883
> LOG=NO
>
> Committed: https://crrev.com/2285a99ef6f7d52f4f0c4d88a7db4224443ee152
> Cr-Commit-Position: refs/heads/master@{#34212}

TBR=jochen@chromium.org,hpayer@chromium.org,mlippautz@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:578883

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

Cr-Commit-Position: refs/heads/master@{#34238}
2016-02-24 09:48:21 +00:00
bmeurer
666aec0348 [compiler] Drop the CompareNilIC.
Since both null and undefined are also marked as undetectable now, we
can just test that bit instead of having the CompareNilIC try to collect
feedback to speed up the general case (without the undetectable bit
being used).

Drive-by-fix: Update the type system to match the new handling of
undetectable in the runtime.

R=danno@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34237}
2016-02-24 09:10:10 +00:00
mattloring
50537badae Unsampling for the sampling heap profiler
Implements poisson unsampling. A poisson process is used to determine
which samples to collect based on a sample rate. Unsampling will
approximate the true number of allocations at each site taking into
account that smaller allocations are less likley to be sampled.

This work was originally being done in the agent that
consumes profiles but it is more efficient to do it here
and individual consumers of the API should not have to
worry about the mathematical details of the sampling
process.

R=ofrobots@google.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34234}
2016-02-24 08:05:18 +00:00
ssanfilippo
bb2f68460e [Interpreter] Readable representation of runtime function IDs.
The first operand to the CallRuntime class of bytecodes is the
ID of the runtime function being called. Before this commit
the ID was printed as plain uint16_t, now we get something like:

  B(CallRuntime) U16(Runtime::Add) ...

This change is intended to make both the golden files more
resistant to modifications of the i::Runtime::FunctionId enum
and the output of generate-bytecode-expectations more readable.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34224}
2016-02-23 19:10:52 +00:00
bradnelson
0dd24015fb Allow constant multiply both ways.
asm.js permits both:
int * constant
constant * int

It does not, however, allow intishes in multiplies.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=mjsunit/asm-wasm,test-asm-validator
R=aseemgarg@chromium.org,titzer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34222}
2016-02-23 19:04:58 +00:00
ahaas
cadc1e7780 [wasm] Added I64Ior to the Int64Lowering.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34219}
2016-02-23 16:30:42 +00:00
yangguo
113d303534 [interpreter,debugger] Unskip debug tests for ignition.
TBR=rmcilroy@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34214}
2016-02-23 15:34:48 +00:00
ulan
2285a99ef6 Replace slots buffer with remembered set.
Slots pointing to evacuation candidates are now recorded in the new RememberedSet<OLD_TO_OLD>.

The remembered set is extended to support typed slots.

During parallel evacuation all migration slots are recorded in local slots buffers.
After evacuation all local slots are added to the remembered set.

BUG=chromium:578883
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#34212}
2016-02-23 13:53:02 +00:00
bradnelson
7e805faa30 Allow intish and floatish to be coerced by heap assignment.
When assigning to an integer view of the heap an intish
value does not need to be collapsed with |0.
Similarly a floatish value does not need to be collapsed with
fround when assigned to a float view of the heap.
i32[0] = i32_1 + i32_2;  // ok
f32[0] = f32_1 + f32_2;  // ok

However, floatish values cannot be safely assigned to double
arrays.
f64[0] = f32_1 + f32_2;  // not ok

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=mjsunit/asm-wasm,test-asm-validator
R=aseemgarg@chromium.org,titzer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34206}
2016-02-23 06:18:54 +00:00
zhengxing.li
2cd9485644 X87: Change the test case for X87 RunRoundUint32ToFloat32.
The CL #33796 (https://codereview.chromium.org/1628133002) added the RunRoundUint32ToFloat32 test case and X87 failed at it.

  The reason is same as the CL #33630 (Issue 1649323002: X87: Change the test case for X87 RunRoundInt32ToFloat32), please refer: https://codereview.chromium.org/1649323002.

  Here is the key comments from CL #33630:
  Some new test cases use CheckFloatEq(...) and CheckDoubleEq(...) function for result check. When GCC compiling the CheckFloatEq() and CheckDoubleEq() function,
  those inlined functions has different behavior comparing with GCC ia32 build and x87 build.
  The major difference is sse float register still has single precision rounding semantic. While X87 register has no such rounding precsion semantic when directly use register value.
  The V8 turbofan JITTed has exactly same result in both X87 and IA32 port.

  For CHECK_EQ(a, b) function, if a and b are doubles, it will has similar behaviors like CheckFloatEq(...) and CheckDoubleEq(...) function when compiled by GCC and causes the test case
  fail.

  So we add the following sentence to do type case to keep the same precision for RunRoundUint32ToFloat32. Such as: volatile double expect = static_cast<float>(*i).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34202}
2016-02-23 01:50:37 +00:00
alan.li
1f5b84e467 MIPS: use DAHI/DATH for li macro on mips64r6.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34176}
2016-02-20 16:24:37 +00:00
alph
c1f653be8d Do not record CPU profile samples when stack collection is failed.
BUG=559304
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34168}
2016-02-19 18:49:37 +00:00
dgozman
0e9ea48c46 Introduce BeforeCallEnteredCallback.
This new callback is similar to CallCompletedCallback, but is executed before the call has been made.
Added Isolate* parameter to CallCompletedCallback, marking previous one as deprecated.

BUG=chromium:585949
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#34167}
2016-02-19 18:48:46 +00:00
ssanfilippo
67f75e30da [Interpreter] Fix generate-bytecode-expectations help message.
--pool-type=int and double have now been merged into number.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34164}
2016-02-19 16:14:22 +00:00
ssanfilippo
4f0be51987 [Interpreter] Support relevant FLAG_s in generate-bytecode-expectations.
FLAG_legacy_const and FLAG_harmony_do_expressions can now be toggled
both through the command line and through the option header.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34160}
2016-02-19 15:52:58 +00:00
titzer
915ae08dd5 [wasm] Add support for import section.
This CL introduces an import section that names functions to be imported
as well as a CallImport bytecode to call imports from this table.

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

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

Cr-Commit-Position: refs/heads/master@{#34157}
2016-02-19 14:58:43 +00:00
ssanfilippo
d2187182a7 [Interpreter] generate-bytecode-expectations improvements.
A few options and features have been added to the tool:

* an output file might be specified using --output=file.name
* a shortcut when the output file is also the input, which is handy
   when fixing golden files, --rebaseline.
* the input snippet might be optionally not wrapped in a top function,
   or not executed after compilation (--no-wrap and --no-execute).
* the name of the wrapper can be configured using --wrapper-name=foo

The same options can be configured via setters on the usual
BytecodeExpectationsPrinter.

The output file now includes all the relevant flags to reproduce it
when running again through the tool (usually with --rebaseline).

In particular, when running in --rebaseline mode, options from the
file header will override options specified in the command line.

A couple of other fixes and improvements:

* description of the handlers is now emitted (closing the TODO).
* the snippet is now correctly unquoted when double quotes are used.
* special registers (closure, context etc.) are now emitted as such,
   instead of displaying their numeric value.
* the tool can now process top level code as well.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34152}
2016-02-19 12:37:16 +00:00
jarin
2ae5894da6 Revert of [turbofan] Connect ObjectIsNumber to effect and control chains. (patchset #1 id:1 of https://codereview.chromium.org/1709093002/ )
Reason for revert:
Tanks benchmarks (e.g., Octane box2d TF).

Original issue's description:
> [turbofan] Connect ObjectIsNumber to effect and control chains.
>
> In theory, we could connect the nodes when doing
> the schedule-in-the-middle pass, but that would require creating two
> versions of the operator (effectful and pure). I believe we do not
> lose anything by wiring the node up eagerly.
>
> Committed: https://crrev.com/2894e80a0a4a51a0d72e72aa48fcd01968f7949f
> Cr-Commit-Position: refs/heads/master@{#34141}

TBR=bmeurer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#34147}
2016-02-19 10:13:56 +00:00
jarin
2894e80a0a [turbofan] Connect ObjectIsNumber to effect and control chains.
In theory, we could connect the nodes when doing
the schedule-in-the-middle pass, but that would require creating two
versions of the operator (effectful and pure). I believe we do not
lose anything by wiring the node up eagerly.

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

Cr-Commit-Position: refs/heads/master@{#34141}
2016-02-19 08:03:34 +00:00
adamk
63efda35b3 Remove strong mode support from Scope and Variable
This frees up one bit in FunctionKind, which I plan to make slightly
more syntactic info about functions available in SharedFunctionInfo
(needed for ES2015 Function.name support).

BUG=v8:3956, v8:4760
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34125}
2016-02-18 17:20:13 +00:00
titzer
e96a54f7b5 [wasm] Refactor WASM test usage of TestingModule.
This cleans up and makes the tests easier to write and understand.
Also prepares for adding the WASM interpreter which needs a
different initialization sequence in tests.

R=ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34123}
2016-02-18 15:58:28 +00:00
ahaas
545943db15 [wasm] WasmRunner can run tests with I64 parameters and return value.
I extended the Int64Lowering to lower calls, loads, stores, returns, and
parameters and apply the lowering on both the test function TF graph and
the WasmRunner TF graph.

The lowering of calls also requires an adjustment of the call descriptor.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34121}
2016-02-18 15:19:18 +00:00
verwaest
9bebb028a0 [runtime] Force internalize names used before lookup in in DescriptorArray and TransitionArray
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34118}
2016-02-18 14:33:44 +00:00
rossberg
cb1bf4af3c [es6] Implement for-of iterator finalization
Implements iterator finalisation by desugaring for-of loops with an additional try-finally wrapper. See comment in parser.cc for details.

Also improved some AST printing facilities while there.

@Ross, I had to disable the bytecode generation test for for-of, because it got completely out of hand after this change (the new bytecode has 150+ lines). See the TODO that I assigned to you.

Patch set 1 is WIP patch by Georg (http://crrev.com/1695583003), patch set 2 relative changes.

@Georg, FYI, I changed the following:

- Moved try-finally out of the loop body, for performance, and in order to be able to handle `continue` correctly.
- Fixed scope management in ParseForStatement, which was the cause for the variable allocation failure.
- Fixed pre-existing zone initialisation bug in rewriter, which caused the crashes.
- Enabled all tests, adjusted a few others, added a couple more.

BUG=v8:2214
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#34111}
2016-02-18 10:49:55 +00:00
ahaas
f8e068e926 [wasm] Replace the BufferedRawMachineAssemblerTester in the WasmRunner.
The BufferedRawMachineAssemblerTester caused problems for the
Int64Lowering. Instead we construct a TF graph now which is compiled by
Pipeline::GenerateCodeForTesting.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34107}
2016-02-18 09:55:49 +00:00
jarin
2225546f55 Fix FunctionTester constructor from given parameter count.
Review URL: https://codereview.chromium.org/1711513003

Cr-Commit-Position: refs/heads/master@{#34103}
2016-02-18 09:28:49 +00:00
machenbach
8934994e36 Revert of Add Scoped Context Info (Isolate) to V8 Traces (patchset #5 id:80001 of https://codereview.chromium.org/1686233002/ )
Reason for revert:
[Sheriff] Breaks arm cross-compile:
https://build.chromium.org/p/client.v8/builders/V8%20Arm%20-%20debug%20builder/builds/7825/

Original issue's description:
> Add Scoped Context Info (Isolate) to V8 Traces
>
> This patch adds the newly added support for contexts in V8 Tracing, as well
> as use it to mark all the entry points for a V8 Isolate.
>
> BUG=v8:4565
> LOG=N
>
> Committed: https://crrev.com/44823c3c6965966c63b7e2e2361d0f2a58d196ea
> Cr-Commit-Position: refs/heads/master@{#34092}

TBR=jochen@chromium.org,fmeawad@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4565

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

Cr-Commit-Position: refs/heads/master@{#34095}
2016-02-17 20:30:44 +00:00
binji
2869071588 [Atomics] Add dmb/dsb/isb instructions to ARM
This is not currently implemented in the simulator, just the assembler and
disassembler.

BUG=v8:4614
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#34093}
2016-02-17 19:58:04 +00:00
fmeawad
44823c3c69 Add Scoped Context Info (Isolate) to V8 Traces
This patch adds the newly added support for contexts in V8 Tracing, as well
as use it to mark all the entry points for a V8 Isolate.

BUG=v8:4565
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34092}
2016-02-17 19:56:33 +00:00
ishell
32b4bc1382 [es6] [interpreter] Add tail calls support to Ignition.
This CL introduces two new bytecodes TailCall and TailCallWide.

BUG=v8:4698,v8:4687
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34083}
2016-02-17 15:19:50 +00:00
ulan
017d128b6e Filter invalid slots after array trimming.
If sweeping is in progress then we need to filter out slots in free space after
array trimming, because the sweeper will add the free space into free list.

This CL also fixes a bug in SlotSet::RemoveRange.

BUG=chromium:587004
LOG=NO
TBR=hpayer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34071}
2016-02-17 11:53:06 +00:00
mstarzinger
305a36e0d4 Remove strong mode support from property loads.
R=rossberg@chromium.org,bmeurer@chromium.org,verwaest@chromium.org
BUG=v8:3956
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34067}
2016-02-17 10:30:47 +00:00
caitpotter88
3649170259 [cleanup] add Parser accessors for FLAG_harmony_function_sent
BUG=
LOG=N
R=adamk@chromium.org, littledan@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34051}
2016-02-17 00:19:21 +00:00
caitpotter88
fd2edb0ea2 [parser] unify metaproperty parsing and require unescaped property name
BUG=v8:4756
LOG=N
R=adamk@chromium.org, littledan@chromium.org, wingo@igalia.com

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

Cr-Commit-Position: refs/heads/master@{#34050}
2016-02-16 23:38:09 +00:00
rmcilroy
5b2d1956eb [Interpreter] Remove some cctest and mjsunit test skips.
Removes some cctest and mjsunit test skips on Ignition for tests that now pass.

BUG=v8:4680
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34045}
2016-02-16 18:52:09 +00:00
titzer
ccc3371264 [test] Shard some slower bytecode graph builder tests.
This CL splits up some long-running bytecode graph builder tests.
There's a lot of working going on here that probably should be split
up into smaller tests and/or mjsunit tests once we have the full
ignition pipeline. This one just targets the top offenders for now.

R=rmcilroy@chromium.org, oth@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34039}
2016-02-16 14:10:34 +00:00
bmeurer
8f87c0acb7 [builtins] Move the Boolean constructor to C++.
Drive-by-fix: Remove the (now) unused %_SetValueOf and %_JSValueGetValue
intrinsics from the various compilers and the runtime.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34037}
2016-02-16 14:03:07 +00:00
mstarzinger
1150092b29 Remove strong mode support from binary operations.
R=bmeurer@chromium.org
BUG=v8:3956
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34036}
2016-02-16 13:55:29 +00:00
verwaest
036d23ec73 Don't include field-type.h/field-index.h into property.h
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34035}
2016-02-16 13:28:47 +00:00
rodolph.perfetta
0dfd7bcdaf Added a ReverseBits operator and used it to implement Ctz.
Let me know if this is not the right approach

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

Cr-Commit-Position: refs/heads/master@{#34028}
2016-02-16 11:14:28 +00:00
rmcilroy
84a225d1e4 [Turbofan] Save and restore lr in OutOfLineRecordWrite when frame is elided.
Fixes a bug in Ignition on Arm64 where lr gets trashed in StaContextSlot
which causes the stack walker to get confused and crash.

BUG=v8:4680
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34016}
2016-02-16 07:49:16 +00:00
danno
fd8fd05cc5 [turbofan] Add an operator to access the parent frame pointer
This functionality is useful for stubs that need to walk the stack. The new
machine operator, LoadParentFramePointer dosn't force the currently compiling
method to have a frame in contrast to LoadFramePointer. Instead, it adapts
accordingly when frame elision is possible, making efficient stack walks
possible without incurring a performance penalty for small stubs that can
benefit from frame elision.

R=bmeurer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34014}
2016-02-16 07:29:16 +00:00
titzer
3a0377a48d [wasm] Clean up handling of function names.
R=ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33999}
2016-02-15 16:00:19 +00:00
jkummerow
5aa2cb3bcc [crankshaft] Replace stub cache harvesting with a bit of type propagation
Harvesting maps from the stub cache for megamorphic ICs is both slow
(linear in the size of the stub cache) and imprecise (as it finds all
maps that have a cached handler for the given property name).
In the canonical megamorphic situation, this type feedback is useless
anyway. The interesting case is when we can filter it down to a single
map; however in these cases it is often possible to derive this map
just by looking at the HGraph, which is both faster and more reliable.

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

Cr-Commit-Position: refs/heads/master@{#33998}
2016-02-15 15:22:00 +00:00
ssanfilippo
e082ebdbf3 [Interpreter] Change the output format of generate-bytecode-expectations.
Now the tool produces a far more readable output format, which bears a
lot of resemblance to YAML. In fact, the output should be machine
parseable as such, one document per testcase. However, the output format
may be subject to changes in future, so don't rely on this property.

In general, the output format has been optimized for producing a meaningful
textual diff, while keeping a decent readability as well. Therefore, not
everything is as compact as it could be, e.g. for an empty const pool we get:

    constant pool: [
    ]

instead of:

    constant pool: []

Also, trailing commas are always inserted in lists.

Additionally, now the tool accepts its output format as input. When
operating in this mode, all the snippets are extracted, processed and
the output is then emitted as usual. If nothing has changed, the output
should match the input. This is very useful for catching bugs in the
bytecode generation by running a textual diff against a known-good file.

The core (namely bytecode-expectations.cc) has been extracted from the
original cc file, which provides the utility as usual. The definitions
in the matching header of the library have been moved into the
v8::internal::interpreter namespace.

The library exposes a class ExpectationPrinter, with a method
PrintExpectation, which takes a test snippet as input, and writes the
formatted expectation to the supplied stream. One might then use a
std::stringstream to retrieve the results as a string and run it through
a diff utility.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33997}
2016-02-15 15:20:33 +00:00
titzer
232b97dd10 [test] Clean up a couple TODOs.
R=bmeurer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33990}
2016-02-15 11:18:43 +00:00
machenbach
05218010cd [Swarming] Isolate perf tests.
This is to enable deduplicating performance tests. We'll
create a hash of all relevant files and send it to perf bots
alongside the other swarming hashes (follow up on infra
side).

This will not actually run on swarming yet, but could at
some later point.

This splits off the cctest executable from other verification
test files, as those are not needed in performance tests.

BUG=chromium:535160
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33989}
2016-02-15 11:17:18 +00:00