Commit Graph

35082 Commits

Author SHA1 Message Date
mstarzinger
2ab2ec2243 [turbofan] Disable bogus lowering of builtin tail-calls.
The TurboFan backends currently don't support tail-calls to CPP builtins
because the semantics of kJavaScriptCallArgCountRegister has different
semantics for stub call descriptors versus JavaScript call descriptors.
This is actually a short-coming of the backends and follow-up work will
make the backends more robust in that regard to fail hard on unsupported
constructs like that. This just disables the lowering creating such a
tail-call.

R=bmeurer@chromium.org
BUG=chromium:658691
TEST=mjsunit/regress/regress-crbug-658691

Review-Url: https://codereview.chromium.org/2447383002
Cr-Commit-Position: refs/heads/master@{#40590}
2016-10-26 12:49:06 +00:00
gsathya
87ec1673e4 [promises] Remove FulfillPromise
This patch replaces it with calls to the runtime function and PromiseSet.

This allows us to move PromiseReject to C++ without regressions.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2451133002
Cr-Commit-Position: refs/heads/master@{#40589}
2016-10-26 12:45:53 +00:00
machenbach
35e4a03f5b Revert of [heap] Uncommit marking deque in concurrent task. (patchset #7 id:120001 of https://codereview.chromium.org/2442443003/ )
Reason for revert:
Seems to break the world, e.g.:
https://build.chromium.org/p/client.v8/builders/V8%20Linux/builds/14118

Original issue's description:
> [heap] Uncommit marking deque in concurrent task.
>
> BUG=

TBR=mlippautz@chromium.org,ulan@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/2454693002
Cr-Commit-Position: refs/heads/master@{#40588}
2016-10-26 12:39:40 +00:00
cbruni
126e030e1d [tools] Filter out accidental group entries in callstats.html
R=jochen@chromium.org
NOTRY=true
BUG=

Review-Url: https://codereview.chromium.org/2452013002
Cr-Commit-Position: refs/heads/master@{#40587}
2016-10-26 12:20:29 +00:00
ahaas
1fe7a91751 [wasm] Fix memory leak in wasm-module-runner.cc
BUG=chromium:658057
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2446593002
Cr-Commit-Position: refs/heads/master@{#40586}
2016-10-26 12:08:50 +00:00
ulan
8d5acea950 [heap] Uncommit marking deque in concurrent task.
BUG=

Review-Url: https://codereview.chromium.org/2442443003
Cr-Commit-Position: refs/heads/master@{#40585}
2016-10-26 12:02:30 +00:00
neis
d5de8f0d11 Don't wrap roots in Handle just to dereference immediately.
R=adamk@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2452543003
Cr-Commit-Position: refs/heads/master@{#40584}
2016-10-26 11:22:28 +00:00
mstarzinger
20c4370ddd [turbofan] Remove dead kArchTailCallJSFunction.
The tail-call operator for invoking a JSFunction object from within stub
code has been dead for a while and untested by now. This removes support
for such a construct.

R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2452943002
Cr-Commit-Position: refs/heads/master@{#40583}
2016-10-26 11:21:40 +00:00
bmeurer
d0a047d440 Revert of [compiler] Properly validate stable map assumption for globals. (patchset #3 id:40001 of https://codereview.chromium.org/2444233004/ )
Reason for revert:
Breaks tree: http://build.chromium.org/p/client.v8/builders/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/builds/8789

Original issue's description:
> [compiler] Properly validate stable map assumption for globals.
>
> For global object property cells, we did not check that the map on the
> previous object is still the same for which we actually optimized. So
> the optimized code was not in sync with the actual state of the property
> cell. When loading from such a global object property cell, Crankshaft
> optimizes away any map checks (based on the stable map assumption),
> leading to arbitrary memory access in the worst case.
>
> TurboFan has the same bug for stores, but is safe on loads because we
> do appropriate map checks there. However mixing TurboFan and Crankshaft
> still exposes the bug.
>
> R=yangguo@chromium.org
> BUG=chromium:659475

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

Review-Url: https://codereview.chromium.org/2454513003
Cr-Commit-Position: refs/heads/master@{#40582}
2016-10-26 11:11:43 +00:00
verwaest
a16701598c Overlay next_ and value_/string_ in AstValue/AstString
BUG=

Review-Url: https://codereview.chromium.org/2449223002
Cr-Commit-Position: refs/heads/master@{#40581}
2016-10-26 09:38:31 +00:00
machenbach
fa12e775c9 [test] Remove verbose output printing on windows.
The original reason for the extra output on windows is
obsolete since a while. Now the extra output just spams
the logs and causes traffic.

BUG=chromium:485932

Review-Url: https://codereview.chromium.org/2452763003
Cr-Commit-Position: refs/heads/master@{#40580}
2016-10-26 09:32:13 +00:00
neis
f33a4078e8 [runtime] Let native setters have a return value.
Native setters (see AccessorInfo in accessors.h) didn't have the ability
to return a result value. As a consequence of this, for instance, Reflect.set
on the length property of arrays had the wrong behavior:

var y = [];
Object.defineProperty(y, 0, {value: 42, configurable: false})
Reflect.set(y, 'length', 0)

The Reflect.set call used to return true. Now it returns false as
required by the spec.

BUG=v8:5401

Review-Url: https://codereview.chromium.org/2397603003
Cr-Commit-Position: refs/heads/master@{#40579}
2016-10-26 09:00:08 +00:00
bmeurer
3aa57eb920 [compiler] Properly validate stable map assumption for globals.
For global object property cells, we did not check that the map on the
previous object is still the same for which we actually optimized. So
the optimized code was not in sync with the actual state of the property
cell. When loading from such a global object property cell, Crankshaft
optimizes away any map checks (based on the stable map assumption),
leading to arbitrary memory access in the worst case.

TurboFan has the same bug for stores, but is safe on loads because we
do appropriate map checks there. However mixing TurboFan and Crankshaft
still exposes the bug.

R=yangguo@chromium.org
BUG=chromium:659475

Review-Url: https://codereview.chromium.org/2444233004
Cr-Commit-Position: refs/heads/master@{#40578}
2016-10-26 08:55:10 +00:00
bmeurer
df981a9ff5 [crankshaft] Refactor kAllowUndefinedAsNaN to kTruncatingToNumber.
The meaning of the HValue::kAllowUndefinedAsNaN is actually ToNumber
conversion (except for the uses in HBranch and HCompareHoleAndBranch,
which were confusing and useless anyways), so fix the naming to match
that.

Also properly integrate the handling of this flag with the existing
truncation analysis that is run as part of the representation changes
phase (i.e. where we already deal with truncating to int32 and smi).

This is done in preparation of allowing Crankshaft to handle any kind
of Oddball in the ToNumber truncation, instead of just undefined for
truncation ToNumber and undefined or boolean for ToInt32. It also helps
to make Crankshaft somewhat more compatible with the (saner)
implementation in TurboFan.

R=yangguo@chromium.org
BUG=v8:5400

Review-Url: https://codereview.chromium.org/2449353002
Cr-Commit-Position: refs/heads/master@{#40577}
2016-10-26 08:04:49 +00:00
cbruni
58e0e3f635 [builtins] Fix Object.create(null) special case
Fix failing assertions in the CodeStubAssembler that cause Object.create(null,
global) fail.
Drive-by-fix: convert some Assert to CSA_ASSERT.

BUG=chromium:657692

Review-Url: https://codereview.chromium.org/2446203003
Cr-Commit-Position: refs/heads/master@{#40576}
2016-10-26 07:21:46 +00:00
cbruni
e408864d60 Remove last references to NeanderObject
All uses of NeanderObject have been replaced by FixedArrays.

BUG=

Review-Url: https://codereview.chromium.org/2447123002
Cr-Commit-Position: refs/heads/master@{#40575}
2016-10-26 07:18:24 +00:00
cbruni
f5d4f8f80f [runtime] Fix Object.create(null) initialization order
A GC might cause the just created dictionary object to have an invalid backing
store, which breaks heap verification.

BUG=chromium:659088

Review-Url: https://codereview.chromium.org/2452653002
Cr-Commit-Position: refs/heads/master@{#40574}
2016-10-26 07:17:35 +00:00
bmeurer
9f4f582bbf [builtins] Don't canonicalize results of Math double operations.
For Math builtins that likely yield double results, i.e. Math.sin,
Math.cos and friends, don't bother trying to canonicalize the result
to Smi. The rationale behind this is that other parts of V8 use the
HeapNumber representation as a hint to assume that certain values
should be represented as double (i.e. for the array elements kind
and for double field tracking). This way the chance that we make
the ideal decision early on is better.

For Math.abs we establish the contract that if the input value is a
Smi, then we try hard to return a Smi (doesn't work for minimal Smi
value), otherwise we preserve the HeapNumberness of the input.

Same for the generic Add, Subtract, Multiply, etc. code stubs.

R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2451973003
Cr-Commit-Position: refs/heads/master@{#40573}
2016-10-26 05:56:33 +00:00
aseemgarg
1f6f345db2 [wasm] fix simd opcode read and error case for bad simd opcodes
BUG=chromium:658426
R=ahaas@chromium.org,titzer@chromium.org,gdeepti@chromium.org

Review-Url: https://codereview.chromium.org/2447683004
Cr-Commit-Position: refs/heads/master@{#40572}
2016-10-25 22:03:50 +00:00
mtrofin
e645b56073 [wasm] Debug-time print for compiler graph
Simple "Print" API for the compiler graph.

BUG=

Review-Url: https://codereview.chromium.org/2447993002
Cr-Commit-Position: refs/heads/master@{#40571}
2016-10-25 18:00:18 +00:00
gsathya
d7a8caa92a [promises] move most of FulfillPromise to c++
This causes a 3.1% regression because we unconditionally call out to a
runtime function.

This patch refactors out most of EnqueuePromiseReactionJob
runtime function into a separate function.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2449053003
Cr-Commit-Position: refs/heads/master@{#40570}
2016-10-25 16:13:04 +00:00
ulan
968caeb44f Reland "[heap] Start sweeper tasks after evacuation" (second try).
This reverts commit 59fb09564a.

BUG=chromium:658718

Review-Url: https://codereview.chromium.org/2445283003
Cr-Commit-Position: refs/heads/master@{#40569}
2016-10-25 15:34:39 +00:00
georgia.kouveli
3836fc074b [arm64] Emit CBZ for deoptimisations.
Emit the compare and branch on zero (CBZ) instruction when
possible for deoptimisations, as we do for normal branches.

BUG=

Review-Url: https://codereview.chromium.org/2448113002
Cr-Commit-Position: refs/heads/master@{#40568}
2016-10-25 15:24:23 +00:00
ivica.bogosavljevic
99e845cc9f MIPS64: Port '[ARM64] Optimize load followed by shift.'
Port dc6b5109d7

BUG=

Review-Url: https://codereview.chromium.org/2437593006
Cr-Commit-Position: refs/heads/master@{#40567}
2016-10-25 14:40:54 +00:00
neis
9c558d7bd9 Reland: [modules] Add partial support for debug-scopes.
Setting variables is not yet implemented.

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

Review-Url: https://codereview.chromium.org/2445683002
Cr-Commit-Position: refs/heads/master@{#40566}
2016-10-25 14:39:29 +00:00
ishell
4da8a9c7c3 [ic] Support negative lookup on receiver in data handlers.
BUG=v8:5561

Review-Url: https://codereview.chromium.org/2446983002
Cr-Commit-Position: refs/heads/master@{#40565}
2016-10-25 14:29:47 +00:00
machenbach
de52faf948 Revert of [modules] Add partial support for debug-scopes. (patchset #1 id:1 of https://codereview.chromium.org/2445683002/ )
Reason for revert:
Breaks https://build.chromium.org/p/client.v8/builders/V8%20Mac%20GC%20Stress/builds/9349

Original issue's description:
> [modules] Add partial support for debug-scopes.
>
> Setting variables is not yet implemented..
>
> R=adamk@chromium.org
> BUG=v8:1569

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

Review-Url: https://codereview.chromium.org/2449883002
Cr-Commit-Position: refs/heads/master@{#40564}
2016-10-25 12:56:02 +00:00
leszeks
f97b28f8b9 [compiler] Put shared function marking behind a flag
This lets us investigate regressions caused by this marking while
letting others continue their work without being impacted.

BUG=v8:5512

Review-Url: https://codereview.chromium.org/2446673002
Cr-Commit-Position: refs/heads/master@{#40563}
2016-10-25 12:34:34 +00:00
gsathya
c6722aeae1 [promises] remove PromiseEnqueue
Removes PromiseEnqueue and moves debugging code to a separate
function which gets called when the debugger is active.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2450763002
Cr-Commit-Position: refs/heads/master@{#40562}
2016-10-25 12:33:13 +00:00
verwaest
9d5b307fa1 Internalize AstRawStrings by walking the string_table_ instead of adding them to a list
BUG=

Review-Url: https://codereview.chromium.org/2446993002
Cr-Commit-Position: refs/heads/master@{#40561}
2016-10-25 12:32:28 +00:00
jochen
b3bdb05f71 Add runtime callstats scopes to some internal accessors
BUG=v8:5557
R=cbruni@chromium.org

Review-Url: https://codereview.chromium.org/2448473002
Cr-Commit-Position: refs/heads/master@{#40560}
2016-10-25 12:31:05 +00:00
neis
ee2f80c6bd [modules] Add partial support for debug-scopes.
Setting variables is not yet implemented..

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

Review-Url: https://codereview.chromium.org/2445683002
Cr-Commit-Position: refs/heads/master@{#40559}
2016-10-25 12:30:15 +00:00
mstarzinger
5c57fcce0d [interpreter] Partially revert handling of --debug-code.
This is a partial revert of 438c5eb28b to avoid huge increases in
testing times due to expensive bytecode handler generation in debug
modes. The additional coverage does not warrant a 2x to 3x increase
in testing time at the moment. We can revisit this later.

TBR=rmcilroy@chromium.org
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2445403002
Cr-Commit-Position: refs/heads/master@{#40558}
2016-10-25 12:00:23 +00:00
adamk
56626f302d [ignition] Use more-targeted check for CONST-this-initialization hole check
This brings the BytecodeGenerator in line with FullCodeGenerator, now that
more requests for hole checks are flowing through BuildVariableAssignment.

BUG=chromium:658528

Review-Url: https://codereview.chromium.org/2447783002
Cr-Commit-Position: refs/heads/master@{#40557}
2016-10-25 11:08:06 +00:00
gsathya
d390e11e02 [promises] remove if kPending check
FulfillPromise is always called when a promise is in a pending state
which makes this check redundant.

Review-Url: https://codereview.chromium.org/2442373002
Cr-Commit-Position: refs/heads/master@{#40556}
2016-10-25 11:06:08 +00:00
mstarzinger
438c5eb28b [interpreter] Ensure --debug-code works with snapshots.
This makes sure that bytecode handlers are regenerated when debugging
code within handlers is being requested. We cannot use the handlers
baked into the snapshot in this case.

R=rmcilroy@chromium.org

Review-Url: https://codereview.chromium.org/2443923002
Cr-Commit-Position: refs/heads/master@{#40555}
2016-10-25 10:30:43 +00:00
titzer
ad9cf53473 [wasm] Add support for exporting WebAssembly.Table instances.
R=bradnelson@chromium.org, rossberg@chromium.org
BUG=v8:5507

Review-Url: https://codereview.chromium.org/2443353002
Cr-Commit-Position: refs/heads/master@{#40554}
2016-10-25 09:44:51 +00:00
clemensh
5452f97ede [wasm] Fix binary search for asm.js offsets
And add a test case for more than one entry ;)

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

Review-Url: https://codereview.chromium.org/2448833004
Cr-Commit-Position: refs/heads/master@{#40553}
2016-10-25 09:00:57 +00:00
clemensh
b1dec60bfa [wasm] Remove obsolete function name table
The function name table is not used any more since
https://chromiumcodereview.appspot.com/2424623002, so remove it.

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

Review-Url: https://codereview.chromium.org/2451693002
Cr-Commit-Position: refs/heads/master@{#40552}
2016-10-25 09:00:09 +00:00
cbruni
532c16eca0 [runtime] Object.create(null) creates a slow object
Object.create(null) is most likely to be used for dictionary-like objects.
Hence it would be beneficial to directly create a slow-mode object and avoid
additional overhead later-on.

BUG=

Review-Url: https://codereview.chromium.org/2430273007
Cr-Commit-Position: refs/heads/master@{#40551}
2016-10-25 08:30:50 +00:00
bmeurer
763dd402b6 [ignition] Tune code size multiplier.
The interpreter is currently too aggressive in tiering up to TurboFan,
especially for (expensive) OSR. Make it slightly less aggressive by
choosing a more realistic code size multiplier.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2448043002
Cr-Commit-Position: refs/heads/master@{#40550}
2016-10-25 08:12:52 +00:00
yangguo
baba15223c [debugger] fix stepping out of across throwing.
R=jgruber@chromium.org
BUG=v8:5559

Review-Url: https://codereview.chromium.org/2445233004
Cr-Commit-Position: refs/heads/master@{#40549}
2016-10-25 08:00:52 +00:00
verwaest
26a5f2128b Drop unused end-position from VariableProxy
BUG=

Review-Url: https://codereview.chromium.org/2445993002
Cr-Commit-Position: refs/heads/master@{#40548}
2016-10-25 07:59:29 +00:00
jgruber
77ddcfb3e0 [regexp] Remove unused code
This CL removes code that is now unused since the port of regexp.js has been
completed. Removed functions / classes are:

* regexp.js (GetSubstitution moved to string.js)
* RegExpConstructResult stub
* RegExpFlags intrinsic
* RegExpSource intrinsic
* RegExpInitializeAndCompile runtime function

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2448463002
Cr-Commit-Position: refs/heads/master@{#40547}
2016-10-25 07:19:13 +00:00
kozyatinskiy
d7a18896bd [inspector] enable inspector by default
To achieve this:
- fixed crash on windows - String16::fromInteger used "%zu" which doesn't support by VS2013 compiler, wrapped with ifdef else.
- fixed asan for d8 - unique_ptr on array has single element type.
- force Debugger.disable at the end of test.

BUG=chromium:635948
R=dgozman@chromium.org,yangguo@chromium.org,machenbach@chromium.org

Review-Url: https://codereview.chromium.org/2450653002
Cr-Commit-Position: refs/heads/master@{#40546}
2016-10-25 07:13:48 +00:00
jgruber
8f770ad9ec [regexp] Mark functions MUST_USE_RESULT
BUG=v8:5339

Review-Url: https://codereview.chromium.org/2442333002
Cr-Commit-Position: refs/heads/master@{#40545}
2016-10-25 07:09:17 +00:00
bmeurer
5a5ffc63e2 [turbofan] Reduce code size for StringFromCharCode.
Don't inline the full StringFromCharCode logic into TurboFan, but only
the common case, and use the %StringFromCharCode runtime function for
the rest, similar to what we do in HStringCharFromCode in Crankshaft.
This greatly reduces compile time for TurboFan due to greatly reduced
number of nodes. For example it reduces overall runtime of the base64
benchmark by up to 15% with the future pipeline.

R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2445273002
Cr-Commit-Position: refs/heads/master@{#40544}
2016-10-25 06:01:39 +00:00
rmcilroy
ed7bef5b91 [Interpreter] Optimize the Register Optimizer.
Modify the Bytecode Register Optimizer to be an independent component
rather than part of the BytecodePipeline. This means the BytecodeArrayBuilder
can explicitly call it with register operands when outputting a bytecode
and the Bytecode Register Optimizer doesn't need to work out which operands
are register operands. This also means we don't need to build BytecodeNodes
for Ldar / Star / Mov bytecodes unless they are actually emitted by the
optimizer.

This change also modifies the way the BytecodeArrayBuilder converts
operands to make use of the OperandTypes specified in bytecodes.h.
This avoids having to individually convert operands to their raw output
value before calling Output(...).

BUG=v8:4280

Review-Url: https://codereview.chromium.org/2393683004
Cr-Commit-Position: refs/heads/master@{#40543}
2016-10-24 20:47:53 +00:00
verwaest
caba112d03 Simplify and fix the rewriter
Now we
- always set .result to undefined before a visited loop and switch since we can't know whether they will set a value,
- only visit finally if it can break/continue; and only store/restore .result in that case

BUG=

Review-Url: https://codereview.chromium.org/2427253003
Cr-Commit-Position: refs/heads/master@{#40542}
2016-10-24 19:23:03 +00:00
rmcilroy
381b5437b2 Don't call FastNewFunctionContextStub if context is bigger than kMaxRegularHeapObjectSize.
CL https://codereview.chromium.org/2177273002 changed FastNewFunctionContextStub
to take a number of slots parameter and in-doing so removed the maximum slot
count for FastNewFunctionContextStub. This made it possible to create a
closure which is larger than kMaxRegularHeapObjectSize and so can't be
allocated by FastNewFunctionContextStub.

Reintroduce FastNewFunctionContextStub::kMaxSlots (but make the limit much
larger) to ensure we call the runtime for contexts which need to be
allocated in the LO space.

BUG=chromium:655573

Review-Url: https://codereview.chromium.org/2445703002
Cr-Commit-Position: refs/heads/master@{#40541}
2016-10-24 17:23:21 +00:00