Commit Graph

11489 Commits

Author SHA1 Message Date
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