Commit Graph

28679 Commits

Author SHA1 Message Date
titzer
76eb976a67 [wasm] Master CL for Binary 0xC changes.
[0xC] Convert to stack machine semantics.
[0xC] Use section codes instead of names.
[0xC] Add elements section decoding.
[0xC] Decoding of globals section.
[0xC] Decoding of memory section.
[0xC] Decoding of imports section.
[0xC] Decoding of exports section.
[0xC] Decoding of data section.
[0xC] Remove CallImport bytecode.
[0xC] Function bodies have an implicit block.
[0xC] Remove the bottom label from loops.
[0xC] Add signatures to blocks.
[0xC] Remove arities from branches.
Add tests for init expression decoding.
Rework compilation of import wrappers and how they are patched.
Rework function indices in debugging.
Fix ASM->WASM builder for stack machine.
Reorganize asm.js foreign functions due to import indices change.

R=ahaas@chromium.org,rossberg@chromium.org,bradnelson@chromium.org
BUG=chromium:575167
LOG=Y

Review-Url: https://codereview.chromium.org/2345593003
Cr-Commit-Position: refs/heads/master@{#39678}
2016-09-23 15:56:54 +00:00
klaasb
3200fafa5f [interpreter] Compute and use type info percentage
Previously we would not have a total count of ICs when interpreting and
thus the check for sufficient type info would always succeed.
Also use the optimization checks for OSR while waiting for baseline
compilation and refactor the check.

BUG=v8:4280
BUG=chromium:634884

Review-Url: https://codereview.chromium.org/2360913003
Cr-Commit-Position: refs/heads/master@{#39677}
2016-09-23 15:30:31 +00:00
jacob.bramley
73518a9070 [arm] Clean up use of IsSupported and IsEnabled.
CpuFeatures::IsSupported(feature) indicates that the feature is
available on the target. AssemblerBase::IsEnabled(feature) indicates
that we've checked for support (using CpuFeatureScope). The main benefit
is that we can test on (for example) ARMv8, but have some assurance that
we won't generate ARMv8 instructions on ARMv7 targets.

This patch simply cleans up the usage, which had become inconsistent.
The instruction emission functions now check not only that their
dependent features are supported, but also that we've verified that
using CpuFeatureScope.

BUG=

Review-Url: https://codereview.chromium.org/2360243002
Cr-Commit-Position: refs/heads/master@{#39676}
2016-09-23 15:29:22 +00:00
ishell
914519dda7 [ic] Remove unused xxxIC_MissFromStubFailure runtime functions.
Namely:
Runtime_LoadIC_MissFromStubFailure
Runtime_StoreIC_MissFromStubFailure
Runtime_KeyedStoreIC_MissFromStubFailure

BUG=chromium:608675

Review-Url: https://codereview.chromium.org/2346743003
Cr-Commit-Position: refs/heads/master@{#39675}
2016-09-23 15:14:52 +00:00
danno
f6d991b1c6 Properly classify new Turbofan stubs
Review-Url: https://codereview.chromium.org/2362113003
Cr-Commit-Position: refs/heads/master@{#39674}
2016-09-23 15:11:14 +00:00
ishell
49695346ae [ic][ia32][x87] Don't push/pop value/slot/vector in store handlers.
According to new store IC calling convention the value, slot and vector are passed
on the stack and there's no need in trying to preserve values or respective registers
in store handlers.

Nice bonus: we also don't need virtual registers anymore.

BUG=v8:5407

Review-Url: https://codereview.chromium.org/2357323003
Cr-Commit-Position: refs/heads/master@{#39672}
2016-09-23 14:29:21 +00:00
jgruber
84145a149b [stubs] Extract ToInteger to CodeStubAssembler
Moving ToInteger to CodeStubAssembler allows us to inline it in several
builtins. In a follow-up commit, we'll add a TruncationMode argument to
specify how -0.0 should be handled.

BUG=

Review-Url: https://codereview.chromium.org/2364473006
Cr-Commit-Position: refs/heads/master@{#39671}
2016-09-23 14:28:11 +00:00
verwaest
7f025eb626 Remove ARGUMENTS_VARIABLE and fix crankshaft to properly detect the arguments object and keep it alive when inlining .apply
BUG=

Review-Url: https://codereview.chromium.org/2367483003
Cr-Commit-Position: refs/heads/master@{#39670}
2016-09-23 14:27:02 +00:00
ishell
9f0fe65853 Minor fixes in the objects printer.
Review-Url: https://codereview.chromium.org/2362203002
Cr-Commit-Position: refs/heads/master@{#39669}
2016-09-23 14:25:56 +00:00
balazs.kilvady
639e8fa4cd MIPS: Improve performance of simulator in debug mode.
The running time of optdebug.quickcheck is improved by 8% while a more strict DCHECKing is kept in simulator.

Review-Url: https://codereview.chromium.org/1349403003
Cr-Commit-Position: refs/heads/master@{#39667}
2016-09-23 13:35:41 +00:00
mvstanton
648ac44056 [turbofan] Cleanup: Type only has a semantic dimension.
BUG=

Review-Url: https://codereview.chromium.org/2366433003
Cr-Commit-Position: refs/heads/master@{#39666}
2016-09-23 13:28:13 +00:00
sashab
e6c1081fe6 Revert of Fix bitfield enums to not trigger upcoming Clang warning (patchset #3 id:40001 of https://codereview.chromium.org/2349153002/ )
Reason for revert:
Causes warning in GCC.

Original issue's description:
> Fix bitfield enums to not trigger upcoming Clang warning
>
> Fix bitfield enums to not trigger upcoming Clang warning regarding
> non-unsigned enum bitfields producing non-portable code.
>
> For more details, see the patch here: https://reviews.llvm.org/D24289
>
> BUG=648462
>
> Committed: https://crrev.com/a81e00d533454a7179f8f954505a8f033e941a8a
> Cr-Commit-Position: refs/heads/master@{#39649}

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

Review-Url: https://codereview.chromium.org/2361013003
Cr-Commit-Position: refs/heads/master@{#39663}
2016-09-23 13:22:41 +00:00
vogelheim
295bafd4bc [parser] Use Back2() where appropriate.
R=marja@chromium.org
BUG=v8:4947

Review-Url: https://codereview.chromium.org/2366573002
Cr-Commit-Position: refs/heads/master@{#39662}
2016-09-23 13:16:19 +00:00
machenbach
99160dc1c1 Revert of [turbofan] Don't take into account source size for inlining heuristics. (patchset #4 id:60001 of https://codereview.chromium.org/2361813002/ )
Reason for revert:
timeouts on windows:
https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20debug/builds/12504

Original issue's description:
> [turbofan] Don't take into account source size for inlining heuristics.
>
> The source size is not a real indicator for whether or not to inline a
> certain function.
>
> R=ishell@chromium.org, jarin@chromium.org
> BUG=v8:3354,v8:5267
>
> Committed: 1b33028607

TBR=ishell@chromium.org,jarin@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:3354,v8:5267

Review-Url: https://codereview.chromium.org/2362853003
Cr-Commit-Position: refs/heads/master@{#39661}
2016-09-23 12:43:45 +00:00
Michael Starzinger
08a441b309 [turbofan] Handle StringCharCodeAt in escape analysis.
This adds handling of {IrOpcode::kStringCharCodeAt} nodes to the escape
status analysis. Such uses are treated as escaping for now until we add
dedicated handling to the escape analysis reducer.

R=bmeurer@chromium.org
BUG=chromium:649492

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

Cr-Commit-Position: refs/heads/master@{#39660}
2016-09-23 11:48:38 +00:00
Benedikt Meurer
1b33028607 [turbofan] Don't take into account source size for inlining heuristics.
The source size is not a real indicator for whether or not to inline a
certain function.

R=ishell@chromium.org, jarin@chromium.org
BUG=v8:3354,v8:5267

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

Cr-Commit-Position: refs/heads/master@{#39659}
2016-09-23 11:47:19 +00:00
Benedikt Meurer
d2626e30d9 [interpreter] Fix word32 vs word64 bug in CodeStubAssembler::UpdateFeedback.
R=epertoso@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#39658}
2016-09-23 11:41:11 +00:00
bmeurer
c80ca79715 Revert of [turbofan] ChangeFloat64ToTagged shouldn't canonicalize. (patchset #3 id:40001 of https://codereview.chromium.org/2367593003/ )
Reason for revert:
Causes tree breakage:

https://build.chromium.org/p/client.v8/builders/V8%20Win64/builds/12916/steps/Check/logs/typedarray

Original issue's description:
> [turbofan] ChangeFloat64ToTagged shouldn't canonicalize.
>
> This matches current Crankshaft/fullcodegen behavior more closely and
> thus reduces the chances that we run into unnecessary polymorphism due
> to the field representation tracking in our object model.
>
> R=jarin@chromium.org
> BUG=v8:5267
>
> Committed: 6a939714e9

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

Review-Url: https://codereview.chromium.org/2358123007
Cr-Commit-Position: refs/heads/master@{#39657}
2016-09-23 11:24:15 +00:00
Michael Starzinger
4b2c6d03e4 [turbofan] Add proper type guards to escape analysis.
This makes sure the {EscapeAnalysisReducer} inserts proper {TypeGuard}
nodes if the replacement node is not a subtype of the original node.
This happens predominantly for code that has been made unreachable by
type checks.

R=jarin@chromium.org
TEST=mjsunit/regress/regress-crbug-640497
BUG=chromium:640497

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

Cr-Commit-Position: refs/heads/master@{#39656}
2016-09-23 11:02:13 +00:00
Benedikt Meurer
6a939714e9 [turbofan] ChangeFloat64ToTagged shouldn't canonicalize.
This matches current Crankshaft/fullcodegen behavior more closely and
thus reduces the chances that we run into unnecessary polymorphism due
to the field representation tracking in our object model.

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

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

Cr-Commit-Position: refs/heads/master@{#39655}
2016-09-23 10:37:27 +00:00
Benedikt Meurer
dfbb3db5ef [turbofan] Improve representation selection for Smi checking.
Rename the high-level operators CheckTaggedSigned to CheckSmi and
CheckTaggedPointer to CheckHeapObject, to better match the naming
convention (i.e. ObjectIsSmi and CheckSmi, ObjectIsString and
CheckString, etc.).

For lowering CheckSmi, always report TaggedSigned representation
and let the RepresentationChanger come up with a reasonable conversion
from whatever input representation to TaggedSigned. This way we no
longer insert the useless ChangeSomethingToTagged and then Smi check
the result sequences, i.e. mostly reduces the amount of useless code
being generated. But we also observe a few performance improvements
on some crypto benchmarks.

This would enable us to avoid the Smi canonicalization when going from
Float64 to Tagged completely and thus match the representation selection
of Crankshaft in many areas (which might reduce the amount of
polymorphism until we fix our object model).

A follow-up CL will do the same for CheckHeapObject.

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

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

Cr-Commit-Position: refs/heads/master@{#39654}
2016-09-23 10:32:35 +00:00
jgruber
49be319215 [stubs] Port SubStringStub to TurboFan
This ports the platform-specific SubStringStub to TurboFan.

It also contains a minor bug-fix for the case when the requested substring
length equals the subject string length, but the start index is not equal to 0.
The old stub implementation returned the subject string, while the new
implementation calls into runtime, which finally results in a thrown exception.

BUG=v8:5415

Review-Url: https://codereview.chromium.org/2355793003
Cr-Commit-Position: refs/heads/master@{#39653}
2016-09-23 06:50:31 +00:00
hablich
a717fb7c01 Revert of Pool implementation for zone segments (patchset #9 id:420001 of https://codereview.chromium.org/2335343007/ )
Reason for revert:
Blocks Roll https://codereview.chromium.org/2366733002/

Original issue's description:
> Pool implementation for zone segments
>
> BUG=v8:5409
>
> Committed: https://crrev.com/37c688a24578e787d3d8941093563ed049c3497e
> Cr-Commit-Position: refs/heads/master@{#39631}

TBR=jkummerow@chromium.org,jochen@chromium.org,verwaest@chromium.org,heimbuef@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5409

Review-Url: https://codereview.chromium.org/2365843002
Cr-Commit-Position: refs/heads/master@{#39652}
2016-09-23 06:03:55 +00:00
hablich
b88a848faf Revert of Replaced different means of zone pooling/reusing by one zone segment pool (patchset #3 id:120001 of https://codereview.chromium.org/2348303002/ )
Reason for revert:
Blocks Roll https://codereview.chromium.org/2366733002/

Original issue's description:
> Replaced different means of zone pooling/reusing by one zone segment pool
>
> BUG=v8:5409
>
> Committed: https://crrev.com/a124feb0760896c8be61de08004a08c3bc9b4b3f
> Cr-Commit-Position: refs/heads/master@{#39633}

TBR=mstarzinger@chromium.org,verwaest@chromium.org,heimbuef@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5409

Review-Url: https://codereview.chromium.org/2360403003
Cr-Commit-Position: refs/heads/master@{#39651}
2016-09-23 06:02:46 +00:00
sashab
a81e00d533 Fix bitfield enums to not trigger upcoming Clang warning
Fix bitfield enums to not trigger upcoming Clang warning regarding
non-unsigned enum bitfields producing non-portable code.

For more details, see the patch here: https://reviews.llvm.org/D24289

BUG=648462

Review-Url: https://codereview.chromium.org/2349153002
Cr-Commit-Position: refs/heads/master@{#39649}
2016-09-23 02:08:54 +00:00
adamk
1ca44a0a28 [d8/modules] Factor out path and string handling logic
Also canonicalize all path separators to '/' for simplicity.

Review-Url: https://codereview.chromium.org/2363773003
Cr-Commit-Position: refs/heads/master@{#39648}
2016-09-23 00:35:15 +00:00
adamk
4453819c9a [modules] Allow Module::Instantiate to throw exceptions
Also prepare d8 for that eventuality, and fixup the runtime call stat
counter used for Module::Evaluate.

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

Review-Url: https://codereview.chromium.org/2366773002
Cr-Commit-Position: refs/heads/master@{#39647}
2016-09-22 23:06:20 +00:00
adamk
3bbd11c233 [modules] Do path resolution relative to each module file in d8
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2361593002
Cr-Commit-Position: refs/heads/master@{#39646}
2016-09-22 21:03:42 +00:00
jyan
3b1691be5e Fix Endian issue in interpreter in EmitBytecode
R=rmcilroy@chromium.org, mythria@chromium.org, leszeks@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2362453003
Cr-Commit-Position: refs/heads/master@{#39644}
2016-09-22 20:45:15 +00:00
verwaest
df7ecd1c1a Declare the arguments object before creating the function var, to make sure it masks it
BUG=chromium:649067

Review-Url: https://codereview.chromium.org/2362463003
Cr-Commit-Position: refs/heads/master@{#39642}
2016-09-22 19:16:42 +00:00
mvstanton
d52451ec86 [turbofan] Remove the representation dimension from Type.
BUG=

Review-Url: https://codereview.chromium.org/2359153002
Cr-Commit-Position: refs/heads/master@{#39641}
2016-09-22 18:35:19 +00:00
neis
ca6886c035 [modules] Basic support of import statements.
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2360063002
Cr-Commit-Position: refs/heads/master@{#39639}
2016-09-22 17:28:48 +00:00
ahaas
813be42791 [wasm] Make sure the interpreter only executes preprocessed code.
BUG=chromium:646753
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2365633002
Cr-Commit-Position: refs/heads/master@{#39638}
2016-09-22 17:11:52 +00:00
rmcilroy
e5ac75c635 [Interpreter] Optimize BytecodeArrayBuilder and BytecodeArrayWriter.
This CL optimizes the code in BytecodeArrayBuilder and
BytecodeArrayWriter by making the following main changes:

 - Move operand scale calculation out of BytecodeArrayWriter to the
BytecodeNode constructor, where the decision on which operands are
scalable can generally be statically decided by the compiler.
 - Move the maximum register calculation out of BytecodeArrayWriter
and into BytecodeRegisterOptimizer (which is the only place outside
BytecodeGenerator which updates which registers are used). This
avoids the BytecodeArrayWriter needing to know the operand types
of a node as it writes it.
 - Modify EmitBytecodes to use individual push_backs rather than
building a buffer and calling insert, since this turns out to be faster.
 - Initialize BytecodeArrayWriter's bytecode vector by reserving 512
bytes,
 - Make common functions in Bytecodes constexpr so that they
can be statically calculated by the compiler.
 - Move common functions and constructors in Bytecodes and
BytecodeNode to the header so that they can be inlined.
 - Change large static switch statements in Bytecodes to const array
lookups, and move to the header to allow inlining.

I also took the opportunity to remove a number of unused helper
functions, and rework some others for consistency.

This reduces the percentage of time spent in making BytecodeArrays
 in  CodeLoad from ~15% to ~11% according to perf. The
CoadLoad score increase by around 2%.

BUG=v8:4280

Committed: https://crrev.com/b11a8b4d41bf09d6b3d6cf214fe3fb61faf01a64
Review-Url: https://codereview.chromium.org/2351763002
Cr-Original-Commit-Position: refs/heads/master@{#39599}
Cr-Commit-Position: refs/heads/master@{#39637}
2016-09-22 16:34:31 +00:00
chiniforooshan
d537582d6f Re-enable TestEventInContext
https://codereview.chromium.org/2253973003 is landed. The V8
macro can be changed accordingly now and the test can be enabled
again.

BUG=647986

Review-Url: https://codereview.chromium.org/2360083005
Cr-Commit-Position: refs/heads/master@{#39636}
2016-09-22 16:31:14 +00:00
mtrofin
57ae3dbf94 [turbofan] Pre-spill ranges that have a slot use.
BUG=

Review-Url: https://codereview.chromium.org/2355373002
Cr-Commit-Position: refs/heads/master@{#39634}
2016-09-22 15:42:55 +00:00
heimbuef
a124feb076 Replaced different means of zone pooling/reusing by one zone segment pool
BUG=v8:5409

Review-Url: https://codereview.chromium.org/2348303002
Cr-Commit-Position: refs/heads/master@{#39633}
2016-09-22 15:35:13 +00:00
machenbach
20caa8770a Revert of [heap] Reland Concurrently free empty typed slot set chunks. (patchset #2 id:20001 of https://codereview.chromium.org/2365603002/ )
Reason for revert:
Leaks and TSAN:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20ASAN/builds/15441
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/11867

Original issue's description:
> [heap] Reland Concurrently free empty typed slot set chunks.
>
> BUG=chromium:648568
>
> Committed: https://crrev.com/ec3835751d678c0b4a3fda47d11ffa107cd27e23
> Cr-Commit-Position: refs/heads/master@{#39630}

TBR=ulan@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/2364603002
Cr-Commit-Position: refs/heads/master@{#39632}
2016-09-22 15:14:59 +00:00
heimbuef
37c688a245 Pool implementation for zone segments
BUG=v8:5409

Review-Url: https://codereview.chromium.org/2335343007
Cr-Commit-Position: refs/heads/master@{#39631}
2016-09-22 14:33:49 +00:00
hpayer
ec3835751d [heap] Reland Concurrently free empty typed slot set chunks.
BUG=chromium:648568

Review-Url: https://codereview.chromium.org/2365603002
Cr-Commit-Position: refs/heads/master@{#39630}
2016-09-22 14:32:40 +00:00
ahaas
396dbab65e [wasm] Break loops in the module-decoder upon error.
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2362663002
Cr-Commit-Position: refs/heads/master@{#39628}
2016-09-22 13:54:40 +00:00
jochen
d008b9efcb Make sure to use the correct context for eval checks
We can't assume that there's no entered context during microtask
execution. We also can't assume that we'll never enter an context during
microtask execution either.

We can however assume that we don't execute microtasks recursively, so
remembering the length of the entered context stack is enough to decide
which context to use.

BUG=chromium:635769
R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2350933007
Cr-Commit-Position: refs/heads/master@{#39627}
2016-09-22 13:38:50 +00:00
hpayer
de42ed2862 [heap] Only insert new slot set entries.
BUG=chromium:648973,chromium:648568

Review-Url: https://codereview.chromium.org/2360233002
Cr-Commit-Position: refs/heads/master@{#39624}
2016-09-22 12:45:35 +00:00
leszeks
b81cddc57f [base] Revert "Move hashmap allocator to a field"
This reverts commit b42ecda533.

That commit introduced a allocator field to hashmap, which indirectly
added a field to Scopes, where the field, effectively storing a Zone, is
unnecessary because the Zone can be accessed in other ways.

Review-Url: https://codereview.chromium.org/2351393003
Cr-Commit-Position: refs/heads/master@{#39623}
2016-09-22 11:08:58 +00:00
bmeurer
a0fb619621 [compiler] Bump --max-inlined-nodes default to 200.
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2361793002
Cr-Commit-Position: refs/heads/master@{#39622}
2016-09-22 10:58:14 +00:00
mvstanton
e13a825b6e [turbofan] Eliminate uses of representation dimension of Type.
BUG=

Review-Url: https://codereview.chromium.org/2355253002
Cr-Commit-Position: refs/heads/master@{#39621}
2016-09-22 10:33:25 +00:00
georgia.kouveli
5b81f5868d [arm64] Check sign with TBZ/TBNZ.
Generate TBZ/TBNZ for certain comparisons against zero. E.g. instead of:

    cmp w0, 0x0
    b.lt/ge <addr>

we can generate:

    tbnz/tbz w0, 31, <addr>

BUG=

Review-Url: https://codereview.chromium.org/2359723004
Cr-Commit-Position: refs/heads/master@{#39620}
2016-09-22 10:24:57 +00:00
bmeurer
b63de989db [turbofan] Bailout for call sites w/o feedback.
If a JSCallFunction node doesn't have any callee information, either
from feedback taken on input nodes, i.e. on property loads, or from
the CallIC, we insert a soft deoptimization exit instead.

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

Review-Url: https://codereview.chromium.org/2361773002
Cr-Commit-Position: refs/heads/master@{#39619}
2016-09-22 10:02:09 +00:00
epertoso
7c498d979a [builtins] Fix Generate_AtomicsStore.
An AtomicStore was used as an input to SmiTag.

R=jgruber@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2360993002
Cr-Commit-Position: refs/heads/master@{#39618}
2016-09-22 08:55:23 +00:00
ishell
76cfb388de [ic][ia32][x87] Pass value, slot and vector to StoreIC and KeyedStoreIC through the stack.
The handlers cleanup will be done in a follow-up CL.

BUG=v8:5407

Review-Url: https://codereview.chromium.org/2357163003
Cr-Commit-Position: refs/heads/master@{#39617}
2016-09-22 08:44:06 +00:00
Ilija.Pavlovic
502b9aa71b MIPS: Port for (fused) multiply add/subtract.
Port for VisitFloat32Add, VisitFloat64Add, VisitFloat32Sub and
VisitFloat64Sub in InstructionSelector.

TEST=unittests/InstructionSelectorTest.Float32AddWithFloat32Mul,
     unittests/InstructionSelectorTest.Float64AddWithFloat64Mul,
     unittests/InstructionSelectorTest.Float32SubWithFloat32Mul,
     unittests/InstructionSelectorTest.Float64SubWithFloat64Mul
BUG=

Review-Url: https://codereview.chromium.org/2341303002
Cr-Commit-Position: refs/heads/master@{#39616}
2016-09-22 08:43:04 +00:00
mstarzinger
59a38a9ac8 [turbofan] Add early detection of object state cycles.
This makes sure cycles in the object states graph are detected early by
escape analysis instead of late in the scheduler. This is mainly done
for improved debuggability.

R=bmeurer@chromium.org
BUG=chromium:613923

Review-Url: https://codereview.chromium.org/2354263002
Cr-Commit-Position: refs/heads/master@{#39614}
2016-09-22 07:51:00 +00:00
ishell
0acde6f974 [crankshaft] HCallWithDescriptor is now able to pass arguments on the stack.
BUG=v8:5407

Review-Url: https://codereview.chromium.org/2353303002
Cr-Commit-Position: refs/heads/master@{#39613}
2016-09-22 06:55:34 +00:00
hablich
5d693348f0 Revert of [Interpreter] Optimize BytecodeArrayBuilder and BytecodeArrayWriter. (patchset #6 id:200001 of https://codereview.chromium.org/2351763002/ )
Reason for revert:
Prime suspect for roll blocker: https://codereview.chromium.org/2362503002/

Original issue's description:
> [Interpreter] Optimize BytecodeArrayBuilder and BytecodeArrayWriter.
>
> This CL optimizes the code in BytecodeArrayBuilder and
> BytecodeArrayWriter by making the following main changes:
>
>  - Move operand scale calculation out of BytecodeArrayWriter to the
> BytecodeNode constructor, where the decision on which operands are
> scalable can generally be statically decided by the compiler.
>  - Move the maximum register calculation out of BytecodeArrayWriter
> and into BytecodeRegisterOptimizer (which is the only place outside
> BytecodeGenerator which updates which registers are used). This
> avoids the BytecodeArrayWriter needing to know the operand types
> of a node as it writes it.
>  - Modify EmitBytecodes to use individual push_backs rather than
> building a buffer and calling insert, since this turns out to be faster.
>  - Initialize BytecodeArrayWriter's bytecode vector by reserving 512
> bytes,
>  - Make common functions in Bytecodes constexpr so that they
> can be statically calculated by the compiler.
>  - Move common functions and constructors in Bytecodes and
> BytecodeNode to the header so that they can be inlined.
>  - Change large static switch statements in Bytecodes to const array
> lookups, and move to the header to allow inlining.
>
> I also took the opportunity to remove a number of unused helper
> functions, and rework some others for consistency.
>
> This reduces the percentage of time spent in making BytecodeArrays
>  in  CodeLoad from ~15% to ~11% according to perf. The
> CoadLoad score increase by around 2%.
>
> BUG=v8:4280
>
> Committed: https://crrev.com/b11a8b4d41bf09d6b3d6cf214fe3fb61faf01a64
> Cr-Commit-Position: refs/heads/master@{#39599}

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

Review-Url: https://codereview.chromium.org/2360193003
Cr-Commit-Position: refs/heads/master@{#39612}
2016-09-22 05:54:01 +00:00
kozyatinskiy
e882623820 [inspector] fixed all shorten-64-to-32 warnings
BUG=chromium:635948
R=dgozman@chromium.org,alph@chromium.org

Committed: https://crrev.com/3d10918d2e1c57d72531c55a956262f5a72fceaa
Review-Url: https://codereview.chromium.org/2332163002
Cr-Original-Commit-Position: refs/heads/master@{#39426}
Cr-Commit-Position: refs/heads/master@{#39610}
2016-09-22 01:48:10 +00:00
gsathya
ba41697cbd [promises] PromiseResolveThenableJob: change then to be a JSReceiver
BUG=v8:649078

Review-Url: https://codereview.chromium.org/2362503003
Cr-Commit-Position: refs/heads/master@{#39609}
2016-09-21 23:56:20 +00:00
kozyatinskiy
a1612d2456 [inspector] change implementation file extension from cpp to cc
BUG=chromium:635948
R=dgozman@chromium.org,alph@chromium.org
TBR=machenbach@chromium.org

Review-Url: https://codereview.chromium.org/2338413003
Cr-Commit-Position: refs/heads/master@{#39608}
2016-09-21 23:55:15 +00:00
adamk
c216b7fa83 Revert of [heap] Concurrently free empty typed slot set chunks. (patchset #3 id:40001 of https://codereview.chromium.org/2352423002/ )
Reason for revert:
TSAN failures on Linux64:

https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/11850

Also saw various threading-related flakiness on multiple bots.

Original issue's description:
> [heap] Concurrently free empty typed slot set chunks.
>
> BUG=chromium:648568
>
> Committed: https://crrev.com/ff8101d8e8d5e14dfa89de1252c510e6a0775539
> Cr-Commit-Position: refs/heads/master@{#39605}

TBR=ulan@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/2358333002
Cr-Commit-Position: refs/heads/master@{#39607}
2016-09-21 23:49:43 +00:00
kozyatinskiy
c0d1afa2d8 [inspector] provide more usefull error message for non serializable value
Runtime.evaluate can return result by value. We need to provide more details why method call was failed.

BUG=chromium:645640
R=dgozman@chromium.org,alph@chromium.org

Committed: https://crrev.com/0965b9b5df532d3aa0583966ca60794b54f56943
Review-Url: https://codereview.chromium.org/2345263003
Cr-Original-Commit-Position: refs/heads/master@{#39574}
Cr-Commit-Position: refs/heads/master@{#39606}
2016-09-21 20:29:16 +00:00
hpayer
ff8101d8e8 [heap] Concurrently free empty typed slot set chunks.
BUG=chromium:648568

Review-Url: https://codereview.chromium.org/2352423002
Cr-Commit-Position: refs/heads/master@{#39605}
2016-09-21 20:11:12 +00:00
neis
b2b434df41 [modules] Support exporting a local variable under multiple export names.
R=adamk@chromium.org
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2353403003
Cr-Commit-Position: refs/heads/master@{#39604}
2016-09-21 18:48:33 +00:00
ahaas
99b773c28a [wasm] Break a decoder loop if there is a failure.
TEST=unittests/WasmModuleVerifyTest.Regression_648070
BUG=chromium:648070
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2356253002
Cr-Commit-Position: refs/heads/master@{#39602}
2016-09-21 16:18:19 +00:00
littledan
f322d3ad5c Remove handling in inspector for Object.observe async task events
Review-Url: https://codereview.chromium.org/2353503006
Cr-Commit-Position: refs/heads/master@{#39601}
2016-09-21 15:47:27 +00:00
ahaas
4c1d574b22 [wasm] FromJS throws a TypeError for I64 values.
This behavior is required by the WebAssembly spec.

TEST=mjsunit/wasm/ffi-error.js:I64ParamsInSignatureThrows

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2360653002
Cr-Commit-Position: refs/heads/master@{#39600}
2016-09-21 15:33:05 +00:00
rmcilroy
b11a8b4d41 [Interpreter] Optimize BytecodeArrayBuilder and BytecodeArrayWriter.
This CL optimizes the code in BytecodeArrayBuilder and
BytecodeArrayWriter by making the following main changes:

 - Move operand scale calculation out of BytecodeArrayWriter to the
BytecodeNode constructor, where the decision on which operands are
scalable can generally be statically decided by the compiler.
 - Move the maximum register calculation out of BytecodeArrayWriter
and into BytecodeRegisterOptimizer (which is the only place outside
BytecodeGenerator which updates which registers are used). This
avoids the BytecodeArrayWriter needing to know the operand types
of a node as it writes it.
 - Modify EmitBytecodes to use individual push_backs rather than
building a buffer and calling insert, since this turns out to be faster.
 - Initialize BytecodeArrayWriter's bytecode vector by reserving 512
bytes,
 - Make common functions in Bytecodes constexpr so that they
can be statically calculated by the compiler.
 - Move common functions and constructors in Bytecodes and
BytecodeNode to the header so that they can be inlined.
 - Change large static switch statements in Bytecodes to const array
lookups, and move to the header to allow inlining.

I also took the opportunity to remove a number of unused helper
functions, and rework some others for consistency.

This reduces the percentage of time spent in making BytecodeArrays
 in  CodeLoad from ~15% to ~11% according to perf. The
CoadLoad score increase by around 2%.

BUG=v8:4280

Review-Url: https://codereview.chromium.org/2351763002
Cr-Commit-Position: refs/heads/master@{#39599}
2016-09-21 15:03:03 +00:00
caitp
5784773feb [builtins] move String.prototype[@@iterator] to C++ builtin
BUG=v8:5388
R=bmeurer@chromium.org, adamk@chromium.org
TBR=hpayer@chromium.org

Review-Url: https://codereview.chromium.org/2348493003
Cr-Commit-Position: refs/heads/master@{#39598}
2016-09-21 14:18:00 +00:00
hpayer
6f06c36c3e [heap] Make typed slot set state and operations atomic.
BUG=chromium:648568

Review-Url: https://codereview.chromium.org/2360513002
Cr-Commit-Position: refs/heads/master@{#39596}
2016-09-21 13:20:48 +00:00
mstarzinger
b097c6c4f1 [turbofan] Support for ConsString by escape analysis.
This add support for ConsString objects allocated inline to the escape
analysis pass. The raw hash field in such strings needs special handling
similar to existing raw fields. This also contains materialization code
within the deoptimizer as usual.

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

Review-Url: https://codereview.chromium.org/2357153002
Cr-Commit-Position: refs/heads/master@{#39594}
2016-09-21 12:30:00 +00:00
ishell
14a87d9639 [stubs] Remove OnStackArgsDescriptor and friends.
Each stub should have more meaningful descriptor instead.

BUG=v8:5407

Review-Url: https://codereview.chromium.org/2356163002
Cr-Commit-Position: refs/heads/master@{#39593}
2016-09-21 11:51:16 +00:00
machenbach
a8951a96ab [gn] Add gn support to gcmole
This also adds sources missing for PPC and x87, fixes a few
missing files in gyp due to wrong quotation and a few that
were simply not included.

The gn files are now authoritative, but the gcmole gyp and
gn source lists are enforced to match exactly.

This additional enforcement helped finding the bugs above
and will be removed when we deprecate the gyp files.

BUG=614645
NOTRY=true

Review-Url: https://codereview.chromium.org/2352103002
Cr-Commit-Position: refs/heads/master@{#39592}
2016-09-21 11:45:24 +00:00
jarin
1601e35a9a [turbofan] Regalloc: only pre-spill live ranges with spill operand.
Review-Url: https://codereview.chromium.org/2360523002
Cr-Commit-Position: refs/heads/master@{#39591}
2016-09-21 11:30:56 +00:00
ishell
12d4dc3222 [stubs] ApiCallbackDescriptor cleanup - make it independent on the number of JS parameters.
This cleanup is necessary to make HCallWithDescriptor support passing arguments on the stack.

BUG=v8:5407

Review-Url: https://codereview.chromium.org/2352163004
Cr-Commit-Position: refs/heads/master@{#39590}
2016-09-21 11:08:45 +00:00
ahaas
698bbe418a [wasm] Set up Table and Memory constructors
Set up Wasm Table and Memory constructors

This only provides skeletons so far: the constructors work, but the
types are not wired up with the import/export mechanism yet; methods are
still nops.

Also, fix errors generated from Wasm to be proper Error/TypeError
instances instead of just strings.

I took over this CL from rossberg@chromium.org. The original CL is
https://codereview.chromium.org/2342623002

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

Review-Url: https://codereview.chromium.org/2350643003
Cr-Commit-Position: refs/heads/master@{#39588}
2016-09-21 10:40:32 +00:00
nikolaos
51b6a3d11b [parser] Refactor of Parse*Statement*, part 8
This patch moves the following parsing method to ParserBase:

- ParseForStatement

R=adamk@chromium.org, marja@chromium.org
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2351233002
Cr-Commit-Position: refs/heads/master@{#39587}
2016-09-21 10:39:31 +00:00
cbruni
2fd6d6093e [elements] Handlify raw parameter_map pointers for SloppyArgumentsAccessor
Handlify pointers in IncludesValueImpl and DirectCollectElementIndicesImpl.

BUG=chromium:648373

Review-Url: https://codereview.chromium.org/2354773006
Cr-Commit-Position: refs/heads/master@{#39586}
2016-09-21 10:22:53 +00:00
hpayer
c19abaddaf [heap] Always use the passed-in collector in CollectGarbage.
Do not overwrite a collector decision.

BUG=

Review-Url: https://codereview.chromium.org/2336943003
Cr-Commit-Position: refs/heads/master@{#39585}
2016-09-21 09:57:08 +00:00
balazs.kilvady
06c6591d0f MIPS: Add NaN handling to floating point operators in simulators.
Review-Url: https://codereview.chromium.org/2184843002
Cr-Commit-Position: refs/heads/master@{#39584}
2016-09-21 09:36:04 +00:00
mstarzinger
81f4342994 [turbofan] Remove bogus constant materialization from frame.
This removes an optimization from the code generator that tries to
materialize certain constants (i.e. context and closure) from the
stackframe when possible. This does not work with Harmony tail calls
which are split into several instructions. There have already been
numerous bugs in this optimization, it is too fragile in its current
form.

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

Review-Url: https://codereview.chromium.org/2357583003
Cr-Commit-Position: refs/heads/master@{#39583}
2016-09-21 09:31:32 +00:00
marija.antic
3d97b804c9 MIPS: [turbofan] Optimize sign-extension patterns like Sar(Shl(x, a), b)).
Port of https://crrev.com/14a5c18cc35b2c55b37de3bd0ad27941cf21cb68

BUG=

Review-Url: https://codereview.chromium.org/2355743003
Cr-Commit-Position: refs/heads/master@{#39582}
2016-09-21 09:27:15 +00:00
verwaest
65bae443a2 Add function-var to variables_ so LookupRecursive doesn't need to special-case it
After parsing a function, if there's no masking declaration in the function scope, DeclareFunctionVar will also bind the function name to a variable. It will either bind it to the const/const-legacy function_ variable, or to a dynamic non-local if the function calls sloppy eval.

Even if the variable is masked or sloppy eval is called, we still declare the function-var. The client immediately sets up the variable by assigning the resulting function to it.

BUG=v8:5209

Review-Url: https://codereview.chromium.org/2274133002
Cr-Commit-Position: refs/heads/master@{#39581}
2016-09-21 09:15:29 +00:00
machenbach
15b4b21855 Revert of [inspector] provide more usefull error message for non serializable value (patchset #3 id:40001 of https://codereview.chromium.org/2345263003/ )
Reason for revert:
Breaks https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/9932

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

Original issue's description:
> [inspector] provide more usefull error message for non serializable value
>
> Runtime.evaluate can return result by value. We need to provide more details why method call was failed.
>
> BUG=chromium:645640
> R=dgozman@chromium.org,alph@chromium.org
>
> Committed: https://crrev.com/0965b9b5df532d3aa0583966ca60794b54f56943
> Cr-Commit-Position: refs/heads/master@{#39574}

TBR=dgozman@chromium.org,alph@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:645640

Review-Url: https://codereview.chromium.org/2352263003
Cr-Commit-Position: refs/heads/master@{#39580}
2016-09-21 09:04:30 +00:00
vogelheim
a2b8b6e7db Handle Utf-8 BOM at beginning of an Utf-8 stream.
(This should enable to drop the BOM handling in the Blink bindings.)

R=marja@chromium.org
BUG=v8:4947

Review-Url: https://codereview.chromium.org/2354973002
Cr-Commit-Position: refs/heads/master@{#39579}
2016-09-21 08:40:10 +00:00
mstarzinger
c0c435b531 Remove some dead ZoneList typedefs.
R=marja@chromium.org

Review-Url: https://codereview.chromium.org/2359443002
Cr-Commit-Position: refs/heads/master@{#39577}
2016-09-21 07:58:44 +00:00
bmeurer
b0b97bfc0f [turbofan] Also allow TaggedSigned/Pointer memory operand.
When we added the new MachineRepresentation::kTaggedSigned and
MachineRepresentation::kTaggedPointer, we didn't extend the logic
for memory operand covering, and so for map checks and other
comparisons with fields we'd always need an additional register.
This fixes that and does reduce register pressure in some cases.

R=jarin@chromium.org
BUG=v8:5267,v8:5270

Review-Url: https://codereview.chromium.org/2354863003
Cr-Commit-Position: refs/heads/master@{#39575}
2016-09-21 07:15:20 +00:00
kozyatinskiy
0965b9b5df [inspector] provide more usefull error message for non serializable value
Runtime.evaluate can return result by value. We need to provide more details why method call was failed.

BUG=chromium:645640
R=dgozman@chromium.org,alph@chromium.org

Review-Url: https://codereview.chromium.org/2345263003
Cr-Commit-Position: refs/heads/master@{#39574}
2016-09-21 06:17:19 +00:00
bmeurer
54b55e5f2e [turbofan] Ship store-store elimination.
R=hablich@chromium.org, jarin@chromium.org

Review-Url: https://codereview.chromium.org/2355113003
Cr-Commit-Position: refs/heads/master@{#39573}
2016-09-21 05:50:35 +00:00
kozyatinskiy
59f18e53b5 [inspector] replaced V8_INSPECTOR* macros with macros from base/macros.h
BUG=chromium:635948
R=alph@chromium.org

Review-Url: https://codereview.chromium.org/2359533002
Cr-Commit-Position: refs/heads/master@{#39572}
2016-09-21 04:23:18 +00:00
gsathya
8c87ae9b88 [promises] Move PromiseResolveThenableJob to c++
- Add a new container object to store the data required for
PromiseResolveThenableJob.

- Create a new runtime function to enqueue the microtask event with
the required data.

This patches causes a 4% regression in the bluebird benchmark.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2314903004
Cr-Commit-Position: refs/heads/master@{#39571}
2016-09-21 03:49:50 +00:00
adamk
cf127e8144 [modules] Expand API to allow linking and use it in d8
This patch gives the ability for the embedder to ask for the
module requests of a module, and to pass a ResolveCallback
into Module::Instantiate().

In d8, I've implemented a simple module_map that's used
along with this API to allow loading, compiling, instantiating,
and evaluating a whole tree of modules.

No path resolution is yet implemented, meaning that all
import paths are relative to whatever directory d8 runs
in. And no imports are linked to the exports of the
requested module.

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2351113004
Cr-Commit-Position: refs/heads/master@{#39569}
2016-09-20 23:39:41 +00:00
neis
a037f350ee [modules] Also (de-)serialize imports.
This is in preparation for basic support of import statements.

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

Review-Url: https://codereview.chromium.org/2357003002
Cr-Commit-Position: refs/heads/master@{#39568}
2016-09-20 22:58:22 +00:00
littledan
dcd61b9020 Filter out synthetic variables from with scopes
This patch ensures that variables like .new_target aren't overwritable
using with scopes. It does this by ensuring that scope analysis does
not consider with scopes (or eval scopes) for such 'synthetic variables',
similarly to how the 'this' variable was already handled.
The patch also adds a DCHECK for the dynamic parallel to this case,
replacing a previous unreachable path for a particular instance.

BUG=v8:5405

Review-Url: https://codereview.chromium.org/2353623002
Cr-Commit-Position: refs/heads/master@{#39567}
2016-09-20 22:14:54 +00:00
littledan
bd078193a0 Remove synthetic unresolved variables from async/await desugaring
This patch uses temporaries rather than unresolved variables for
.promise and .debug_is_active. For .promise, a new field is added
to the FunctionState, similarly to .generator_object. This change
fixes a bug where .promise was locally shadowable by with, affecting
program semantics.

BUG=v8:5405

Review-Url: https://codereview.chromium.org/2359513002
Cr-Commit-Position: refs/heads/master@{#39566}
2016-09-20 21:31:32 +00:00
littledan
377358516f Make Promise.all/Promise.race catch prediction conditional on DevTools
To improve performance, this patch makes Promise.all and Promise.race not
perform correct catch prediction when the debugger is not open. The case
may come up if Promise.race or Promise.all is called, then DevTools is
open, then a component Promise is rejected. In this case, the user would
falsely get an exception event even if the "pause on caught exceptions"
box is unchecked. There are tests which triggered this case; however, it
seems both unlikely and and acceptable to have an event in this case.
Many analogous events are already produced when DevTools is enabled
during the operation of a program.

BUG=v8:3093

Review-Url: https://codereview.chromium.org/2350363002
Cr-Commit-Position: refs/heads/master@{#39565}
2016-09-20 19:34:35 +00:00
littledan
1b414e283a Reland Async/await Promise dependency graph
This patch knits together Promises returned by async/await such that when
one async function awaits the result of another one, catch prediction works
across the boundaries, whether the exception comes synchronously or
asynchronously. Edges are added in three places:
- When a locally uncaught await happens, if the value passed into await
  is a Promise, from the awaited value to the Promise under construction
  in the broader async function
- From a "throwaway" Promise, which may be found on the Promise debug
  stack, to the Promise under construction in the async function that
  surrounds it
- When a Promise is resolved with another Promise (e.g., when returning a
  Promise from an async function)

In this reland, the caught tests are broken up into four parts to avoid
timeouts.

BUG=v8:5167

Review-Url: https://codereview.chromium.org/2346363004
Cr-Commit-Position: refs/heads/master@{#39564}
2016-09-20 19:04:26 +00:00
adamk
c604eae3c2 [modules] Add a requested_modules field to Module
Also simplify Factory::NewModule to take only the SharedFunctionInfo.

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

Review-Url: https://codereview.chromium.org/2355033002
Cr-Commit-Position: refs/heads/master@{#39563}
2016-09-20 18:50:54 +00:00
klaasb
5deb0bc157 [interpreter] Inline FastCloneShallowArrayStub into bytecode handler
The CreateArrayLiteral bytecode handler now directly inlines the FastCloneShallowArrayStub.

BUG=v8:4280

Review-Url: https://codereview.chromium.org/2341743003
Cr-Commit-Position: refs/heads/master@{#39562}
2016-09-20 18:04:50 +00:00
ziyang
3b4cc88e9c PPC/s390: [Interpreter] Adds stackcheck in InterpreterPushArgsAndCall/Construct builtins.
Port 7f3d15aad4

    Original commit message:
    In ignition, arguments to function calls and function constructors are
    pushed onto the stack before calling the function. It is required to check
    that stack does not overflow when pushing the arguments.

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

Review-Url: https://codereview.chromium.org/2356583003
Cr-Commit-Position: refs/heads/master@{#39561}
2016-09-20 17:52:57 +00:00
bmeurer
c819a1e228 [TypeFeedbackVector] Properly ignore binary/compare op slots for FCG.
Fix a typo in TypeFeedbackVector::ComputeCounts, where we would not
skip the interpreter binary/compare op IC slots for fullcodegen, and
thus mess up the heuristics for tearing up.

TBR=mvstanton@chromium.org

Review-Url: https://codereview.chromium.org/2353513006
Cr-Commit-Position: refs/heads/master@{#39560}
2016-09-20 17:49:34 +00:00
neis
445e766fb8 Remove unused string from ast-value-factory.
R=adamk@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2351643006
Cr-Commit-Position: refs/heads/master@{#39559}
2016-09-20 17:47:45 +00:00
heimbuef
7a4f8e4d83 Moved zones and zone related stuff in its own directory.
This is some initial cleanup to keep /src clean. The
AccountingAllocator is actually exclusively used by zones and this
common subfolder makes that more clear.

BUG=v8:5409

Review-Url: https://codereview.chromium.org/2344143003
Cr-Commit-Position: refs/heads/master@{#39558}
2016-09-20 16:08:07 +00:00
hpayer
e05e735a8a [heap] Make slot set state and operations atomic.
Here we only change the type of the slot set fields to atomic values and use CAS to change the state. There is no change in behavior or semantics of the slot set.

BUG=chromium:648568

Review-Url: https://codereview.chromium.org/2353553003
Cr-Commit-Position: refs/heads/master@{#39557}
2016-09-20 14:58:54 +00:00
ahaas
57d8193764 [wasm] Fix EnsureSpace in the ZoneBuffer of the wasm encoder.
BUG=chromium:647329
R=titzer@chromium.org
TEST=unittest EncoderTest.Regression_647329

Review-Url: https://codereview.chromium.org/2355803002
Cr-Commit-Position: refs/heads/master@{#39556}
2016-09-20 14:04:13 +00:00
mvstanton
b88d132f4c [TypeFeedbackVector] special ic slots for interpreter compare/binary ops.
Full code uses patching ICs for this feedback, and the interpreter uses
the type feedback vector. It's a good idea to code the vector slots
appropriately as ICs so that the runtime profiler can better gauge if
the function is ready for tiering up from Ignition to TurboFan.

As is, the feedback is stored in "general" slots which can't be
characterized by the runtime profiler into feedback states.

This CL addresses that problem. Note that it's also important to
carefully exclude these slots from the profiler's consideration when
determining if you want to optimize from Full code.

BUG=

Review-Url: https://codereview.chromium.org/2342853002
Cr-Commit-Position: refs/heads/master@{#39555}
2016-09-20 13:54:51 +00:00
vogelheim
05a00a93b1 Simplify Scanner bookmarking.
- Eliminates *all* copies in the process.
- Moves (nearly) all functionality into Scanner::BookmarkScope.
- Significant code reduction.

[Needs to be rebased once crrev.com/2347883002 lands. All changes in *parser* are from that CL.]

R=marja@chromium.org
BUG=v8:4947

Review-Url: https://codereview.chromium.org/2341323002
Cr-Commit-Position: refs/heads/master@{#39554}
2016-09-20 13:48:04 +00:00
mstarzinger
b88df1c9e4 [turbofan] Ship generators if --turbo-from-bytecode set.
This makes sure generator functions are marked as optimizable for all
configurations where the BytecodeGraphBuilder is used. Note that as
usual AstNumbering is just a heuristic and the underlying compiler can
still bailout from optimization when the compilation pipeline chooses
another compiler that does not support generator functions.

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

Review-Url: https://codereview.chromium.org/2353793003
Cr-Commit-Position: refs/heads/master@{#39553}
2016-09-20 13:44:09 +00:00
ivica.bogosavljevic
10b023c1ba MIPS: Fix long branches being emitted mistakenly in floating-point branches
Due to a typo, long branches were emitted instead of short branches, and the
code would stop working at all in the situation when long branches must be
emitted. This patche fixes this issue.

TEST=mjsunit/wasm/embenchen/lua_binarytrees
BUG=

Review-Url: https://codereview.chromium.org/2351143002
Cr-Commit-Position: refs/heads/master@{#39552}
2016-09-20 13:01:06 +00:00
mstarzinger
4dab7b5a1d [turbofan] Fix loop assignment analysis on ForInStatements.
The implicit assignment to the induction variable in a ForInStatement
has been ignored by the AST loop assignment analysis. This was hidden
for cases where the parser introduced a ".for" temporary, but triggers
when the variable is declared outside the loop.

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

Review-Url: https://codereview.chromium.org/2356733002
Cr-Commit-Position: refs/heads/master@{#39551}
2016-09-20 12:37:33 +00:00
klaasb
e2455873e6 Port FastCloneShallowArrayStub to Turbofan
Refactors CodeStubAssembler::AllocateJSArray to share code.

BUG=chromium:608675

Review-Url: https://codereview.chromium.org/2304573004
Cr-Commit-Position: refs/heads/master@{#39550}
2016-09-20 12:36:28 +00:00
ishell
05eb56798e [ic] Reorder parameters of StoreIC_Miss and KeyedStoreIC_Miss runtime functions.
This will allow to simplify the miss part of store IC handlers when we decide
to pass value/slot/vector on the stack.

BUG=v8:5407

Review-Url: https://codereview.chromium.org/2351643005
Cr-Commit-Position: refs/heads/master@{#39549}
2016-09-20 12:26:19 +00:00
jochen
0f0912dd23 Change the CompilerDispatcherJob to take a SharedFunctionInfo
This means we can no longer take the closure's context to parse, but
need to rely on the outer scope info.

Since it's not possible to get that, however, for lazy functions, we
introduce a new field to SharedFunctionInfo that stores the outer scope
info whenever available.

BUG=v8:5215
R=marja@chromium.org,verwaest@chromium.org,jgruber@chromium.org

Review-Url: https://codereview.chromium.org/2358503002
Cr-Commit-Position: refs/heads/master@{#39548}
2016-09-20 12:08:42 +00:00
jgruber
4f5695229e [d8] Fix the shared-library build
This commit ensures that the d8 shared library build uses the same logic as
the standard static build by exporting relevant functions and classes.

BUG=chromium:646337

Committed: https://crrev.com/2c10ca8086a4d595ecf9aa843d2031b068470d65
Review-Url: https://codereview.chromium.org/2342563002
Cr-Original-Commit-Position: refs/heads/master@{#39503}
Cr-Commit-Position: refs/heads/master@{#39547}
2016-09-20 12:06:54 +00:00
jochen
7d9a037524 Only create ScopeInfos for scopes that really need one
R=verwaest@chromium.org,marja@chromium.org

Review-Url: https://codereview.chromium.org/2351823005
Cr-Commit-Position: refs/heads/master@{#39546}
2016-09-20 11:47:24 +00:00
leszeks
bedde181fd [base] Decrease probing in hashmap
Removes some unnecessary probing in TemplateHashMapImpl, in
particular probing a second time in LookupOrInsert after the
first probe came up with an empty value.

Review-Url: https://codereview.chromium.org/2349163002
Cr-Commit-Position: refs/heads/master@{#39545}
2016-09-20 11:30:51 +00:00
ulan
72456950c1 [heap] Properly handle --noconcurrent-sweeping flag in page unmapper.
BUG=

Review-Url: https://codereview.chromium.org/2347073003
Cr-Commit-Position: refs/heads/master@{#39544}
2016-09-20 11:17:22 +00:00
ishell
4286f2c0bd [crankshaft] Remove HStoreKeyedGeneric and use HCallWithDescriptor instead to call KeyedStoreIC.
... because the latter automatically respects the desired calling convention.

BUG=v8:5407

Review-Url: https://codereview.chromium.org/2350423002
Cr-Commit-Position: refs/heads/master@{#39543}
2016-09-20 11:12:01 +00:00
rmcilroy
b2615904c2 Remove unecessary arm/arm64 OWNERS files.
BUG=

Review-Url: https://codereview.chromium.org/2357563002
Cr-Commit-Position: refs/heads/master@{#39542}
2016-09-20 11:10:59 +00:00
rmcilroy
4243a7f085 [Interpreter] Remove extra CHECKS added for crbug.com/642111.
BUG=chromium:642111

Review-Url: https://codereview.chromium.org/2358523003
Cr-Commit-Position: refs/heads/master@{#39541}
2016-09-20 11:09:14 +00:00
bmeurer
29dd7fc5ed [turbofan] Lower ConsString creation in JSTypedLowering.
Extract String feedback on Add operation and utilize to lower ConsString
creation in JSTypedLowering when we know that a String addition will
definitely result in the creation of a ConsString.

Note that Crankshaft has to guard the potential length overflow of the
resulting string with an eager deoptimization exit, while we can safely
throw an exception in that case.

Also note that the bytecode pipeline does not currently provide the
String feedback for the addition, which has to be added.

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

Review-Url: https://codereview.chromium.org/2354853002
Cr-Commit-Position: refs/heads/master@{#39540}
2016-09-20 11:00:39 +00:00
bmeurer
0e03973047 [turbofan] Introduce PretenureFlagOf helper function.
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2357573002
Cr-Commit-Position: refs/heads/master@{#39539}
2016-09-20 10:58:40 +00:00
leszeks
b42ecda533 [base] Move hashmap allocator to a field
Moves the hashmap's allocator from being a parameter in the various
hashmap functions, to being a field in the hashmap itself. This

1. Protects against incorrectly passed allocators, and
2. Cleans up the API so that e.g. callers don't have to store their
   allocator

This is part of a wider set of changes discussed in:
https://groups.google.com/forum/#!topic/v8-dev/QLsC0XPYLeM

Review-Url: https://codereview.chromium.org/2345233003
Cr-Commit-Position: refs/heads/master@{#39538}
2016-09-20 10:46:07 +00:00
leszeks
044a62be6c [interpreter] Add fast path for dynamic global lookups
Adds a fast path for loading DYNAMIC_GLOBAL variables, which are lookup
variables that can be globally loaded, without calling the runtime, as long as
there was no context extension by a sloppy eval along their context chain.

BUG=v8:5263

Review-Url: https://codereview.chromium.org/2347143002
Cr-Commit-Position: refs/heads/master@{#39537}
2016-09-20 10:31:52 +00:00
verwaest
cab644f3f2 Internalize the ast-value-factory before tracing in trace-parse. Otherwise the string-handle isn't available yet
BUG=

Review-Url: https://codereview.chromium.org/2348373004
Cr-Commit-Position: refs/heads/master@{#39536}
2016-09-20 10:30:50 +00:00
ishell
3b5fcea883 [crankshaft] Remove HStoreNamedGeneric and use HCallWithDescriptor instead to call StoreIC.
... because the latter automatically respects the desired calling convention.

BUG=v8:5407

Review-Url: https://codereview.chromium.org/2358533002
Cr-Commit-Position: refs/heads/master@{#39535}
2016-09-20 10:00:11 +00:00
bmeurer
825f506fab [turbofan] Propagate tenuring decisions to child object allocations.
When an allocation for a parent object is pretenured, also propagate
that to all allocations for objects that are (potentially) stored into
the parent object.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2348293003
Cr-Commit-Position: refs/heads/master@{#39534}
2016-09-20 09:58:32 +00:00
vogelheim
b36c60cce8 Remove legacy API on Utf16CharacterStream.
BUG=v8:4947

Review-Url: https://codereview.chromium.org/2347883002
Cr-Commit-Position: refs/heads/master@{#39533}
2016-09-20 09:44:00 +00:00
rmcilroy
a06df1f21c [Parser] Don't internalize on-the-fly.
Avoid internalizing on-the-fly now that scope analysis and natives syntax
runtime calls no longer require internalized AST values. This should be
more efficient by avoiding extra branches on every AST value creation.

BUG=v8:5215, chromium:634953

Review-Url: https://codereview.chromium.org/2328593002
Cr-Commit-Position: refs/heads/master@{#39531}
2016-09-20 09:33:01 +00:00
leszeks
696dd65b80 [base] Template hashmap on key and value
Adds template parameters for the TemplateHashMapImpl for the key and
value type, to allow them to be something other than pointers. To keep
the impact of this patch low, uses of TemplateHashMapImpl set these
types to void* to emulate the previous behaviour.

This is part of a wider set of changes discussed in:
https://groups.google.com/forum/#!topic/v8-dev/QLsC0XPYLeM

Review-Url: https://codereview.chromium.org/2343123002
Cr-Commit-Position: refs/heads/master@{#39530}
2016-09-20 08:40:33 +00:00
jyan
eb57f22e2b Fix BigE for Rework scanner-character-streams.
R=vogelheim@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2354683003
Cr-Commit-Position: refs/heads/master@{#39529}
2016-09-20 08:26:06 +00:00
jgruber
5ab3874559 [regexp/string] Merge ExpandReplacement and GetSubstitution
R=littledan@chromium.org
BUG=v8:5339

Review-Url: https://codereview.chromium.org/2332333002
Cr-Commit-Position: refs/heads/master@{#39528}
2016-09-20 08:13:33 +00:00
machenbach
298ee9cde1 Revert of [d8] Fix the shared-library build (patchset #12 id:20002 of https://codereview.chromium.org/2342563002/ )
Reason for revert:
Unblocking roll

Original issue's description:
> [d8] Fix the shared-library build
>
> This commit ensures that the d8 shared library build uses the same logic as
> the standard static build by exporting relevant functions and classes.
>
> BUG=chromium:646337
>
> Committed: https://crrev.com/2c10ca8086a4d595ecf9aa843d2031b068470d65
> Cr-Commit-Position: refs/heads/master@{#39503}

TBR=jochen@chromium.org,vogelheim@chromium.org,bmeurer@chromium.org,titzer@chromium.org,jgruber@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:646337

Review-Url: https://codereview.chromium.org/2356703003
Cr-Commit-Position: refs/heads/master@{#39526}
2016-09-20 07:13:27 +00:00
bmeurer
d86038db25 [crankshaft] Protect against deopt loops from string length overflows.
Crankshaft just unconditionally deoptimizes the code when the length of
a string addition result would overflow. In order to protect against
deopt loops we insert a global protector cell.

We will use the same mechanism for inlining certain string additions
into TurboFan as well, and protecting against overflow (we will also
extend this to deal with String.prototype.concat and friends once we
get there).

BUG=v8:5404
R=jarin@chromium.org,hpayer@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_linux64_msan_rel

Committed: https://crrev.com/cb19257a926a55209a6d6858ce26d51a0447ba71
Review-Url: https://codereview.chromium.org/2348293002
Cr-Original-Commit-Position: refs/heads/master@{#39511}
Cr-Commit-Position: refs/heads/master@{#39525}
2016-09-20 05:59:35 +00:00
littledan
100336f5dc Revert of Async/await Promise dependency graph (patchset #30 id:550001 of https://codereview.chromium.org/2317383002/ )
Reason for revert:
Need to break up test into smaller tests to avoid timeouts

Original issue's description:
> Async/await Promise dependency graph
>
> This patch knits together Promises returned by async/await such that when
> one async function awaits the result of another one, catch prediction works
> across the boundaries, whether the exception comes synchronously or
> asynchronously. Edges are added in three places:
> - When a locally uncaught await happens, if the value passed into await
>   is a Promise, from the awaited value to the Promise under construction
>   in the broader async function
> - From a "throwaway" Promise, which may be found on the Promise debug
>   stack, to the Promise under construction in the async function that
>   surrounds it
> - When a Promise is resolved with another Promise (e.g., when returning a
>   Promise from an async function)
>
> BUG=v8:5167
>
> Committed: https://crrev.com/7265fdde7c76b9f875b40b0b139515936d491d64
> Cr-Commit-Position: refs/heads/master@{#39522}

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

Review-Url: https://codereview.chromium.org/2351953002
Cr-Commit-Position: refs/heads/master@{#39523}
2016-09-20 01:09:51 +00:00
littledan
7265fdde7c Async/await Promise dependency graph
This patch knits together Promises returned by async/await such that when
one async function awaits the result of another one, catch prediction works
across the boundaries, whether the exception comes synchronously or
asynchronously. Edges are added in three places:
- When a locally uncaught await happens, if the value passed into await
  is a Promise, from the awaited value to the Promise under construction
  in the broader async function
- From a "throwaway" Promise, which may be found on the Promise debug
  stack, to the Promise under construction in the async function that
  surrounds it
- When a Promise is resolved with another Promise (e.g., when returning a
  Promise from an async function)

BUG=v8:5167

Review-Url: https://codereview.chromium.org/2317383002
Cr-Commit-Position: refs/heads/master@{#39522}
2016-09-19 23:59:03 +00:00
littledan
bf43f883c1 Reland of Fix async/await memory leak (patchset #1 id:1 of https://codereview.chromium.org/2348403003/ )
This patch closes a memory leak in async/await where the desugaring
was creating a situation analagous to that described in v8:5002.
Intermediate Promises were being kept alive, so a long-running loop
would cause linear memory usage on the heap. This patch returns
undefined to the 'then' callback passed into PerformPromiseThen
in order to avoid this hazard. Test expectations are fixed to remove
expecting extraneous events which occurred on Promises that are
now not given unnecessarily complex resolution paths before being
thrown away.

This patch is a reland; originally, tests which exercised the memory
exhaustion were checked in. Although it's possible to find good parameters
for running such tests locally, it is difficult to automate the tests
between the rock of timeouts and the hard place of too-small heaps
causing memory exhaustion in some modes even when there is no leak.

BUG=v8:5390

Review-Url: https://codereview.chromium.org/2352933002
Cr-Commit-Position: refs/heads/master@{#39520}
2016-09-19 23:51:52 +00:00
neis
c5785bfb92 [modules] Explicitly keep track of module requests.
We must keep track of the exact order in which modules are requested.
To do so, maintain a map from module specifiers to position while
parsing (in ModuleDescriptor). Descriptor entries now refer to that
position rather than the string.  When generating the ModuleInfo, turn
this map into an array of specifiers. We don't need the map anymore
later on, so we do not reconstruct it when deserializing again.

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2353633002
Cr-Commit-Position: refs/heads/master@{#39519}
2016-09-19 22:08:20 +00:00
machenbach
53510f6a80 Revert of [crankshaft] Protect against deopt loops from string length overflows. (patchset #1 id:1 of https://codereview.chromium.org/2348293002/ )
Reason for revert:
Mean https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/builds/10910

Original issue's description:
> [crankshaft] Protect against deopt loops from string length overflows.
>
> Crankshaft just unconditionally deoptimizes the code when the length of
> a string addition result would overflow. In order to protect against
> deopt loops we insert a global protector cell.
>
> We will use the same mechanism for inlining certain string additions
> into TurboFan as well, and protecting against overflow (we will also
> extend this to deal with String.prototype.concat and friends once we
> get there).
>
> BUG=v8:5404
> R=jarin@chromium.org,hpayer@chromium.org
>
> Committed: https://crrev.com/cb19257a926a55209a6d6858ce26d51a0447ba71
> Cr-Commit-Position: refs/heads/master@{#39511}

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

Review-Url: https://codereview.chromium.org/2357433002
Cr-Commit-Position: refs/heads/master@{#39518}
2016-09-19 21:50:15 +00:00
lkelvin
47f203e409 PPC/s390: Record call counts also for megamorphic calls.
Port: 2ab3fcf42f

Original commit message:

	To make better inlining decisions, it's good to have call
counts for poly/mega-morphic cases. This CL makes it work for calls,
and another will follow to better unify the code between constructor
calls and normal calls (and thence, to record megamorphic call counts
there as well).

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

Review-Url: https://codereview.chromium.org/2356483002
Cr-Commit-Position: refs/heads/master@{#39517}
2016-09-19 21:10:12 +00:00
bradnelson
a4737793cb [wasm] Support asm.js modules with a single function.
Handle the case of asm.js modules that return a single function
instead of a collection of them.

R=mtrofin@chromium.org
TEST=mjsunit/asm/asm-wasm
BUG=v8:4203
BUG=v8:5356

Review-Url: https://codereview.chromium.org/2348383003
Cr-Commit-Position: refs/heads/master@{#39515}
2016-09-19 21:01:34 +00:00
verwaest
58507b719e Don't make immediately resolved proxies unresolved
BUG=v8:5209

Review-Url: https://codereview.chromium.org/2349193002
Cr-Commit-Position: refs/heads/master@{#39514}
2016-09-19 21:01:33 +00:00
littledan
3f366186e9 Revert of Fix async/await memory leak (patchset #5 id:160001 of https://codereview.chromium.org/2348403002/ )
Reason for revert:
Still causes issues on bot (sometimes!)

Original issue's description:
> Reland of Fix async/await memory leak (patchset #1 id:1 of https://codereview.chromium.org/2354473002/ )
>
> Reason for revert:
> Relanding with faster-running test
>
> Original issue's description:
> > Revert of Fix async/await memory leak (patchset #5 id:80001 of https://codereview.chromium.org/2334323006/ )
> >
> > Reason for revert:
> > newly introduced test async-await-loop times out: https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/builds/10894/steps/Ignition%20-%20turbofan%20%28flakes%29/logs/async-await-loop
> >
> > Original issue's description:
> > > Fix async/await memory leak
> > >
> > > This patch closes a memory leak in async/await where the desugaring
> > > was creating a situation analagous to that described in v8:5002.
> > > Intermediate Promises were being kept alive, so a long-running loop
> > > would cause linear memory usage on the heap. This patch returns
> > > undefined to the 'then' callback passed into PerformPromiseThen
> > > in order to avoid this hazard. Test expectations are fixed to remove
> > > expecting extraneous events which occurred on Promises that are
> > > now not given unnecessarily complex resolution paths before being
> > > thrown away.
> > >
> > > BUG=v8:5390
> > >
> > > Committed: https://crrev.com/a0ba18e9634c5e2d439033ab61a77cff54f9af35
> > > Cr-Commit-Position: refs/heads/master@{#39479}
> >
> > TBR=adamk@chromium.org,caitp@igalia.com,littledan@chromium.org
> > NOTRY=true
> > BUG=v8:5390
> >
> > Committed: https://crrev.com/196db1999da130019bbf8e3bd65977f840e8afaf
> > Cr-Commit-Position: refs/heads/master@{#39493}
>
> TBR=adamk@chromium.org,caitp@igalia.com,hablich@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> BUG=v8:5390
>
> Committed: https://crrev.com/e51482f01f26e0013e6377e85c4d2c41900e403c
> Cr-Commit-Position: refs/heads/master@{#39508}

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

Review-Url: https://codereview.chromium.org/2348403003
Cr-Commit-Position: refs/heads/master@{#39512}
2016-09-19 21:01:31 +00:00
bmeurer
cb19257a92 [crankshaft] Protect against deopt loops from string length overflows.
Crankshaft just unconditionally deoptimizes the code when the length of
a string addition result would overflow. In order to protect against
deopt loops we insert a global protector cell.

We will use the same mechanism for inlining certain string additions
into TurboFan as well, and protecting against overflow (we will also
extend this to deal with String.prototype.concat and friends once we
get there).

BUG=v8:5404
R=jarin@chromium.org,hpayer@chromium.org

Review-Url: https://codereview.chromium.org/2348293002
Cr-Commit-Position: refs/heads/master@{#39511}
2016-09-19 21:01:30 +00:00
lpy
9e640b74b3 [Tracing] Remove unnecessary memory allocation in runtime call stats.
Previously we didn't implement TRACE_STR_COPY when we write trace events to
file, which causes us to allocate a growing independent memory chunk for dumped
runtime call stats table. Since we now have a fully functional TRACE_STR_COPY,
this memory allocation can be avoided, this patch removes it.

BUG=v8:5089

Committed: https://crrev.com/e1997bb7d780d12e3a89078e8dd652dcf1d90039
Review-Url: https://codereview.chromium.org/2342643004
Cr-Original-Commit-Position: refs/heads/master@{#39462}
Cr-Commit-Position: refs/heads/master@{#39510}
2016-09-19 21:01:29 +00:00
mtrofin
a1784e87cd [wasm] calculate wasm mem size base explicitly
This CL avoids relying on signed/unsigned implicit conversions
when re-computing wasm mem sizes.

BUG=

Review-Url: https://codereview.chromium.org/2349053002
Cr-Commit-Position: refs/heads/master@{#39509}
2016-09-19 21:01:28 +00:00
littledan
e51482f01f Reland of Fix async/await memory leak (patchset #1 id:1 of https://codereview.chromium.org/2354473002/ )
Reason for revert:
Relanding with faster-running test

Original issue's description:
> Revert of Fix async/await memory leak (patchset #5 id:80001 of https://codereview.chromium.org/2334323006/ )
>
> Reason for revert:
> newly introduced test async-await-loop times out: https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/builds/10894/steps/Ignition%20-%20turbofan%20%28flakes%29/logs/async-await-loop
>
> Original issue's description:
> > Fix async/await memory leak
> >
> > This patch closes a memory leak in async/await where the desugaring
> > was creating a situation analagous to that described in v8:5002.
> > Intermediate Promises were being kept alive, so a long-running loop
> > would cause linear memory usage on the heap. This patch returns
> > undefined to the 'then' callback passed into PerformPromiseThen
> > in order to avoid this hazard. Test expectations are fixed to remove
> > expecting extraneous events which occurred on Promises that are
> > now not given unnecessarily complex resolution paths before being
> > thrown away.
> >
> > BUG=v8:5390
> >
> > Committed: https://crrev.com/a0ba18e9634c5e2d439033ab61a77cff54f9af35
> > Cr-Commit-Position: refs/heads/master@{#39479}
>
> TBR=adamk@chromium.org,caitp@igalia.com,littledan@chromium.org
> NOTRY=true
> BUG=v8:5390
>
> Committed: https://crrev.com/196db1999da130019bbf8e3bd65977f840e8afaf
> Cr-Commit-Position: refs/heads/master@{#39493}

TBR=adamk@chromium.org,caitp@igalia.com,hablich@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
BUG=v8:5390

Review-Url: https://codereview.chromium.org/2348403002
Cr-Commit-Position: refs/heads/master@{#39508}
2016-09-19 18:41:05 +00:00
vogelheim
d8eeaed3f9 Behold, a unit test for Scanner::BookmarkScope (& scanner bookmarking).
This is in preparation for upcmoming scanner + bookmarking cleanups.

Also, drive-by fix for setting a bookmark close to the end of the stream,
when the look-ahead character (c0_) is kEndOfInput, which the bookmarking
logic also used as kNoBookmark.

R=marja@chomium.org
BUG=v8:4947

Review-Url: https://codereview.chromium.org/2345053003
Cr-Commit-Position: refs/heads/master@{#39507}
2016-09-19 16:51:05 +00:00
kozyatinskiy
072c694336 [inspector] fixed all deprecated calls
BUG=chromium:635948
R=dgozman@chromium.org,alph@chromium.org

Review-Url: https://codereview.chromium.org/2332243002
Cr-Commit-Position: refs/heads/master@{#39506}
2016-09-19 16:11:24 +00:00
verwaest
e3f86f3269 Drop declare_free parameter to LookupRecursive
BUG=v8:5209

Review-Url: https://codereview.chromium.org/2351673002
Cr-Commit-Position: refs/heads/master@{#39504}
2016-09-19 12:59:47 +00:00
jgruber
2c10ca8086 [d8] Fix the shared-library build
This commit ensures that the d8 shared library build uses the same logic as
the standard static build by exporting relevant functions and classes.

BUG=chromium:646337

Review-Url: https://codereview.chromium.org/2342563002
Cr-Commit-Position: refs/heads/master@{#39503}
2016-09-19 12:47:22 +00:00
heimbuef
48faea070f Used a BitField to improve packing of AstNode and subclasses
BUG=

Review-Url: https://codereview.chromium.org/2266493002
Cr-Commit-Position: refs/heads/master@{#39502}
2016-09-19 11:48:42 +00:00
marja
f7fadf268c Don't force eager parsing when natives are allowed.
PreParser is already capable of handling natives, because
ParseV8Intrinsic was moved to ParserBase. There's no reason to force
eager parsing when natives are allowed.

R=nikolaos@chromium.org, mstarzinger@chromium.org
BUG=v8:5398

Review-Url: https://codereview.chromium.org/2342133003
Cr-Commit-Position: refs/heads/master@{#39501}
2016-09-19 11:46:59 +00:00