Commit Graph

36114 Commits

Author SHA1 Message Date
yangguo
00c82cd1ba [serializer] fix hash function for hashmap used for serializing.
Yes. I thought I was being smart. And yes. It's just a one-liner.

TBR=cbruni@chromium.org
BUG=chromium:672009

Review-Url: https://codereview.chromium.org/2555213005
Cr-Commit-Position: refs/heads/master@{#41572}
2016-12-08 08:15:27 +00:00
bmeurer
b5f27ef30c Revert of Store OSR'd optimized code on the native context. (patchset #8 id:140001 of https://codereview.chromium.org/2549753002/ )
Reason for revert:
Speculative revert WebGL breakage reported in https://bugs.chromium.org/p/chromium/issues/detail?id=672367

Original issue's description:
> Store OSR'd optimized code on the native context.
>
> Since we OSR code rarely, it makes sense to store it and look for it on the native context rather than the SharedFunctionInfo. This makes the OptimizedCodeMap data structure more space efficient, as it doesn't have to store an ast ID for the OSR entry point.
>
> BUG=
>
> Committed: https://crrev.com/378b6b22fb7925ac5b672335a54599f5739e7758
> Cr-Commit-Position: refs/heads/master@{#41554}

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

Review-Url: https://codereview.chromium.org/2562623003
Cr-Commit-Position: refs/heads/master@{#41571}
2016-12-08 07:29:20 +00:00
mgiuca
2cc4b0e025 assembler-arm: Use unsigned ints to avoid integer overflow.
BUG=v8:5725

Review-Url: https://codereview.chromium.org/2559933002
Cr-Commit-Position: refs/heads/master@{#41570}
2016-12-08 06:20:09 +00:00
gsathya
11359e331a [promises] Port ResolvePromise to TF
-- Moves promiseHasHandlerSymbol to inobject property
-- Ports PromiseResolveClosure to TF
-- Fix a non spec async-await test which fails now because we do a map
check for native promise check (instead of IsPromise). Changing the
constructor (in the test) invalidates the map check.

This patch results in a 7.1% performance improvement in the bluebird
benchmark (over 5 runs).

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2541283002
Cr-Commit-Position: refs/heads/master@{#41569}
2016-12-08 06:12:48 +00:00
v8-autoroll
21c9d278f6 Update V8 DEPS.
Rolling v8/build: 788dcd7..53448a6

Rolling v8/third_party/catapult: 415a532..11d3d44

Rolling v8/tools/clang: 7f925e3..caccf42

TBR=machenbach@chromium.org,vogelheim@chromium.org,hablich@chromium.org

Review-Url: https://codereview.chromium.org/2555223003
Cr-Commit-Position: refs/heads/master@{#41568}
2016-12-08 04:24:23 +00:00
lpy
ecdff43b99 [Tracing] Support multi-categories group list.
jasongin@ created this patch.
dcc50445a3
This patch adds the support to emit a trace event by using a comma-separated
list of categories, so that the trace event will be emitted if there is at least
one category is enabled in the categories list.

TBR=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2558193002
Cr-Commit-Position: refs/heads/master@{#41567}
2016-12-08 00:28:18 +00:00
luoe
c7c19c86a7 Show functions in object previews
Due to the isOwn check, functions inherited through prototype will not be
included in a preview.

BUG=645053

Review-Url: https://codereview.chromium.org/2554623003
Cr-Commit-Position: refs/heads/master@{#41566}
2016-12-07 22:34:13 +00:00
luoe
80bcbccc67 Add getter properties to array entry previews
Getter properties are not currently included in the protocol's
Runtime.ObjectPreview. DevTools currently shows getter properties
when evaluating arrays in the console, and this CL brings them into
the preview generated for RemoteObjects.

Corresponding DevTools CL: https://codereview.chromium.org/2521513006/

BUG=666882

Review-Url: https://codereview.chromium.org/2508423002
Cr-Commit-Position: refs/heads/master@{#41565}
2016-12-07 22:31:38 +00:00
gsathya
87b84a341d [promises] Don't allocate new array before filling up existing array
Previously we created 3 FixedArrays and then filled them up with
values. This meant that during the creation of the second and third
FixedArray, there were one and two FixedArrays respectively, without
any values in it which broke the FixedArrayVerify.

This patch fills each FixedArray with the correct values before
creating new ones.

BUG=chromium:672051

Review-Url: https://codereview.chromium.org/2554323003
Cr-Commit-Position: refs/heads/master@{#41564}
2016-12-07 20:51:13 +00:00
jwolfe
93b87c89f2 A decimal integer literal with a leading 0 is now an error in strict mode.
We're still collecting use counter data for this situation.

BUG=v8:4973
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2510873005
Cr-Commit-Position: refs/heads/master@{#41563}
2016-12-07 20:09:43 +00:00
bjaideep
3bc53ad765 PPC/s390: Store OSR'd optimized code on the native context.
Port 378b6b22fb

Original Commit Message:

    Since we OSR code rarely, it makes sense to store it and look for
    it on the native context rather than the SharedFunctionInfo.
    This makes the OptimizedCodeMap data structure more space efficient,
    as it doesn't have to store an ast ID for the OSR entry point.

R=mvstanton@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2557113002
Cr-Commit-Position: refs/heads/master@{#41562}
2016-12-07 18:55:47 +00:00
ishell
0d29250547 [interpreter] Avoid code duplication in Interpreter::Initialize().
BUG=

Review-Url: https://codereview.chromium.org/2560893002
Cr-Commit-Position: refs/heads/master@{#41561}
2016-12-07 18:53:35 +00:00
jwolfe
089e4fd32c Change error messages for octal escape sequences
When an octal escape sequence is in a string in strict mode:
- Octal literals are not allowed in strict mode.
+ Octal escape sequences are not allowed in strict mode.

When an octal escape sequence is in a template string:
- Octal literals are not allowed in template strings.
+ Octal escape sequences are not allowed in template strings.

BUG=v8:4973
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2551633002
Cr-Commit-Position: refs/heads/master@{#41560}
2016-12-07 17:26:42 +00:00
lpy
0a3c8fc3ef [Tracing] Implement IC statistics in tracing.
This patch introduces:

1. ICStats class to store ic statistics items produced by V8,
2. A disabled by default tracing category v8.ic_stats,
3. An trace event V8.ICStats that contains ic statistics items in args,

We store ic statistics items in an array until the array is full to reduce
the number of trace events.

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

Review-Url: https://codereview.chromium.org/2503183002
Cr-Commit-Position: refs/heads/master@{#41559}
2016-12-07 16:58:46 +00:00
ulan
ebb1aff1e6 [heap] Do not delay mark-compact in Heap::CollectGarbage if incremental
marking needs finalization.

TBR=mlippautz@chromium.org
BUG=chromium:671994,chromium:670675

Review-Url: https://codereview.chromium.org/2560813002
Cr-Commit-Position: refs/heads/master@{#41558}
2016-12-07 16:33:18 +00:00
bradnelson
582cdddeb4 [wasm][asm.js] Require exported asm.js functions have be names.
The asm.js spec requires exports to be identifiers,
this was DCHECKED in the asm-wasm-builder, but not the typer.

BUG=672046
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2552913004
Cr-Commit-Position: refs/heads/master@{#41557}
2016-12-07 15:55:49 +00:00
dcheng
ebe9419228 Propagate exceptions thrown by access check interceptors.
When v8 fails an access check, it invokes a helper to try to see if it
can service the request via an access check interceptor. Invoking the
access check interceptor can throw an exception (e.g. a SecurityError).

Unfortunately, the failed access check property helpers and the
interceptor helpers don't agree on how to propagate the exception: if
the interceptor helper detects a scheduled exception, it promotes the
exception to a pending exception and returns to the failed access check
property helper.

The failed access check property helper also has an early return in
case of a scheduled exception. However, this doesn't work, as the
previously thrown exception is no longer scheduled, as it's been
promoted to a pending exception. Thus, the failed access check property
helper always end up calling the failed access check callback as well.
Since Blink's implementation of the failed access check callback also
throws an exception, this conflicts with the previously-thrown,
already-pending exception.

With this patch, the failed access check property helpers check for a
pending exception rather than a scheduled exception after invoking the
interceptor, so the exception can be propagated correctly.

BUG=v8:5715
R=yangguo@chromium.org,jochen@chromium.org

Review-Url: https://codereview.chromium.org/2550423002
Cr-Commit-Position: refs/heads/master@{#41556}
2016-12-07 15:54:39 +00:00
caitp
b5f146a02a [ignition] desugar GetIterator() via bytecode rather than via AST
Introduces:
- a new AST node representing the GetIterator() algorithm in the specification, to be used by ForOfStatement, YieldExpression (in the case of delegating yield*), and the future `for-await-of` loop proposed in http://tc39.github.io/proposal-async-iteration/#sec-async-iterator-value-unwrap-functions.
- a new opcode (JumpIfJSReceiver), which is useful for `if Type(object) is not Object` checks which are common throughout the specification. This node is easily eliminated by TurboFan.

The AST node is desugared specially in bytecode, rather than manually when building the AST. The benefit of this is that desugaring in the BytecodeGenerator is much simpler and easier to understand than desugaring the AST.

This also reduces parse time very slightly, and allows us to use LoadIC rather than KeyedLoadIC, which seems to have  better baseline performance. This results in a ~20% improvement in test/js-perf-test/Iterators micro-benchmarks, which I believe owes to the use of the slightly faster LoadIC as opposed to the KeyedLoadIC in the baseline case. Both produce identical optimized code via TurboFan when the type check can be eliminated, and the load can be replaced with a constant value.

BUG=v8:4280
R=bmeurer@chromium.org, rmcilroy@chromium.org, adamk@chromium.org, neis@chromium.org, jarin@chromium.org
TBR=rossberg@chromium.org

Review-Url: https://codereview.chromium.org/2557593004
Cr-Commit-Position: refs/heads/master@{#41555}
2016-12-07 15:20:33 +00:00
mvstanton
378b6b22fb Store OSR'd optimized code on the native context.
Since we OSR code rarely, it makes sense to store it and look for it on the native context rather than the SharedFunctionInfo. This makes the OptimizedCodeMap data structure more space efficient, as it doesn't have to store an ast ID for the OSR entry point.

BUG=

Review-Url: https://codereview.chromium.org/2549753002
Cr-Commit-Position: refs/heads/master@{#41554}
2016-12-07 15:11:04 +00:00
mlippautz
fd12750209 [heap] Clear cached wrappers upon aborting incremental marking
BUG=chromium:468240,chromium:668060

Review-Url: https://codereview.chromium.org/2551973005
Cr-Commit-Position: refs/heads/master@{#41553}
2016-12-07 14:04:38 +00:00
clemensh
ae1c5746f2 [wasm] Fix ToNumber conversion
There were two bugs, one partly hiding the other one:
1) We generate the ToNumber conversion for each WASM_TO_JS wrapper,
   even if the expected return type is void.
2) The return node in the WASM_TO_JS wrapper did not use the effect of
   the ToNumber conversion.

This CL fixes both, and adds test cases to check that we do throw an
error trying to convert (e.g.) Symbol to a number, but only if the
return type is not void.
Additional test check that a user-provided valueOf method is actually
called the correct number of times.

R=titzer@chromium.org, bradnelson@chromium.org
BUG=v8:4203

Review-Url: https://codereview.chromium.org/2552123004
Cr-Commit-Position: refs/heads/master@{#41552}
2016-12-07 13:54:27 +00:00
mstarzinger
0ded4cbd41 Remove dead SharedFunctionInfo::TrimOptimizedCodeMap.
R=mvstanton@chromium.org

Review-Url: https://codereview.chromium.org/2561563002
Cr-Commit-Position: refs/heads/master@{#41551}
2016-12-07 13:53:24 +00:00
jgruber
40e176056d [regexp] Shrink results array in @@match and @@split
Both @@match and @@split internally use dynamically growing fixed
arrays. Shrink to fit when wrapping these in a JSArray to avoid
excessive memory usage.

BUG=chromium:670205,chromium:670708

Review-Url: https://codereview.chromium.org/2556773002
Cr-Commit-Position: refs/heads/master@{#41550}
2016-12-07 13:05:55 +00:00
yangguo
0d4219913e [debug] do not retroactively apply script break points.
R=jgruber@chromium.org, kozyatinskiy@chromium.org
BUG=v8:5510

Review-Url: https://codereview.chromium.org/2530093002
Cr-Commit-Position: refs/heads/master@{#41549}
2016-12-07 11:44:12 +00:00
ishell
36807f8a21 [stubs] Fix issues found by the machine graph verifier in load/store IC stubs.
BUG=

Review-Url: https://codereview.chromium.org/2560663002
Cr-Commit-Position: refs/heads/master@{#41548}
2016-12-07 10:57:42 +00:00
ishell
df2f66e01e [turbofan] Add --csa-verify flag that enables machine graph verification of code stubs.
The flag must be used only by CodeStubAssemblerGraphsCorrectness cctest for now
and once all the verification issues are fixed the flag will be enabled in debug
mode by default.

This CL also relaxes some checks for code stub graphs and fixes some issues in the stubs.

BUG=

Review-Url: https://codereview.chromium.org/2558653002
Cr-Commit-Position: refs/heads/master@{#41547}
2016-12-07 10:41:03 +00:00
henrique.ferreiro
afd5ff553b Install the 'name' property in classes at runtime
This allows to detect a static property also named 'name', and also makes sure 'name' is added last, to be standards-compliant.

BUG=v8:4199

Review-Url: https://codereview.chromium.org/2423053002
Cr-Commit-Position: refs/heads/master@{#41546}
2016-12-07 10:35:00 +00:00
alph
dfc0bb63a1 [profiler] Add extra CHECK to track down crbug.com/665398
BUG=chromium:665398

Review-Url: https://codereview.chromium.org/2556833003
Cr-Commit-Position: refs/heads/master@{#41545}
2016-12-07 10:24:36 +00:00
ishell
331b0df6e4 [stubs] Ensure that the stubs are recompiled in respective tests.
Removing elements from stub cache by Major key only does not always work.

BUG=

Review-Url: https://codereview.chromium.org/2551353003
Cr-Commit-Position: refs/heads/master@{#41544}
2016-12-07 10:23:21 +00:00
dusan.simicic
c35cc1419c MIPS[64]: Fix jump_tables6 test for r6 architectures
This patch fixes jump_tables6 test for mips32r6 and mips64r6.
This is regression from CL:
https://crrev.com/d735f3ab12061f0a588b3f0538f9229cf747f818

BUG=

Review-Url: https://codereview.chromium.org/2547033002
Cr-Commit-Position: refs/heads/master@{#41543}
2016-12-07 09:13:44 +00:00
petermarshall
a25e768864 [Ignition/turbo] Add a NewWithSpread bytecode.
This just calls into a runtime function for implementation currently.

Intermediate step in speeding up constructor calls containing a spread.

The NewWithSpread bytecode will probably end up having different arguments with future CLs - the constructor and the new.target should have their own regs. For now we are calling into the runtime function, so we need the regs together.

BUG=v8:5659

Review-Url: https://codereview.chromium.org/2541113004
Cr-Commit-Position: refs/heads/master@{#41542}
2016-12-07 08:35:09 +00:00
jarin
da2529ada0 [turbofan] Fix skipping of translations for lazy deopt return value stores.
BUG=chromium:671574

Review-Url: https://codereview.chromium.org/2560743002
Cr-Commit-Position: refs/heads/master@{#41541}
2016-12-07 08:31:40 +00:00
v8-autoroll
b1e6e9a32a Update V8 DEPS.
Rolling v8/build: 2b2a961..788dcd7

Rolling v8/buildtools: 64e38f0..55ad626

Rolling v8/third_party/catapult: 287f4bd..415a532

TBR=machenbach@chromium.org,vogelheim@chromium.org,hablich@chromium.org

Review-Url: https://codereview.chromium.org/2556003002
Cr-Commit-Position: refs/heads/master@{#41540}
2016-12-07 04:27:01 +00:00
bjaideep
3c9fa1aec2 PPC: pass correct condition register to Assert
Since addi sets cr0, it should be passed to Assert method (default
is cr7)

R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2560473003
Cr-Commit-Position: refs/heads/master@{#41539}
2016-12-07 03:27:56 +00:00
gsathya
05b6741f01 [promises] allow allocation in large object space
BUG=v8:5343

Review-Url: https://codereview.chromium.org/2556483002
Cr-Commit-Position: refs/heads/master@{#41538}
2016-12-06 21:31:45 +00:00
gsathya
733104a0c2 [promises] reset callbacks once the promise is resolved
BUG=v8:5343

Review-Url: https://codereview.chromium.org/2558493003
Cr-Commit-Position: refs/heads/master@{#41537}
2016-12-06 19:40:36 +00:00
bjaideep
f7f817d783 PPC: Split kPPC_Add into kPPC_Add[32|64]
R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2559433003
Cr-Commit-Position: refs/heads/master@{#41536}
2016-12-06 19:26:47 +00:00
adamk
1f53653e6c Fix crash in --print-scopes when Scope::variables_ is empty
Apparently our HashMap can't deal with iteration over an empty map.

R=verwaest@chromium.org,neis@chromium.org
BUG=v8:5711

Review-Url: https://codereview.chromium.org/2551943003
Cr-Commit-Position: refs/heads/master@{#41535}
2016-12-06 19:16:43 +00:00
gsathya
52e2c154ff Reland Create JSPromise (patchset #16 id:300001 of https://codereview.chromium.org/2536463002/ )"
This reverts commit 4c7cccf9f4.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2554943002
Cr-Commit-Position: refs/heads/master@{#41534}
2016-12-06 18:43:18 +00:00
lpy
900d1982cd [Tracing] Remove AppendLongInteger in TracedValue.
JavaScript cannot represent integer larger than 2^53 - 1 from JSON, thus this
patch removes AppendLongInteger and convert long integer to string using
std::to_string.

TBR=cbruni@chromium.org

Review-Url: https://codereview.chromium.org/2557463003
Cr-Commit-Position: refs/heads/master@{#41533}
2016-12-06 18:12:32 +00:00
ishell
a9345a158a Revert of [turbofan] Add --csa-verify flag that enables machine graph verification of code stubs. (patchset #2 id:60001 of https://codereview.chromium.org/2551933002/ )
Reason for revert:
Broke nosnap build: https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20nosnap%20-%20debug/builds/10689

Original issue's description:
> [turbofan] Add --csa-verify flag that enables machine graph verification of code stubs.
>
> The flag must be used only by CodeStubAssemblerGraphsCorrectness cctest for now
> and once all the verification issues are fixed the flag will be enabled in debug
> mode by default.
>
> BUG=
>
> Committed: https://crrev.com/292b3548f6d02b964b4afe3e05f89c0681fa5620
> Cr-Commit-Position: refs/heads/master@{#41531}

TBR=mstarzinger@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/2552893003
Cr-Commit-Position: refs/heads/master@{#41532}
2016-12-06 17:29:15 +00:00
ishell
292b3548f6 [turbofan] Add --csa-verify flag that enables machine graph verification of code stubs.
The flag must be used only by CodeStubAssemblerGraphsCorrectness cctest for now
and once all the verification issues are fixed the flag will be enabled in debug
mode by default.

BUG=

Review-Url: https://codereview.chromium.org/2551933002
Cr-Commit-Position: refs/heads/master@{#41531}
2016-12-06 16:18:40 +00:00
titzer
f897e36c8c [wasm] Names of exported functions should be the stringified function index.
R=bradnelson@chromium.org,rossberg@chromium.org
BUG=v8:5705

Review-Url: https://codereview.chromium.org/2551323003
Cr-Commit-Position: refs/heads/master@{#41530}
2016-12-06 15:33:42 +00:00
bradnelson
051bc1ec3e [wasm][asm.js] Pass Script with Handle.
The asm-wasm-builder started allocating SharedFunctionInfos,
this makes it bad we'd passed Script by pointer (due to ignorance).
Switching to Handle<Script>.

R=clemensh@chromium.org,titzer@chromium.org
BUG=v8:5716

Review-Url: https://codereview.chromium.org/2552873003
Cr-Commit-Position: refs/heads/master@{#41529}
2016-12-06 15:29:22 +00:00
titzer
400b01ffe7 [wasm] Honor the names section for modules coming from asm.js.
R=bradnelson@chromium.org,clemensh@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2553123002
Cr-Commit-Position: refs/heads/master@{#41528}
2016-12-06 14:31:51 +00:00
clemensh
a9017cb018 [inspector] Split V8DebuggerScript implementation for wasm
Make some methods on V8DebuggerScript virtual and provide the
implementations ActualScript for scripts which are backed by scripts on
V8's side, and WasmVirtualScript for wasm scripts.

The added test case ensures that we at least don't crash on the attempt
to get breakable locations for wasm "scripts", which we did previously.
Returning a reasonable result for wasm will be implemented in a
follow-up commit.

R=yangguo@chromium.org, jgruber@chromium.org
BUG=chromium:667767,chromium:613110

Review-Url: https://codereview.chromium.org/2532433003
Cr-Commit-Position: refs/heads/master@{#41527}
2016-12-06 14:26:41 +00:00
jgruber
9c9c8d7bb5 [stubs] Add option to allow LO space allocation
Passing kAllowLargeObjectAllocation now allocates in LOS if necessary.
Allow such allocations when growing fixed arrays in RegExp's @@match
and @@split operations.

BUG=chromium:670671

Review-Url: https://codereview.chromium.org/2555703003
Cr-Commit-Position: refs/heads/master@{#41526}
2016-12-06 14:08:57 +00:00
bradnelson
52fd3c1ec5 [wasm] [asm.js] Avoid expensive GetLineNumber up front in asm-typer.
In switching to incremental parsing, we switched to pre-computing
line numbers for forward declarations. This is expensive,
because GetLineNumber reparses lines.

Also, switch typing maps to unordered_map (as they appear hot).

BUG=v8:4203
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2553033002
Cr-Commit-Position: refs/heads/master@{#41525}
2016-12-06 14:07:48 +00:00
ulan
fdc0aa0c97 [heap] Ensure finalization of incremental marking even if all allocations
come from the runtime.

This patch fixes an issue of heap growing to max capacity when incremental
marking is finished but cannot finalize due to GC stack guard not triggering.

It can happen if all allocations come from the runtime, for example,
from JSON parser or compiler.

Now before expanding the heap we check if we are above the allocation limit
and the incremental marking needs to be finalized. If so we do not expand
the heap and force GC, which will finalize the incremental marking.
The check is performed for paged spaces and large-object space.

BUG=chromium:670675

Review-Url: https://codereview.chromium.org/2552613004
Cr-Commit-Position: refs/heads/master@{#41524}
2016-12-06 14:06:40 +00:00
machenbach
ca74343a70 [test] Skip flaky FunctionApplySample test on windows
BUG=v8:5193
NOTRY=true
TBR=alph@chromium.org,yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2555683003
Cr-Commit-Position: refs/heads/master@{#41523}
2016-12-06 13:58:12 +00:00