Commit Graph

11769 Commits

Author SHA1 Message Date
yangguo
6f67d171f1 [regexp] Fix non-match and max match length in RegExpCharacterClass.
R=mstarzinger@chromium.org
BUG=chromium:605862
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35764}
2016-04-25 13:32:14 +00:00
bmeurer
dcf178fb29 [turbofan] Move ChangeTaggedToFoo lowerings to EffectControlLinearizer.
These also lower to subgraphs that have to be connected to the effect
and control chains, otherwise removing the atomic regions around heap
allocations would still be unsound.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35762}
2016-04-25 12:41:17 +00:00
neis
0ff89ea75b Migrate Object.definePropert{ies,y} from v8natives to builtins.
R=bmeurer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35761}
2016-04-25 12:24:48 +00:00
machenbach
cb855fe728 [build] Prepare moving v8.gyp to src/
This will allow to pull in gyp as a deps to the same location
as chromium (tools/gyp not build/gyp), needed for gn switch.

This is the first step of a 3-way move.
1) Copy v8.gyp in v8
2) Update references in embedders (follow up)
3) Remove old v8.gyp (follow up)

BUG=chromium:474921
LOG=n
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#35760}
2016-04-25 12:20:24 +00:00
neis
17024be077 Migrate Object.getPrototypeOf from v8natives to builtins.
More v8natives cleanup to come...

R=bmeurer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35759}
2016-04-25 11:45:40 +00:00
yangguo
3c7391093b [debugger] fix mjsunit/regress/regress-crbug-119800 for ignition.
R=vogelheim@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35758}
2016-04-25 11:37:12 +00:00
jarin
692eec3969 [turbofan] Remove obsolete parts of change lowering.
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35756}
2016-04-25 09:27:18 +00:00
rmcilroy
c005029aa4 [Interpreter] Use FastNewSloppyArguments when possible.
Use the FastNewSloppyArgumentsStub in the interpreter when function doesn't have
duplicate parameters.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35754}
2016-04-25 09:25:06 +00:00
yangguo
098ff93558 [debugger] make step positions for for-of compatible with interpreter.
R=mstarzinger@chromium.org, rossberg@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35750}
2016-04-25 06:53:41 +00:00
jarin
9cae24b8cc [turbofan] Wire in floating control during effect linearization phase.
Review URL: https://codereview.chromium.org/1921483002

Cr-Commit-Position: refs/heads/master@{#35747}
2016-04-25 04:29:23 +00:00
bmeurer
0231a7efa2 [turbofan] Introduce TruncateTaggedToWord32 simplified operator.
This allows us to get rid of the "push TruncateFloat64ToInt32 into Phi"
trick that was used in the MachineOperatorReducer to combine the
ChangeTaggedToFloat64 and TruncateFloat64ToInt32 operations. Instead of
doing that later, we can just introduce the proper operator during the
representation selection directly.

Also separate the TruncateFloat64ToInt32 machine operator, which had two
different meanings depending on a flag (either JavaScript truncation or
C++ style round to zero). Now there's a TruncateFloat64ToWord32 which
represents the JavaScript truncation (implemented via TruncateDoubleToI
macro + code stub) and the RoundFloat64ToInt32, which implements the C++
round towards zero operation (in the same style as the other WebAssembly
driven Round* machine operators).

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35743}
2016-04-24 11:41:20 +00:00
Adam Klein
f6c09c893a Remove non-existent object-observe test from mjsunit.status
TBR=machenbach@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35740}
2016-04-22 18:31:44 +00:00
mbrandy
d0f414dbe6 Reland "Fix interpreter unittest for embedded constant pools."
The offset from fp to the register file is based on the frame size
-- which is one slot larger when embedded constant pools are enabled.

TEST=unittests/DecodeBytecodeAndOperands
TBR=rmcilroy@chromium.org, bmeurer@chromium.org, oth@chromium.org, mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35735}

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

Cr-Commit-Position: refs/heads/master@{#35737}
2016-04-22 15:32:22 +00:00
mbrandy
2a113b8e2e Revert of Fix interpreter unittest for embedded constant pools. (patchset #2 id:20001 of https://codereview.chromium.org/1906963002/ )
Reason for revert:
Need to fix the #undef logic.

Original issue's description:
> Fix interpreter unittest for embedded constant pools.
>
> The offset from fp to the register file is based on the frame size
> -- which is one slot larger when embedded constant pools are enabled.
>
> TEST=unittests/DecodeBytecodeAndOperands
> R=rmcilroy@chromium.org, bmeurer@chromium.org, oth@chromium.org, mstarzinger@chromium.org
> BUG=

TBR=bmeurer@chromium.org,mstarzinger@chromium.org,oth@chromium.org,rmcilroy@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/1909323003

Cr-Commit-Position: refs/heads/master@{#35736}
2016-04-22 15:04:50 +00:00
mbrandy
074320ac2d Fix interpreter unittest for embedded constant pools.
The offset from fp to the register file is based on the frame size
-- which is one slot larger when embedded constant pools are enabled.

TEST=unittests/DecodeBytecodeAndOperands
R=rmcilroy@chromium.org, bmeurer@chromium.org, oth@chromium.org, mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35735}
2016-04-22 14:50:02 +00:00
epertoso
339000bf3b [turbofan] Add the Verifier to the pipeline for code stubs.
Removes some control edges added from the RawMachineAssembler to the end of the graph.
Adds a parameter that tells the Verifier to ignore effect and control inputs.

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

Cr-Commit-Position: refs/heads/master@{#35731}
2016-04-22 13:56:36 +00:00
mike
b86ec74395 [modules] Infer strict mode from within scope object
Refactor the Scope object to automatically enable strict mode when
initialized as a "module" scope, relieving the caller of this
responsibility.

BUG=v8:4941
LOG=N
R=adamk@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35730}
2016-04-22 13:38:15 +00:00
yangguo
4b580cad0c [debugger,interpreter] fix source position of compare operation.
R=mstarzinger@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35729}
2016-04-22 13:11:48 +00:00
rossberg
9ce87d6772 Add flag for disallowing for-in initializers
This does not affect use counters.

R=nikolaos@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35726}
2016-04-22 12:04:15 +00:00
mstarzinger
5c8609de9d [interpreter] Heal closures when bytecode array is gone.
This ensures the InterpreterEntryTrampoline heals code entry fields
inside closures when being called without a valid bytecode array. This
is preparatory work to allow removal of bytecode when switching some
functions to other types of code.

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

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

Cr-Commit-Position: refs/heads/master@{#35724}
2016-04-22 11:13:28 +00:00
bmeurer
550c0f9f55 [turbofan] Move more type checks to the representation selector.
Get rid of further typing checks from ChangeLowering and put them into
the representation selection pass instead (encoding the information in
the operator instead).

Drive-by-change: Rename ChangeSmiToInt32 to ChangeTaggedSignedToInt32
for consistency about naming Tagged, TaggedSigned and TaggedPointer.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35723}
2016-04-22 11:03:17 +00:00
yangguo
672983830f [debugger] Hide scopes that originate from desugaring.
Some scopes are introduced by the parser for desugaring and do not
have any positions associated. The debugger should not make them
visible.

Also add some missing source positions.

R=kozyatinskiy@chromium.org, rossberg@chromium.org
BUG=chromium:604458
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#35721}
2016-04-22 10:48:45 +00:00
rmcilroy
c58f328581 [Interpreter] Introduce IncStub and DecStub.
Adds IncStub and DecStub TurboFan code stubs and hooks them up to the
interpreter's Inc and Dec bytecodes (which are used for count
operations, e.g. i++).

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35720}
2016-04-22 10:36:33 +00:00
rmcilroy
11e3ba34f5 [Interpreter] Fix incorrect Register OperandSize calculation for ExtraWide.
Fixes a mistake made in r35618 for register OperandSize calculations.

BUG=605470
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35719}
2016-04-22 10:32:14 +00:00
neis
b090715250 Introduce bytecodes for assisting generator suspend and resume.
The new bytecodes replace two runtime functions. They are still unsupported by the bytecode graphbuilder, though.

BUG=v8:4907
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35716}
2016-04-22 09:19:00 +00:00
jkummerow
f4a9a50147 [tests] Add testcase for r35397
This is a follow-up to 58429beb7b
"Fix KeyedStore stub selection for STRING_WRAPPER_ELEMENTS".

BUG=chromium:602184
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35715}
2016-04-22 09:08:46 +00:00
adamk
6a370a6f01 Remove support for Object.observe
The feature was deprecated in M49 and flagged off in M50.
This patch removes it entirely from the codebase.

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

Cr-Commit-Position: refs/heads/master@{#35714}
2016-04-22 09:02:41 +00:00
bmeurer
861295bf16 [turbofan] Optimize tagged conversion based on type.
If we have to convert a float64 value to tagged representation and we
already know that the value is either in Signed31/Signed32 or
Unsigned32 range, then we can just convert the float64 to word32 and
use the fast word32 to tagged conversion. Doing this in
ChangeLowering (or the effect linearization pass) would be unsound, as
the types on the nodes are no longer usable.

This removes all Type uses from effect linearization. There's still some
work to be done for ChangeLowering tho.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35713}
2016-04-22 08:40:05 +00:00
mstarzinger
82a7c53e97 [interpreter] Enable webkit test that no longer fails.
R=machenbach@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35710}
2016-04-21 16:35:20 +00:00
jkummerow
9bebebd909 [ic] Restore PROPERTY key tracking in keyed ICs
Non-vectorized KeyedLoadICs used to remember whether they had seen Names
as keys; Crankshaft uses this information to avoid emitting elements
accesses which would always deopt. This CL restores that functionality
for vector ICs.

BUG=chromium:594183
LOG=y
R=mvstanton@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35706}
2016-04-21 13:18:28 +00:00
yangguo
ff2a04bbb9 [debugger] fix mjsunit/es6/debug-promises/stepin-constructor.js for ignition.
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35704}
2016-04-21 13:16:04 +00:00
yangguo
4d824551c7 [debugger] fix mjsunit/debug-allscopes-on-debugger.js for ignition.
R=vogelheim@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35701}
2016-04-21 11:30:44 +00:00
verwaest
7dfb5beeec Fix 'typeof null' canonicalization in crankshaft
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35699}
2016-04-21 11:24:31 +00:00
titzer
b3cf031eb8 [wasm] Enforce strict ordering of WASM module sections.
R=jfb@chromium.org,rossberg@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35698}
2016-04-21 11:20:15 +00:00
verwaest
4a6a0f5530 Make sure we always try to make prototypes fast again when transitioning accessors
BUG=chromium:605060
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35697}
2016-04-21 11:18:08 +00:00
titzer
727c7df035 [wasm] Extra LEB utilities to leb-helper.h
R=bradnelson@chromium.org,aseemgarg@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35695}
2016-04-21 10:15:16 +00:00
ishell
b4dbb2f710 [deoptimizer] Do not modify stack_fp which is used as a key for lookup of previously materialized objects.
BUG=chromium:604680, v8:4698
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35693}
2016-04-21 09:54:33 +00:00
jochen
2cfac65eac Allow for creating Private API symbols that have a number as an ID
BUG=v8:4933
R=verwaest@chromium.org
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35692}
2016-04-21 09:50:27 +00:00
clemensh
e530556471 [wasm] Add test case for stack trace of wasm traps
Since traps now throw real Error objects, we get stack traces
containing <WASM> functions on top-level. The additional tests check
for two traps: unreachable and memory out-of-bounds.

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

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

Cr-Commit-Position: refs/heads/master@{#35691}
2016-04-21 09:38:21 +00:00
zhengxing.li
d5ffbfefd9 X87: Change the test case for X87 RunTruncateFloat32ToUint32.
The CL #35651 (https://codereview.chromium.org/1858323003) exposed one hiden issue in RunTruncateFloat32ToUint32 test cases and X87 failed at it.

  Here is the issue in RunTruncateFloat32ToUint32:
  For float input = static_cast<float>(*i), the x87 GCC would optimize the input viariable in float floating register for release build.

  The problem is:
  SSE float register has single precision rounding semantic While X87 register hasn't when directly use floating register value. It will cause the value of input viariable has
  different precision for IA32 and X87 port. So static_cast<uint32_t>(input) will be different for IA32 and X87 port too.
  This led to CHECK_EQ(static_cast<uint32_t>(input), m.Call(input)) fail although V8 turbofan JITTed code m.Call(input) has exactly same result in both X87 and IA32 port.

  So we add the following sentence to do type cast to keep the single precision for RunTruncateFloat32ToUint32 by forcing the input viariable get value from memory insread of
  floating register.
  Such as: volatile float input = static_cast<float>(*i).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#35689}
2016-04-21 09:12:11 +00:00
machenbach
2d454e226a [test] Slim down test that exceeds stack limit
BUG=v8:4928
LOG=n
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#35688}
2016-04-21 08:37:20 +00:00
clemensh
449af6f229 [wasm] Also test structured stack trace
This extends the wasm test case which only checks the "simple"
string-variant of the stack trace.
It checks the return values of the getFunctionName, getLineNumber,
getFileName and toString methods.

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

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

Cr-Commit-Position: refs/heads/master@{#35687}
2016-04-21 08:37:19 +00:00
ahaas
b4889f7d93 [wasm] New implementation of popcnt and ctz.
This patch provides a new implementation of popcnt and ctz in the case
where the platform does not provide these instructions. Instead of
building a TF graph which implements it we now call a C function.

Additionally I turned on additional tests in test-run-wasm-64.cc

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35685}
2016-04-21 07:47:05 +00:00
yangguo
b4697727e9 MIPS64: [regexp] do not assume short external strings have a minimum size.
Port 3518e492c0

Original commit message:
    Short external strings do not cache the resource data, and may be used
    for compressible strings. The assumptions about their lengths is
    invalid and may lead to oob reads.

R=bmeurer@chromium.org
BUG=v8:4923,chromium:604897
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35683}
2016-04-21 05:58:47 +00:00
rmcilroy
04927031d0 [Interpreter] Fix typo in generate-bytecode-expectations.
BUG=v8:4681
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35679}
2016-04-20 21:05:42 +00:00
adamk
e96cbdcdd6 More accurately record an end position for default parameters in arrows
Our previous over-conservative answer caused us to emit hole checks in
full-codegen when eagerly parsing but not when lazily parsing.

With this patch, we use the positions of the BinaryOperations making up
the parameter list (which are the positions of the commas) to determine
the appropriate "end position" for each parameter's initializer. This means
that we get accurate-enough positions for the initializers in the eager
parsing step to get the same answers for hole-check-elimination that we
will later during ParseLazy.

In the included test case, for example:

  (function() { ((s = 17, y = s) => s)(); } )();
                        ^2     ^1

The old code would generate a hole check when trying to load
|s| for assignment to |y| (because it treated the closing parentheses
pointed to by "^1" as the "initialization position" of |s|).

The new code uses the comma pointed to by "^2" as the initialization
position of |s|. Since that occurs textually before the load of |s|,
full-codegen knows it can avoid the hole check.

BUG=v8:4908
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35678}
2016-04-20 20:49:16 +00:00
littledan
f32e30240d Detach ArrayBuffer in test262
New incoming test262 tests check what happens on detached ("neutered")
ArrayBuffers. This patch makes the test262 infrastructure define
detaching an ArrayBuffer in terms of %ArrayBufferNeuter, passing the
--allow-natives-syntax flag, when it is needed.

BUG=v8:4193
LOG=N
R=adamk,machenbach

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

Cr-Commit-Position: refs/heads/master@{#35676}
2016-04-20 19:44:05 +00:00
machenbach
921381bc13 Revert of [wasm] Also test structured stack trace (patchset #4 id:60001 of https://codereview.chromium.org/1875153002/ )
Reason for revert:
Breaks:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20custom%20snapshot%20-%20debug/builds/6322

Original issue's description:
> [wasm] Also test structured stack trace
>
> This extends the wasm test case which only checks the "simple"
> string-variant of the stack trace.
> It checks the return values of the getFunctionName, getLineNumber,
> getFileName and toString methods.
>
> R=ahaas@chromium.org, jfb@chromium.org, titzer@chromium.org
> BUG=

TBR=ahaas@chromium.org,jfb@chromium.org,titzer@chromium.org,clemensh@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/1903293002

Cr-Commit-Position: refs/heads/master@{#35670}
2016-04-20 16:25:21 +00:00
clemensh
0fd76cc29c Ignore test failure for today
Fix tomorrow.

BUG=
TBR=mstarzinger@chromium.org,machenbach@chromium.org
NOTRY=true
NOTREECHECKS=true

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

Cr-Commit-Position: refs/heads/master@{#35669}
2016-04-20 16:23:09 +00:00
rmcilroy
8fc0e2a72e Disable InterpreterCreateArguments on nosnap due to issue with --mstackalign flag.
BUG=v8:4928
LOG=N
TBR=machenbach@chromium.org
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#35668}
2016-04-20 15:48:36 +00:00
littledan
8b7b5a6f45 Pass the --module flag to test262 tests with modules enabled
This causes an incoming test262 test to pass, as part of the next
test262 roll.

R=adamk,machenbach
BUG=v8:1569
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35667}
2016-04-20 15:44:30 +00:00
clemensh
782c204c80 [wasm] Also test structured stack trace
This extends the wasm test case which only checks the "simple"
string-variant of the stack trace.
It checks the return values of the getFunctionName, getLineNumber,
getFileName and toString methods.

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

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

Cr-Commit-Position: refs/heads/master@{#35666}
2016-04-20 15:20:18 +00:00
clemensh
ec8e14e697 [wasm] Add a cctest for the stack on a wasm trap
In contrast to the existing cctest, this time the error is not thrown
from javascript, but by a trap in wasm. And in contrast to the mjsunit
tests, this checks the detailed stack trace, not the simple one.

R=jfb@chromium.org, mstarzinger@chromium.org, titzer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35665}
2016-04-20 15:10:05 +00:00
clemensh
b1434ac460 [wasm] Throw real Error on wasm trap
Before, just a string was thrown, so no stack trace was attached there.
Generated code from wasm does not grow by this change, we just pass a
message id to the respective (new) runtime function.

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

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

Cr-Commit-Position: refs/heads/master@{#35664}
2016-04-20 14:53:28 +00:00
ahaas
965e6bdc0a [wasm] Wasm functions with int64 parameters can now be called from JS.
All wasm spec tests can now be run on ia32.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35663}
2016-04-20 14:45:08 +00:00
yangguo
3518e492c0 [regexp] do not assume short external strings have a minimum size.
Short external strings do not cache the resource data, and may be used
for compressible strings. The assumptions about their lengths is
invalid and may lead to oob reads.

R=jkummerow@chromium.org
BUG=v8:4923,chromium:604897
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35660}
2016-04-20 13:57:08 +00:00
titzer
b994ad45b0 [turbofan] Length and index2 are unsigned in CheckedLoad/CheckedStore.
Also factor out test cases from test-run-machops.cc into test-run-load-store.cc

BUG=chromium:599717
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#35651}
2016-04-20 09:35:06 +00:00
vogelheim
ed9b7d92e7 Prevent un-parsed LiteralFunction reaching the compiler.
BUG=chromium:604044
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#35650}
2016-04-20 09:35:05 +00:00
mlippautz
2489738d4a [heap] Add page evacuation mode for new->old
In a full mark-compact GC, instead of copying memory to old space for
pages that have more than X% live bytes, we just move the whole page over to old
space.

X=70 (default value)

BUG=chromium:581412
LOG=N
TBR=hpayer@chromium.org

This reverts commit 8b3337278f.

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

Cr-Commit-Position: refs/heads/master@{#35649}
2016-04-20 09:30:40 +00:00
mike
43fa3e65c9 [modules] Treat top-level functions as lexical
[15.2.1.11 Static Semantics:
LexicallyDeclaredNames](https://tc39.github.io/ecma262/#sec-module-semantics-static-semantics-lexicallydeclarednames)
(in contrast with its definition for StatementListItem) makes no
explicit provision for HoistableDeclarations. This means that function
declarations are treated as lexically scoped in module code, as
described in section 15.2.1.11's informative note:

> At the top level of a function, or script, function declarations are
> treated like var declarations rather than like lexical declarations.

BUG=v8:4884
LOG=N
R=adamk@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35633}
2016-04-19 17:53:03 +00:00
adamk
59546149c6 Remove all non-function-name uses of CONST_LEGACY
Now that all 'const' declarations are of the ES2015 variety, the only
use of CONST_LEGACY is for function name bindings in sloppy mode
named function expressions.

This patch aims to delete all code meant to handle other cases, which
mostly had to do with hole initialization/hole checks. Since function
name bindings are initialized at entry to a function, it's impossible
to ever observe one in an uninitialized state.

To simplify the patch further, it removes the `IMPORT` VariableMode,
as it's not likely to be needed (IMPORT is identical to CONST for
the purpose of VariableMode).

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

Cr-Commit-Position: refs/heads/master@{#35632}
2016-04-19 17:04:36 +00:00
kozyatinskiy
de5aaad638 [Debugger] Fix StepNext over function with caught exception
Without CL debugger on StepNext adds breakpoint to function where throw instruction is located. In case of StepNext we will skip pause in this function because StepNext shouldn't break in a deeper frame.

BUG=chromium:604495
R=yangguo@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35627}
2016-04-19 15:29:33 +00:00
clemensh
5c1d28770b [wasm] Add test for detailed stack trace
This cctest triggers a detailed stack trace containing WASM frames.

R=jfb@chromium.org, mstarzinger@chromium.org, titzer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35624}
2016-04-19 14:20:43 +00:00
clemensh
3e5f45b64b [wasm] Flag WASM code sections as such in the tests
This makes them show up in the stack trace. Otherwise the stack frames
are identified as type STUB, and skipped by the iterator.

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

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

Cr-Commit-Position: refs/heads/master@{#35621}
2016-04-19 12:55:02 +00:00
machenbach
8b3337278f Revert of 🏄 [heap] Add page evacuation mode for new->old (patchset #21 id:800001 of https://codereview.chromium.org/1863983002/ )
Reason for revert:
[Sheriff] Breaks:
https://build.chromium.org/p/client.v8.ports/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20nosnap%20-%20debug/builds/102

Original issue's description:
> [heap] Add page evacuation mode for new->old
>
> In a full mark-compact GC, instead of copying memory to old space for
> pages that have more than X% live bytes, we just move the whole page over to old
> space.
>
> X=70 (default value)
>
> BUG=chromium:581412
> LOG=N
>
> Committed: https://crrev.com/0d7e23a6edd3822970983030a77a5b80cd337911
> Cr-Commit-Position: refs/heads/master@{#35610}

TBR=hpayer@chromium.org,ulan@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:581412

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

Cr-Commit-Position: refs/heads/master@{#35619}
2016-04-19 12:52:47 +00:00
rmcilroy
623ad7de88 [Interpreter] Remove register file register and replace with LoadParentFramePointer.
Removes the register file machine register from the interpreter and
replaces it will loads from the parent frame pointer. As part of this
change the raw operand values for register values changes to enable the
interpreter to keep using the operand value as the offset from the
parent frame pointer.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35618}
2016-04-19 12:48:41 +00:00
clemensh
09b50113d4 Move two test-internal functions up to header file
... such that they can be reused from other tests.

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

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

Cr-Commit-Position: refs/heads/master@{#35617}
2016-04-19 12:24:39 +00:00
machenbach
9c927d0f01 [test] Set default locale in test runner
BUG=v8:4437,v8:2899,chromium:604310
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35614}
2016-04-19 11:27:08 +00:00
mlippautz
0d7e23a6ed [heap] Add page evacuation mode for new->old
In a full mark-compact GC, instead of copying memory to old space for
pages that have more than X% live bytes, we just move the whole page over to old
space.

X=70 (default value)

BUG=chromium:581412
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35610}
2016-04-19 10:09:11 +00:00
ishell
28113880e3 Fix polymorphic keyed load handler selection for proxies.
BUG=chromium:603463
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35607}
2016-04-19 08:58:43 +00:00
neis
d0ccddd032 First version of the new generators implementation.
Behind --ignition-generators. Does not yet support Turbofan.

TBR=bmeurer@chromium.org
BUG=v8:4907
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35584}
2016-04-18 14:13:30 +00:00
yangguo
89d7bfda0d Correctly annotate eval origin.
There were a couple of issues with it:
- interpreter is not supported
- the source position was just accidentally correct for full-codegen
- the eval origin could have been cached

Also fixes a few other places to use AbstractCode.

R=mstarzinger@chromium.org

Committed: https://crrev.com/2f3a171adc9e620c2235bf0562145b9d4eaba66d
Cr-Commit-Position: refs/heads/master@{#35257}

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

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

Cr-Commit-Position: refs/heads/master@{#35581}
2016-04-18 13:21:07 +00:00
rmcilroy
559113b092 [Interpreter] Add support for FunctionEntryHook.
Adds code to call FunctionEntryHook on entry to the InterpreterEntryTrampoline.
This should give SyzyProf enough information to build non-discontinous profile
graphs, however since interpreter functions aren't uniquely identified they will
all get lumped into one bucket. This should be good enough for SyzyProf's current
use-case.

BUG=v8:4763
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35568}
2016-04-18 09:51:15 +00:00
mstarzinger
8a29223c01 [compiler] Prevent unnecessary parsing with interpreter.
This disables parsing when we optimize directly from bytecode using
TurboFan, because TurboFan is capable of building graphs out of the
bytecode directly.

R=bmeurer@chromium.org
BUG=v8:4280
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35567}
2016-04-18 09:11:16 +00:00
jochen
a142dedaff Reland of Immediately cache compiled scripts. (patchset #1 id:1 of https://codereview.chromium.org/1882833006/ )
Reason for revert:
Fixed webkit_unit_tests

Original issue's description:
> Revert of Immediately cache compiled scripts. (patchset #2 id:20001 of https://codereview.chromium.org/1890083002/ )
>
> Reason for revert:
> [Sheriff] Breaks:
> https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20debug/builds/8769
>
> Auto-bisect points to this CL.
>
> Original issue's description:
> > Immediately cache compiled scripts.
> >
> > Usually, script compilation is expensive enough to warrant the extra
> > overhead of caching scripts immediatly.
> >
> > BUG=chromium:588900
> > R=yangguo@chromium.org
> > LOG=n
> >
> > Committed: https://crrev.com/3533c084d470912384988768c4b3b109304da357
> > Cr-Commit-Position: refs/heads/master@{#35527}
>
> TBR=yangguo@chromium.org,jochen@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=chromium:588900
>
> Committed: https://crrev.com/f8a5a4da70d0a8e6dbb1b5c633c2b6b47fe5c3f6
> Cr-Commit-Position: refs/heads/master@{#35536}

TBR=yangguo@chromium.org,machenbach@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=chromium:588900
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35566}
2016-04-18 09:01:10 +00:00
jarin
b9e287c6d9 [turbofan] Effect linearization after representation inference.
This introduces a compiler pass that schedules the graph and re-wires effect chain according to the schedule. It also connects allocating representation changes to the effect chain, and removes the BeginRegion and EndRegion nodes - they should not be needed anymore because all effectful nodes should be already wired-in.

This is an intermediate CL - the next step is to move lowering of the Change*ToTaggedEffect nodes to StateEffectIntroduction so that we do not have to introduce the effectful versions of nodes.

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

Cr-Commit-Position: refs/heads/master@{#35565}
2016-04-18 08:29:51 +00:00
bmeurer
e96c143171 [turbofan] Optimize typeof in abstract/strict equality comparison.
Add support to optimize certain comparisons of typeof with known
strings to utilize the existing ObjectIs<Type> predicates. Also
add a new ObjectIsCallable, which is used to optimize the common
typeof x === "function" pattern.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35562}
2016-04-18 07:03:23 +00:00
bmeurer
662caac9d2 [turbofan] JSTypeOf, JSStrictEqual, JSStrictNotEqual and JSToBoolean are pure.
These operators are really pure on the JavaScript level, and were only
part of the effect chain to make sure we don't accidentially schedule
them right after raw allocations, which is no longer an issue since we
now have the concept of atomic regions.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35552}
2016-04-16 19:28:12 +00:00
haavardm
0ba934d7bf Expose JSON stringifier through V8 API
BUG=602659
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35543}
2016-04-15 18:24:28 +00:00
nikolaos
451fa77235 Re-scope inner scopes in arrow parameter initializers
This patch correctly re-scopes inner scopes that can appear in do
expressions used as initializers to arrow parameters.

R=rossberg@chromium.org
BUG=v8:4904
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35542}
2016-04-15 18:08:31 +00:00
machenbach
f8a5a4da70 Revert of Immediately cache compiled scripts. (patchset #2 id:20001 of https://codereview.chromium.org/1890083002/ )
Reason for revert:
[Sheriff] Breaks:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20debug/builds/8769

Auto-bisect points to this CL.

Original issue's description:
> Immediately cache compiled scripts.
>
> Usually, script compilation is expensive enough to warrant the extra
> overhead of caching scripts immediatly.
>
> BUG=chromium:588900
> R=yangguo@chromium.org
> LOG=n
>
> Committed: https://crrev.com/3533c084d470912384988768c4b3b109304da357
> Cr-Commit-Position: refs/heads/master@{#35527}

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

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

Cr-Commit-Position: refs/heads/master@{#35536}
2016-04-15 14:21:48 +00:00
mvstanton
401450493e Security: type confusion lead to information leak in decodeURI
Quit using the global array in uri code.

R=yangguo@chromium.org
BUG=chromium:602970
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35530}
2016-04-15 13:09:45 +00:00
jochen
00a589d9ff [api] Bring back finalizers on global handles
Seems like node.js depends on it in many places. At least try to get rid
of WeakCallbackData vs WeakCallbackInfo

BUG=
R=hpayer@chromium.org
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#35528}
2016-04-15 12:59:47 +00:00
jochen
3533c084d4 Immediately cache compiled scripts.
Usually, script compilation is expensive enough to warrant the extra
overhead of caching scripts immediatly.

BUG=chromium:588900
R=yangguo@chromium.org
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35527}
2016-04-15 12:53:36 +00:00
ahaas
5df9406a07 [arm] Turn off the default NaN mode on arm.
The default NaN mode was originally used to identify holes in double
arrays. With (https://codereview.chromium.org/863633002/) signalling
NaNs are used for that, and the default NaN mode is not needed anymore.
Without the default NaN mode it is easier to satisfy the WebAssembly
spec which requires that quiet NaNs are preserved.

R=titzer@chromium.org, rodolph.perfetta@arm.com, bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35526}
2016-04-15 12:45:27 +00:00
mstarzinger
5882033203 [turbofan] Mark escape analysis as experimental.
This prefixes the escape analysis flag with "experimental", thereby
making sure the flag in question is not being fuzzed. It will reduce
noise levels on ClusterFuzz again.

R=jarin@chromium.org
BUG=chromium:603653
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35521}
2016-04-15 12:19:29 +00:00
jochen
93c60dca13 [api] Expose ES6 7.3.14 SetIntegrityLevel on v8::Object
BUG=v8:4846
R=verwaest@chromium.org
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#35520}
2016-04-15 12:19:28 +00:00
machenbach
5f5a3282d4 Revert of Rehash and clear deleted entries in weak collections during GC (patchset #8 id:140001 of https://codereview.chromium.org/1877233005/ )
Reason for revert:
[Sheriff] Speculative revert. Suspect for gc stress crashes, like:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/builds/5119

Original issue's description:
> Rehash and clear deleted entries in weak collections during GC
>
> Otherwise, they'll just keep growing until we run out of memory or hit the FixedArray's maximum capacity.
>
> BUG=v8:4909
> R=hpayer@chromium.org
> LOG=n
>
> Committed: https://crrev.com/e093a047796d4c0575fe63d36529e7fe89b8865d
> Cr-Commit-Position: refs/heads/master@{#35514}

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

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

Cr-Commit-Position: refs/heads/master@{#35519}
2016-04-15 12:17:20 +00:00
ahaas
2f9eb09f20 [arm64] Turn off the default NaN mode on arm64.
The default NaN mode was originally used to identify holes in double
arrays. With (https://codereview.chromium.org/863633002/) signalling
NaNs are used for that, and the default NaN mode is not needed anymore.
Without the default NaN mode it is easier to satisfy the WebAssembly
spec which requires that quiet NaNs are preserved.

R=titzer@chromium.org, rodolph.perfetta@arm.com, bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35518}
2016-04-15 11:52:04 +00:00
mstarzinger
62cca39e6c [compiler] Move ensuring deoptimization support to backends.
This moves the responsibility of preparing full-codegen code with
deoptimization support into the backends. This avoids generating such
code when optimization can be done directly from existing bytecode.

R=bmeurer@chromium.org
BUG=v8:4280
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35517}
2016-04-15 11:26:44 +00:00
yangguo
85e9c2095a Unskip debugger tests after GC fix.
This has been fixed by 165186f272.

R=machenbach@chromium.org
BUG=v8:4893,v8:4894
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35515}
2016-04-15 11:00:54 +00:00
jochen
e093a04779 Rehash and clear deleted entries in weak collections during GC
Otherwise, they'll just keep growing until we run out of memory or hit the FixedArray's maximum capacity.

BUG=v8:4909
R=hpayer@chromium.org
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35514}
2016-04-15 10:21:40 +00:00
zhengxing.li
459d79ac1b X87: Simplify IC interfaces.
port 911a5768dc (r35301)

  original commit message:

BUG=

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

Cr-Commit-Position: refs/heads/master@{#35512}
2016-04-15 09:46:24 +00:00
rmcilroy
6dca319395 [Interpreter] No longer require context machine register in bytecode handlers
The current context is stored as a stack slot on the interpreter frame
and therefore we don't need to also maintain a machine register for the
context. Removes this register from bytecode handlers.

In the process modifies this frees up a register on ia32 to keep the
dispatch table pointer in a register rather than on a stack slot on
ia32.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35511}
2016-04-15 09:34:36 +00:00
mstarzinger
43c7c76f1d [turbofan] Use inline allocation for closures.
This changes closure creation to lower to inline allocations when
possible instead of going through the FastNewClosureStub. It allows us
to leverage all advantages of inline allocations on closures. Note that
it is only safe to embed the raw entry point of the compile lazy stub
into the code, because that stub is immortal and immovable.

R=mvstanton@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35499}
2016-04-14 15:19:17 +00:00
yangguo
93135d8c0d [regexp] fix assertion failure when parsing close to stack overflow.
R=jkummerow@chromium.org
BUG=chromium:600257
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35496}
2016-04-14 14:44:28 +00:00
jarin
f5961f90b1 [turbofan] Change number operations to handle Undefined as well.
This allows us to remove the turbofan bailout that we introduced
as a response to crbug.com/589792.

BUG=chromium:589792
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35493}
2016-04-14 13:13:56 +00:00
yangguo
5af0a68442 Revert of Correctly annotate eval origin. (patchset #5 id:80001 of https://codereview.chromium.org/1854713002/ )
Reason for revert:
performance impact

Original issue's description:
> Correctly annotate eval origin.
>
> There were a couple of issues with it:
> - interpreter is not supported
> - the source position was just accidentally correct for full-codegen
> - the eval origin could have been cached
>
> Also fixes a few other places to use AbstractCode.
>
> R=mstarzinger@chromium.org
>
> Committed: https://crrev.com/2f3a171adc9e620c2235bf0562145b9d4eaba66d
> Cr-Commit-Position: refs/heads/master@{#35257}
>
> Committed: https://crrev.com/ad4e8a27963b704bb70ec8bac0991c57296b1d16
> Cr-Commit-Position: refs/heads/master@{#35481}

TBR=mstarzinger@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/1888013002

Cr-Commit-Position: refs/heads/master@{#35491}
2016-04-14 12:46:00 +00:00
mlippautz
3ace01d1b3 Reland of "[heap] Better integrate handling of aborted compaction pages"
- Get rid of fixing up pointers on the main thread
- Get rid of sweeping on the main thread

Instead:
- Record (and process afterwards) slots in parallel
- Add the pages to the concurrent sweeper as pointers have already been fixed

This reverts commit 6df04b296b.

BUG=chromium:581412
LOG=N
TEST=cctest/test-compaction/*

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

Cr-Commit-Position: refs/heads/master@{#35485}
2016-04-14 11:07:20 +00:00
yangguo
ad4e8a2796 Correctly annotate eval origin.
There were a couple of issues with it:
- interpreter is not supported
- the source position was just accidentally correct for full-codegen
- the eval origin could have been cached

Also fixes a few other places to use AbstractCode.

R=mstarzinger@chromium.org

Committed: https://crrev.com/2f3a171adc9e620c2235bf0562145b9d4eaba66d
Cr-Commit-Position: refs/heads/master@{#35257}

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

Cr-Commit-Position: refs/heads/master@{#35481}
2016-04-14 10:08:15 +00:00
rmcilroy
0c05e02f25 [Interpreter] Make dispatch table point to code entry instead of code objects.
Modifies Ignition to store code entry addresses in the dispatch table
rather than code objects. This allows the interpreter to avoid
calculating the code entry address from the code object on every
dispatch and provides a ~5-7% performance improvement on Octane with
Ignition.

This change adds ArchOpcode::kArchTailCallAddress to TurboFan to enable
tail call dispatch using these code addresses. It also adds a Dispatch
linkage creator (distinct from the stub linkage type used previously) to
allow targetting a code address target (which will diverge further from
the stub linkage type when we remove the context machine register in
Ignition).

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35480}
2016-04-14 10:04:26 +00:00
mythria
7effb4f736 [Interpreter] Updates mjsunit.status.
Removes skips for two tests that no longer fail on windows system.
Updates description of another failing test with more details.

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

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

Cr-Commit-Position: refs/heads/master@{#35475}
2016-04-14 09:01:34 +00:00
bmeurer
5b99eec342 [turbofan] Remove unused PlainPrimitiveToNumber operator.
At some point we thought about using this instead of JSToNumber, but now
there doesn't seem to be any reason for this anymore.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35469}
2016-04-14 07:42:22 +00:00
bradnelson
53bc649e88 [wasm] Adding metrics for Asm/Wasm.
Collecting:
Time histograms for: instantiate, decode module, decode function, compile, compile function.
Memory histograms for: decode peak, instantiate peak, compile function peak, min mem pages, max mem pages, function bytes, module bytes.
Range histograms of: functions per module.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
BUG= https://bugs.chromium.org/p/chromium/issues/detail?id=575167
TEST=None
R=ahaas@chromium.org,bmeurer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35467}
2016-04-14 07:30:14 +00:00
machenbach
b0e14e148c [test] Skip flaky test.
BUG=v8:4751
LOG=n
NOTRY=true
TBR=adamk@chromium.org, rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35465}
2016-04-14 07:22:22 +00:00
aseemgarg
c09792bf37 [wasm] Enable the remaining embenchen tests for asm to wasm
BUG=v8:4203
TEST=mjsunit/asm-wasm
R=titzer@chromium.org,bradnelson@chromium.org,ahaas@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35458}
2016-04-14 00:35:12 +00:00
aseemgarg
1d37d4216b [wasm] optimized switch implementation in asm.js to wasm builder
This change implements switch as a balanced if/else tree or break table or
hybrid. A lot of asm.js modules are expected to extensively use switch
alongside function tables that can benefit from a better implementation.

BUG=v8:4203
TEST=mjsunit/asm-wasm
R=titzer@chromium.org,bradnelson@chromium.org,ahaas@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35455}
2016-04-13 21:56:42 +00:00
mlippautz
6df04b296b Revert of [heap] Better integrate handling of aborted compaction pages (patchset #7 id:130001 of https://codereview.chromium.org/1881423003/ )
Reason for revert:
Breaks: https://uberchromegw.corp.google.com/i/client.v8.ports/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20nosnap%20-%20debug/builds/20

RecordMigratedSlotVisitor is not safe to use on code pages.

Original issue's description:
> [heap] Better integrate handling of aborted compaction pages
>
> - Get rid of fixing up pointers on the main thread
> - Get rid of sweeping on the main thread
>
> Instead:
> - Record (and process afterwards) slots in parallel
> - Add the pages to the concurrent sweeper as pointers have already been fixed
>
> BUG=chromium:581412
> LOG=N
> TEST=cctest/test-compaction/*
>
> Committed: https://crrev.com/2e4f57774d4993f9f98332d3b2469280ee10beca
> Cr-Commit-Position: refs/heads/master@{#35451}

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

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

Cr-Commit-Position: refs/heads/master@{#35454}
2016-04-13 18:46:06 +00:00
binji
5e9ddf6ce4 [Atomics] code stubs for atomic operations
Reland of (https://codereview.chromium.org/1617503003)

* New atomic code stubs for x64, ia32, arm, arm64
* Add convenience functions JumpIfNotValidSmiValue, JumpIfUintNotValidSmiValue
  to macro-assembler-ia32 (API based on x64 macro assembler)
* Remove runtime implementation of Atomics.load, the code stub should always be
  called instead
* Add new test to mjsunit atomics test; check that Smi values of different
  sizes are supported when possible, else fall back to HeapNumbers

These changes were needed to add another codestub:
* Bump kStubMajorKeyBits from 7 to 8
* Reduce ScriptContextFieldStub::kSlotIndexBits from 13 to 12

BUG=v8:4614
LOG=y
TBR=jarin@chromium.org,bmeurer@chromium.org,rodolph.perfetta@gmail.com,machenbach@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35427}

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

Cr-Commit-Position: refs/heads/master@{#35453}
2016-04-13 18:24:28 +00:00
mlippautz
2e4f57774d [heap] Better integrate handling of aborted compaction pages
- Get rid of fixing up pointers on the main thread
- Get rid of sweeping on the main thread

Instead:
- Record (and process afterwards) slots in parallel
- Add the pages to the concurrent sweeper as pointers have already been fixed

BUG=chromium:581412
LOG=N
TEST=cctest/test-compaction/*

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

Cr-Commit-Position: refs/heads/master@{#35451}
2016-04-13 16:12:35 +00:00
ofrobots
2837cb387b disallow left-trim fast path when sampling heap profiler is active
Left trimming assumes that nobody other than the JSArray has a reference to the
backing store. Sampling heap profiler may profile the backing store and keep a
reference too it. This reference was never updated on a left-trim, causing a
crash.

R=alph@chromium.org, hpayer@chromium.org, mattloring@google.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35449}
2016-04-13 15:11:21 +00:00
Miran.Karic
3b416c67f5 Adjust bytecode operand values for big endian.
Operand values in Bytecodes.DecodeBytecodeAndOperands test are encoded
in little endian format. The test calls Bytecodes::Decode function which
reads the operands but the values are byte swapped on big endian
machines. Added big endian encoded data which decodes correctly on BE
machines.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#35447}
2016-04-13 13:53:05 +00:00
machenbach
2a5cce6580 Revert of [Atomics] code stubs for atomic operations (patchset #28 id:530001 of https://codereview.chromium.org/1617503003/ )
Reason for revert:
[Sheriff] Roll was reverted. Please fix unused methods, see:
https://codereview.chromium.org/1884913002/

https://build.chromium.org/p/tryserver.chromium.win/builders/win_clang/builds/5585/steps/compile%20%28with%20patch%29/logs/stdio

Original issue's description:
> [Atomics] code stubs for atomic operations
>
> * New atomic code stubs for x64, ia32, arm, arm64
> * Add convenience functions JumpIfNotValidSmiValue, JumpIfUintNotValidSmiValue
>   to macro-assembler-ia32 (API based on x64 macro assembler)
> * Remove runtime implementation of Atomics.load, the code stub should always be
>   called instead
> * Add new test to mjsunit atomics test; check that Smi values of different
>   sizes are supported when possible, else fall back to HeapNumbers
>
> These changes were needed to add another codestub:
> * Bump kStubMajorKeyBits from 7 to 8
> * Reduce ScriptContextFieldStub::kSlotIndexBits from 13 to 12
>
> BUG=v8:4614
> LOG=y
>
> Committed: https://crrev.com/10b5febe11b318cfef130abae343183ac862e60d
> Cr-Commit-Position: refs/heads/master@{#35427}

TBR=jarin@chromium.org,bmeurer@chromium.org,rodolph.perfetta@gmail.com,binji@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4614

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

Cr-Commit-Position: refs/heads/master@{#35443}
2016-04-13 11:59:28 +00:00
mvstanton
c2de961128 RESUBMITTING: Bogus assert prevented chromium roll.
Visit the Optimized Code Map on first call rather than closure creation.

This is useful for escape analysis, and helps upcoming changes to
type feedback gathering.

Adding notry due to crashed builders:
NOTRY=true
BUG=

Committed: https://crrev.com/9336f4cc6d25d39a128176679a70dbd13a6d946e
Cr-Commit-Position: refs/heads/master@{#35395}

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

Cr-Commit-Position: refs/heads/master@{#35440}
2016-04-13 10:55:39 +00:00
neis
e298646be8 [generators] Simplify %CreateJSGeneratorObject
Instead of looking at the top JavaScriptFrame, take the needed information as
arguments.  This is in preparation of the new generators implementation.

R=adamk@chromium.org, bmeurer@chromium.org
BUG=v8:4907
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35430}
2016-04-13 08:18:18 +00:00
binji
10b5febe11 [Atomics] code stubs for atomic operations
* New atomic code stubs for x64, ia32, arm, arm64
* Add convenience functions JumpIfNotValidSmiValue, JumpIfUintNotValidSmiValue
  to macro-assembler-ia32 (API based on x64 macro assembler)
* Remove runtime implementation of Atomics.load, the code stub should always be
  called instead
* Add new test to mjsunit atomics test; check that Smi values of different
  sizes are supported when possible, else fall back to HeapNumbers

These changes were needed to add another codestub:
* Bump kStubMajorKeyBits from 7 to 8
* Reduce ScriptContextFieldStub::kSlotIndexBits from 13 to 12

BUG=v8:4614
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#35427}
2016-04-12 23:10:36 +00:00
jfb
9041833647 Fix printf formats
The usage of __attribute__((format(x, y)) was either wrong or missing from multiple functions, leading to erroneous formats. This CL:

 - Imports PRINTF_FORMAT macro from Chrome's src/base/compiler-specific.h.
 - Uses it appropriately.
 - Imports Chrome's base/format_macros.h mainly to fix size_t formats (further cleanup could be done).
 - Fixes a bunch of incorrect formats.

Original CL: https://codereview.chromium.org/1869433004
Reverted in: https://codereview.chromium.org/1867383002
Reverted again in: https://codereview.chromium.org/1877823003

Reverts due to non-CQ bots:
  - First: v8_win_dbg, v8_win64_dbg, v8_mac_dbg
  - Second: gc mole (added to v8_linux_rel_ng for this patch)

R= jochen@chromium.org
TBR= ahaas@chromium.org,bmeurer@chromium.org,yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35423}
2016-04-12 16:14:03 +00:00
marija.antic
fdf19ffa5d MIPS64: Fix rotate instructions in simulator
Fix for drotr and drotr32 instructions in MIPS64 simulator.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#35420}
2016-04-12 14:49:50 +00:00
jochen
b3d793e48a [api] Introduce ReturnValue::Get
This is a convenience API that an embedder can use to do final checks on
the return value. Note that this creates a new handle and thus defeats
the performance optimization done for ReturnValue - an embedder should
only use this in non-performance critical code paths.

BUG=
R=verwaest@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35409}
2016-04-12 09:34:12 +00:00
gdeepti
52148c41c9 [compiler] Add relocatable pointer constants for wasm memory references.
Add relocatable pointers for wasm memory references that need to be updated when wasm GrowMemory is used. Code generator changes to accept relocatable constants as immediates.

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

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

Committed: https://crrev.com/297932a302ce0b73c3618ef9e4eba9d9d241f2b3
Cr-Commit-Position: refs/heads/master@{#35400}

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

Cr-Commit-Position: refs/heads/master@{#35407}
2016-04-12 09:07:00 +00:00
oth
fa2fbcfc2d [interpreter] Update bytecode expectations for ES6 instanceof.
Fixes updating golden files following instanceof change.

BUG=v8:4280
LOG=N
R=rmcilroy@chromium.org,ssanfilippo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35406}
2016-04-12 08:42:36 +00:00
hablich
f021b7ca8f Revert of Visit the Optimized Code Map on first call rather than closure creation. (patchset #7 id:120001 of https://codereview.chromium.org/1670143002/ )
Reason for revert:
Blocks roll. See https://codereview.chromium.org/1877003002/ for detailed messages.

You should be able to repro this with Linux ASAN.

Original issue's description:
> Visit the Optimized Code Map on first call rather than closure creation.
>
> This is useful for escape analysis, and helps upcoming changes to
> type feedback gathering.
>
> BUG=
>
> Committed: https://crrev.com/9336f4cc6d25d39a128176679a70dbd13a6d946e
> Cr-Commit-Position: refs/heads/master@{#35395}

TBR=mstarzinger@chromium.org,bmeurer@chromium.org,mvstanton@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/1878063004

Cr-Commit-Position: refs/heads/master@{#35404}
2016-04-12 07:59:11 +00:00
machenbach
3f69393a90 Revert of [compiler] Add relocatable pointer constants for wasm memory references. (patchset #15 id:320001 of https://codereview.chromium.org/1759383003/ )
Reason for revert:
[Sheriff] Breaks msan:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/builds/7842

Original issue's description:
> [compiler] Add relocatable pointer constants for wasm memory references.
>
> Add relocatable pointers for wasm memory references that need to be updated when wasm GrowMemory is used. Code generator changes to accept relocatable constants as immediates.
>
> R=titzer@chromium.org, yangguo@chromium.org, bradnelson@chromium.org
>
> Committed: https://crrev.com/eb5fe0df64ec0add423b2a1f6fb62d5a33dce2a5
> Cr-Commit-Position: refs/heads/master@{#35182}
>
> Committed: https://crrev.com/297932a302ce0b73c3618ef9e4eba9d9d241f2b3
> Cr-Commit-Position: refs/heads/master@{#35400}

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

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

Cr-Commit-Position: refs/heads/master@{#35401}
2016-04-12 07:49:19 +00:00
gdeepti
297932a302 [compiler] Add relocatable pointer constants for wasm memory references.
Add relocatable pointers for wasm memory references that need to be updated when wasm GrowMemory is used. Code generator changes to accept relocatable constants as immediates.

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

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

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

Cr-Commit-Position: refs/heads/master@{#35400}
2016-04-11 22:35:04 +00:00
hablich
b88d048adf Reland of [compiler] Make feedback vector cope with flag changes. (patchset #1 id:1 of https://codereview.chromium.org/1876103002/ )
Reason for revert:
Did not fail on another roll including this CL ..

Original issue's description:
> Revert of [compiler] Make feedback vector cope with flag changes. (patchset #1 id:1 of https://codereview.chromium.org/1869693003/ )
>
> Reason for revert:
> Blocks current roll: https://codereview.chromium.org/1876713002/ according to bisect: https://codereview.chromium.org/1872353002/#ps80001
>
> Original issue's description:
> > [compiler] Make feedback vector cope with flag changes.
> >
> > This fixes corner cases where the layout of feedback vectors baked into
> > the snapshot is different from the expected layout, depending on some
> > runtime flags. We make sure the feedback vector is regenereated for
> > functions that are not compiled. Flag changes of this kind are only
> > allowed when code is not serialized.
> >
> > An alternative solution would be to not serialize the feedback vector
> > for such cases in the first place. That solution however would have a
> > higher overhead, as it would required the serializer to be able to
> > recognize feedback vectors while generating a snapshot.
> >
> > R=mvstanton@chromium.org
> > TEST=mjsunit/regress/regress-crbug-600995
> > BUG=chromium:600995
> > LOG=n
> >
> > Committed: https://crrev.com/460bff5fb6af2bd79e610f89afdf6da9dba3cf0c
> > Cr-Commit-Position: refs/heads/master@{#35339}
>
> TBR=mvstanton@chromium.org,mstarzinger@chromium.org
>
> BUG=chromium:600995
> LOG=N
> NOTRY=true
>
> Committed: https://crrev.com/78049e9c4837f053575d6c71e53ae12fec99f1aa
> Cr-Commit-Position: refs/heads/master@{#35392}

TBR=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=chromium:600995

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

Cr-Commit-Position: refs/heads/master@{#35398}
2016-04-11 18:56:37 +00:00
machenbach
df826bf50f Revert of Fix printf formats (patchset #4 id:60001 of https://codereview.chromium.org/1877453002/ )
Reason for revert:
Breaks gc mole:
https://build.chromium.org/p/client.v8/builders/V8%20Linux/builds/9421

Original issue's description:
> Fix printf formats
>
> The usage of __attribute__((format(x, y)) was either wrong or missing from multiple functions, leading to erroneous formats. This CL:
>
>  - Imports PRINTF_FORMAT macro from Chrome's src/base/compiler-specific.h.
>  - Uses it appropriately.
>  - Imports Chrome's base/format_macros.h mainly to fix size_t formats (further cleanup could be done).
>  - Fixes a bunch of incorrect formats.
>
> Original CL: https://codereview.chromium.org/1869433004
> Reverted in: https://codereview.chromium.org/1867383002
>
> R= jochen@chromium.org
> TBR= bmeurer@chromium.org, yangguo@chromium.org, ahaas@chromium.org
>
> Committed: https://crrev.com/bf505329288e1b75bab0e6800371a9aac40fa5cc
> Cr-Commit-Position: refs/heads/master@{#35394}

TBR=jochen@chromium.org,ahaas@chromium.org,bmeurer@chromium.org,yangguo@chromium.org,jfb@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/1877823003

Cr-Commit-Position: refs/heads/master@{#35396}
2016-04-11 17:30:18 +00:00
mvstanton
9336f4cc6d Visit the Optimized Code Map on first call rather than closure creation.
This is useful for escape analysis, and helps upcoming changes to
type feedback gathering.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#35395}
2016-04-11 17:28:20 +00:00
jfb
bf50532928 Fix printf formats
The usage of __attribute__((format(x, y)) was either wrong or missing from multiple functions, leading to erroneous formats. This CL:

 - Imports PRINTF_FORMAT macro from Chrome's src/base/compiler-specific.h.
 - Uses it appropriately.
 - Imports Chrome's base/format_macros.h mainly to fix size_t formats (further cleanup could be done).
 - Fixes a bunch of incorrect formats.

Original CL: https://codereview.chromium.org/1869433004
Reverted in: https://codereview.chromium.org/1867383002

R= jochen@chromium.org
TBR= bmeurer@chromium.org, yangguo@chromium.org, ahaas@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35394}
2016-04-11 16:27:54 +00:00
hablich
78049e9c48 Revert of [compiler] Make feedback vector cope with flag changes. (patchset #1 id:1 of https://codereview.chromium.org/1869693003/ )
Reason for revert:
Blocks current roll: https://codereview.chromium.org/1876713002/ according to bisect: https://codereview.chromium.org/1872353002/#ps80001

Original issue's description:
> [compiler] Make feedback vector cope with flag changes.
>
> This fixes corner cases where the layout of feedback vectors baked into
> the snapshot is different from the expected layout, depending on some
> runtime flags. We make sure the feedback vector is regenereated for
> functions that are not compiled. Flag changes of this kind are only
> allowed when code is not serialized.
>
> An alternative solution would be to not serialize the feedback vector
> for such cases in the first place. That solution however would have a
> higher overhead, as it would required the serializer to be able to
> recognize feedback vectors while generating a snapshot.
>
> R=mvstanton@chromium.org
> TEST=mjsunit/regress/regress-crbug-600995
> BUG=chromium:600995
> LOG=n
>
> Committed: https://crrev.com/460bff5fb6af2bd79e610f89afdf6da9dba3cf0c
> Cr-Commit-Position: refs/heads/master@{#35339}

TBR=mvstanton@chromium.org,mstarzinger@chromium.org

BUG=chromium:600995
LOG=N
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#35392}
2016-04-11 15:36:30 +00:00
bmeurer
086bc49894 [turbofan] Remove support for --turbo-types.
We had exactly one test case for --noturbo-types, so it's likely that
the generic pipeline (without types) was already broken for quite some
time, plus no one expressed interest in maintaining it, plus it
complicates the JSGenericLowering integration. So decision is to kill
it.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35387}
2016-04-11 12:57:28 +00:00
ishell
26c480d13c [deoptimizer] Extend assert to also expect kTailCallerFunction as bottommost frame when accessing arguments for inlined function.
BUG=chromium:601617, v8:4698
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35385}
2016-04-11 12:20:37 +00:00
mythria
8982cb5c70 [Interpreter] Handles legacy constants in strict mode.
Function bindings are the only variables in LEGACY_CONST mode.
(https://codereview.chromium.org/1819123002/). Since these variables
can also be accessed in strict mode functions we should support
handling such variables. Assigning to a legacy constant throws
a TypeError in strict mode. Also fixes hydrogen.cc to throw a
TypeError for legacy constants.

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

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

Cr-Commit-Position: refs/heads/master@{#35383}
2016-04-11 12:04:01 +00:00
cbruni
a6fd69ac29 [elements] Add more tests to increase coverage
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35371}
2016-04-11 08:28:18 +00:00
Ilija.Pavlovic
0b479e4e81 MIPS: Enable big endian testing.
Enabled big endian testing for MIPS32 and MIPS64. The tests are also
adapted for big endian variant.

TEST=cctest/test-assembler-mips[64]
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35369}
2016-04-11 06:36:42 +00:00
jfb
4c4fdc2d63 Revert of Fix printf formats (patchset #8 id:140001 of https://codereview.chromium.org/1869433004/ )
Reason for revert:
One small issue easily fixed here: https://codereview.chromium.org/1867333003/

But it looks like MSVS 2013 doesn't like some of the formats and exists with the unhelpful:
Stderr:
f:\dd\vctools\crt\crtw32\stdio\output.c(1125) : Assertion failed: ("Incorrect
format specifier", 0)

It's easier to revert for now, I'll dig more into the docs:
https://msdn.microsoft.com/en-us/library/56e442dc(v=vs.120).aspx
https://msdn.microsoft.com/en-us/library/tcxf1dw6(v=vs.120).aspx

And then resubmit, making sure I run these bots.

Original issue's description:
> Fix printf formats
>
> The usage of __attribute__((format(x, y)) was either wrong or missing from multiple functions, leading to erroneous formats. This CL:
>
>  - Imports PRINTF_FORMAT macro from Chrome's src/base/compiler-specific.h.
>  - Uses it appropriately.
>  - Imports Chrome's base/format_macros.h mainly to fix size_t formats (further cleanup could be done).
>  - Fixes a bunch of incorrect formats.
>
> R= jochen@chromium.org, bmeurer@chromium.org, yangguo@chromium.org, ahaas@chromium.org
>
> Committed: https://crrev.com/6ebf9fbb93d31f9be41156a3325d58704ed4933d
> Cr-Commit-Position: refs/heads/master@{#35365}

TBR=jochen@chromium.org,bmeurer@chromium.org,yangguo@chromium.org,ahaas@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/1867383002

Cr-Commit-Position: refs/heads/master@{#35366}
2016-04-08 18:05:12 +00:00
jfb
6ebf9fbb93 Fix printf formats
The usage of __attribute__((format(x, y)) was either wrong or missing from multiple functions, leading to erroneous formats. This CL:

 - Imports PRINTF_FORMAT macro from Chrome's src/base/compiler-specific.h.
 - Uses it appropriately.
 - Imports Chrome's base/format_macros.h mainly to fix size_t formats (further cleanup could be done).
 - Fixes a bunch of incorrect formats.

R= jochen@chromium.org, bmeurer@chromium.org, yangguo@chromium.org, ahaas@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35365}
2016-04-08 15:31:15 +00:00
machenbach
9fd74adaf6 S390: Skip slow test.
TBR=jyan@ca.ibm.com
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#35361}
2016-04-08 14:15:44 +00:00
mstarzinger
1407c89427 [parser] Remove ParseInfo::closure field.
The parser should never need to look at the underlying closure object,
hence the field can be moved from ParseInfo into CompilationInfo.

R=rossberg@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35358}
2016-04-08 12:32:23 +00:00
ahaas
f7aa8cc70e [x64] Load int32 constants with movl instead of movq to avoid sign extension.
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35352}
2016-04-08 11:46:44 +00:00
balazs.kilvady
65eb0f6b33 MIPS: [turbofan] Add AddInt + WordShl tests to machops cctest file.
AddInt + WordShl cases can be optimized on MIPS and this CL contains
tests for those special cases. These test also must be passed on other
architectures.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#35349}
2016-04-08 09:57:01 +00:00
jarin
03975befe3 [turbofan] Remove some clever-but-wrong bits from select lowering.
BUG=chromium:600593
LOG=n
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35347}
2016-04-08 08:26:13 +00:00
cbruni
ad1784e5c6 [elements] revert overzealous optimzation for fast sloppy arguments delete
BUG=chromium:601390
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35345}
2016-04-08 08:02:47 +00:00
yangguo
e39ba01420 [regexp] extend \p syntax to binary and enumerated properties.
Also make the syntax a bit less complicated and speculative.

R=littledan@chromium.org
BUG=v8:4743
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35344}
2016-04-08 05:39:43 +00:00
adamk
a0a8ecd078 Remove runtime flags for sloppy mode block scoping features
These were all on by default in M49 without complaint.

R=littledan@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35342}
2016-04-08 00:30:20 +00:00
mstarzinger
460bff5fb6 [compiler] Make feedback vector cope with flag changes.
This fixes corner cases where the layout of feedback vectors baked into
the snapshot is different from the expected layout, depending on some
runtime flags. We make sure the feedback vector is regenereated for
functions that are not compiled. Flag changes of this kind are only
allowed when code is not serialized.

An alternative solution would be to not serialize the feedback vector
for such cases in the first place. That solution however would have a
higher overhead, as it would required the serializer to be able to
recognize feedback vectors while generating a snapshot.

R=mvstanton@chromium.org
TEST=mjsunit/regress/regress-crbug-600995
BUG=chromium:600995
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35339}
2016-04-07 15:35:03 +00:00
mike
9acbca1845 [es6] Fix bug in pattern re-writing
As originally implemented, a SingleNameBinding within a BindingPattern
was incorrectly interpreted as an assignment if an initializer was
present and that initializer was itself an AssignmentExpresion.
For example:

    let x;
    { let [x = y = 1] = []; }
    print(x); // expected: undefined, actual: 1

Extend the heuristic that detects the "context" of a destructuring
pattern to account for AssignmentExpressions within SingleNameBindings.

BUG=v8:4891
LOG=N
R=adamk@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35334}
2016-04-07 13:26:54 +00:00
cbruni
9478356ed3 Fix representation issue in FastArrayPushStub
Pushing undefined onto a FAST_DOUBLE_ARRAY does not enforce the right representation checks.

BUG=chromuim:599089
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35332}
2016-04-07 12:46:08 +00:00
mvstanton
ce1fe78d7e Bugfix: assert in lithium compile for LMaybeGrowElements
BUG=chromium:585041
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35331}
2016-04-07 11:41:39 +00:00
machenbach
2e9fc9373b [test] Skip flaky test on linux.
BUG=v8:4894
NOTRY=true
LOG=n
TBR=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35325}
2016-04-07 08:42:44 +00:00
clemensh
b4edd2f658 Allow to pass a user message to assert functions
Nothing too important, but it helps localizing the cause of an error
much faster.
By the way, I also changed the output for assertThrows and
assertDoesNotThrow a bit.
All new arguments are optional, so everything is backwards compatible.

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

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

Cr-Commit-Position: refs/heads/master@{#35322}
2016-04-07 08:16:04 +00:00
machenbach
ecb458440c [test] Skip flaky test on windows.
Crashes flakily with stressopt/alwaysopt.

BUG=v8:4893
LOG=n
TBR=yangguo@chromium.org
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#35321}
2016-04-07 08:14:02 +00:00
ivica.bogosavljevic
d4403b172f MIPS: Add tests for AddBranchOvf and SubBranchOvf macro instructions.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35320}
2016-04-07 07:16:29 +00:00
jarin
3df0a8c1f2 [crankshaft] Make infinite loops preserve control flow.
We have to preserve control flow so that the liveness analysis is less
confused. This CL fixes loops to preserve teh original control flow.

BUG=chromium:599710
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35318}
2016-04-07 05:36:44 +00:00
marija.antic
4b86e6e321 MIPS: [wasm] Lowering of Int64Shl, Int64Shr, Int64Sar, Int64Add and Int64Sub.
Implementation of turbofan operators Word32PairShl, Word32PairShr,
Word32PairSar, Int32AddPair and Int32SubPair for MIPS.

Port of:
https://codereview.chromium.org/1765973002/
https://codereview.chromium.org/1778893004/
https://codereview.chromium.org/1778493004/
https://codereview.chromium.org/1778893005/
https://codereview.chromium.org/1842013002/

Added tests for Word32PairShr and Word32PairSar in test-run-machops.cc.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#35307}
2016-04-06 14:45:30 +00:00
mattloring
3184aff964 Eliminate zero count allocations from profile
If no objects allocated at a location are live when a profile is
collected we report a zero count sample. This is confusing to those
looking at the profiles and will leak memory.

We now delete allocations once the number of sampled live objects for
that location reaches zero.

R=ofrobots@google.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35305}
2016-04-06 14:23:02 +00:00
cbruni
ca5b896fab [elements] cleaning up string wrapper elements kind and adding tests
drive-by-fix: unify template parameters

BUG=chromium:586068
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35302}
2016-04-06 13:38:34 +00:00
verwaest
911a5768dc Simplify IC interfaces
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35301}
2016-04-06 13:38:33 +00:00
cbruni
604f5be5f7 [elements] add fast-path for slice with FastSloppyArguments
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35300}
2016-04-06 13:30:08 +00:00
hpayer
d16c3825fb [heap] Old generation limit is based on capacity.
BUG=chromium:600258
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35296}
2016-04-06 11:53:10 +00:00
bmeurer
318d9f52fd [test] Fix windows nosnap test expectations.
Now that we pass all these tests, we need to update the test
expectations.

TBR=machenbach@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35295}
2016-04-06 11:40:17 +00:00
mlippautz
6a5e24b29b Move MemoryAllocator and CodeRange into Heap
- MemoryAllocator is now part of Heap
- CodeRange is now part of MemoryAllocator

BUG=chromium:581076
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35294}
2016-04-06 11:40:16 +00:00
clemensh
0845448672 Prepare StackFrame hierarchy & iterators for WASM
This particularly changes the StackTraceFrameIterator such that is not
only returs JavaScriptFrames, but also WasmFrames. Because of that,
some methods (Summarize, function, receiver) were pulled up to the
StandardFrame, with specializations in JavaScriptFrame and WasmFrame.

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

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

Cr-Commit-Position: refs/heads/master@{#35293}
2016-04-06 11:38:20 +00:00
jacob.bramley
141324cfdc [arm] Implement Float(32|64)(Min|Max) using vsel.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35292}
2016-04-06 10:17:57 +00:00
ahaas
a7d3e24fd6 [wasm] Refactoring of wasm-external-refs.
1) I moved the implementations of the wrapper functions into a new cc
file so that I can use these wrapper functions in tests.

2) I made a generic test for all tests in
test-run-calls-to-external-references.cc. In the new test we only
compare the result of a function call through an external reference with
the result of a direct function call. This is sufficient because we only
want to test function calls through external references work here.
The implementation of these functions are tested somewhere else.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35289}
2016-04-06 09:26:05 +00:00
titzer
e00a0c621c [wasm] Local decl parsing tweak.
R=ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35286}
2016-04-06 08:57:50 +00:00
bmeurer
974721c661 [generators] Decouple generator resume from fullcodegen.
Introduce a ResumeGeneratorTrampoline, which does the actual stack state
reconstruction (currently always restores a fullcodegen frame), and
introduce appropriate TurboFan builtins for %GeneratorPrototype%.next,
%GeneratorPrototype%.return and %GeneratorPrototype%.throw based on
this native builtin.

Also unify the flooding in case of step-in to always work based on
JSFunction and remove the special casing for JSGeneratorObject.

R=mstarzinger@chromium.org, neis@chromium.org
TBR=rossberg@chromium.org
BUG=chromium:513471
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35283}
2016-04-06 08:39:24 +00:00
ishell
03953f52bd Convert receiver when calling an Api accessor.
BUG=chromium:590071
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35282}
2016-04-06 08:02:24 +00:00
oth
7f3442133e [interpreter] Add accumulator use description to bytecodes.
Anotates bytecodes with a description of how each uses the accumulator.

Validates annotations and uses of accumulator when generating bytecode
handlers.

Only prints the accumulator during tracing where used.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35281}
2016-04-06 07:57:56 +00:00
adamk
9bfad834d3 Ship --harmony-regexp-exec
The Chrome Extensions code that was broken by this change the first time
it landed has been amended to deal appropriately with the ES2015
semantics in https://codereview.chromium.org/1864733002/.

BUG=v8:4602
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#35279}
2016-04-05 22:50:42 +00:00
hablich
dc39c194d4 [Ignition] Skip timing out WASM tests
BUG=v8:4680
LOG=N
TBR=mstarzinger@chromium.org,rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35278}
2016-04-05 21:56:15 +00:00
caitpotter88
f60048c556 [destructuring] don't attempt to visit contents of FunctionLiterals
The parser eagerly rewrites destructuring assignments occuring
in formal parameter initializers, because not doing so would
cause the BindingPattern rewriting to be confused and do the
wrong thing.

This change prevents this rewriting from descending into the
bodies of lazily parsed functions.

In general, it's a mistake to descend into the bodies of function
literals anyways, since they are rewritten separately on their
own time, so there is no distinction made between lazily
"throw away" eagerly parsed functions in the temporary parser
arena, or "real" eagerly parsed functions that will be compiled.

BUG=chromium:594084, v8:811
LOG=N
R=adamk@chromium.org, littledan@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35277}
2016-04-05 18:43:17 +00:00
kozyatinskiy
725672512a [V8] Removed debugger V8::PromiseEvent
We decided to remove related devtools experiment.

BUG=chromium:526811
LOG=Y
R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35275}
2016-04-05 18:13:02 +00:00
titzer
77a8c2ea86 [asm.js] Fix typing bug for non-literals in heap access.
R=bradnelson@chromium.org
BUG=chromium:599825
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#35273}
2016-04-05 17:24:03 +00:00
titzer
6dda75f23b [wasm] Refactor decoding of local declarations and make more robust.
R=ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35272}
2016-04-05 17:16:30 +00:00
littledan
7a38462e8b Ensure CreateDataProperty works correctly on TypedArrays
Previously, CreateDataProperty would fail a DCHECK when used to create
an integer indexed property on a TypedArray. This patch makes it throw
a TypeError instead. The issue came up when Array.prototype.concat
was repaired to use CreateDataProperty rather than SetElement; concat
can be tricked into making a new TypedArray if it is given an Array
whose prototype is a TypedArray. This patch prevents the issue.

R=adamk
LOG=Y
BUG=chromium:596394

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

Cr-Commit-Position: refs/heads/master@{#35271}
2016-04-05 16:56:12 +00:00
cbruni
823224f3ee [elements] Fix length bounds precheck for Array.prototype.concat
BUG=chromium:599414
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35269}
2016-04-05 15:35:27 +00:00
ssanfilippo
9e39a9fff1 Remove snapshot log parsing and option from tools.
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35268}
2016-04-05 15:31:32 +00:00
mstarzinger
0ce296f180 [interpreter] Rely on SharedFunctionInfo in UseIgnition.
This makes sure the SharedFunctionInfo is available whenever we evaluate
the UseIgnition predicate. This makes sure we can apply filters properly
even when the interpreter causes eager compilation (instead of lazy).

R=rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35263}
2016-04-05 14:08:00 +00:00
jyan
99eea1e109 Disable Bytecodes.DecodeBytecodeAndOperands for big-endian.
Because the operands in this test are encoded in little endian format.
Therefore, their bytes are all swapped when reading them on big endian machine.

R=mbrandy@us.ibm.com,joransiu@ca.ibm.com,titzer@chromium.org,machenbach@chromium.org,bradnelson@chromium.org,ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35262}
2016-04-05 13:27:18 +00:00
mlippautz
3f92137209 [heap] Non-contiguous young generation
This change removes the large contiguous backing store from the young generation
and replaces it regular pages.

We keep a pool of pages that are committed/uncommitted to avoid creating virtual
memory maps during growing and shrinking.

BUG=chromium:581412
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35261}
2016-04-05 13:12:30 +00:00
machenbach
cf951dfb37 Revert of Correctly annotate eval origin. (patchset #4 id:60001 of https://codereview.chromium.org/1854713002/ )
Reason for revert:
[Sheriff] Crashes a layout test:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/5855

Original issue's description:
> Correctly annotate eval origin.
>
> There were a couple of issues with it:
> - interpreter is not supported
> - the source position was just accidentally correct for full-codegen
> - the eval origin could have been cached
>
> Also fixes a few other places to use AbstractCode.
>
> R=mstarzinger@chromium.org
>
> Committed: https://crrev.com/2f3a171adc9e620c2235bf0562145b9d4eaba66d
> Cr-Commit-Position: refs/heads/master@{#35257}

TBR=mstarzinger@chromium.org,yangguo@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/1858773004

Cr-Commit-Position: refs/heads/master@{#35260}
2016-04-05 13:01:17 +00:00
jarin
4142bc6bc1 [turbofan] Restrict types in load elimination.
In simplified numbering, we make sanity checks based on types (e.g.,
NumberSubtract should take numbers as inputs), but this can be
violated if optimization passes make types less precise.

In this CL, we fix load elimination to make sure that types are
smaller in the store -> load elimination by taking an intersection
of the load's type with the store value's type and inserting a guard
with that type. Note that the load type comes from type feedback, so
it can be disjoint from the stored value type (in that case, this
must be dead code because the map chack for the load should prevent
us from using the stored value).

BUG=chromium:599412
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35259}
2016-04-05 12:30:14 +00:00
yangguo
2e191cee8a [debugger] ScopeIterator should unwrap debug-evaluate contexts.
If we use ScopeIterator inside a debug-evaluate call, we may iterate
over a debug-evaluate context that we created for the debug-evaluate
call. This may trigger assertions.

The solution is to have the ScopeIterator hide debug-evaluate contexts
by unwrapping it if it comes across any.

R=cbruni@chromium.org
BUG=chromium:599662
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35258}
2016-04-05 12:08:19 +00:00
yangguo
2f3a171adc Correctly annotate eval origin.
There were a couple of issues with it:
- interpreter is not supported
- the source position was just accidentally correct for full-codegen
- the eval origin could have been cached

Also fixes a few other places to use AbstractCode.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35257}
2016-04-05 11:31:44 +00:00
cbruni
47e0a39246 Setting Symbol.length to 0 according to the spec
BUG=v8:4882
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35255}
2016-04-05 10:57:47 +00:00
ishell
792bf2a093 [crankshaft] Fix environment handling after leaving inlined tail call.
BUG=chromium:537444, v8:4698
LOG=N
TBR=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35253}
2016-04-05 09:43:56 +00:00
yangguo
1354b1bf37 [interpreter] statement position always overwrites earlier positions.
If a statement or expression does not produce any bytecode, it's position
should always be overwritten by a following statement position.

R=mstarzinger@chromium.org, vogelheim@chromium.org
BUG=v8:4680
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35252}
2016-04-05 09:14:19 +00:00
neis
4edf16ddd9 Fix treatment of rest pattern in array destructuring.
When seeing a rest pattern, we used to get the remaining elements from the
iterator by calling %concat_iterable_to_array on it.  This was wrong because it
caused an observable [[Get]] for @@iterator (which the iterator may not even
provide).

This CL gets rid of the call to %concat_iterable_to_array and does the iteration
manually in a simple while-loop.  It also gets rid of %concat_iterable_to_array
itself because there aren't any other uses of it.

BUG=v8:4759
LOG=n
R=adamk@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35251}
2016-04-05 08:56:51 +00:00
bmeurer
e5724d958b [frames] Also properly deal with TF builtins in OptimizedFrame::GetFunctions().
This was missing from the previous fix.

R=ishell@chromium.org
BUG=chromium:599714
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35249}
2016-04-05 06:41:20 +00:00
titzer
45d75bca5c [turbofan] Handle dead diamonds in scheduling and add a test.
The background here is that graphs generated from WASM are not trimmed.
That means there can be some floating control diamonds that are not
reachable from end. An assertion in the scheduler for phis from floating
diamonds checks that the use edge in this situation is the control edge,
but in general, any edge could cause this.

Scheduling still works without this assertion. The longer term fix
is to either trim the graphs (more compile time overhead for WASM)
or improve the scheduler's handling of dead code in the graph. Currently
it does not schedule dead code but the potential use positions of
dead code are used in the computation of the common dominator of uses. We could
recognize dead nodes in PrepareUses() and check in GetBlockForUse()
as per TODO.

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

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

Cr-Commit-Position: refs/heads/master@{#35245}
2016-04-04 17:45:59 +00:00
hablich
ba18967453 Revert of [Ignition] Skip failing tests (patchset #1 id:1 of https://codereview.chromium.org/1852263002/ )
Reason for revert:
Already fixed

Original issue's description:
> [Ignition] Skip failing tests
>
> BUG=v8:4680
> LOG=N
> TBR=machenbach@chromium.org,rmcilroy@chromium.org,mstarzinger@chromium.org
>
> Committed: https://crrev.com/2b46892be60b025dcba7513be749f504046055ef
> Cr-Commit-Position: refs/heads/master@{#35241}

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

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

Cr-Commit-Position: refs/heads/master@{#35242}
2016-04-04 16:06:19 +00:00
hablich
2b46892be6 [Ignition] Skip failing tests
BUG=v8:4680
LOG=N
TBR=machenbach@chromium.org,rmcilroy@chromium.org,mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35241}
2016-04-04 16:02:30 +00:00
mstarzinger
54e336885b [interpreter] Skip failing generator regression test.
TBR=rmcilroy@chromium.org,machenbach@chromium.org
TEST=mjsunit/regress/regress-crbug-513471
BUG=chromium:513471
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35240}
2016-04-04 14:47:40 +00:00
hpayer
3dc43a7550 [heap] Remove unused step_size_in_bytes in AdvanceIncrementalMarking.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35238}
2016-04-04 13:01:45 +00:00
ivica.bogosavljevic
114c109a32 MIPS: Fix Run_Wasm_F32CopySign.
Run_Wasm_F32CopySign was failing because function copysign
that is used to verify the results does implicit conversion
from float to double. In this conversion we lose information
about NaN sign and the test fails.

Fix by using copysignf to avoid unnecessary float to double
conversion.

TEST=cctest/test-run-wasm/Run_Wasm_F32CopySign
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35237}
2016-04-04 12:59:35 +00:00
yangguo
f7e7ba1125 [interpreter] add some expression positions.
Statement positions should overwrite expression positions if they
have the same bytecode offset.

R=mstarzinger@chromium.org, vogelheim@chromium.org
BUG=v8:4680,v8:4689
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35236}
2016-04-04 12:37:48 +00:00
mstarzinger
6ab9c1850f Fix resuming generator marked for optimization.
This fixes a corner case where the generator function of a suspended
generator has been marked for optimization. We assume the optimization
approach will cause a bailout because generators are not optimized. But
resuming is more resilient by always activating the unoptimized code.

R=neis@chromium.org,bmeurer@chromium.org
TEST=mjsunit/regress/regress-crbug-513471
BUG=chromium:513471
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35234}
2016-04-04 11:52:09 +00:00
ishell
4598356f17 Properly complete in-object slack tracking.
BUG=chromium:599003
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35232}
2016-04-04 10:00:44 +00:00
yangguo
3d4f85ab9f [debugger] fix step-next for tail calls.
R=ishell@chromium.org
BUG=v8:4698
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35230}
2016-04-04 09:40:32 +00:00
ishell
c7ff5766cf Display a meaningfull error message when trying to capture a stack trace to a proxy.
... instead of RUNTIME_ASSERT pointing to V8 guts.

BUG=chromium:599067
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35227}
2016-04-04 08:37:30 +00:00
neis
f70b3d3b2c Preserve exception message in iterator finalization.
The parser uses a try-catch in order to record when the client of an iterator
throws.  The exception then used to get rethrown via 'throw', which
unfortunately resulted in the original exception message object getting
overwritten.

This CL solves this as follows:
- add a clear_pending_message flag to TryCatchStatement (set to true in normal
  cases),
- set clear_pending_message to false for the TryCatchStatement used in iterator
  finalization
- change full-codegen, turbofan, and the interpreter to emit the ClearPendingMessage call
  only when the flag is set,
- replace 'throw' with '%ReThrow' in the iterator finalization code, thus
  reusing the (not-cleared) pending message

R=littledan@chromium.org, mstarzinger@chromium.org, yangguo@chromium.org
BUG=v8:4875
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35226}
2016-04-04 08:15:25 +00:00
littledan
277f5bd0a3 Further ES2015 RegExp spec compliance fixes
- RegExp.prototype.toString() doesn't have any special handling of
  RegExp instances and simply calls the source and flags getters
- Use the original values of global and sticky, rather than based
  on the current flag getters, as specified in
  https://github.com/tc39/ecma262/pull/494

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

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

Cr-Commit-Position: refs/heads/master@{#35225}
2016-04-04 07:06:18 +00:00
bmeurer
eaa92feb9a [builtins] Migrate Math.clz32 to a TurboFan builtin.
This allows us to remove the troublesome %_MathClz32 intrinsic and also
allows us to utilize the functionality that is already available in
TurboFan. Also introduce a proper NumberClz32 operator so we don't need
to introduce a machine operator at the JS level.

R=epertoso@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35208}
2016-04-01 14:36:32 +00:00
mythria
8a9ada4863 [Interpreter] Handles BytecodeArrays when scanning objects in heap.
Handles bytecodeArray Objects when verifying the heap and also when
collecting code statistics. The changes include:
1. BytecodeArrays could be a part of the large object space. When
verifying the large object space we should also allow BytecodeArray
objects.
2. Adds support for BytecodeArrays when collecting code statistics.

BUG=v8:4280,chromium:599001
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35202}
2016-04-01 13:14:33 +00:00
oth
0c32e98eab [interpreter] A few code coverage improvements.
Improves code coverage of bytecode array builder and constant
array builder.

Fixes initial index for constant pool slice for kQuad operands.

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

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

Cr-Commit-Position: refs/heads/master@{#35201}
2016-04-01 12:09:10 +00:00
hablich
701911f9a0 Revert of Ship --harmony-regexp-exec (patchset #3 id:40001 of https://codereview.chromium.org/1847103002/ )
Reason for revert:
breaks some chromium browser_tests: https://codereview.chromium.org/1848233002/

Original issue's description:
> Ship --harmony-regexp-exec
>
> There are still spec compliance fixes to be made, but this patch
> turns the flag to shipping to make sure we get more canary coverage
> and performance data from the bots.
>
> BUG=v8:4602
> LOG=y
>
> Committed: https://crrev.com/84492bb66b340f4e0df36758e98fddbb10b5d1dc
> Cr-Commit-Position: refs/heads/master@{#35181}

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

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

Cr-Commit-Position: refs/heads/master@{#35198}
2016-04-01 10:48:20 +00:00
jochen
cb7aa79b12 Expose a lower bound of malloc'd memory via heap statistics
We expect that the majority of malloc'd memory held by V8 is allocated
in Zone objects. Introduce an Allocator class that is used by Zones to
manage memory, and allows for querying the current usage.

BUG=none
R=titzer@chromium.org,bmeurer@chromium.org,jarin@chromium.org
LOG=n
TBR=rossberg@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35196}
2016-04-01 10:01:56 +00:00
ahaas
3ffee875ef Fixed rotate left on windows.
R=titzer@chromium.org, bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35195}
2016-04-01 09:52:13 +00:00
yangguo
3a2174c89e [debugger] add test case for stepping out from tail calls.
R=ishell@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35193}
2016-04-01 09:42:43 +00:00
ishell
ecb8fcfcca [crankshaft] [turbofan] Fix environment handling when generating a tail call from inlined function.
This CL ensures that we build environments/frame states so that tail caller frame will never become topmost.

BUG=chromium:598998, v8:4698
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35188}
2016-04-01 07:22:47 +00:00
bmeurer
6df9a22c3f [ic] Use the CallFunction builtin to invoke accessors.
The HandlerCompiler did not properly handle the weird edge case when a
sloppy mode function was installed as an accessor on one of the value
wrapper prototypes and then accessed via a load from a primitive value.
In this case we just passed the primitive value untouched instead of
properly wrapping it first. The CallFunction builtin properly deals with
all the funny edge cases, so we use it instead of duplicating almost all
of the logic here (the performance difference is neglible).

R=verwaest@chromium.org
BUG=chromium:599073, v8:4413
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35187}
2016-04-01 06:37:57 +00:00
yangguo
2069ab2202 Revert of [compiler] Add relocatable pointer constants for wasm memory references. (patchset #14 id:300001 of https://codereview.chromium.org/1759383003/ )
Reason for revert:
Test failures: https://build.chromium.org/p/client.v8/builders/V8%20Mac64/builds/8046

Original issue's description:
> [compiler] Add relocatable pointer constants for wasm memory references.
>
> Add relocatable pointers for wasm memory references that need to be updated when wasm GrowMemory is used. Code generator changes to accept relocatable constants as immediates.
>
> R=titzer@chromium.org, yangguo@chromium.org, bradnelson@chromium.org
>
> Committed: https://crrev.com/eb5fe0df64ec0add423b2a1f6fb62d5a33dce2a5
> Cr-Commit-Position: refs/heads/master@{#35182}

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

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

Cr-Commit-Position: refs/heads/master@{#35185}
2016-04-01 05:53:17 +00:00
gdeepti
eb5fe0df64 [compiler] Add relocatable pointer constants for wasm memory references.
Add relocatable pointers for wasm memory references that need to be updated when wasm GrowMemory is used. Code generator changes to accept relocatable constants as immediates.

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

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

Cr-Commit-Position: refs/heads/master@{#35182}
2016-04-01 00:41:35 +00:00
adamk
84492bb66b Ship --harmony-regexp-exec
There are still spec compliance fixes to be made, but this patch
turns the flag to shipping to make sure we get more canary coverage
and performance data from the bots.

BUG=v8:4602
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#35181}
2016-04-01 00:39:25 +00:00
littledan
31e806ebd1 Revert of Remove RegExp.prototype.source getter compat workaround (patchset #2 id:20001 of https://codereview.chromium.org/1837843002/ )
Reason for revert:
TC39 decided that this compatibility fix should be standardized.

Original issue's description:
> Remove RegExp.prototype.source getter compat workaround
>
> The getter RegExp.prototype.source is specified in ES2015 to throw when
> called on a non-RegExp instance, such as RegExp.prototype. We had previously
> put in a compatibility workaround for all RegExp getters to make them
> throw on access specifically with RegExp.prototype as the receiver; however,
> we only have evidence that this is needed for properties other than source.
> This patch removes the compatibility workaround for get RegExp.prototype.source
> and gives it semantics precisely as per the ES2015 specification.
>
> R=adamk
> BUG=chromium:581577,v8:4827
> LOG=Y
>
> Committed: https://crrev.com/80803aa89e31839b8f73959776fa7e1923c6b461
> Cr-Commit-Position: refs/heads/master@{#35086}

R=adamk@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=chromium:581577,v8:4827
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#35180}
2016-04-01 00:37:25 +00:00
ahaas
ac7f0e2b61 [wasm] Fixed float-to-int conversion tests.
*) For all tests the input validation was incorrect, i.e. some values
were considered invalid although they were valid. The problem was that
values which are outside int range can get in range through truncation.

*) Removed an assertion in the x64 code generation of
TruncateFloat64ToUint32 which trapped on negative inputs.

*) Introduced a new TF operator TruncateFloat32ToUint32 which does
the same as ChangeFloat32ToUint32 but does not trap on negative inputs.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35176}
2016-03-31 18:38:36 +00:00
ahaas
bd4fb28ecd [wasm] Int64Lowering of Word64Ror and Word64Rol.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35173}
2016-03-31 17:05:43 +00:00
mythria
e6b6e55453 [Interpreter] Changes GenerateDoubleToObject to push and pop rsi value.
In the earlier implementation of GenerateDoubleToObject the context
is loaded from the parent's frame. rsi is clobbered because it is used
to store kHoleNan constnat. It is not always safe to peek at
the parents frame. Bytecode handlers have TypedFrame and the type of
frame is stored at FP + 1. GenerateDoubleToObject expects context
to be store at that place. In the current implementation rsi is pushed
onto the stack and is popped when exiting this function.

BUG=v8:4280,chromium:597565
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35163}
2016-03-31 13:45:48 +00:00
oth
8cf73ae1e9 [interpreter] Adds test for tracing.
Fixes a stale DCHECK and a memory leak in tracing output.

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

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

Cr-Commit-Position: refs/heads/master@{#35161}
2016-03-31 11:58:06 +00:00
titzer
08e0ea38cd [wasm] Fix and enable more tests.
R=ahaas@chromium.org, bradnelson@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35156}
2016-03-31 09:20:21 +00:00
mlippautz
f2a585935f Remove usages of Heap::NewSpaceStart and its external reference
Replace the uses with proper page flag lookups.

BUG=chromium:581412
LOG=N
TEST=mjsunit/allocation-site-info

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

Cr-Commit-Position: refs/heads/master@{#35153}
2016-03-31 07:55:26 +00:00
machenbach
a0aac3cb1d [test] Fix deterministic test shards.
Test case objects were sorted without key function, resulting
in random sort order. On sharded builds, the shards are
determined by the sort order and rely on a deterministic
sorting. This led to random cctest and unittest cases being
dropped or executed twice on sharded testers.

TBR=jkummerow@chromium.org, hablich@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35151}
2016-03-31 07:38:22 +00:00
machenbach
7a4e13b89b [test] Skip more cpu profiler tests on windows.
BUG=v8:2999,v8:4751
LOG=n
NOTRY=true
TBR=hablich@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35149}
2016-03-31 07:24:54 +00:00
mattloring
607143d460 Gracefully handle unloaded scripts
If a script is unloaded between the collection of an allocation and the
tranlation of an allocation profile, the profiler will segfault. With
this change, we report unloaded scripts as having no line number,column
number, or name.

R=ofrobots@google.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35147}
2016-03-31 06:36:33 +00:00
yangguo
297daf6c37 [debugger] allow debug-evaluate to change stack and context values.
R=bmeurer@chromium.org, cbruni@chromium.org, ulan@chromium.org
BUG=chromium:124206,chromium:569811
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35145}
2016-03-31 06:00:21 +00:00
titzer
d167c3743d [wasm] Mask shift counts on architectures that don't implicitly mask.
R=ahaas@chromium.org,bradnelson@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35136}
2016-03-30 12:40:22 +00:00
bmeurer
8d20f2fe37 [builtins] Make Math.ceil, Math.trunc and Math.round optimizable.
Migrate Math.ceil, Math.round and Math.trunc to TurboFan code stubs,
similar to what we did with Math.floor, and make these builtins properly
optimizable in TurboFan via appropriate simplified operators NumberCeil,
NumberRound and NumberTrunc, which are intended to be reusable for
ToInteger and ToLength optimizations that will be done in a followup CL.

Also allows us to kill the funky %RoundNumber runtime function, which
was quite heavy.

Improve test coverage for Math.ceil and Math.trunc a lot, especially
making sure that we also properly trigger the TurboFan builtin reducer
case.

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

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

Cr-Commit-Position: refs/heads/master@{#35135}
2016-03-30 11:57:20 +00:00
titzer
257bdfe543 [wasm] Fix asm.js semantics for divide by zero in WASM translation.
R=ahaas@chromium.org,bradnelson@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35134}
2016-03-30 11:37:44 +00:00
ishell
037f7f6215 [api] Add a switch that controls if ES2015 tail call elimination feature is enabled or not.
BUG=v8:4698
LOG=N
TBR=rossberg@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35132}
2016-03-30 11:05:19 +00:00
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
hablich
2bb46c3cb9 [Interpreter][WASM] Skip timing out tests
Reference build:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/builds/7641

BUG=v8:4680
LOG=N
TBR=titzer@chromium.org,rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35128}
2016-03-30 08:59:24 +00:00
mythria
b82720df34 [Interpreter] Adds support to fetch return value on break at return.
Debugger fetches the return value of a function when we break at return.
Interpreter holds the return value in accumulator. This is not stored in a
specified location on stack and hence it is not possible to look it up from
stack similar to full-codegen or optimized frames. This cl adds support to
store the value of accumulator on debug breaks. The value of accumulator is
passed to the runtime function and is then stored in thread local data.

Also changes full-codegen implementation to match that of ignition.
The return value from full-codegen is also stored in thread local data.
The return value is fetched directly thread local data instead of
finding it by iterating over frames.

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

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

Cr-Commit-Position: refs/heads/master@{#35127}
2016-03-30 08:52:03 +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
yangguo
b25131a451 [debugger] add test case for stepping into tail calls.
R=ishell@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35124}
2016-03-30 05:31:10 +00:00
adamk
d0cb7cf556 Stage --harmony-regexp-exec
R=littledan@chromium.org
BUG=v8:4602
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#35120}
2016-03-29 21:50:25 +00:00
adamk
360586f2f9 Add fast paths for native RegExps in ES2015 subclass-aware code
This patch adds fast paths for @@replace and @@split that call into
the old, side-effect free (and faster) versions of those builtin
operations when possible (roughly, when the receiver is a RegExp
and the 'exec' method is untampered). Also add some micro-optimizations
that further improve performance.

Taken altogether, this takes us from a ~70% regression on the Octane
RegExp benchmark to a ~9% regression.

The test262.status lines for RegExps has been reorganized to make it
clearer the status of individual tests. More work will likely be
required to increase spec compliance before the --harmony-regexp-exec
flag is shipped; some of that work is happening on the spec side.

BUG=v8:4602
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#35118}
2016-03-29 20:42:54 +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
neis
7ed2d00bc3 [runtime] Don't call GetArrayKeys on proxies.
This fixes another bug in Array.prototype.sort (when the array is not a
JSArray and there is a proxy on the prototype chain).

R=cbruni@chromium.org
BUG=chromium:596866
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35101}
2016-03-29 12:36:04 +00:00
yangguo
4c1d670e98 [regexp, intl] Intl should not cause side effects to the RegExp object.
R=jochen@chromium.org
BUG=v8:4361
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35099}
2016-03-29 11:57:03 +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
978ad03b92 [crankshaft] Address the deoptimization loops of Math.floor, Math.round and Math.ceil.
Fix and re-enable the flexible representation for Math.floor (which is used to
implement Math.ceil) and Math.round, which allows Math.floor and Math.round to
return double results instead of int32, and therefore allows values outside
the int32 range, especially -0 is now a valid result, which doesn't deopt.

Also port this feature to x64 and ia32 when the CPU supports the SSE4.1
extension.

This addresses all the known deoptimization loops related to Math.round
in the Kraken benchmark suite, and seems to also address most of the
deoptimization loops related to Math.floor in the Oort Online benchmark.

Drive-by-fix: Import the regression tests for the broken HMathFloorOfDiv
optimization that caused the initial revert of the feature (for arm64 only
back then).

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

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

Cr-Commit-Position: refs/heads/master@{#35094}
2016-03-29 10:24:54 +00:00
littledan
80803aa89e Remove RegExp.prototype.source getter compat workaround
The getter RegExp.prototype.source is specified in ES2015 to throw when
called on a non-RegExp instance, such as RegExp.prototype. We had previously
put in a compatibility workaround for all RegExp getters to make them
throw on access specifically with RegExp.prototype as the receiver; however,
we only have evidence that this is needed for properties other than source.
This patch removes the compatibility workaround for get RegExp.prototype.source
and gives it semantics precisely as per the ES2015 specification.

R=adamk
BUG=chromium:581577,v8:4827
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#35086}
2016-03-28 20:43:02 +00:00
adamk
0fdf32556c String.prototype.{match,search} should do only one RegExp brand check
Previously, they would check for Symbol.match/Symbol.search, and then
do another check for Symbol.match in the RegExp constructor. This patch
avoids the second one by skipping the RegExp constructor, as the spec does.

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

Cr-Commit-Position: refs/heads/master@{#35085}
2016-03-28 18:53:39 +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
caitpotter88
f5b85cb74c [esnext] handle elements in FastObjectValuesOrEntries()
Add support for optimizing objects with elements, which do not invoke JS and
cannot change the shape of the Object.

BUG=v8:4663
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35081}
2016-03-28 15:54:23 +00:00
machenbach
62b9f3ce46 [Ignition] Skip failing tests on windows.
BUG=v8:4680
LOG=n
NOTRY=true
TBR=rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35079}
2016-03-26 12:47:52 +00:00
machenbach
da0e49db30 [test] Skip slow tests for deopt fuzzer.
TBR=ishell@chromium.org
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#35078}
2016-03-26 12:45:44 +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
binji
88724ec4cb [Atomics] Fix atomic access index validation
BUG=v8:4737
LOG=n
R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35074}
2016-03-25 21:52:52 +00:00