Commit Graph

29454 Commits

Author SHA1 Message Date
verwaest
cc782c0a16 Only rewrite all statements in a block if we're in a breakable scope
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2431273002
Cr-Commit-Position: refs/heads/master@{#40492}
2016-10-21 08:51:28 +00:00
gdeepti
5afa8ed77a [wasm] GrowMemory should update imported memory objects.
When the instance has imported memory, calling GrowMemory should update the memory object to have a consistent view of the memory. This fixes the failing emscripten test case, added a reduced test that simulates the same behavior.

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

Review-Url: https://chromiumcodereview.appspot.com/2438673006
Cr-Commit-Position: refs/heads/master@{#40490}
2016-10-21 08:38:52 +00:00
machenbach
6e162add3e Revert of Update implementation of atomics with latest Chromium version but use compiler builtin atomics (patchset #10 id:190001 of https://chromiumcodereview.appspot.com/2425963002/ )
Reason for revert:
https://build.chromium.org/p/client.v8.ports/builders/V8%20Android%20Arm64%20-%20builder/builds/4851

Original issue's description:
> Update implementation of atomics with latest Chromium version but use compiler builtin atomics
>
> Ideally, we would use the standard library. However, when we are compiling against an older version of the standard library the atomic implementation may be slow.
>
> BUG=

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

Review-Url: https://chromiumcodereview.appspot.com/2438983002
Cr-Commit-Position: refs/heads/master@{#40489}
2016-10-21 08:10:31 +00:00
hpayer
343c4ebdd1 Update implementation of atomics with latest Chromium version but use compiler builtin atomics
Ideally, we would use the standard library. However, when we are compiling against an older version of the standard library the atomic implementation may be slow.

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2425963002
Cr-Commit-Position: refs/heads/master@{#40488}
2016-10-21 07:33:10 +00:00
yangguo
2f135d464c [debugger] basic test infrastructure for new debugger test api.
This introduces:
- a way in d8 to send messages to the inspector and receive responses.
- a new test suite where existing debugger tests should migrate to.

R=jgruber@chromium.org, kozyatinskiy@chromium.org, machenbach@chromium.org
BUG=v8:5530

Review-Url: https://chromiumcodereview.appspot.com/2425973002
Cr-Commit-Position: refs/heads/master@{#40487}
2016-10-21 06:38:05 +00:00
bjaideep
c4c840d45c s390x: Implement kS390_RotLeftAndClear64
R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=
LOG=N

Review-Url: https://chromiumcodereview.appspot.com/2439673005
Cr-Commit-Position: refs/heads/master@{#40485}
2016-10-20 22:56:35 +00:00
kozyatinskiy
820811f582 [inspector] fix UAF in another part of console code
BUG=chromium:656823
R=dgozman@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2436783003
Cr-Commit-Position: refs/heads/master@{#40484}
2016-10-20 21:36:12 +00:00
kozyatinskiy
24e5dfb546 [inspector] migrate stepping related methods to debug-interface
* introduced DebugInterface::PrepareStep and DebugInterface::ClearStepping method.
Inspector calls these methods only on pause and not interseted in calling this for not current break_id so we don't need to expose debug interface with break_id argument and can only check that current break_id is valid.

BUG=chromium:652939,v8:5510
R=yangguo@chromium.org,dgozman@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://chromiumcodereview.appspot.com/2423153002
Cr-Commit-Position: refs/heads/master@{#40483}
2016-10-20 18:51:46 +00:00
vogelheim
9e6bfbd33c Revert of Speedup access to global_proxy.* attributes/accessors. (patchset #6 id:160001 of https://codereview.chromium.org/2403003002/ )
Reason for revert:
Revert, because of crbug.com/656959.

Original issue's description:
> Speedup access to global_proxy.* attributes/accessors.
>
> Using a global proxy (e.g. 'window.f', 'w.f' or 'this.f') is considerably slower than evaluating just 'f'. This CL aims to perform the necessary checks at compile time and inline the accesses.
>
> This is a follow-on CL to crrev.com/2369933005:
> - The initial upload is crrev.com/2369933005 + a rebase.
> - The remaining issues are the fixes requested by the reviewers on that CL.
>
> BUG=chromium:634276, chromium:654716
>
> Committed: https://crrev.com/8f43d748272536117008aa6a1b53ea52126261c1
> Committed: https://crrev.com/041314524952a3c1bc71bd3beafbbb37319f1d22
> Cr-Original-Commit-Position: refs/heads/master@{#40153}
> Cr-Commit-Position: refs/heads/master@{#40365}

TBR=jochen@chromium.org,verwaest@chromium.org
NOTRY=true
NOPRESUBMIT=true
BUG=chromium:634276, chromium:654716

Review-Url: https://chromiumcodereview.appspot.com/2434233002
Cr-Commit-Position: refs/heads/master@{#40481}
2016-10-20 17:48:30 +00:00
alph
fa0f953297 [profiler] Update cpu profile tracing format.
Encapsulate nodes and samples into cpuProfile object.

BUG=chromium:406277

Review-Url: https://chromiumcodereview.appspot.com/2425093002
Cr-Commit-Position: refs/heads/master@{#40480}
2016-10-20 17:47:09 +00:00
adamk
35a3ccbfac [ignition] Eliminate hole checks where statically possible for loads and stores
Move hole check logic from full-codegen into scope analysis, and store the
"needs hole check" bit on VariableProxy. This makes it easy to re-use in
any backend: it will be trivial to extend the use of this logic in, e.g.,
full-codegen variable stores.

While changing the signatures of the variable loading/storing methods in
Ignition, I took the liberty of replacing the verb "Visit" with "Build", since these
are not part of AST visiting.

BUG=v8:5460

Review-Url: https://chromiumcodereview.appspot.com/2411873004
Cr-Commit-Position: refs/heads/master@{#40479}
2016-10-20 17:32:08 +00:00
ulan
189794ddb2 Reland "[heap] Start sweeper tasks after evacuation. (patchset #2 id:20001 of https://chromiumcodereview.appspot.com/2428043002/ )"
The performance regression in crbug.com/657776 was not caused by this CL.

This reverts commit 4490a7601c.

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2437873004
Cr-Commit-Position: refs/heads/master@{#40478}
2016-10-20 16:25:26 +00:00
jpp
5331e3b616 [V8][asm.js] Adds support to global const variables.
This CL adds support for:
https://discourse.wicg.io/t/allow-const-global-variables/684

It allows global const variables to be used as if they were numeric
literals. For example:

  const f0 = fround(0);
  ...
  function foo() {
    var v = f0;  // no type annotation.
    ...
    return f0;  // no return type annotation.
  }

BUG= https://bugs.chromium.org/p/v8/issues/detail?id=5540

Review-Url: https://chromiumcodereview.appspot.com/2435823002
Cr-Commit-Position: refs/heads/master@{#40477}
2016-10-20 15:48:41 +00:00
heimbuef
ef690ca387 Constrain the zone segment pool size
Added a size constraint to the configuration to limit the segment pool.
This will likely fix the memory alerts from small android devices.

BUG=chromium:655129

Review-Url: https://chromiumcodereview.appspot.com/2424393002
Cr-Commit-Position: refs/heads/master@{#40476}
2016-10-20 14:48:55 +00:00
bjaideep
83e66947cc PPC/s390: [wasm] Trim graph before scheduling.
Port 9902368259

Original commit message:

    The scheduler expects a trimmed graph, so we have to trim the graph
    before scheduling.

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

BUG=
LOG=N

Review-Url: https://chromiumcodereview.appspot.com/2431093004
Cr-Commit-Position: refs/heads/master@{#40475}
2016-10-20 14:32:44 +00:00
ahaas
57b14b0606 [wasm] Track in the interpreter if a NaN could have been produced.
The wasm specification does not fully specify the binary representation
of NaN: the sign bit can be non-deterministic. The wasm-code fuzzer
found a test case where the wasm interpreter and the compiled code
produce a different sign bit for a NaN, and as a consequence they
produce different results.

With this CL the interpreter tracks whether it executed an instruction
which can produce a NaN, which are div and sqrt instructions. The
fuzzer uses this information and compares the result of the interpreter
with the result of the compiled code only if there was no instruction
which could have produced a NaN.

R=titzer@chromium.org

TEST=cctest/test-run-wasm-interpreter/TestMayProduceNaN
BUG=chromium:657481

Review-Url: https://chromiumcodereview.appspot.com/2438603003
Cr-Commit-Position: refs/heads/master@{#40474}
2016-10-20 14:27:45 +00:00
mtrofin
2282dd0941 [wasm] remove deprecated deserialization API
We don't need the Deserialize API taking in a SerializedData anymore.

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2436543004
Cr-Commit-Position: refs/heads/master@{#40473}
2016-10-20 14:19:30 +00:00
mtrofin
d2784b985f [turbofan] splinters should spill if there is no register use
When allocating for splinters, we were prematurely reverting to the
hot range behavior, even when the range didn't actually have any
positions requiring a register. This could cause unnecessary moves.

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2436813003
Cr-Commit-Position: refs/heads/master@{#40472}
2016-10-20 14:18:25 +00:00
mstarzinger
510b56d3f2 Revert "[compiler] Ship Ignition for all TurboFan code."
Breaks layout tests on Blink builders.

TBR=machenbach@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2428413004
Cr-Commit-Position: refs/heads/master@{#40471}
2016-10-20 14:09:29 +00:00
ishell
9e720e3fdd [ic] Refactoring definition of a smi-encoded load handlers.
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2433333002
Cr-Commit-Position: refs/heads/master@{#40469}
2016-10-20 12:45:41 +00:00
mythria
8a80c3b70f [Interpreter] Collect feedback about Oddballs in Bitwise, Inc, Dec operations.
Add support to collect feedback about oddballs for Bitwise binary operations and
Increment and decrement operations. For the case of Oddballs the code to convert
them to numbers is inlined into the handlers instead of calling the
NonNumberToNumber Stub.

BUG=v8:4280, v8:5400

Review-Url: https://chromiumcodereview.appspot.com/2407103003
Cr-Commit-Position: refs/heads/master@{#40468}
2016-10-20 12:43:47 +00:00
ivica.bogosavljevic
f36713b5e9 MIPS: Simulate SEB and SEH instructions on MIPS32R1 through MacroAssembler
SEB and SEH instructions are not available on MIPS32R1. This caused several failures on
MIPS32R1 in mjsunit/wasm/* and mjsunit/asm test suites.
This fix simulates these instruction in MacroAssembler for those architectures that do not support them.

TEST=mjsunit/asm/sqlite3/sqlite-pointer-masking,mjsunit/wasm/embenchen/lua_binarytrees
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2434973002
Cr-Commit-Position: refs/heads/master@{#40467}
2016-10-20 12:28:40 +00:00
ishell
54194b2d8d [stubs] Cleanup CSA::BitFieldDecode(..) and friends.
This CL also introduces IsSetWord<T>(..) and IsSetWord32<T>(..) operations
to ease checking if the bit field is set or not.

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2436893003
Cr-Commit-Position: refs/heads/master@{#40466}
2016-10-20 12:27:42 +00:00
ulan
4490a7601c Revert of [heap] Start sweeper tasks after evacuation. (patchset #2 id:20001 of https://chromiumcodereview.appspot.com/2428043002/ )
Reason for revert:
Performance regression on arm64: crbug.com/657776

Original issue's description:
> [heap] Start sweeper tasks after evacuation.
>
> This allows us to use more tasks for parallel evacuation.
>
> BUG=

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

Review-Url: https://chromiumcodereview.appspot.com/2440693002
Cr-Commit-Position: refs/heads/master@{#40465}
2016-10-20 12:15:24 +00:00
hablich
555a725810 Revert of [inspector] align console implementation with spec (patchset #2 id:20001 of https://chromiumcodereview.appspot.com/2428473003/ )
Reason for revert:
Breaks roll: https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/164610

See https://chromiumcodereview.appspot.com/2434733002/ for more context

Original issue's description:
> [inspector] align console implementation with spec
>
> console should be non enumerable.
>
> BUG=chromium:656826
> R=dgozman@chromium.org

TBR=dgozman@chromium.org,kozyatinskiy@chromium.org
NOTRY=true
BUG=chromium:656826

Review-Url: https://chromiumcodereview.appspot.com/2435013002
Cr-Commit-Position: refs/heads/master@{#40464}
2016-10-20 11:57:48 +00:00
titzer
85cb43cbb8 [wasm] Fix canonicalization bug for function signatures in CallIndirect.
R=ahaas@chromium.org
BUG=chromium:654231

Review-Url: https://chromiumcodereview.appspot.com/2439613003
Cr-Commit-Position: refs/heads/master@{#40463}
2016-10-20 11:26:26 +00:00
mstarzinger
20d29ff036 [compiler] Ship Ignition for all TurboFan code.
This enables Ignition unconditionally for all code that is destined for
optimization with TurboFan. This ensures all optimization attempts will
go through the BytecodeGraphBuilder and that the AstGraphBuilder pipe is
dried out in practice.

R=mvstanton@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2427953002
Cr-Commit-Position: refs/heads/master@{#40462}
2016-10-20 10:57:58 +00:00
mstarzinger
e75d6885cd [turbofan] Remove dead state value validation.
This removes validation code for state value consistency within frame
states in the {BytecodeGraphBuilder} that is no longer used.

R=jarin@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2432043006
Cr-Commit-Position: refs/heads/master@{#40461}
2016-10-20 10:54:23 +00:00
jkummerow
818d61ab28 [cleanup] Delete MacroAssembler::CopyBytes, it is dead code
Review-Url: https://chromiumcodereview.appspot.com/2434753003
Cr-Commit-Position: refs/heads/master@{#40459}
2016-10-20 10:15:34 +00:00
titzer
ff46fcb9e4 [wasm] Only use the table maximum in allocation if it is non-zero.
R=ahaas@chromium.org
BUG=chromium:654231

Review-Url: https://chromiumcodereview.appspot.com/2433313002
Cr-Commit-Position: refs/heads/master@{#40458}
2016-10-20 09:34:11 +00:00
ulan
0a82f09110 [heap] Add a guard for restarting the memory reducer after mark-compact.
Currently it is possible to get into a cycle of
mark-compact -> memory reducer -> mark-compact -> memory reducer ...
where the memory reducer does not free memory.

This patch ensures that the memory reducer restarts only if the
committed memory increased by sufficient amount after the last run.

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2433933005
Cr-Commit-Position: refs/heads/master@{#40457}
2016-10-20 09:04:37 +00:00
jochen
9780e970ff Add CodeStubAssembler::FlattenString
R=danno@chromium.org
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2435953002
Cr-Commit-Position: refs/heads/master@{#40456}
2016-10-20 08:48:35 +00:00
machenbach
5006df44c3 Revert of [inspector] migrate stepping related methods to debug-interface (patchset #3 id:40001 of https://chromiumcodereview.appspot.com/2423153002/ )
Reason for revert:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/10808

https://github.com/v8/v8/wiki/Blink-layout-tests

Original issue's description:
> [inspector] migrate stepping related methods to debug-interface
>
> * introduced DebugInterface::PrepareStep and DebugInterface::ClearStepping method.
> Inspector calls these methods only on pause and not interseted in calling this for not current break_id so we don't need to expose debug interface with break_id argument and can only check that current break_id is valid.
>
> BUG=chromium:652939,v8:5510
> R=yangguo@chromium.org,dgozman@chromium.org

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

Review-Url: https://chromiumcodereview.appspot.com/2441583002
Cr-Commit-Position: refs/heads/master@{#40455}
2016-10-20 08:32:17 +00:00
zhengxing.li
3cc949e3be X87: [wasm] Trim graph before scheduling.
port 9902368259 (r40446)

  original commit message:
  The scheduler expects a trimmed graph, so we have to trim the graph
  before scheduling.

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2431213003
Cr-Commit-Position: refs/heads/master@{#40454}
2016-10-20 08:27:30 +00:00
mstarzinger
c44dca798b [turbofan] Make FrameStateBeforeAndAfter explicit.
This makes the creation of frame states "before" and "after" node
sequences explicit in the {BytecodeGraphBuilder}. This removes some
complexity and also allows us to ellide redundant {Checkpoint} nodes
before operations that don't actually eager deoptimize.

In this change such redundant {Checkpoint} nodes have been removed for
arguments object and rest array creation bytecodes. The frame states
used in such {Checkpoint} nodes were actually bogus because they would
resume bytecode execution before the {new.target} value is assigned to
its respective variable.

R=jarin@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2437683003
Cr-Commit-Position: refs/heads/master@{#40453}
2016-10-20 08:23:09 +00:00
machenbach
b659cc1e81 Revert of [profiler] Update cpu profile tracing format. (patchset #2 id:20001 of https://chromiumcodereview.appspot.com/2425093002/ )
Reason for revert:
Breaks
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/10805

See also:
https://github.com/v8/v8/wiki/Blink-layout-tests

Original issue's description:
> [profiler] Update cpu profile tracing format.
>
> Encapsulate nodes and samples into cpuProfile object.
>
> BUG=chromium:406277

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

Review-Url: https://chromiumcodereview.appspot.com/2432373004
Cr-Commit-Position: refs/heads/master@{#40452}
2016-10-20 07:40:36 +00:00
gdeepti
e936685b0d [wasm] Remove incorrect assembler check.
BUG=chromium:644670
R=ahaas@chromium.org, titzer@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2438593003
Cr-Commit-Position: refs/heads/master@{#40451}
2016-10-20 07:39:15 +00:00
kozyatinskiy
859eddbdef [inspector] migrate stepping related methods to debug-interface
* introduced DebugInterface::PrepareStep and DebugInterface::ClearStepping method.
Inspector calls these methods only on pause and not interseted in calling this for not current break_id so we don't need to expose debug interface with break_id argument and can only check that current break_id is valid.

BUG=chromium:652939,v8:5510
R=yangguo@chromium.org,dgozman@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2423153002
Cr-Commit-Position: refs/heads/master@{#40450}
2016-10-20 05:37:30 +00:00
aseemgarg
cf9ee0ec6c [wasm] simd scalar lowering F32x4Add and I32x4Add
BUG=v8:4124
TEST:test-run-wasm-simd-lowering
R=titzer@chromium.org,bradnelson@chromium.org,gdeepti@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2294743003
Cr-Commit-Position: refs/heads/master@{#40448}
2016-10-20 00:20:07 +00:00
alph
71e390faf6 [profiler] Update cpu profile tracing format.
Encapsulate nodes and samples into cpuProfile object.

BUG=chromium:406277

Review-Url: https://chromiumcodereview.appspot.com/2425093002
Cr-Commit-Position: refs/heads/master@{#40447}
2016-10-19 19:16:15 +00:00
ahaas
9902368259 [wasm] Trim graph before scheduling.
The scheduler expects a trimmed graph, so we have to trim the graph
before scheduling.

R=titzer@chromium.org, bmeurer@chromium.org
TEST=cctest/test-run-wasm/RunWasmCompiled_GraphTrimming

Review-Url: https://chromiumcodereview.appspot.com/2428443002
Cr-Commit-Position: refs/heads/master@{#40446}
2016-10-19 16:21:36 +00:00
jkummerow
03b8554109 [stubs] KeyedStoreIC: Use BuildFastLoop() helper
Bonus: CodeStubAssembler::StringIndexOfChar gets the same treatment.
Review-Url: https://chromiumcodereview.appspot.com/2435713003
Cr-Commit-Position: refs/heads/master@{#40445}
2016-10-19 16:18:33 +00:00
ulan
9eff39aebf [heap] Start sweeper tasks after evacuation.
This allows us to use more tasks for parallel evacuation.

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2428043002
Cr-Commit-Position: refs/heads/master@{#40444}
2016-10-19 15:12:08 +00:00
lpy
65b3af466e Use TracedValue in runtime statistics.
We introduced TracedValue into V8 tracing previously, this patch uses it to
build JSON string of runtime statistics instead of using stringstream as buffer.

BUG=v8:5089
LOG=N

Review-Url: https://chromiumcodereview.appspot.com/2418303002
Cr-Commit-Position: refs/heads/master@{#40443}
2016-10-19 14:56:35 +00:00
jochen
eafa9206ac Bail out in AstTraversalVisitor::VisitFunctionBody for lazy functions
R=verwaest@chromium.org,mstarzinger@chromium.org
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2425563003
Cr-Commit-Position: refs/heads/master@{#40442}
2016-10-19 14:50:32 +00:00
ziyang
489843f552 PPC/s390: [builtins] Remove the unused AllocationSite slot from ConstructFrame.
Port 77419488a9

Original commit message:

  This slot is completely unused and always undefined anyways, so there's
  no need to maintain the slot during object construction.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, bjaideep@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2429983002
Cr-Commit-Position: refs/heads/master@{#40441}
2016-10-19 14:21:54 +00:00
gsathya
cade0f4ba5 [promises] move PromiseResolveThenableJob debugging code to runtime function
Moving the rest of the debugging code is blocked on making IsPromise inlinable.

BUG=v8:5343

Review-Url: https://chromiumcodereview.appspot.com/2431793003
Cr-Commit-Position: refs/heads/master@{#40440}
2016-10-19 14:15:28 +00:00
bjaideep
91c99de0a1 s390x: [wasm] Adding r3 to GP return register list
Taking similar approach as ia32 which also has 1 return register
eax (as per ia32's ABI) but uses edx as return register as well.
This will fix some failures on s390x where a function returns 2
values.

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

BUG=
LOG=N

Review-Url: https://chromiumcodereview.appspot.com/2426233002
Cr-Commit-Position: refs/heads/master@{#40439}
2016-10-19 13:48:45 +00:00
titzer
07094aaf7d [wasm] Fix minor ternary mistake.
R=clemensh@chromium.org
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2431183005
Cr-Commit-Position: refs/heads/master@{#40438}
2016-10-19 13:47:27 +00:00
jochen
e4ac0105b8 Move DivisionByConstant template instantiations to cpp file
R=bmeurer@chromium.org
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2437733002
Cr-Commit-Position: refs/heads/master@{#40436}
2016-10-19 13:32:34 +00:00
bmeurer
b888150afd [interpreter] Also optimize small functions earlier.
For fullcodegen the RuntimeProfiler has a shortcut that allows it to
tier up small functions earlier, when enough type feedback is available.
Port the same optimization for the Ignition+TurboFan pipeline.

R=mstarzinger@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2427283004
Cr-Commit-Position: refs/heads/master@{#40435}
2016-10-19 13:12:24 +00:00
titzer
418b239f0b [wasm] Use a Managed<WasmModule> to hold metadata about modules.
This CL refactors the handling of metadata associated with WebAssembly
modules to reduce the duplicate marshalling of data from the C++ world
to the JavaScript world. It does this by wrapping the C++ WasmModule*
object in a Foreign that is rooted from the on-heap WasmCompiledModule
(which is itself just a FixedArray). Upon serialization, the C++ object
is ignored and the original WASM wire bytes are serialized. Upon
deserialization, the C++ object is reconstituted by reparsing the bytes.

This is motivated by increasing complications in implementing the JS
API, in particular WebAssembly.Table, which must perform signature
canonicalization across instances.

Additionally, this CL implements the proper base + offset initialization
behavior for tables.

R=rossberg@chromium.org,bradnelson@chromium.org,mtrofin@chromium.org,yangguo@chromium.org
BUG=v8:5507, chromium:575167, chromium:657316

Review-Url: https://chromiumcodereview.appspot.com/2424623002
Cr-Commit-Position: refs/heads/master@{#40434}
2016-10-19 13:07:22 +00:00
yangguo
61dc1de0f6 [debugger] remove test for legacy JSON API to return V8's version.
R=jgruber@chromium.org
BUG=v8:5510

Review-Url: https://chromiumcodereview.appspot.com/2430673002
Cr-Commit-Position: refs/heads/master@{#40432}
2016-10-19 12:35:34 +00:00
jarin
7296bd4980 [turbofan] Remove representation changes for machine constants.
No machine constants should reach the representation selector.

Review-Url: https://chromiumcodereview.appspot.com/2431693002
Cr-Commit-Position: refs/heads/master@{#40430}
2016-10-19 12:05:49 +00:00
cbruni
b7ff0d7136 [stubs] Implement TF builtin for Object.create fast paths
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2385423005
Cr-Commit-Position: refs/heads/master@{#40429}
2016-10-19 11:34:04 +00:00
bmeurer
3c10b97c34 [interpreter] Don't canonicalize results of feedback collecting handlers.
For binary operations that collect feedback (in Ignition), don't
canonicalize when the operation itself is already performed in
Float64. This is the first step to fix the performance difference
we still see between TurboFan and TurboFan+Ignition.

R=mythria@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2431363002
Cr-Commit-Position: refs/heads/master@{#40428}
2016-10-19 11:13:47 +00:00
Benedikt Meurer
09410621f9 [turbofan] Don't introduce PlainPrimitiveToNumber for String inputs.
During JSTypedLowering we can decide to insert PlainPrimitiveToNumber
operators on the inputs to still utilize pure Number operators, when
the type feedback on the numeric binary operation is NumberOrOddball.
However that is not beneficial if the inputs can be Strings, that is
we cannot statically rule out String based on input type, as that
inserts a ToNumber stub call into the hot code path.

This repairs the NavierStokes regression with Ignition on Octane.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#40427}
2016-10-19 10:33:08 +00:00
titzer
acf99a893c [wasm] Improve naming consistency for WASM instances.
R=clemensh@chromium.org,ahaas@chromium.org
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2428343005
Cr-Commit-Position: refs/heads/master@{#40426}
2016-10-19 10:30:38 +00:00
jgruber
ae64bdce4e [debugger] Remove unused arg from setPauseOnExceptionsImpl
BUG=v8:5530

Review-Url: https://chromiumcodereview.appspot.com/2436613002
Cr-Commit-Position: refs/heads/master@{#40425}
2016-10-19 10:25:12 +00:00
jkummerow
194c43a103 [stubs] Port KeyedStoreIC dispatcher to TurboFan
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2403483002
Cr-Commit-Position: refs/heads/master@{#40423}
2016-10-19 10:11:45 +00:00
Benedikt Meurer
8b94aee525 [turbofan] Also remove minus zero check for rhs of CheckedInt32Add.
Similar to http://crrev.com/2410883003 we don't need to do a minus zero
check for the right hand side of CheckedInt32Add, because we already
know that the left hand side cannot be minus zero, and the only way that
addition can yield -0 is (-0) + (-0).

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#40421}
2016-10-19 08:28:14 +00:00
ahaas
2f3ca961c7 [turbofan] Use uint32 to store the number of control outputs instead of uint16.
Using uint32 to store the the number of control outputs allows WebAssembly switches to have more than 2^16 case.

BUG=v8:5531
TEST=mjsunit/regress/wasm/regression-5531
R=titzer@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2425983002
Cr-Commit-Position: refs/heads/master@{#40420}
2016-10-19 07:25:51 +00:00
bmeurer
efe4fd4b5b [builtins] Optimize Number.parseInt for HeapNumbers in Signed32 range.
When the input to Number.parseInt is a HeapNumber in Signed32 range, we
can just return the (truncated) input value (i.e. we need to map -0 to
0 due to the ToString conversion).

R=jarin@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2432923002
Cr-Commit-Position: refs/heads/master@{#40419}
2016-10-19 05:41:31 +00:00
bmeurer
3a7eac15e8 [turbofan] Fix invalid Number.parseInt inlining.
The inlined version of Number.parseInt did a ToInt32 truncation, which
is not what the EcmaScript specification says.

R=jarin@chromium.org
BUG=v8:5538

Review-Url: https://chromiumcodereview.appspot.com/2432143002
Cr-Commit-Position: refs/heads/master@{#40418}
2016-10-19 05:17:52 +00:00
zhengxing.li
572c231c98 X87: [ic] Unify CallIC feedback collection and handling.
port 308788b306 (r40397)

  original commit message:
  Consistently collect CallIC feedback in fullcodegen and Ignition, even
  for possibly direct eval calls, that were treated specially so far, for
  no apparent reason. With the upcoming SharedFunctionInfo based CallIC
  feedback, we might be able to even inline certain direct eval calls, if
  they manage to hit the eval cache. More importantly, this patch
  simplifies the collection and dealing with CallIC feedback (and as a
  side effect fixes an inconsistency with feedback for super constructor
  calls).

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2429623005
Cr-Commit-Position: refs/heads/master@{#40416}
2016-10-19 03:32:41 +00:00
kozyatinskiy
550910445f [inspector] align console implementation with spec
console should be non enumerable.

BUG=chromium:656826
R=dgozman@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2428473003
Cr-Commit-Position: refs/heads/master@{#40414}
2016-10-19 02:02:20 +00:00
kozyatinskiy
377533fc06 [inspector] move changeBreakpointState from debugger-script to native
* introduced v8::DebugInterface::ChangeBreakOnException(Isolate*,ExceptionBreakState);
* migrated inspector to new API;
* added cctest for new API;
* added inspector test for setPauseOnExceptionState.

BUG=chromium:652939,v8:5510
R=dgozman@chromium.org,yangguo@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2396193002
Cr-Commit-Position: refs/heads/master@{#40413}
2016-10-19 02:00:57 +00:00
bjaideep
78085e4d7f PPC/s390: [ic] Unify CallIC feedback collection and handling.
Port 308788b306

Original commit message:

    Consistently collect CallIC feedback in fullcodegen and Ignition, even
    for possibly direct eval calls, that were treated specially so far, for
    no apparent reason. With the upcoming SharedFunctionInfo based CallIC
    feedback, we might be able to even inline certain direct eval calls, if
    they manage to hit the eval cache. More importantly, this patch
    simplifies the collection and dealing with CallIC feedback (and as a
    side effect fixes an inconsistency with feedback for super constructor
    calls).

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2425243003
Cr-Commit-Position: refs/heads/master@{#40412}
2016-10-18 22:59:12 +00:00
gdeepti
0c6354e03b [wasm] GrowMemory should use maximum size declared in WebAssembly.Memory
BUG=

Review-Url: https://codereview.chromium.org/2410763002
Cr-Commit-Position: refs/heads/master@{#40411}
2016-10-18 22:19:53 +00:00
jochen
d1daae6221 Fix inspector test in components build
R=jgruber@chromium.org,machenbach@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2421303002
Cr-Commit-Position: refs/heads/master@{#40410}
2016-10-18 20:08:12 +00:00
bmeurer
669a084a2b [builtins] Fix typo in Number.parseInt TurboFan builtin.
http://crrev.com/2424403002 contained a typo comparing the input map
against the undefined constant rather than the HeapNumber map, which
tanks the case where Number.parseInt is used instead of Math.floor.

TBR=epertoso@chromium.org
BUG=v8:5049

Review-Url: https://codereview.chromium.org/2425703007
Cr-Commit-Position: refs/heads/master@{#40409}
2016-10-18 20:01:15 +00:00
jpp
07ac97835d [V8][asm.js] Fixes a bug in comma-expression validation.
Comma expressions need to special-handle function calls. When validating
the rhs of a Comma, the validatior needs to ensure that it returns
AsmType::Float() if the function being called is fround().

BUG= https://bugs.chromium.org/p/v8/issues/detail?id=5528

Review-Url: https://chromiumcodereview.appspot.com/2426473007
Cr-Commit-Position: refs/heads/master@{#40408}
2016-10-18 19:05:42 +00:00
mythria
d875e2cf80 [Interpreter] Collect feedback about Oddballs in Add, Mul, Div, Modulus stubs.
Add support to collect feedback about oddballs in Add, Mul, Div and Modulus stubs.
Turbofan uses NumberOrOddball feedback to reduce the number of deoptimizations.

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

Review-Url: https://codereview.chromium.org/2406263002
Cr-Commit-Position: refs/heads/master@{#40407}
2016-10-18 16:35:28 +00:00
jwolfe
21fda06c05 [turbofan] Implement JSBuiltinReducer for String.prototype[Symbol.iterator].
BUG=v8:5388

Review-Url: https://codereview.chromium.org/2422383002
Cr-Commit-Position: refs/heads/master@{#40406}
2016-10-18 16:33:05 +00:00
gsathya
0d8b253c34 Move PromiseNextMicrotaskID to cpp
BUG=v8:5343

Review-Url: https://codereview.chromium.org/2425553003
Cr-Commit-Position: refs/heads/master@{#40405}
2016-10-18 15:41:46 +00:00
kozyatinskiy
8bb2cef9c3 [inspector] introduce debug-interface.h
debug-interface.h contains part of v8-debug.h that is used by src/inspector.

BUG=v8:5510
R=dgozman@chromium.org, yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2423713003
Cr-Commit-Position: refs/heads/master@{#40404}
2016-10-18 15:15:21 +00:00
titzer
7bbfe5c81a [wasm] Compare wasm signatures against SMI constants for more efficient check.
R=ahaas@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2429833002
Cr-Commit-Position: refs/heads/master@{#40403}
2016-10-18 13:43:01 +00:00
epertoso
b6c152e967 [stubs] Removes the BranchIf.*() methods from CodeAssembler, changes their uses to Branch().
BranchIf and helpers were introduced when exporting the schedule from the RawMachineAssembler was not ensuring that the CFG was well-form. These methods, that were used to introduce blocks to ensure edge-split form, are now unnecessary.

BUG=

Review-Url: https://codereview.chromium.org/2426923002
Cr-Commit-Position: refs/heads/master@{#40402}
2016-10-18 13:28:22 +00:00
bmeurer
6c85285b98 [intrinsics] Nuke %HasCachedArrayIndex and %GetCachedArrayIndex.
These intrinsics are unused now, and so we can drop all the code in
fullcodegen and Crankshaft that deals with those. TurboFan and Ignition
never tried to optimize those.

R=mstarzinger@chromium.org
BUG=v8:5049

Review-Url: https://codereview.chromium.org/2427673004
Cr-Commit-Position: refs/heads/master@{#40401}
2016-10-18 13:13:36 +00:00
ahaas
3ebb74e0a2 [wasm] Use branch hint for the -1 check in I(32|64)Div.
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2413343002
Cr-Commit-Position: refs/heads/master@{#40400}
2016-10-18 12:55:05 +00:00
bmeurer
1b4e0fcaea [builtins] Migrate Number.parseInt to TurboFan builtin.
R=epertoso@chromium.org
BUG=v8:5049

Review-Url: https://codereview.chromium.org/2424403002
Cr-Commit-Position: refs/heads/master@{#40399}
2016-10-18 12:45:01 +00:00
ivica.bogosavljevic
7499d92d7f MIPS64: Fix Word32Compare turbofan operator implementation when comparing signed with unsigned operand
MIPS64 doesn't support Word32 compare instructions. Instead it relies
that the values in registers are correctly sign-extended and uses
Word64 comparison instead. This behavior is correct in most cases,
but doesn't work when comparing signed with unsigned operands.
The solution proposed here tries to match a comparison of signed
with unsigned operand, and perform Word32Compare simulation only
in those cases. Unfortunately, the solution is not complete because
it might skip cases where Word32 compare simulation is needed, so
basically it is a hack.

BUG=
TEST=mjsunit/compiler/uint32

Review-Url: https://codereview.chromium.org/2391393003
Cr-Commit-Position: refs/heads/master@{#40398}
2016-10-18 12:13:58 +00:00
bmeurer
308788b306 [ic] Unify CallIC feedback collection and handling.
Consistently collect CallIC feedback in fullcodegen and Ignition, even
for possibly direct eval calls, that were treated specially so far, for
no apparent reason. With the upcoming SharedFunctionInfo based CallIC
feedback, we might be able to even inline certain direct eval calls, if
they manage to hit the eval cache. More importantly, this patch
simplifies the collection and dealing with CallIC feedback (and as a
side effect fixes an inconsistency with feedback for super constructor
calls).

R=mvstanton@chromium.org, mythria@chromium.org
BUG=v8:2206,v8:4280,v8:5267

Review-Url: https://codereview.chromium.org/2426693002
Cr-Commit-Position: refs/heads/master@{#40397}
2016-10-18 12:01:22 +00:00
mythria
cad36659b1 [turbofan] When inlining JSCallConstruct receiver should be set to the hole.
When inlining JSCallConstruct in turbofan, receiver is initialized to model
the behaviour of constructor. When an implicit receiver is not required the
receiver value should be set to the hole value instead of undefined value.
When initializing the receiver via super calls, we check that the receiver
is the hole value.

BUG=chromium:653407

Review-Url: https://codereview.chromium.org/2424123002
Cr-Commit-Position: refs/heads/master@{#40396}
2016-10-18 11:48:15 +00:00
yangguo
35aee89a68 Fix android build.
TBR=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2426913002
Cr-Commit-Position: refs/heads/master@{#40395}
2016-10-18 11:17:03 +00:00
hpayer
60cb6013d4 [heap] Reland move slot filtering logic into sweeper.
BUG=chromium:648568

Review-Url: https://codereview.chromium.org/2428493003
Cr-Commit-Position: refs/heads/master@{#40393}
2016-10-18 10:07:08 +00:00
yangguo
0655c45986 [serializer] add test case for unknown external references.
Unknown external references must trigger assertion failure.

Review-Url: https://codereview.chromium.org/2428463002
Cr-Commit-Position: refs/heads/master@{#40391}
2016-10-18 09:47:31 +00:00
zhengxing.li
b275457ecb [builtins] Fixed a Gcc compilation error in src/code-stub-assembler.cc.
The CL #40373 (https://codereview.chromium.org/2405253006 ) caused a Gcc compilation error.

  The error message was:
  ../src/code-stub-assembler.cc: In member function ‘v8::internal::compiler::Node* v8::internal::CodeStubAssembler::CreateArrayIterator(v8::internal::compiler::Node*, v8::internal::compiler::Node*, v8::internal::compiler::Node*, v8::internal::compiler::Node*, v8::internal::IterationKind)’:
  ../src/code-stub-assembler.cc:7909:7: error: ‘kBaseMapIndex’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     int kBaseMapIndex;
         ^
  cc1plus: all warnings being treated as errors
  make[1]: *** [/home/zxli/work/google-v8/v8/out/x87.release/obj.target/v8_base/src/code-stub-assembler.o] Error 1

  This CL fixed this issue by initalizing kBaseMapIndex to 0.

BUG=

Review-Url: https://codereview.chromium.org/2423343002
Cr-Commit-Position: refs/heads/master@{#40390}
2016-10-18 09:46:16 +00:00
zhengxing.li
62649b8240 X87: [builtins] Remove the unused AllocationSite slot from ConstructFrame.
port 77419488a9 (r40377)

  original commit message:
  This slot is completely unused and always undefined anyways, so there's
  no need to maintain the slot during object construction.

BUG=

Review-Url: https://codereview.chromium.org/2425183002
Cr-Commit-Position: refs/heads/master@{#40389}
2016-10-18 08:48:36 +00:00
zhengxing.li
a05f85a3db X87: [ic] Delete old KeyedLoadIC code.
port 3f6e0a4ef9 (r40354)

  original commit message:
  RIP, handwritten KeyedLoadICStub, handwritten KeyedLoadIC_Megamorphic,
  and hydrogenized KeyedLoadGeneric!

BUG=

Review-Url: https://codereview.chromium.org/2430613003
Cr-Commit-Position: refs/heads/master@{#40388}
2016-10-18 08:30:02 +00:00
clemensh
ea51b8a764 [debug] [reland] Consistently use script from FrameMirror
... instead of getting it from the FunctionMirror. For WASM frames
(including asm.js -> WASM), the function is either unresolved or does
not contain the script.

The added test case failed before this CL.

R=kozyatinskiy@chromium.org, yangguo@chromium.org, titzer@chromium.org
BUG=v8:4203, chromium:656622

Committed: https://crrev.com/ce32e2ffd835062d764f3c0ee6a32543417cb615
Review-Url: https://codereview.chromium.org/2415073003
Cr-Original-Commit-Position: refs/heads/master@{#40348}
Cr-Commit-Position: refs/heads/master@{#40387}
2016-10-18 08:19:28 +00:00
zhengxing.li
1107aa8b74 X87: [turbofan]: Micro optimizations to lea[l/q] on ia32/x64.
port 87ae05c7c4 (r40341)

  original commit message:
  Utilize all opportunities to turn leas into adds.

BUG=

Review-Url: https://codereview.chromium.org/2429763002
Cr-Commit-Position: refs/heads/master@{#40386}
2016-10-18 08:10:59 +00:00
bmeurer
85844420a2 [turbofan] Fix return value of Array.prototype.push.
The inlined version of Array.prototype.push returned the value that was
pushed instead of the new "length" property value.

R=jarin@chromium.org
BUG=chromium:656037

Review-Url: https://codereview.chromium.org/2425903002
Cr-Commit-Position: refs/heads/master@{#40384}
2016-10-18 08:02:25 +00:00
verwaest
c4e7992cf7 Add support to trace preparsing decisions
BUG=v8:5501

Review-Url: https://codereview.chromium.org/2424013002
Cr-Commit-Position: refs/heads/master@{#40383}
2016-10-18 08:00:35 +00:00
jgruber
7a75f34b20 [regexp] RegExp.prototype.replace fast-paths
This CL adds two new fast-paths for RegExp.prototype.replace in the case
that the regexp itself is an unmodified JSRegExp instance and the
replace argument is callable. Such cases call directly into runtime.

This could be improved even further by turning the relevant runtime
functions into inline TurboFan.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2415663007
Cr-Commit-Position: refs/heads/master@{#40381}
2016-10-18 07:16:14 +00:00
danno
787157dd0f [stubs] Port StringAddStub to TF
In the process:
- Add ToString to the CodeStubAssembler and use it where appropriate
- Add constant-folding versions of IntPtrAdd/IntPtrSub to simplify code
  in element offset computation, especially for strings.

BUG=chromium:608675
LOG=N

Review-Url: https://codereview.chromium.org/2407813002
Cr-Commit-Position: refs/heads/master@{#40379}
2016-10-18 06:34:56 +00:00
ahaas
34fa66c08c [wasm] Break effect cycles in the Int64Lowering.
EffectPhis can cause a cycle in a TurboFan graph. We delay the
processing of EffectPhis in the Int64Lowering to break these cycles. We
do the same already for Phis.

R=titzer@chromium.org
BUG=v8:5518
TEST=unittests/Int64LoweringTest.EffectPhiLoop

Review-Url: https://codereview.chromium.org/2428583002
Cr-Commit-Position: refs/heads/master@{#40378}
2016-10-18 06:31:22 +00:00
bmeurer
77419488a9 [builtins] Remove the unused AllocationSite slot from ConstructFrame.
This slot is completely unused and always undefined anyways, so there's
no need to maintain the slot during object construction.

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

Review-Url: https://codereview.chromium.org/2423323002
Cr-Commit-Position: refs/heads/master@{#40377}
2016-10-18 06:07:00 +00:00
mtrofin
5bbf88bc44 [wasm] Test deserialized module still has bytes, + negative test
BUG=

Review-Url: https://codereview.chromium.org/2420373002
Cr-Commit-Position: refs/heads/master@{#40376}
2016-10-18 04:35:48 +00:00
zhengxing.li
3145befb3d [turbofan][X64] Movzxbl/Movsxbl/Movzxwl/Movsxwl also zero extend to 64bit.
movzxbl/movsxbl/movzxwl/movsxwl operations implicitly zero-extend to 64-bit on x64, So It's not necessary to generate a "movl" instruction to zero-extend.

  For example, movzxbl/movl instruction sequence occurs frequently in v8 interpreter bytecode handler.
  such as:
  kind = BYTECODE_HANDLER
  name = LdaSmi
  compiler = turbofan
  Instructions (size = 76)
  0x184870a3ce40 0 430fbe442601 movsxbl rax,[r14+r12*1+0x1]
  0x184870a3ce46 6 48c1e020 REX.W shlq rax, 32
  0x184870a3ce4a 10 498d5c2402 REX.W leaq rbx,[r12+0x2]
  0x184870a3ce4f 15 420fb61433 movzxbl rdx,[rbx+r14*1]
  0x184870a3ce54 20 8bd2 movl rdx,rdx          <---------------------- here is a redundant "movl"
  0x184870a3ce56 22 4883fa1e REX.W cmpq rdx,0x1e
  0x184870a3ce5a 26 0f8518000000 jnz 56 (0x184870a3ce78)

  This CL also referenced to CL #36038 (https://codereview.chromium.org/1950013003 ) for adding test cases.

BUG=

Review-Url: https://codereview.chromium.org/2427483002
Cr-Commit-Position: refs/heads/master@{#40375}
2016-10-18 03:40:37 +00:00
caitp
86d0dd362f [builtins] implement Array.prototype[@@iterator] in TFJ builtins
Implements the variations of CreateArrayIterator() in TFJ builtins
(ArrayPrototypeValues, ArrayPrototypeEntries and ArrayPrototypeKeys), and
provides two new Object types with numerous maps which identify certain
behaviours, which will be useful for inlining.

Removes src/js/array-iterator.js entirely

Also adds support for printing Symbol literals inserted by the Parser during
desugaring when FLAG_print_builtin_ast is set to true.

BUG=v8:5388
R=bmeurer@chromium.org, cbruni@chromium.org
TBR=ulan@chromium.org

Review-Url: https://codereview.chromium.org/2405253006
Cr-Commit-Position: refs/heads/master@{#40373}
2016-10-18 02:43:14 +00:00
ziyang
e75c5a6427 S390: Change printf format specifier in mark-compact.cc
fragmentation_limit_kb has type of size_t, using PRIuS instead of V8PRIdPTR.

R=mlippautz@chromium.org, ulan@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2425013002
Cr-Commit-Position: refs/heads/master@{#40371}
2016-10-17 19:50:43 +00:00
gsathya
18a116c7bd [promises] Move async debug event creation to c++
BUG=v8:5343

Review-Url: https://codereview.chromium.org/2415023002
Cr-Commit-Position: refs/heads/master@{#40369}
2016-10-17 15:38:16 +00:00
jgruber
0e0123a61c [regexp] Work around gcc bug triggering -Werror=strict-overflow
BUG=v8:5526

Review-Url: https://codereview.chromium.org/2422173003
Cr-Commit-Position: refs/heads/master@{#40368}
2016-10-17 15:13:08 +00:00
epertoso
ff287be98f [turbofan] Fixes CodeAssembler::Word32Shr'r rhs operand type.
BUG=

Review-Url: https://codereview.chromium.org/2425723002
Cr-Commit-Position: refs/heads/master@{#40367}
2016-10-17 14:59:54 +00:00
verwaest
7b5f018a2d Simplify should-eager-compile handling
BUG=v8:5209

Review-Url: https://codereview.chromium.org/2428533002
Cr-Commit-Position: refs/heads/master@{#40366}
2016-10-17 14:11:36 +00:00
vogelheim
0413145249 Speedup access to global_proxy.* attributes/accessors.
Using a global proxy (e.g. 'window.f', 'w.f' or 'this.f') is considerably slower than evaluating just 'f'. This CL aims to perform the necessary checks at compile time and inline the accesses.

This is a follow-on CL to crrev.com/2369933005:
- The initial upload is crrev.com/2369933005 + a rebase.
- The remaining issues are the fixes requested by the reviewers on that CL.

BUG=chromium:634276, chromium:654716

Committed: https://crrev.com/8f43d748272536117008aa6a1b53ea52126261c1
Review-Url: https://codereview.chromium.org/2403003002
Cr-Original-Commit-Position: refs/heads/master@{#40153}
Cr-Commit-Position: refs/heads/master@{#40365}
2016-10-17 13:37:03 +00:00
mstarzinger
dd144bbb03 [turbofan] Fix JSON escapes in --trace-turbo files.
This makes the character escaping in the graph visualizer less generic
but correct against the JSON spec. The spec has the following definition
for valid characters within a double quoted string:

char ::
  any-Unicode-character-except-"-or-\-or-control-character
  \"
  \\
  \/
  \b
  \f
  \n
  \r
  \t
  \u four-hex-digits

R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2421313002
Cr-Commit-Position: refs/heads/master@{#40364}
2016-10-17 13:10:33 +00:00
marja
d293bf54b0 Fix OOM handling on a background thread.
We don't have an Isolate, so we cannot use it for retrieving data or
calling the embedder's OOM handler. So just crash.

BUG=5525

Review-Url: https://codereview.chromium.org/2427623002
Cr-Commit-Position: refs/heads/master@{#40363}
2016-10-17 13:01:45 +00:00
machenbach
f5d333c297 Revert of [debug] Consistently use script from FrameMirror (patchset #3 id:40001 of https://codereview.chromium.org/2415073003/ )
Reason for revert:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/10706

https://github.com/v8/v8/wiki/Blink-layout-tests

Original issue's description:
> [debug] Consistently use script from FrameMirror
>
> ... instead of getting it from the FunctionMirror. For WASM frames
> (including asm.js -> WASM), the function is either unresolved or does
> not contain the script.
>
> The added test case failed before this CL.
>
> R=kozyatinskiy@chromium.org, yangguo@chromium.org, titzer@chromium.org
> BUG=v8:4203
>
> Committed: https://crrev.com/ce32e2ffd835062d764f3c0ee6a32543417cb615
> Cr-Commit-Position: refs/heads/master@{#40348}

TBR=kozyatinskiy@chromium.org,yangguo@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=v8:4203

Review-Url: https://codereview.chromium.org/2427633002
Cr-Commit-Position: refs/heads/master@{#40362}
2016-10-17 12:38:12 +00:00
heimbuef
e7fa9b0129 Named all zones in the project
This adds more useful information to the v8-heap-stats tool.

BUG=v8:5489

Review-Url: https://codereview.chromium.org/2394213003
Cr-Commit-Position: refs/heads/master@{#40361}
2016-10-17 12:12:42 +00:00
bmeurer
4afd2a14b6 [turbofan] Add support for TypeGuard to escape analysis.
R=mstarzinger@chromium.org

Review-Url: https://codereview.chromium.org/2427583002
Cr-Commit-Position: refs/heads/master@{#40360}
2016-10-17 12:07:11 +00:00
leszeks
0c1727ad79 [ignition/turbo] Add liveness analysis for the accumulator
Adds a boolean flag to the liveness analysis which makes it also analyze
the accumulator. This can help prevent the accumulator escaping loops,
as well as decreasing the number of distinct state values nodes in the
graph.

The flag is a kind of ugly way to hack this in, however it is probably
the simplest to add, and (more importantly) to remove once the AST graph
builder is gone.

I measure a 2.6% improvement on Mandreel on my x64 machine, and a ~2%
improvement on Navier-Stokes. Other improvements are expected.

Review-Url: https://codereview.chromium.org/2428503002
Cr-Commit-Position: refs/heads/master@{#40359}
2016-10-17 11:48:04 +00:00
ishell
7078c31dc6 [ic] Cache weak cells containing prototypes in respective PrototypeInfo objects.
BUG=

Review-Url: https://codereview.chromium.org/2428473002
Cr-Commit-Position: refs/heads/master@{#40358}
2016-10-17 11:45:00 +00:00
rossberg
4a90e7220c [wasm] Implement Table#set and Table#grow
R=ahaas@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2414053002
Cr-Commit-Position: refs/heads/master@{#40357}
2016-10-17 11:39:34 +00:00
verwaest
fbef7e1485 Take the scope info of the direct outer scope as outer scope info
BUG=v8:5209

Review-Url: https://codereview.chromium.org/2424693003
Cr-Commit-Position: refs/heads/master@{#40356}
2016-10-17 11:25:41 +00:00
cbruni
f8654ce9f6 Do not inline object-stats functions to reduce binary size.
BUG=chromium:645378

Review-Url: https://codereview.chromium.org/2422143002
Cr-Commit-Position: refs/heads/master@{#40355}
2016-10-17 11:10:08 +00:00
jkummerow
3f6e0a4ef9 [ic] Delete old KeyedLoadIC code
RIP, handwritten KeyedLoadICStub, handwritten KeyedLoadIC_Megamorphic,
and hydrogenized KeyedLoadGeneric!

Review-Url: https://codereview.chromium.org/2424433002
Cr-Commit-Position: refs/heads/master@{#40354}
2016-10-17 10:31:18 +00:00
mstarzinger
ab5379074d [parser] Deprecate ParseInfo constructor taking closure.
This removes the {ParseInfo} constructor consuming a closure, replacing
all uses to pass only the shared function info. The goal is to make the
fact that parsing is independent of a concrete closure explicit.

R=jochen@chromium.org
BUG=v8:2206

Committed: https://crrev.com/3de42b3f224217ec88e4c609d3cf23fe06806dca
Review-Url: https://codereview.chromium.org/2396963003
Cr-Original-Commit-Position: refs/heads/master@{#40083}
Cr-Commit-Position: refs/heads/master@{#40353}
2016-10-17 10:27:29 +00:00
bmeurer
4386dfeee0 [turbofan] Eliminate redundant ChangeTaggedSignedToInt32.
Apply the same strength reduction to the ChangeTaggedSignedToInt32
operator that we already have for ChangeTaggedToInt32.

R=epertoso@chromium.org

Review-Url: https://codereview.chromium.org/2428493002
Cr-Commit-Position: refs/heads/master@{#40352}
2016-10-17 10:15:07 +00:00
bmeurer
201e53fbe9 [turbofan] Run load elimination prior to escape analysis.
Once the escape analysis ran, it'll be harder to eliminate a bunch of
checks (for example map checks, which would currently block escape
analysis, but that's about to be fixed). Also the escape analysis will
have a lot less stress after the load elimination, which takes care of
redundant loads and checks already.

R=mstarzinger@chromium.org
BUG=v8:5448

Review-Url: https://codereview.chromium.org/2427533002
Cr-Commit-Position: refs/heads/master@{#40351}
2016-10-17 10:13:41 +00:00
jochen
6755b55a74 Make unittests work in component build
R=machenbach@chromium.org,titzer@chromium.org,bmeurer@chromium.org,jgruber@chromium.org
BUG=
CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_win_dbg,v8_mac_dbg;master.tryserver.chromium.android:android_arm64_dbg_recipe

Review-Url: https://codereview.chromium.org/2416243002
Cr-Commit-Position: refs/heads/master@{#40350}
2016-10-17 10:02:06 +00:00
verwaest
b7a163257b Separate scope info allocation for the debugger from regular allocation
BUG=

Review-Url: https://codereview.chromium.org/2425633002
Cr-Commit-Position: refs/heads/master@{#40349}
2016-10-17 09:45:01 +00:00
clemensh
ce32e2ffd8 [debug] Consistently use script from FrameMirror
... instead of getting it from the FunctionMirror. For WASM frames
(including asm.js -> WASM), the function is either unresolved or does
not contain the script.

The added test case failed before this CL.

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

Review-Url: https://codereview.chromium.org/2415073003
Cr-Commit-Position: refs/heads/master@{#40348}
2016-10-17 09:41:44 +00:00
titzer
6d266f0088 [wasm] Add a Managed<T> wrapper class for allocating C++ classes that are deleted when the wrapper is garbage collected.
Use sparingly!

This doesn't add any really new functionality, other than making it more
convenient to do this.

This will primarily be used to wrap a WasmModule to be referenced from a
JSObject that represents an instance. There is one WasmModule C++ object
per parsed WasmModule, so this should not be more than a handful or a few
dozen in well-behaved programs.

R=rossberg@chromium.org,mlippautz@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2409173005
Cr-Commit-Position: refs/heads/master@{#40346}
2016-10-17 09:28:40 +00:00
sander
f87d19c42e [crankshaft] Eliminate unnecessary ToNumber call
This is a fix for a regression that started ~6 months ago when
https://codereview.chromium.org/1757013002 landed. This patch will remove the
unnecessary Change/CallWithDescriptor/Change opcodes causing the regression.

BUG=v8:5373
R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2423923002
Cr-Commit-Position: refs/heads/master@{#40345}
2016-10-17 09:27:39 +00:00
bmeurer
e0b4b1b63f [turbofan] Manually smash the type on literal allocation.
Currently JSCreateLowering drops the type information for object
literals, when inlining the JSCreateLiteralArray/Object nodes,
which means we will not eliminate a couple of checks after the
lowering.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2423913002
Cr-Commit-Position: refs/heads/master@{#40344}
2016-10-17 09:13:54 +00:00
verwaest
9768ff47e7 Move should_eager_compile and is_lazily_parsed to DeclarationScope
BUG=v8:5209

Review-Url: https://codereview.chromium.org/2423883002
Cr-Commit-Position: refs/heads/master@{#40343}
2016-10-17 09:04:46 +00:00
mstarzinger
3c6bbe07e8 [turbofan] Funnel class constructors through TurboFan.
This makes optimization of all class constructors (i.e. both base and
derived) go through TurboFan. Note some class constructors containing
Harmony language features (e.g. super constructor calls or accesses to
the new.target value) were already going through TurboFan before.

R=bmeurer@chromium.org
BUG=v8:5458

Review-Url: https://codereview.chromium.org/2397723002
Cr-Commit-Position: refs/heads/master@{#40342}
2016-10-17 08:58:25 +00:00
danno
87ae05c7c4 [turbofan]: Micro optimizations to lea[l/q] on ia32/x64
Utilize all opportunities to turn leas into adds.

Review-Url: https://codereview.chromium.org/2418803002
Cr-Commit-Position: refs/heads/master@{#40341}
2016-10-17 08:57:44 +00:00
clemensh
8bb1e6d06b Add option to print all exceptions
When DevTools calls to JavaScript, it often ignores exceptions and just
fails since no value was returned.
The new --print-all-exceptions flag makes it easy to spot the location
and the reason for the thrown exception.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2417743004
Cr-Commit-Position: refs/heads/master@{#40340}
2016-10-17 08:37:41 +00:00
bmeurer
a40be67bbd [turbofan] Eliminate CheckHeapObject if the input cannot be in SignedSmall range.
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2425613002
Cr-Commit-Position: refs/heads/master@{#40339}
2016-10-17 08:36:35 +00:00
verwaest
9126cb8d2a Also mark the script-scope for eager compilation upon ForceEagerCompilation
BUG=v8:5424

Review-Url: https://codereview.chromium.org/2427503002
Cr-Commit-Position: refs/heads/master@{#40338}
2016-10-17 08:32:06 +00:00
bmeurer
8791f01bb1 [ignition] Collect feedback for super constructor calls.
In order to optimize super constructor calls with ES6 classes, we need
some feedback for both the JSCallConstruct and the resulting JSCreate
nodes in TurboFan. Both already optimize perfectly when the see nodes
with JSFunction constants, so utilizing the existing CallIC machinery
here, enables us to optimize the super constructor calls right now w/o
a lot of effort.

Note that there are probably better ways to track this information,
for example we could do some tracking on the constructor functions;
this will however require serious changes in TurboFan and the runtime,
and would block progress on more important tasks.

R=mythria@chromium.org
BUG=v8:5517

Review-Url: https://codereview.chromium.org/2419423002
Cr-Commit-Position: refs/heads/master@{#40337}
2016-10-17 07:57:42 +00:00
neis
4c364e63af [modules] Don't unnecessarily keep function alive after evaluation.
Also hide some implementation details behind abstract predicates and clean up the heap verifier functions.

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

Review-Url: https://codereview.chromium.org/2407183002
Cr-Commit-Position: refs/heads/master@{#40336}
2016-10-17 07:37:03 +00:00
bmeurer
0f4a4ae026 [turbofan] Inline Object.prototype.__proto__ getter.
In the JSCallReducer, recognize and inline calls to the __proto__ getter
on the %ObjectPrototype%.

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

Review-Url: https://codereview.chromium.org/2421923002
Cr-Commit-Position: refs/heads/master@{#40335}
2016-10-17 06:29:24 +00:00
bmeurer
96f1327a93 [turbofan] Add missing Float32 -> TaggedSigned conversion.
There are a couple of operators that can indeed produce Float32
representation, which we might end up using in a TaggedSigned
context, so add the missing conversion (indirectly via Float64).

BUG=chromium:656275
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2421193002
Cr-Commit-Position: refs/heads/master@{#40334}
2016-10-17 05:41:09 +00:00
gdeepti
3d6f774352 [wasm] Fix bounds check for zero initial memory.
Currently when memory size references are updated with zero initial memory during GrowMemory/Relocation of Instance objects, the bounds check does not take into account the size of memtype.

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

Committed: https://crrev.com/70416a2b360c0d993cffb48284b143d484d1e290
Review-Url: https://codereview.chromium.org/2416543002
Cr-Original-Commit-Position: refs/heads/master@{#40326}
Cr-Commit-Position: refs/heads/master@{#40329}
2016-10-14 23:54:50 +00:00
gdeepti
2c4563003c Revert of [wasm] Fix bounds check for zero initial memory. (patchset #11 id:200001 of https://codereview.chromium.org/2416543002/ )
Reason for revert:
Reverting because of failure on V8 Linux64 GC Stress

http://build.chromium.org/p/client.v8/builders/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/builds/8572

Original issue's description:
> [wasm] Fix bounds check for zero initial memory.
>
> Currently when memory size references are updated with zero initial memory during GrowMemory/Relocation of Instance objects, the bounds check does not take into account the size of memtype.
>
> R=titzer@chromium.org, bradnelson@chromium.org
>
> Committed: https://crrev.com/70416a2b360c0d993cffb48284b143d484d1e290
> Cr-Commit-Position: refs/heads/master@{#40326}

TBR=bradnelson@chromium.org,titzer@chromium.org,bradnelson@google.com,mtrofin@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/2416393002
Cr-Commit-Position: refs/heads/master@{#40328}
2016-10-14 22:43:24 +00:00
gsathya
b122da39d0 [async await] Fix debug async task event
If the catch prediction machinery in the middle of some async op, we
shouldn't send invalid events to the debugger.

Instead of sending events with an undefined id, we don't send them at
all.

Review-Url: https://codereview.chromium.org/2417093003
Cr-Commit-Position: refs/heads/master@{#40327}
2016-10-14 21:16:58 +00:00
gdeepti
70416a2b36 [wasm] Fix bounds check for zero initial memory.
Currently when memory size references are updated with zero initial memory during GrowMemory/Relocation of Instance objects, the bounds check does not take into account the size of memtype.

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

Review-Url: https://codereview.chromium.org/2416543002
Cr-Commit-Position: refs/heads/master@{#40326}
2016-10-14 21:01:55 +00:00
ishell
5acc31d863 [ic] Support data handlers that represent loads of constants from prototypes.
BUG=

Review-Url: https://codereview.chromium.org/2421883002
Cr-Commit-Position: refs/heads/master@{#40325}
2016-10-14 19:25:03 +00:00
ishell
d4a47fe6cc [ic] Smi-handlers are now able to represent loads of constants from descriptor array.
BUG=

Review-Url: https://codereview.chromium.org/2418063003
Cr-Commit-Position: refs/heads/master@{#40324}
2016-10-14 19:17:04 +00:00
alph
74a392cc88 [inspector] Record EvaluateScript trace event upon console evaluation
It will allow timeline to show JS profile on code evaluated from console.

BUG=chromium:655430

Committed: https://crrev.com/6882c91ecd222f3ee2feb42ad73fbc796d5c8172
Review-Url: https://codereview.chromium.org/2413943002
Cr-Original-Commit-Position: refs/heads/master@{#40289}
Cr-Commit-Position: refs/heads/master@{#40323}
2016-10-14 19:05:10 +00:00
danno
2f95265238 [Reland]: Improve CodeStubAssembler assert functionality
Introduce CSA_ASSERT macro that outputs a message, file name and line number to
console before calling DebugBreak.

Committed: https://crrev.com/23836e9c14f3df9b675fe02e2c23bb11e728b83d
Review-Url: https://codereview.chromium.org/2419433008
Cr-Original-Commit-Position: refs/heads/master@{#40307}
Cr-Commit-Position: refs/heads/master@{#40322}
2016-10-14 15:16:15 +00:00
mtrofin
80caaac31b [wasm] test deserialization when header is invalid
A test where the deserialization data has a header, but the
header is invalid. This is in addition to the current test
where we have empty deserialization data.

BUG=

Review-Url: https://codereview.chromium.org/2418483002
Cr-Commit-Position: refs/heads/master@{#40321}
2016-10-14 14:25:25 +00:00
epertoso
3653261931 [turbofan] Modifies the --turbo-verify-machine-graph flag to act as a filter.
This allows people writing code stubs to just verify the graph of the stub they're working on, at least until we fix all of the issues we have and enable the verification by default.

Also fixes representations in CodeStubAssembler::SmiOr and InterpreterAssembler::StarDispatchLookahead.

R=bmeurer@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2413653006
Cr-Commit-Position: refs/heads/master@{#40320}
2016-10-14 14:22:36 +00:00
verwaest
7899fcc524 Drop Lazy from parser method names and events
BUG=

Review-Url: https://codereview.chromium.org/2414383002
Cr-Commit-Position: refs/heads/master@{#40318}
2016-10-14 14:09:27 +00:00
ziyang
cb0958e657 S390: Change printf format specifier for promoted and semi_space_copied in GcTracer
promoted and semi_space_copied are still int type, so it is needed to use V8PRIdPTR
as their printf format specifier.

R=mlippautz@chromium.org, ulan@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2415183003
Cr-Commit-Position: refs/heads/master@{#40317}
2016-10-14 13:46:10 +00:00
yangguo
b3852ab3b4 Remove --log-regexp.
There is no user for this log entry, and a large part of regexp log
output has long been removed already.

R=jgruber@chromium.org

Review-Url: https://codereview.chromium.org/2422593003
Cr-Commit-Position: refs/heads/master@{#40316}
2016-10-14 13:26:33 +00:00
marja
97fe83c78f Remove "is function lazy" logic from Preparser + tiny error reporting refactoring.
It doesn't need to have this logic.

ParseLazyFunctionLiteralBody is basically just ParseStatementList
+ log the function position. But PreParser doesn't need to have
the "which functions to log" logic, since logging the function is
always done exactly when Parser falls back to PreParser. (See
PreParseLazyFunction.)

So in the current state, PreParser would log several functions in
a SingletonLogger, and only the last one would take
effect (that's the one Parser also logs in SkipLazyFunctionBody).

Also updated test-parsing/Regress928 to produce the preparse data
the way we do now (i.e., not running the PreParser directly, but
running the Parser).

Error reporting: when PreParser finds an error, it doesn't need
to ReportUnexpectedToken in PreParseLazyFunction, since it
already has reported the error whenever it found it.

BUG=v8:5515

Review-Url: https://codereview.chromium.org/2421833002
Cr-Commit-Position: refs/heads/master@{#40315}
2016-10-14 13:21:12 +00:00
ishell
ac886b0c1c [ic] Move Smi-handler creation code to SmiHandler class.
... to keep all the pieces in one place for easier modifications.

This CL also adds a new runtime call stats bucket: KeyedLoadIC_LoadElementDH.

BUG=

Review-Url: https://codereview.chromium.org/2412983008
Cr-Commit-Position: refs/heads/master@{#40314}
2016-10-14 12:37:32 +00:00
machenbach
0b260995c6 Revert of Improve CodeStubAssembler assert functionality (patchset #3 id:40001 of https://codereview.chromium.org/2419433008/ )
Reason for revert:
[Sheriff] Fails leak checker:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20debug/builds/12393

Original issue's description:
> Improve CodeStubAssembler assert functionality
>
> Introduce CSA_ASSERT macro that outputs a message, file name and line number to
> console before calling DebugBreak.
>
> Committed: https://crrev.com/23836e9c14f3df9b675fe02e2c23bb11e728b83d
> Cr-Commit-Position: refs/heads/master@{#40307}

TBR=epertoso@chromium.org,ishell@google.com,ishell@chromium.org,danno@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/2414373002
Cr-Commit-Position: refs/heads/master@{#40313}
2016-10-14 12:32:34 +00:00
yangguo
859eb7bdbc Fix interpreted regexp build wrt tracing.
R=jgruber@chromium.org

Review-Url: https://codereview.chromium.org/2418123002
Cr-Commit-Position: refs/heads/master@{#40312}
2016-10-14 12:23:50 +00:00
yangguo
92efd8f112 Clean up builtins export whitelist.
R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2410303009
Cr-Commit-Position: refs/heads/master@{#40311}
2016-10-14 11:52:03 +00:00
jgruber
fa28281266 [regexp] Match spec semantics in AdvanceStringIndex
Let AdvanceStringIndex return the incremented index instead of the
increment, and adjust all use sites.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2415383002
Cr-Commit-Position: refs/heads/master@{#40310}
2016-10-14 11:49:30 +00:00
jgruber
b182ab8302 [regexp] Simplify GetCapture
GetCapture can reuse the bool pointer argument of GenericCaptureGetter
instead of duplicating that logic with additional checks.

The check also incorrectly checks for undefined while
GenericCaptureGetter returns the empty string on failure.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2422563002
Cr-Commit-Position: refs/heads/master@{#40309}
2016-10-14 11:48:10 +00:00
jgruber
f60a7c4f61 [regexp] Turn last match info into a simple FixedArray
Now that all accesses to the last match info are in C++ and TF code, we can
finally turn the last match info into a FixedArray. Similar to the ArrayList,
it uses its first field to store its length and grows dynamically in amortized
O(1) time.

Unlike previously, this means that the last match info pointer stored on the
context can actually change (in case the FixedArray needs to grow).

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2415103002
Cr-Commit-Position: refs/heads/master@{#40308}
2016-10-14 11:47:09 +00:00
danno
23836e9c14 Improve CodeStubAssembler assert functionality
Introduce CSA_ASSERT macro that outputs a message, file name and line number to
console before calling DebugBreak.

Review-Url: https://codereview.chromium.org/2419433008
Cr-Commit-Position: refs/heads/master@{#40307}
2016-10-14 11:28:46 +00:00
bmeurer
71cb88281c [builtins] Also port the Object.prototype.__proto__ accessors to C++.
These accessors also always call into C++ anyways, so there's no point
in having the JavaScript wrappers.

R=yangguo@chromium.org
BUG=v8:5049, chromium:655963

Committed: https://crrev.com/ede69cfabd790fe9f171b5d1f426ea0fc55e3c98
Review-Url: https://codereview.chromium.org/2417183002
Cr-Original-Commit-Position: refs/heads/master@{#40298}
Cr-Commit-Position: refs/heads/master@{#40306}
2016-10-14 11:25:02 +00:00
ulan
ddf83fb84a [heap] Reland "Cancel tasks before tearing down the heap."
BUG=chromium:654343

Review-Url: https://codereview.chromium.org/2419783004
Cr-Commit-Position: refs/heads/master@{#40305}
2016-10-14 10:07:35 +00:00
machenbach
0b74984156 Revert of [builtins] Also port the Object.prototype.__proto__ accessors to C++. (patchset #1 id:1 of https://codereview.chromium.org/2417183002/ )
Reason for revert:
[Sheriff] Speculative revert for webkit tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/10656

Was broken before, but this one test failure started with this CL:
inspector/console/console-dir.htm

All other errors stopped after another revert.

See also:
https://github.com/v8/v8/wiki/Blink-layout-tests

Original issue's description:
> [builtins] Also port the Object.prototype.__proto__ accessors to C++.
>
> These accessors also always call into C++ anyways, so there's no point
> in having the JavaScript wrappers.
>
> R=yangguo@chromium.org
> BUG=v8:5049
>
> Committed: https://crrev.com/ede69cfabd790fe9f171b5d1f426ea0fc55e3c98
> Cr-Commit-Position: refs/heads/master@{#40298}

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

Review-Url: https://codereview.chromium.org/2415173003
Cr-Commit-Position: refs/heads/master@{#40303}
2016-10-14 09:50:51 +00:00
jgruber
6f7cbc23c0 Remove RETURN_RESULT macro
'RETURN_RESULT(isolate, call, type)' is equivalent to 'return call' in
all current use cases.

BUG=

Review-Url: https://codereview.chromium.org/2415993003
Cr-Commit-Position: refs/heads/master@{#40302}
2016-10-14 09:18:54 +00:00
neis
b61baa9e32 [builtins] Remove template argument from args.target().
It's always JSFunction.

R=bmeurer@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2422573002
Cr-Commit-Position: refs/heads/master@{#40301}
2016-10-14 09:01:42 +00:00
jochen
c592e45400 Fix generate-bytecode-expectations to work in component builds
R=machenbach@chromium.org,jgruber@chromium.org,mythria@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_win_dbg,v8_mac_dbg;master.tryserver.chromium.android:android_arm64_dbg_recipe

Review-Url: https://codereview.chromium.org/2410353005
Cr-Commit-Position: refs/heads/master@{#40300}
2016-10-14 08:56:07 +00:00
machenbach
64378066b7 Revert of [inspector] Record EvaluateScript trace event upon console evaluation (patchset #2 id:20001 of https://codereview.chromium.org/2413943002/ )
Reason for revert:
Breaks layout tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/10647

See also:
https://github.com/v8/v8/wiki/Blink-layout-tests

Original issue's description:
> [inspector] Record EvaluateScript trace event upon console evaluation
>
> It will allow timeline to show JS profile on code evaluated from console.
>
> BUG=chromium:655430
>
> Committed: https://crrev.com/6882c91ecd222f3ee2feb42ad73fbc796d5c8172
> Cr-Commit-Position: refs/heads/master@{#40289}

TBR=caseq@chromium.org,paulirish@chromium.org,dgozman@chromium.org,alph@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:655430

Review-Url: https://codereview.chromium.org/2416213002
Cr-Commit-Position: refs/heads/master@{#40299}
2016-10-14 08:51:50 +00:00
bmeurer
ede69cfabd [builtins] Also port the Object.prototype.__proto__ accessors to C++.
These accessors also always call into C++ anyways, so there's no point
in having the JavaScript wrappers.

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

Review-Url: https://codereview.chromium.org/2417183002
Cr-Commit-Position: refs/heads/master@{#40298}
2016-10-14 08:36:52 +00:00
jochen
aee0a2573b parser fuzzer and parser shell should also work in component builds
R=machenbach@chromium.org,jgruber@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_win_dbg,v8_mac_dbg;master.tryserver.chromium.android:android_arm64_dbg_recipe

Review-Url: https://codereview.chromium.org/2417703003
Cr-Commit-Position: refs/heads/master@{#40297}
2016-10-14 08:35:52 +00:00
verwaest
1ac958d4b2 Make sure we always temp-zone parse if we preparse toplevel
BUG=

Review-Url: https://codereview.chromium.org/2421493002
Cr-Commit-Position: refs/heads/master@{#40296}
2016-10-14 08:21:14 +00:00
jochen
ad99b196cb Introduce a CompilerDispatcherTracer and track how long jobs take
R=ulan@chromium.org,cbruni@chromium.org,rmcilroy@chromium.org
BUG=v8:5215

Review-Url: https://codereview.chromium.org/2413243002
Cr-Commit-Position: refs/heads/master@{#40295}
2016-10-14 08:12:44 +00:00
epertoso
4897c357e7 [stubs] Gets rid of the Smi(Add/Sub)WithOverflow macros.
This is done to introduce the correct bitcasts operator on the right nodes.

R=bmeurer@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2415133002
Cr-Commit-Position: refs/heads/master@{#40294}
2016-10-14 08:11:37 +00:00
bmeurer
4a88d8fb1d [builtins] Migrate Object.setPrototypeOf to C++.
This calls into C++ anyways, so no need to add the JavaScript wrapper
around it.

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

Review-Url: https://codereview.chromium.org/2421803002
Cr-Commit-Position: refs/heads/master@{#40293}
2016-10-14 08:10:18 +00:00
machenbach
cdc3459a85 Revert of [heap] Move slot filtering logic into sweeper. (patchset #4 id:60001 of https://codereview.chromium.org/2418773002/ )
Reason for revert:
[Sheriff] Speculative revert for heap corruption on all platforms, e.g.:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20debug/builds/12377
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20debug/builds/12379
https://build.chromium.org/p/client.v8/builders/V8%20Win32/builds/4819
https://build.chromium.org/p/client.v8/builders/V8%20Win32%20-%20nosnap%20-%20shared/builds/16783
https://build.chromium.org/p/client.v8/builders/V8%20Mac64%20-%20debug/builds/10007

Original issue's description:
> [heap] Move slot filtering logic into sweeper.
>
> BUG=chromium:648568
>
> Committed: https://crrev.com/18db69c38c93450c1ae957999fc48c465f111f00
> Cr-Commit-Position: refs/heads/master@{#40267}

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

Review-Url: https://codereview.chromium.org/2418053002
Cr-Commit-Position: refs/heads/master@{#40292}
2016-10-14 06:59:38 +00:00
kozyatinskiy
2082afcf3c [inspector] added check that context always survives inspected context
Inspected context is created in V8InspectorImpl::contextCreated method and destroyed in V8InspectorImpl::contextDestroyed.
Both methods takes valid v8::Local<v8::Context> handle to the same context, it means that context is created before InspectedContext constructor and is always destroyed after InspectedContext destructor therefore context weak callback in inspected context should be never called.
It's possible only if inspector client doesn't call contextDestroyed which is considered an error.

Therefore CHECK(false) is added into context weak callback to be sure that v8::Context always survives inspected context.

BUG=chromium:652548
R=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2413583002
Cr-Commit-Position: refs/heads/master@{#40290}
2016-10-14 02:00:00 +00:00
alph
6882c91ecd [inspector] Record EvaluateScript trace event upon console evaluation
It will allow timeline to show JS profile on code evaluated from console.

BUG=chromium:655430

Review-Url: https://codereview.chromium.org/2413943002
Cr-Commit-Position: refs/heads/master@{#40289}
2016-10-13 21:57:48 +00:00
kozyatinskiy
7ba222ffcb [inspector] fix timestamp formatting with non C locales
If current locale has "," as decimal separator then message for consoleAPICalled will be corrupted.

BUG=chromium:653424
R=dgozman@chromium.org

Committed: https://crrev.com/dde5ef75cbac1eb7e2dae59b246e4a0d0ba6a0f4
Review-Url: https://codereview.chromium.org/2410933002
Cr-Original-Commit-Position: refs/heads/master@{#40190}
Cr-Commit-Position: refs/heads/master@{#40288}
2016-10-13 20:32:07 +00:00
ahaas
52cf416aa8 [wasm] Let BranchTableIterator::has_next return false if decoder->failed()
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2411793006
Cr-Commit-Position: refs/heads/master@{#40287}
2016-10-13 18:32:15 +00:00
jarin
96a448aba3 [turbofan] Native-context-spec: Use the CheckMaps for polymorphic fall-through.
Review-Url: https://codereview.chromium.org/2412393003
Cr-Commit-Position: refs/heads/master@{#40286}
2016-10-13 18:13:31 +00:00
bmeurer
a601eccbde Revert of [turbofan] Enable super constructor inlining. (patchset #1 id:1 of https://codereview.chromium.org/2409423006/ )
Reason for revert:
As adamk@ pointed out, this is not correct. Some more changes required instead

Original issue's description:
> [turbofan] Enable super constructor inlining.
>
> When we inlined a [[Construct]] call to a subclass constructor, we can
> also inline the super constructor call (either explicit or implicit),
> since we have a concrete JSFunction constant for the subclass and we
> can thus constant-fold the %_GetSuperConstructor intrinsic. We don't
> need any guards here since the prototype of subclass constructors is
> non-writable, non-configurable in ES6.
>
> BUG=v8:5517
> R=jarin@chromium.org
>
> Committed: https://crrev.com/74158b00b3f6a1fc8676dd1f7af4d96131eb5ebe
> Cr-Commit-Position: refs/heads/master@{#40261}

TBR=jarin@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:5517

Review-Url: https://codereview.chromium.org/2413883003
Cr-Commit-Position: refs/heads/master@{#40285}
2016-10-13 18:04:56 +00:00
mlippautz
0ee8eea2f4 [heap] Consider both marking deques when triggering a GC in finalization
R=ulan@chromium.org
BUG=chromium:468240

Review-Url: https://codereview.chromium.org/2418803003
Cr-Commit-Position: refs/heads/master@{#40284}
2016-10-13 17:49:09 +00:00
ishell
73460009a6 [ic] Support data handlers that represent loads from prototypes.
This CL also adds separate runtime call stats buckets for data handlers.

BUG=

Review-Url: https://codereview.chromium.org/2419513002
Cr-Commit-Position: refs/heads/master@{#40281}
2016-10-13 16:19:24 +00:00
rossberg
fb5b2f5241 [wasm] Implement {Compile,Runtime}Error; fix traps from start function
R=ahaas@chromium.org, titzer@chromium.org
BUG=v8:5507

Review-Url: https://codereview.chromium.org/2421453002
Cr-Commit-Position: refs/heads/master@{#40280}
2016-10-13 16:18:10 +00:00
ulan
f0c3a2523d Revert of [heap] Cancel tasks before tearing down the heap. (patchset #2 id:20001 of https://codereview.chromium.org/2413203004/ )
Reason for revert:
Timeout on gc stress bot.

Original issue's description:
> [heap] Cancel tasks before tearing down the heap.
>
> BUG=chromium:654343
>
> Committed: https://crrev.com/9365463d6f1fc11b2369fff63ca0ac825c61eae4
> Cr-Commit-Position: refs/heads/master@{#40272}

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

Review-Url: https://codereview.chromium.org/2414073002
Cr-Commit-Position: refs/heads/master@{#40279}
2016-10-13 16:16:46 +00:00
jgruber
a10b4712c6 [regexp] Port remaining JS functions in regexp.js
This ports RegExpInitialize, IsRegExp, InternalMatch and InternalReplace to C++
/ TurboFan. InternalMatch is in TurboFan because it calls RegExpExecStub and
needs to construct a RegExpResult (which are, respectively, a PlatformStub and
a CodeStubAssembler function).

Except for LastMatchInfo (and GetSubstitution, which could be moved to string.js
anytime), regexp.js is now completely empty.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2409513003
Cr-Commit-Position: refs/heads/master@{#40277}
2016-10-13 15:03:22 +00:00
ziyang
34e0596a39 S390: Change printf format specifier for size_t in GcTracer
GCC on S390 31-bit treats size_t as 'long unsigned int', which
is incompatible with %d format specifier that expects an 'int'.
Using the appropriate macro (PRIuS) instead.

R=mlippautz@chromium.org, ulan@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2412563003
Cr-Commit-Position: refs/heads/master@{#40276}
2016-10-13 14:56:11 +00:00
verwaest
3f8a85cefd Remove explicitly setting of allow_lazy_parsing in background-parsing-task.cc
This is automatically taken into account in the Parser constructor already

BUG=v8:5501

Review-Url: https://codereview.chromium.org/2409103005
Cr-Commit-Position: refs/heads/master@{#40275}
2016-10-13 14:50:54 +00:00
mythria
6fa76d461b [Interpreter] Print information about interpreted functions when tracing ics.
With --trace-ic flag, the function names and the source positions are
not shown for interpreted functions. Interpreted functions have an extra
frame built by bytecode handlers which has to be skipped to get the
interpreted function's frame. Also the code offsets are computed differently
for interpreted functions.

BUG=v8:4280

Review-Url: https://codereview.chromium.org/2405173007
Cr-Commit-Position: refs/heads/master@{#40274}
2016-10-13 14:48:01 +00:00
rossberg
d95b754319 Implement Table#length and Table#get
R=ahaas@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2411963003
Cr-Commit-Position: refs/heads/master@{#40273}
2016-10-13 14:43:46 +00:00
ulan
9365463d6f [heap] Cancel tasks before tearing down the heap.
BUG=chromium:654343

Review-Url: https://codereview.chromium.org/2413203004
Cr-Commit-Position: refs/heads/master@{#40272}
2016-10-13 14:35:18 +00:00
ahaas
fa1f9c37d1 [wasm] Do not generate a loop stack check upon a decoder error.
A decoder error sets builder_ to null, which causes builder_->StackCheck
to segfault.

R=titzer@chromium.org

TEST=mjsunit/regress/wasm/loop-stack-check

Review-Url: https://codereview.chromium.org/2416873002
Cr-Commit-Position: refs/heads/master@{#40271}
2016-10-13 14:33:11 +00:00
mvstanton
0bf492215c OBJECT_PRINT needs to have ICState2String() defined.
R=ishell@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2410353004
Cr-Commit-Position: refs/heads/master@{#40270}
2016-10-13 14:06:33 +00:00
verwaest
9284459748 Explicitly check for lazy parser when dealing with parser cache
BUG=v8:5501

Review-Url: https://codereview.chromium.org/2417643004
Cr-Commit-Position: refs/heads/master@{#40269}
2016-10-13 14:02:08 +00:00
clemensh
e902b69d88 [wasm] Stack inspection support for asm.js frames
This CL fixes the debugger interface to provide correct (high-level)
information for asm.js frames.
It moves the computation of the source position from the FrameInspector
to the individual StackFrame implementations, such that we can easily
specualize it for certain frame types, and can potentially reuse this
in other locations.

Also, we are finalizing the setup of the wasm module earlier, before
executing the start function. This is required for correct stack traces
during the execution of the start function.

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

Review-Url: https://codereview.chromium.org/2413693003
Cr-Commit-Position: refs/heads/master@{#40268}
2016-10-13 13:55:07 +00:00
hpayer
18db69c38c [heap] Move slot filtering logic into sweeper.
BUG=chromium:648568

Review-Url: https://codereview.chromium.org/2418773002
Cr-Commit-Position: refs/heads/master@{#40267}
2016-10-13 13:43:18 +00:00
mvstanton
26307c76c3 [turbofan] Remove Float32 truncation.
R=jarin@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2407153007
Cr-Commit-Position: refs/heads/master@{#40266}
2016-10-13 13:38:27 +00:00
neis
dafe6867f3 [modules] Implement @@iterator on namespace objects.
As part of this, introduce a new JSObject for iterating over the elements of a
FixedArray.

R=adamk@chromium.org,bmeurer@chromium.org
TBR=ulan@chromium.org
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2407423002
Cr-Commit-Position: refs/heads/master@{#40265}
2016-10-13 13:35:06 +00:00
verwaest
6e3af1070b Directly enter the parsing mode in DoParseProgram
BUG=v8:5501

Review-Url: https://codereview.chromium.org/2413763004
Cr-Commit-Position: refs/heads/master@{#40264}
2016-10-13 13:34:09 +00:00
neis
27228d2ffd [turbofan] Remember source positions when creating graph from bytecode.
R=bmeurer@chromium.org
BUG=v8:5439

Review-Url: https://codereview.chromium.org/2407823002
Cr-Commit-Position: refs/heads/master@{#40263}
2016-10-13 13:14:13 +00:00
Ilija.Pavlovic
9cb42010aa [heap] Fix MemoryAllocator::AllocateAlignedMemory.
AllocateAlignedMemory calls ReserveAlignedMemory which increments size_
value. In some cases AllocateAlignedMemory can return NULL value. Before
returning NULL, AllocateAlignedMemory should decrease size_ value.

TEST=cctest/test-spaces/LargeObjectSpace
BUG=

Review-Url: https://codereview.chromium.org/2418733002
Cr-Commit-Position: refs/heads/master@{#40262}
2016-10-13 13:10:38 +00:00
bmeurer
74158b00b3 [turbofan] Enable super constructor inlining.
When we inlined a [[Construct]] call to a subclass constructor, we can
also inline the super constructor call (either explicit or implicit),
since we have a concrete JSFunction constant for the subclass and we
can thus constant-fold the %_GetSuperConstructor intrinsic. We don't
need any guards here since the prototype of subclass constructors is
non-writable, non-configurable in ES6.

BUG=v8:5517
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2409423006
Cr-Commit-Position: refs/heads/master@{#40261}
2016-10-13 12:56:31 +00:00
marja
a726e85fe3 Move function length tracking from Scope to (Pre)?ParserFormalParameters.
It belongs there more logically. In addition, this is a pre-step needed
for preparsing the parameters of a preparsed function.

In addition, move the "subtract rest parameter from arity" logic from
Parser to (Pre)?ParserFormalParameters.

BUG=v8:5515

Review-Url: https://codereview.chromium.org/2414003002
Cr-Commit-Position: refs/heads/master@{#40258}
2016-10-13 12:34:54 +00:00
verwaest
1bb9fb34d7 Turn AllowsLazyParsingWithoutUnresolvedVariables into a whitelist stopping at the outer parsed context.
Any context outer to what we're parsing already has proper context allocation, so we don't need to check those scopes.

BUG=v8:5501

Review-Url: https://codereview.chromium.org/2417643003
Cr-Commit-Position: refs/heads/master@{#40256}
2016-10-13 12:22:16 +00:00
ishell
c97535f57e [ic] Support non-code handlers in megamorphic stub cache.
BUG=

Review-Url: https://codereview.chromium.org/2412043003
Cr-Commit-Position: refs/heads/master@{#40255}
2016-10-13 12:02:27 +00:00
ahaas
77bda187a5 [wasm] Stop the BranchTableIterator if there is an error in the decoder.
In a fuzzer testcase I found locally the ast-decoder spent a lot of time
in the decoding of kExprBrTable after the decoder already found an
error. I did not add a test because the fuzzer test case did not
actually crash. It only run out of memory in the chromium fuzzer.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2413863003
Cr-Commit-Position: refs/heads/master@{#40254}
2016-10-13 11:59:06 +00:00
jgruber
33a4faa47d [regexp] Port RegExp.prototype[@@replace]
This moves the implementation of @@replace from regexp.js to builtins-regexp.cc
(the TurboFan fast path) and runtime-regexp.cc (slow path). The fast path
handles all cases in which the regexp itself is an unmodified JSRegExp
instance, the given 'replace' argument is not callable and does not contain any
'$' characters (i.e. we are doing a string replacement).

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2398423002
Cr-Commit-Position: refs/heads/master@{#40253}
2016-10-13 11:27:50 +00:00
marja
897d89eec5 Update src/regexp/OWNERS
BUG=

Review-Url: https://codereview.chromium.org/2412493008
Cr-Commit-Position: refs/heads/master@{#40252}
2016-10-13 11:11:34 +00:00
ahaas
e7dc517748 [wasm] Add stack checks to loops.
Stack checks in loops allows to interrupt loops.

BUG=cctest/test-run-wasm-module/TestInterruptLoop
R=titzer@chromium.org, bradnelson@chromium.org

Review-Url: https://codereview.chromium.org/2405293002
Cr-Commit-Position: refs/heads/master@{#40251}
2016-10-13 10:56:59 +00:00
ulan
5831264356 [heap] Use size_t in free list and evacuation candidate selection.
BUG=chromium:652721

Review-Url: https://codereview.chromium.org/2406363002
Cr-Commit-Position: refs/heads/master@{#40250}
2016-10-13 10:50:52 +00:00
jgruber
e89eef3029 [regexp] Fix fallback path in RegExpExec
This fixes the code-path in RegExpExec in which both the passed exec
argument and regexp.exec are not callable and regexp is a JSRegExp.

In this case, we fall back to the default RegExp.prototype.exec
implementation. The arguments for Execution::call were incorrect.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2415073002
Cr-Commit-Position: refs/heads/master@{#40249}
2016-10-13 10:43:32 +00:00
verwaest
2325ad7e62 Allow lazy parsing of eval-created functions
I don't see a reason why we can't benefit from preparsing such functions. We don't necessarily compile them, so fully parsing them when unnecessary is just additional overhead.

BUG=v8:5501

Review-Url: https://codereview.chromium.org/2413213002
Cr-Commit-Position: refs/heads/master@{#40248}
2016-10-13 10:08:18 +00:00
verwaest
8ab5051333 Only guard the eager compile hint by whether the target literal was same-zone parsed
BUG=v8:5501,chromium:655122

Review-Url: https://codereview.chromium.org/2419663005
Cr-Commit-Position: refs/heads/master@{#40247}
2016-10-13 08:33:34 +00:00
ahaas
0e1f6d8bfc [wasm] Do not create TF nodes during verification
BUG=chromium:654377
TEST=mjsunit/regress/wasm/regression-654377
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2403013002
Cr-Commit-Position: refs/heads/master@{#40246}
2016-10-13 08:21:47 +00:00
mvstanton
1bf1c5303d [turbofan] Quit storing strings in types.
BUG=

Review-Url: https://codereview.chromium.org/2402313003
Cr-Commit-Position: refs/heads/master@{#40245}
2016-10-13 07:26:45 +00:00
zhengxing.li
232bbb1be2 X87: [stubs] Refactor the CallICStub to pass the number of arguments.
port c15c58274f (r40206)

  original commit message:
  This is the next step to unify the Call/Construct feedback collection
  and prepare it to be able to collect SharedFunctionInfo feedback. This
  also reduces the CallICStub overhead quite a bit since we only need one
  stub per mode (and tail call mode), not also one per call arity.

BUG=

Review-Url: https://codereview.chromium.org/2409953005
Cr-Commit-Position: refs/heads/master@{#40244}
2016-10-13 07:10:49 +00:00
neis
d1d2addb19 [runtime] Avoid code duplication in %CreateIterResultObject.
R=jgruber@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2407153003
Cr-Commit-Position: refs/heads/master@{#40243}
2016-10-13 06:26:48 +00:00
gsathya
094e95cdd1 [promises] don't store undefined resulting from ResolvePromise
Review-Url: https://codereview.chromium.org/2419713002
Cr-Commit-Position: refs/heads/master@{#40241}
2016-10-12 23:53:52 +00:00
gsathya
4fda85aa19 [promises] rename PromiseContainer to PromiseResolveThenableJobInfo
This is a much more descriptive name.

BUG=v8:5343
TBR=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2412263002
Cr-Commit-Position: refs/heads/master@{#40240}
2016-10-12 22:19:09 +00:00
gsathya
6f94a8f1c7 [promises] Move PromiseReactionJob to c++
This patch results in a 11% improvement over 5 runs in the
bluebird benchmark.

BUG=v8:5343,v8:5046
TBR=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2406343002
Cr-Commit-Position: refs/heads/master@{#40239}
2016-10-12 20:45:57 +00:00
mtrofin
38ac7fe658 [wasm] API renames for wasm serialization/deserialization
This incorporates recent feedback:
- simpler deserialization API by dropping the std::unique_ptr.
The only purpose there was communicating to the caller that they
own the buffer, and that the deserializer won't delete it. The new
design communicates that through a naming choice.
- renamed *UncompiledBytes to *WasmWireBytes

BUG=

Review-Url: https://codereview.chromium.org/2411263004
Cr-Commit-Position: refs/heads/master@{#40238}
2016-10-12 20:11:29 +00:00
alph
f116876e91 DevTools: Do not allow v8 to use inspector.
Review-Url: https://codereview.chromium.org/2404663002
Cr-Commit-Position: refs/heads/master@{#40237}
2016-10-12 19:24:59 +00:00
lpy
11e3ec3cdf Add over allocated memory of fixed array sub types to fixed array type.
The over allocated memory of fixed array type didn't equal to the sum of all
fixed array sub types previously, this patch adds over allocated memory of fixed
array sub types to fixed array type when we record fixed array sub type stats.

BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2410083003
Cr-Commit-Position: refs/heads/master@{#40234}
2016-10-12 16:50:51 +00:00
clemensh
8d19005336 [wasm] Clean up wasm module implementation
By defining functions with namespace prefix, the compiler checks that
they were previously declared, and checks that the signature matches.
I stumbled across this several times when changing the interface of a
function in the header.
With this change you get a compile error right away instead of a linker
error in the very end.

This change also revealed two functions which could be placed in an
anonymous namespace, saving 5.5kB program size in Debug build, 2.3kB in
Optdebug and 0.3kB in Release. It's also opening more options for
compiler optimizations, as the functions now have internal linkage.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2415603002
Cr-Commit-Position: refs/heads/master@{#40233}
2016-10-12 15:41:17 +00:00
fmeawad
610fe2892b [Tracing] Remove State Sampling Profiling
The state sampling was implemented in chrome, we had an interface for it
V8 but it was not implemented yet.
The chrome version version has been removed in
https://codereview.chromium.org/2406703002/
Therefore following up with its removal in V8 as well.

This CL can land independent of the Chromium related CL.

R=primiano@chromium.org,alph@chromium.org

Review-Url: https://codereview.chromium.org/2410523002
Cr-Commit-Position: refs/heads/master@{#40232}
2016-10-12 15:34:51 +00:00
verwaest
479e30c031 Decide ParseLazy vs ParseProgram based on is_toplevel
BUG=v8:5501

Review-Url: https://codereview.chromium.org/2410413003
Cr-Commit-Position: refs/heads/master@{#40231}
2016-10-12 15:22:27 +00:00
dschuff
9b55c07698 Imported and defined globals share an index space, but previously the decoder clobbered the imported global indices with the defined globals.
BUG=none

Review-Url: https://codereview.chromium.org/2410953003
Cr-Commit-Position: refs/heads/master@{#40230}
2016-10-12 15:19:41 +00:00
jgruber
760328f229 [regexp] Extract code to regexp-utils.{h,cc}
This CL is in preparation for the upcoming port of
RegExp.prototype.replace, which will need use these methods in
runtime-regexp.cc. Moving them in advance makes that diff less noisy.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2398413002
Cr-Commit-Position: refs/heads/master@{#40229}
2016-10-12 15:15:44 +00:00
bjaideep
c6f8955e46 PPC/s390: [stubs] Refactor the CallICStub to pass the number of arguments.
Port c15c58274f

Original commit message:

    This is the next step to unify the Call/Construct feedback collection
    and prepare it to be able to collect SharedFunctionInfo feedback. This
    also reduces the CallICStub overhead quite a bit since we only need one
    stub per mode (and tail call mode), not also one per call arity.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2415583002
Cr-Commit-Position: refs/heads/master@{#40228}
2016-10-12 14:38:45 +00:00
verwaest
d3d64736f7 Mark ParseInfo as eval in the constructors
BUG=v8:5501

Review-Url: https://codereview.chromium.org/2413673002
Cr-Commit-Position: refs/heads/master@{#40227}
2016-10-12 14:29:03 +00:00
titzer
34459d50a6 [wasm] Rename WasmModuleInstance to WasmInstance.
R=clemensh@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2415533003
Cr-Commit-Position: refs/heads/master@{#40224}
2016-10-12 13:57:25 +00:00
ishell
42884efd19 [crankshaft] Remove HLoadKeyedGeneric and use HCallWithDescriptor to call KeyedLoadIC.
... because the latter automatically respects the desired calling convention.

BUG=v8:5408

Review-Url: https://codereview.chromium.org/2391043005
Cr-Commit-Position: refs/heads/master@{#40223}
2016-10-12 13:48:38 +00:00
ishell
ca680a68ee [crankshaft] Exclude context parameter from HCallWithDescriptor arguments.
Thus the parameter indices defined in respective CallInterfaceDescriptor can
be used for querying parameters.

BUG=

Review-Url: https://codereview.chromium.org/2389133007
Cr-Commit-Position: refs/heads/master@{#40222}
2016-10-12 13:30:23 +00:00
hpayer
4c3a172539 [heap] Reland concurrent slot filtering in sweeper threads.
BUG=chromium:648568

Review-Url: https://codereview.chromium.org/2403423007
Cr-Commit-Position: refs/heads/master@{#40221}
2016-10-12 13:07:43 +00:00
ishell
9b5a1cf5d8 [stubs] Remove unused StoreGlobalViaContextStub.
Review-Url: https://codereview.chromium.org/2412613004
Cr-Commit-Position: refs/heads/master@{#40220}
2016-10-12 13:06:10 +00:00
ishell
50efae9b7e [stubs] Rename StoreIC[Trampoline]TFStub to StoreIC[Trampoline]Stub.
Review-Url: https://codereview.chromium.org/2411793004
Cr-Commit-Position: refs/heads/master@{#40219}
2016-10-12 12:59:06 +00:00
hpayer
13488842de [heap] Fix forwarding pointer race between sweeper threads and pointer updating threads.
The race can happen if:
1) Fixed array A is right before object B in new space
2) A slot in object C located in old space points to object B (old to new remembered set entry is created)
3) Object C becomes unreachable which held the only reference to object B which also becomes unreachable
4) Fixed array A gets right trimmed
5) The sweeper will sweep the last word of object A and object B. It will write the free space map into the last word of object A and a size field in the first word of object B.
6) Pointer updating may observe the size field now because the recored slot points to the start of object B and will confuse it with a forwarding pointer.

Note a similar race may happen with left trimming. Array A points to its backing store, the backing store gets left trimmed by 1 element, and array A dies.
BUG=

Review-Url: https://codereview.chromium.org/2416563002
Cr-Commit-Position: refs/heads/master@{#40218}
2016-10-12 12:54:45 +00:00
verwaest
c5df7fe2f3 Restore kDeclaration as a condition for temp-zone parsing
This should restore the codeload regression when FLAG_lazy_inner_functions is turned off

BUG=v8:5501

Review-Url: https://codereview.chromium.org/2412483005
Cr-Commit-Position: refs/heads/master@{#40217}
2016-10-12 12:53:36 +00:00
ishell
3285b96506 [stubs] Drop StoreICStub and StoreICTrampolineStub (the non-TurboFan implementations of StoreIC dispatchers).
Because of the planned improvements of IC system it does not make sense to
keep the old platform version of the stub around.

Review-Url: https://codereview.chromium.org/2413653003
Cr-Commit-Position: refs/heads/master@{#40216}
2016-10-12 12:52:36 +00:00
verwaest
8f66bb641e Mark ParseInfo as top-level in the constructors
If we're parsing a script or based on a SharedFunctionInfo marked as toplevel, we can implicitly set it. Only manually set in the background parsing task where we manually set up ParseInfo.

BUG=v8:5501

Review-Url: https://codereview.chromium.org/2405263003
Cr-Commit-Position: refs/heads/master@{#40215}
2016-10-12 12:51:21 +00:00
verwaest
35fc3d58a1 Don't count nested function scopes towards MaxNestedContextChainlength
This is allocating registers in the function for all inner contexts that can be active in that function, so that nested blocks always have O(1) access to all outer contexts. However, currently it's always walking into nested functions, overallocating the number of registers, causing additional register pressure.

BUG=v8:5484

Review-Url: https://codereview.chromium.org/2408303003
Cr-Commit-Position: refs/heads/master@{#40214}
2016-10-12 12:15:03 +00:00
hpayer
10ffd2b111 [heap] Old-to-new pointer updates need atomic accessors.
This CL also introduces a NoBarrierAtomicValue with NoBarrier accessors.

BUG=chromium:648568

Review-Url: https://codereview.chromium.org/2408233004
Cr-Commit-Position: refs/heads/master@{#40213}
2016-10-12 12:05:02 +00:00
ishell
d9fab441ca [stubs] Rename LoadIC[Trampoline]TFStub to LoadIC[Trampoline]Stub.
Review-Url: https://codereview.chromium.org/2412493006
Cr-Commit-Position: refs/heads/master@{#40212}
2016-10-12 12:01:08 +00:00
ishell
9a99cc4732 [stubs] Drop LoadICStub and LoadICTrampolineStub (the non-TurboFan implementations of LoadIC dispatchers).
Because of the planned improvements of IC system it does not make sense to
keep the old platform version of the stub around.

Review-Url: https://codereview.chromium.org/2418513002
Cr-Commit-Position: refs/heads/master@{#40211}
2016-10-12 11:57:01 +00:00
bmeurer
c6779297a1 [runtime] Rename FieldTypeGroup to FieldOwnerGroup.
We want to extend the use of this code dependency, so the name does no
longer reflect the purpose.

R=ishell@chromium.org

Review-Url: https://codereview.chromium.org/2410293003
Cr-Commit-Position: refs/heads/master@{#40210}
2016-10-12 11:11:19 +00:00
epertoso
87cc641e8c [stubs] Renames WordIsSmi to TaggedIsSmi, introducing an appropriate bitcast of the parameter.
WordIsSmi, by itself, is not that descriptive, as it just ands a word with the heap object tag. With this change, the MachineGraphVerifier can check that the input to TaggedIsSmi actually has a tagged representation.

This CL also introduces a few bitcast operators in the Smi* macros in the CodeStubAssembler.

R=bmeurer@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2407303002
Cr-Commit-Position: refs/heads/master@{#40209}
2016-10-12 10:01:01 +00:00
georgia.kouveli
bba8024db7 [turbofan] Remove minus zero check for rhs of CheckedInt32Sub.
The only way to get a minus zero result from subtraction is
(-0) - (+0) = -0, hence checking for minus zero on the RHS is
redundant. This is causing some unnecessary deoptimisations
in Box2D from Octane on 32-bit platforms.

BUG=

Review-Url: https://codereview.chromium.org/2410883003
Cr-Commit-Position: refs/heads/master@{#40207}
2016-10-12 09:53:29 +00:00
bmeurer
c15c58274f [stubs] Refactor the CallICStub to pass the number of arguments.
This is the next step to unify the Call/Construct feedback collection
and prepare it to be able to collect SharedFunctionInfo feedback. This
also reduces the CallICStub overhead quite a bit since we only need one
stub per mode (and tail call mode), not also one per call arity.

R=mvstanton@chromium.org
BUG=v8:2206
NOTRY=true

Review-Url: https://codereview.chromium.org/2412453005
Cr-Commit-Position: refs/heads/master@{#40206}
2016-10-12 09:26:14 +00:00
clemensh
5d9fa102a7 [wasm] Provide better stack traces for asm.js code
For the asm.js to WASM pipeline, the current stack traces only show
low-level WASM information.
This CL maps this back to asm.js source positions.
It does so by attaching the asm.js source Script to the compiled WASM
module, and emitting a delta-encoded table which maps from WASM byte
offsets to positions within that Script. As asm.js code does not throw
exceptions, we only store a mapping for call instructions.

The new AsmJsWasmStackFrame implementation inherits from
WasmStackFrame, but contains the logic to provide the source script and
the position inside of it.
What is still missing is the JSFunction object returned by
CallSite.getFunction(). We currently return null.

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

Review-Url: https://codereview.chromium.org/2404253002
Cr-Commit-Position: refs/heads/master@{#40205}
2016-10-12 09:17:28 +00:00
clemensh
e7a0089149 [wasm] Fix decoder for null data
If passing <nullptr, 0> to the decoder and trying to decode something,
it correctly detects the error and sets an error message, but still
returns true on ok(), and returns a valid result.
I triggered this error by passing a null Vector, returned by FindSection(), to
the decoder.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2410913002
Cr-Commit-Position: refs/heads/master@{#40204}
2016-10-12 09:11:52 +00:00
ishell
9a0109d72e [crankshaft] Range analysis should not rely on overflowed ranges.
BUG=chromium:645438

Review-Url: https://codereview.chromium.org/2412853002
Cr-Commit-Position: refs/heads/master@{#40202}
2016-10-12 09:06:32 +00:00
bmeurer
edfe391ef5 [turbofan] Fix effect chain for polymorphic array access.
We accidently dropped the effect on the floor that we have for the
polymorphic map check in case of array elements access.

BUG=chromium:655004
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2411273002
Cr-Commit-Position: refs/heads/master@{#40201}
2016-10-12 08:31:55 +00:00