Commit Graph

29523 Commits

Author SHA1 Message Date
yangguo
39ed137bce [serializer] introduce API to serialize internal fields
See https://goo.gl/C9U1dL

BUG=chromium:617892

Review-Url: https://codereview.chromium.org/2452333002
Cr-Commit-Position: refs/heads/master@{#40623}
2016-10-27 13:35:36 +00:00
gsathya
b4f76a8ee8 [promises] Remove PromiseRejectEvent
This is no longer used.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2454713003
Cr-Commit-Position: refs/heads/master@{#40622}
2016-10-27 13:05:12 +00:00
adamk
84bbdc7648 [modules] Move MODULE variable back to Scopes, before resolution
Unlike other variable allocation logic, MODULE allocation does
not depend on resolution. So in order to give hole check elimination
(which runs during resolution) access to the information "is this
variable an import", simply allocate all modules variables prior
to resolution.

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2458653002
Cr-Commit-Position: refs/heads/master@{#40621}
2016-10-27 12:37:59 +00:00
henrique.ferreiro
2c38023be3 [cleanup] #undef DECLARE_ERROR instead of non-existent DEFINE_ERROR
The latter was left from a previous commit and not updated later to reflect the new name.

Review-Url: https://codereview.chromium.org/2447023004
Cr-Commit-Position: refs/heads/master@{#40620}
2016-10-27 12:36:36 +00:00
jarin
21d55e2166 [turbofan] Relax a too-strict dcheck.
BUG=v8:5573

Review-Url: https://codereview.chromium.org/2458623002
Cr-Commit-Position: refs/heads/master@{#40619}
2016-10-27 12:33:19 +00:00
gsathya
b15f8710c6 [promises] Create runtime-promise.cc
This patch moves promise specific runtime functions
to runtime-promise.cc from runtime-internal.cc

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2452833003
Cr-Commit-Position: refs/heads/master@{#40618}
2016-10-27 12:28:14 +00:00
mstarzinger
8549811ae3 [compiler] Prepare for partially shipping Ignition.
This prepares the code-base so that Ignition can be enabled on a certain
subset of compilations without setting the {FLAG_ignition} flag (which
enables Ignition on all compilations). We should not check the flag in
question explicitly anywhere outside of the compiler heuristics.

R=mvstanton@chromium.org

Review-Url: https://codereview.chromium.org/2443573002
Cr-Commit-Position: refs/heads/master@{#40617}
2016-10-27 12:17:37 +00:00
bmeurer
305948fa76 [ic] Properly deal with all oddballs when updating BinaryOpIC state.
R=jarin@chromium.org
BUG=chromium:659967

Review-Url: https://codereview.chromium.org/2453633005
Cr-Commit-Position: refs/heads/master@{#40616}
2016-10-27 12:16:13 +00:00
gsathya
f80f450993 [promises] Move PromiseReject to c++
This patch refactors most of FulfillPromise runtime call out to a separate
function so that we can to it from PromiseReject runtime call.

This patch adds a PromiseStatus enum.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2451163003
Cr-Commit-Position: refs/heads/master@{#40615}
2016-10-27 11:51:49 +00:00
ulan
017f48d221 Reland "[heap] Uncommit marking deque in concurrent task."
This reverts commit 35e4a03f5b.

BUG=

Review-Url: https://codereview.chromium.org/2454723002
Cr-Commit-Position: refs/heads/master@{#40614}
2016-10-27 11:30:35 +00:00
neis
8cd5592f54 [parsing] When failing due to variable redeclaration, point at the variable.
We used to point elsewhere, for instance the right-hand-side of an assignment.

Small limitation: Since variable proxies only have a start position, not an end
position, the best we can do is point at the first character.  (We cannot rely
on the scanner's last token position because Declare may be called long after
the variable has been scanned.)

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

Review-Url: https://codereview.chromium.org/2447143005
Cr-Commit-Position: refs/heads/master@{#40613}
2016-10-27 11:03:47 +00:00
leszeks
a5ed05aa8b [compiler] Make SFI "optimize" flag a "tier up" flag
Reuses (and renames) the SFI "mark for optimization" flag to also permit
marking for baseline recompilation. The flag now represents a "tier up"
request, and CompileLazy can get baseline code as well as optimized
code.

BUG=v8:5512

Review-Url: https://codereview.chromium.org/2448933002
Cr-Commit-Position: refs/heads/master@{#40612}
2016-10-27 10:08:09 +00:00
cbruni
433cd531df [tools] Support more map information in --trace-ic and ic-explorer.html
BUG=

Review-Url: https://codereview.chromium.org/2451173002
Cr-Commit-Position: refs/heads/master@{#40611}
2016-10-27 09:56:14 +00:00
leszeks
c4d770b182 [ignition] Add a property call bytecode
This is a new bytecode which behaves (for now) exactly like Call,
except that in turbofan graph building we can set the
ConvertReceiverMode to NotNullOrUndefined.

I observe a 1% improvement on Box2D, I'd expect a similar improvement on
other OOP heavy code.

Review-Url: https://codereview.chromium.org/2450243002
Cr-Commit-Position: refs/heads/master@{#40610}
2016-10-27 09:36:15 +00:00
jgruber
88c5a300c5 [regexp] Set static property attributes as in spec proposal
'[...] accessor properties who have the attributes { [[Enumerable]]:
false, [[Configurable]]: true } [...]'

BUG=v8:5566

Review-Url: https://codereview.chromium.org/2452913002
Cr-Commit-Position: refs/heads/master@{#40609}
2016-10-27 08:26:05 +00:00
bmeurer
7d383be9da [crankshaft] Support all oddballs for truncating TaggedToI changes.
For inputs to truncating binary operations like <<, | or >>>, support
all Oddballs not just undefined, true and false. This unifies treatment
of these truncations in Crankshaft and TurboFan, and is very easy
nowadays, since the memory layout of Oddball and HeapNumber is
compatible.

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

Review-Url: https://codereview.chromium.org/2452193003
Cr-Commit-Position: refs/heads/master@{#40608}
2016-10-27 06:00:05 +00:00
zhengxing.li
9bc155b9c3 X87: [crankshaft] Refactor kAllowUndefinedAsNaN to kTruncatingToNumber.
port df981a9ff5 (r40577)

  original commit message:
  The meaning of the HValue::kAllowUndefinedAsNaN is actually ToNumber
  conversion (except for the uses in HBranch and HCompareHoleAndBranch,
  which were confusing and useless anyways), so fix the naming to match
  that.

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

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

BUG=

Review-Url: https://codereview.chromium.org/2456503003
Cr-Commit-Position: refs/heads/master@{#40607}
2016-10-27 04:32:37 +00:00
aseemgarg
4156d940e4 [wasm] add atomic opcodes
R=titzer@chromium.org,binji@chromium.org
BUG=v8:4614

Review-Url: https://codereview.chromium.org/2423883003
Cr-Commit-Position: refs/heads/master@{#40606}
2016-10-26 20:28:44 +00:00
rob
cb2a39d367 Avoid using stale InspectedContext pointers
BUG=657568
TEST=Manually, see bug report

Review-Url: https://codereview.chromium.org/2432163004
Cr-Commit-Position: refs/heads/master@{#40605}
2016-10-26 20:27:12 +00:00
bbudge
51bbfc7da2 [Turbofan] Add USE for local used only by DCHECK.
LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2453813002
Cr-Commit-Position: refs/heads/master@{#40603}
2016-10-26 17:28:51 +00:00
heimbuef
610c0d75c8 New zone-backed list datastructure to replace ZoneList
Since ZoneLists are essentially non-standard ZoneVectors and have a bad
growing behaviour (ZoneList-allocations make up ~50% of website parse
zone memory) we should stop using them. The zone-containers are merely
a clean-up, with none of them actually better suited to be used with
zones. This new datastructure allows most operations of a LinkedList (
except pop_first and insertAt/removeAt) but uses about the same memory
as a well-initialized ZoneVector/ZoneList (<3% overhead with reasonably
large lists). It also never attempts to free memory again (which would
not work in zones anyway).

The ZoneChunkList is essentially a doubly-linked-list of arrays of
variable size.

Some test-results where I tried storing 16k pointers in different list
types (lists themselves also zone-allocated):

List type                       Zone memory used   Time taken
-----------------------------------------------------------------------
Zone array (for comparison)     131072 B

Ideally initialized ZoneList    131088 B           0.062ms

ChunkZoneList                   134744 B           0.052ms <--new thing

ZoneDeque                       141744 B

ZoneLinkedList                  393264 B

Initially empty ZoneList        524168 B           0.171ms <--right now

ChunkZoneList only push_front   524320 B

Review-Url: https://codereview.chromium.org/2449383002
Cr-Commit-Position: refs/heads/master@{#40602}
2016-10-26 17:08:28 +00:00
titzer
24d38be132 [wasm] Remove the "Wasm" object.
BUG=chromium:575167, v8:5507

R=rossberg@chromium.org,bradnelson@chromium.org
CC=ahaas@chromium.org

Review-Url: https://codereview.chromium.org/2447013004
Cr-Commit-Position: refs/heads/master@{#40601}
2016-10-26 16:58:53 +00:00
titzer
3f207617d7 [wasm] Binary 0xD: update encoding of opcodes, types, and add immediates.
R=ahaas@chromium.org,rossberg@chromium.org,binji@chromium.org,bradnelson@chromium.org
BUG=chromium:575167, chromium:659591

Review-Url: https://codereview.chromium.org/2440953002
Cr-Commit-Position: refs/heads/master@{#40600}
2016-10-26 16:56:49 +00:00
clemensh
ff5194e3ce Improve exception printing for debug
If there is no stack trace (which happens), then at least print the
location of the message.

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

Review-Url: https://codereview.chromium.org/2450253002
Cr-Commit-Position: refs/heads/master@{#40599}
2016-10-26 16:45:28 +00:00
mythria
46a1b34e86 [Interpreter] Tune runtime profiler parameters for turbofan and OSR.
Turbofan requires a different tuning when compared to crankshaft. Crankshaft
typically has faster compilation times when compared to turbofan. Hence,
added a new parameter, so that crankshaft and turbofan can be tuned
independently.

OSRing too soon is not good for performance, especially for sunspider
benchmarks. Since they are really small functions and optimizing them is
more expensive than just executing unoptimized code. Tuning the code size
threshold of the functions that can be OSRed from ignition.

BUG=v8:4280,chromium:659111

Review-Url: https://codereview.chromium.org/2445203003
Cr-Commit-Position: refs/heads/master@{#40598}
2016-10-26 16:32:54 +00:00
bbudge
09ab8e6ad9 [Turbofan] Add concept of FP register aliasing on ARM 32.
- Modifies RegisterConfiguration to specify complex aliasing on ARM 32.
- Modifies RegisterAllocator to consider aliasing.
- Modifies ParallelMove::PrepareInsertAfter to handle aliasing.
- Modifies GapResolver to split wider register moves when interference
with smaller moves is detected.
- Modifies MoveOptimizer to handle aliasing.
- Adds ARM 32 macro-assembler pseudo move instructions to handle cases where
  split moves don't correspond to actual s-registers.
- Modifies CodeGenerator::AssembleMove and AssembleSwap to handle moves of
  different widths, and moves involving pseudo-s-registers.
- Adds unit tests for FP operand interference checking and PrepareInsertAfter.
- Adds more tests of FP for the move optimizer and register allocator.

LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2410673002
Cr-Commit-Position: refs/heads/master@{#40597}
2016-10-26 16:04:33 +00:00
clemensh
f6c3fd0a74 [compiler] Remove redundant code
Just stumbled across this while doing
https://codereview.chromium.org/2457433002/

R=mstarzinger@chromium.org

Review-Url: https://codereview.chromium.org/2449103006
Cr-Commit-Position: refs/heads/master@{#40596}
2016-10-26 15:55:38 +00:00
rmcilroy
7db6c79acd [Interpreter] Don't require a CanonicalHandleScope for parse / renumbering
Removes the need for a CanonicalHandleScope for parsing and renumbering
phases when using Ignition. Since AST strings are canonicalized by the
AST value factory, we only need to make sure we use the same canonical
handles for any other handles we add to the bytecode generator.

This avoids a regression when enabling Ignition for all Turbofan code, and
improves CodeLoad on for Ignition by about 5%.

BUG=v8:4280

Review-Url: https://codereview.chromium.org/2448323004
Cr-Commit-Position: refs/heads/master@{#40595}
2016-10-26 15:11:22 +00:00
neis
038a81976e [modules] Improve error messages.
For instance, when an import cannot be resolved, actually
point at the corresponding import statement.

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2451153002
Cr-Commit-Position: refs/heads/master@{#40594}
2016-10-26 15:10:24 +00:00
bjaideep
35b3e01394 PPC/s390: [crankshaft] Refactor kAllowUndefinedAsNaN to kTruncatingToNumber.
Port df981a9ff5

Original commit message:

    The meaning of the HValue::kAllowUndefinedAsNaN is actually ToNumber
    conversion (except for the uses in HBranch and HCompareHoleAndBranch,
    which were confusing and useless anyways), so fix the naming to match
    that.

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

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

R=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/2449373002
Cr-Commit-Position: refs/heads/master@{#40593}
2016-10-26 14:41:02 +00:00
bmeurer
2bd7464ec1 [compiler] Properly validate stable map assumption for globals.
For global object property cells, we did not check that the map on the
previous object is still the same for which we actually optimized. So
the optimized code was not in sync with the actual state of the property
cell. When loading from such a global object property cell, Crankshaft
optimizes away any map checks (based on the stable map assumption),
leading to arbitrary memory access in the worst case.

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

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

Review-Url: https://codereview.chromium.org/2444233004
Cr-Commit-Position: refs/heads/master@{#40592}
2016-10-26 13:44:03 +00:00
gsathya
a7a350012c [promises] remove kPending check in RejectPromise
RejectPromise is always called on a pending promise making this a redundant check.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2446113007
Cr-Commit-Position: refs/heads/master@{#40591}
2016-10-26 13:00:52 +00:00
mstarzinger
2ab2ec2243 [turbofan] Disable bogus lowering of builtin tail-calls.
The TurboFan backends currently don't support tail-calls to CPP builtins
because the semantics of kJavaScriptCallArgCountRegister has different
semantics for stub call descriptors versus JavaScript call descriptors.
This is actually a short-coming of the backends and follow-up work will
make the backends more robust in that regard to fail hard on unsupported
constructs like that. This just disables the lowering creating such a
tail-call.

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

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

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

BUG=v8:5343

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

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

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

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

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

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

R=bmeurer@chromium.org

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

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

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

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

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

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

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

BUG=v8:5401

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

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

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

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

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

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

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

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

BUG=chromium:657692

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

BUG=

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

BUG=chromium:659088

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

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

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

R=yangguo@chromium.org

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

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

BUG=

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

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

BUG=v8:5343

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

BUG=chromium:658718

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

BUG=

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

BUG=

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

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

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

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

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

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

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

BUG=v8:5512

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

BUG=v8:5343

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

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

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

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

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

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

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

BUG=chromium:658528

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

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

R=rmcilroy@chromium.org

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

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

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

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

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

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

BUG=

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

R=jarin@chromium.org

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

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

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

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

BUG=v8:5339

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

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

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

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

R=yangguo@chromium.org

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

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

BUG=v8:4280

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

BUG=

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

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

BUG=chromium:655573

Review-Url: https://codereview.chromium.org/2445703002
Cr-Commit-Position: refs/heads/master@{#40541}
2016-10-24 17:23:21 +00:00
marja
55277d9969 Remove unused parsing related histograms.
R=jochen@chromium.org
BUG=chromium:656854

Review-Url: https://codereview.chromium.org/2427933002
Cr-Commit-Position: refs/heads/master@{#40540}
2016-10-24 17:08:04 +00:00
ulan
59fb09564a Revert of Reland "[heap] Start sweeper tasks after evacuation. (patchset #2 id:20001 of https://chromiumcoder… (patchset #1 id:1 of https://chromiumcodereview.appspot.com/2437873004/ )
Reason for revert:
Canary crashes crbug.com/658718

Original issue's description:
> 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=

TBR=mlippautz@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=

Review-Url: https://codereview.chromium.org/2446583003
Cr-Commit-Position: refs/heads/master@{#40539}
2016-10-24 16:41:13 +00:00
ziyang
e39a7c7187 PPC/s390: [full-codegen] Eliminate unnecessary hole checks for stores
Port 231c8ac0a7

Original commit message:
  Loads already used source position elimination to avoid unnecessary hole checks,
  but for reasons unknown stores did not. This CL corrects that, making full-codegen's
  hole elimination equivalent to ignition's.

  Also introduced a HoleCheckMode enum class to avoid more bool flags and updated
  VariableProxy and BytecodeGenerator appropriately.

R=adamk@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://codereview.chromium.org/2449473002
Cr-Commit-Position: refs/heads/master@{#40538}
2016-10-24 16:33:53 +00:00
clemensh
ef7e896d2a [wasm] Set externally passed memory non neuterable
If at instantiation we get an existing ArrayBuffer, set it non
neuterable, because we embed the backing memory address in wasm code.

With this fix, all tests pass if validate-asm is set to default=true.

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

Review-Url: https://codereview.chromium.org/2441353003
Cr-Commit-Position: refs/heads/master@{#40536}
2016-10-24 14:45:01 +00:00
bjaideep
f2d278a957 [builtins] fix load of surrogate pair for BE platform
Swaping the order when loading surrogate pairs on big endian
platform. This fixes testcase string-iterator.js on big
endian.

BUG=
R=bmeurer@chromium.org, mstarzinger@chromium.org, jkummerow@chromium.org

Review-Url: https://codereview.chromium.org/2431223010
Cr-Commit-Position: refs/heads/master@{#40535}
2016-10-24 14:28:55 +00:00
mstarzinger
6dd0587be3 Revert of [compiler] Prepare for partially shipping Ignition. (patchset #1 id:1 of https://codereview.chromium.org/2443573002/ )
Reason for revert:
Causes regressions: https://bugs.chromium.org/p/chromium/issues/detail?id=658711

Original issue's description:
> [compiler] Prepare for partially shipping Ignition.
>
> This prepares the code-base so that Ignition can be enabled on a certain
> subset of compilations without setting the {FLAG_ignition} flag (which
> enables Ignition on all compilations). We should not check the flag in
> question explicitly anywhere outside of the compiler heuristics.
>
> R=mvstanton@chromium.org

BUG=chromium:658711
TBR=mvstanton@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.

Review-Url: https://codereview.chromium.org/2448443002
Cr-Commit-Position: refs/heads/master@{#40534}
2016-10-24 13:02:29 +00:00
jgruber
ae3357d216 [regexp] Move RegExp.prototype.test to TF
This results in a speedup of around 2x. RegExpExec is also ported in
this CL.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2441993002
Cr-Commit-Position: refs/heads/master@{#40532}
2016-10-24 12:41:29 +00:00
mstarzinger
65e68c66af [interpreter] Make --trace-codegen also trace bytecode.
This ensures that both --trace-codegen as well as --print-ast work for
Ignition and print traces for generated bytecode as well. Here we do
consider "bytecode" to be "code" as well for tracing purposes.

R=rmcilroy@chromium.org

Review-Url: https://codereview.chromium.org/2443003003
Cr-Commit-Position: refs/heads/master@{#40531}
2016-10-24 12:33:35 +00:00
jgruber
fa907e1559 [regexp] Extract implementation of RE.prototype.exec
This will have additional use sites in TurboFan soon once RegExpExec is ported.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2440893003
Cr-Commit-Position: refs/heads/master@{#40529}
2016-10-24 11:01:53 +00:00
zhengxing.li
38939ff3e1 X87: [full-codegen] Eliminate unnecessary hole checks for stores.
port 231c8ac0a7 (r40522)

  original commit message:
  Loads already used source position elimination to avoid unnecessary hole checks,
  but for reasons unknown stores did not. This CL corrects that, making full-codegen's
  hole elimination equivalent to ignition's.

  Also introduced a HoleCheckMode enum class to avoid more bool flags and updated
  VariableProxy and BytecodeGenerator appropriately.

BUG=

Review-Url: https://codereview.chromium.org/2444823002
Cr-Commit-Position: refs/heads/master@{#40527}
2016-10-24 10:48:01 +00:00
bmeurer
6c5fa8b49e [turbofan] Fix deopt loop in out-of-bounds string element access.
We need to check the KeyedLoadIC state to guard against potential
deoptimization loops due to out-of-bounds accesses, because the IC
system uses the MEGAMORPHIC state to also signal that there was an
out-of-bounds access already.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2443893002
Cr-Commit-Position: refs/heads/master@{#40525}
2016-10-24 10:32:36 +00:00
ishell
c2a5dc81c7 [ic] Support data handlers that represent simple field stores.
BUG=

Review-Url: https://codereview.chromium.org/2438553003
Review-Url: https://codereview.chromium.org/2438553003
Cr-Original-Original-Commit-Position: refs/heads/master@{#40503}
Cr-Original-Commit-Position: refs/heads/master@{#40511}
Cr-Commit-Position: refs/heads/master@{#40524}
2016-10-24 10:00:49 +00:00
ulan
ad815a7b9a [heap] Refactor marking deque.
This patch moves management of marking deque backing store into the
MarkingDeque class, which will simplify unmapping of backing store in
concurrent task.

BUG=

Review-Url: https://codereview.chromium.org/2439063002
Cr-Commit-Position: refs/heads/master@{#40523}
2016-10-24 09:07:28 +00:00
adamk
231c8ac0a7 [full-codegen] Eliminate unnecessary hole checks for stores
Loads already used source position elimination to avoid unnecessary hole checks,
but for reasons unknown stores did not. This CL corrects that, making full-codegen's
hole elimination equivalent to ignition's.

Also introduced a HoleCheckMode enum class to avoid more bool flags and updated
VariableProxy and BytecodeGenerator appropriately.

Review-Url: https://codereview.chromium.org/2441543005
Cr-Commit-Position: refs/heads/master@{#40522}
2016-10-24 08:09:01 +00:00
bmeurer
8e7426173b [turbofan] Also constant-fold String element access if possible.
When accessing elements of a compile-time constant String, we don't need
to check the receiver, and we can constant-fold the loading of the
length.

R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2442243002
Cr-Commit-Position: refs/heads/master@{#40521}
2016-10-24 07:39:14 +00:00
zhengxing.li
ac8318e2e0 X87: [compiler] Mark shared functions for optimization.
port 4a31323e97 (r40506)

  original commit message:
  The current method of marking functions for optimization, which replaces
  the JSFunction's code object with one that triggers optimization, would
  never allow unnamed functions to be optimized. This is an issue for a
  style of programming which heavily relies on passing around closures.

  This patch sets a bit on the SharedFunctionInfo when a JSFunction is
  marked. When another JSFunction referring to the same SharedFunctionInfo
  is lazily compiled, it immediately triggers a non-concurrent optimize.

BUG=

Review-Url: https://codereview.chromium.org/2439393002
Cr-Commit-Position: refs/heads/master@{#40520}
2016-10-24 06:43:29 +00:00
bmeurer
a58d7907ea [turbofan] Fix typed lowering of JSToLength.
When lowering JSToLength, we cannot just smash arbitrary bounds on the
Select nodes, as that will confuse the representation selection later.
Instead properly rename the input using NumberMax and NumberMin.

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

Review-Url: https://codereview.chromium.org/2440333002
Cr-Commit-Position: refs/heads/master@{#40519}
2016-10-24 06:37:22 +00:00
bmeurer
a2d4a7932e [turbofan] Constant-fold "length" property on strings.
When lowering loads of "length" on compile-time constant strings,
generate constant length instead of a load.

R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2442233002
Cr-Commit-Position: refs/heads/master@{#40518}
2016-10-24 06:25:26 +00:00
mtrofin
91a5a219d4 [wasm] Avoid double-serializing the wire bytes
Since the public API for deserialization is now just DeserializeOrCompile,
we can trickle down the wire bytes to the deserialization logic, and
avoid the need for duplicating the wire bytes when serializing.

BUG=chromium:657316

Review-Url: https://chromiumcodereview.appspot.com/2433273002
Cr-Commit-Position: refs/heads/master@{#40516}
2016-10-22 15:15:04 +00:00
jkummerow
226d627829 [stubs] Fine-tune monomorphic IC dispatcher performance
BUG=chromium:657786

Review-Url: https://chromiumcodereview.appspot.com/2436423003
Cr-Commit-Position: refs/heads/master@{#40514}
2016-10-21 20:26:50 +00:00
ishell
80f163ce34 Revert of [ic] Support data handlers that represent simple field stores. (patchset #2 id:40001 of https://codereview.chromium.org/2438553003/ )
Reason for revert:
http://build.chromium.org/p/client.v8/builders/V8%20Mac%20GC%20Stress/builds/9306 "V8 Mac GC Stress"

Original issue's description:
> [ic] Support data handlers that represent simple field stores.
>
> BUG=
>
> Review-Url: https://codereview.chromium.org/2438553003
> Cr-Commit-Position: refs/heads/master@{#40503}

TBR=jkummerow@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/2442523003
Cr-Commit-Position: refs/heads/master@{#40512}
2016-10-21 17:54:27 +00:00
ishell
d2557f2e9d [ic] Support data handlers that represent simple field stores.
BUG=

Review-Url: https://codereview.chromium.org/2438553003
Review-Url: https://chromiumcodereview.appspot.com/2438553003
Cr-Original-Commit-Position: refs/heads/master@{#40503}
Cr-Commit-Position: refs/heads/master@{#40511}
2016-10-21 16:42:40 +00:00
neis
cadfe092a2 [modules] Fix bugs in assignments to exported variables.
- Add hole check if needed.
- Preserve the accumulator so that the result is the rhs.

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

Review-Url: https://chromiumcodereview.appspot.com/2438653003
Cr-Commit-Position: refs/heads/master@{#40510}
2016-10-21 14:24:31 +00:00
jgruber
44375382c1 [builtins] Update TFJ macro to take actual argc
Up until now, the TFJ macro would take 'argc + 1' for the implicitly
passed receiver. Decrease the cognitive load by making it take the
explicit argc.

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2439013003
Cr-Commit-Position: refs/heads/master@{#40509}
2016-10-21 13:47:59 +00:00
neis
dd614f55ce [modules] Check more invariants for Module objects in heap verifier.
R=adamk@chromium.org
BUG=v8:1569

Review-Url: https://chromiumcodereview.appspot.com/2442723002
Cr-Commit-Position: refs/heads/master@{#40508}
2016-10-21 13:40:10 +00:00
mstarzinger
e31e5e91a5 [compiler] Prepare for partially shipping Ignition.
This prepares the code-base so that Ignition can be enabled on a certain
subset of compilations without setting the {FLAG_ignition} flag (which
enables Ignition on all compilations). We should not check the flag in
question explicitly anywhere outside of the compiler heuristics.

R=mvstanton@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2443573002
Cr-Commit-Position: refs/heads/master@{#40507}
2016-10-21 13:14:28 +00:00
leszeks
4a31323e97 [compiler] Mark shared functions for optimization
The current method of marking functions for optimization, which replaces
the JSFunction's code object with one that triggers optimization, would
never allow unnamed functions to be optimized. This is an issue for a
style of programming which heavily relies on passing around closures.

This patch sets a bit on the SharedFunctionInfo when a JSFunction is
marked. When another JSFunction referring to the same SharedFunctionInfo
is lazily compiled, it immediately triggers a non-concurrent optimize.

BUG=v8:5512

Review-Url: https://chromiumcodereview.appspot.com/2437043002
Cr-Commit-Position: refs/heads/master@{#40506}
2016-10-21 13:13:07 +00:00
jgruber
a4ff04ab13 Revert of [ic] Support data handlers that represent simple field stores. (patchset #1 id:20001 of https://chromiumcodereview.appspot.com/2438553003/ )
Reason for revert:
http://build.chromium.org/p/client.v8/builders/V8%20Mac%20GC%20Stress/builds/9299

Original issue's description:
> [ic] Support data handlers that represent simple field stores.
>
> BUG=

TBR=jkummerow@chromium.org,ishell@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/2439053002
Cr-Commit-Position: refs/heads/master@{#40505}
2016-10-21 12:46:44 +00:00
jgruber
a8e30c0e68 [regexp] Add fast-path for global, callable replace
This adds a fast-path for calls to RegExp.prototype[@@replace] for cases in
which the given regexp is unmodified and global, and the given replace argument
is callable.

The fast-path implementation itself is almost identical to the original JS
implementation except that it currently does not reuse result_array.

SunSpider/unpack-code relies heavily on this codepath.

BUG=v8:5339

Review-Url: https://chromiumcodereview.appspot.com/2433923003
Cr-Commit-Position: refs/heads/master@{#40504}
2016-10-21 12:12:18 +00:00
ishell
1f697f4231 [ic] Support data handlers that represent simple field stores.
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2438553003
Cr-Commit-Position: refs/heads/master@{#40503}
2016-10-21 12:09:12 +00:00
jgruber
0e76a9c369 [stubs] Add IsCallableMap predicate to CSA
Add an IsCallableMap predicate to code-stub-assembler which tests
whether the given map is callable, and adjust all use sites.

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2435283002
Cr-Commit-Position: refs/heads/master@{#40502}
2016-10-21 12:01:26 +00:00
jgruber
eb10dc4c91 [regexp] Use consistent map checks for fast paths
These map checks were implemented for TF code already. This CL makes
sure that parts implemented in C++ follow the same logic, which is:

An object is an unmodified regexp if:
1) it's a receiver,
2) its map is the initial regexp map,
3) its prototype is a receiver,
4) and its prototype's map is the initial prototype's initial map.

We can now be smarter in @@replace and @@split since checking maps
(unlike the previous check of RegExp.prototype.exec) is not observable,
so we can perform fast-path checks at a time of our choosing.

BUG=v8:5339,v8:5434,v8:5123

Review-Url: https://chromiumcodereview.appspot.com/2434983002
Cr-Commit-Position: refs/heads/master@{#40501}
2016-10-21 11:58:50 +00:00
mlippautz
da2f61030c Add flag --single-threaded
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2420063002
Cr-Commit-Position: refs/heads/master@{#40500}
2016-10-21 11:47:36 +00:00
machenbach
0b7e35ff16 Revert of [regexp] Use consistent map checks for fast paths (patchset #7 id:120001 of https://chromiumcodereview.appspot.com/2434983002/ )
Reason for revert:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/10853

Original issue's description:
> [regexp] Use consistent map checks for fast paths
>
> These map checks were implemented for TF code already. This CL makes
> sure that parts implemented in C++ follow the same logic, which is:
>
> An object is an unmodified regexp if:
> 1) it's a receiver,
> 2) its map is the initial regexp map,
> 3) its prototype is a receiver,
> 4) and its prototype's map is the initial prototype's initial map.
>
> We can now be smarter in @@replace and @@split since checking maps
> (unlike the previous check of RegExp.prototype.exec) is not observable,
> so we can perform fast-path checks at a time of our choosing.
>
> BUG=v8:5339,v8:5434,v8:5123

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

Review-Url: https://chromiumcodereview.appspot.com/2438283002
Cr-Commit-Position: refs/heads/master@{#40499}
2016-10-21 11:15:20 +00:00
jacob.bramley
2e360cd83f Improve phi hinting heuristics.
The basic intention is to try to remove unnecessary moves caused by
hints in otherwise empty blocks. Roughly:

Before                          After
-----------------------------------------------------------
B0: add   x1, ...               B0: add   x1, ...
    b.ne  B2                        b.eq  B3
B1: mov   x0, x1                B1: [empty]
    b     B3
B2: add   x0, x1, ...           B2: add   x1, x1, ...
B3: phi(B1,B2) in x0            B3: phi(B0,B1) in x1

Hinting is also improved in cases where one of the inputs is already
allocated. This occurs commonly on architectures with instructions which
write into fixed registers, for example.

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2125463002
Cr-Commit-Position: refs/heads/master@{#40498}
2016-10-21 10:44:47 +00:00
ulan
14be3846bd [heap] Account mark-compact prologue and epilogue in GC tracer.
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2442693002
Cr-Commit-Position: refs/heads/master@{#40497}
2016-10-21 10:14:35 +00:00
hpayer
726becfb49 Reland Update implementation of atomics with latest Chromium version but use compiler builtin atomics
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2438273002
Cr-Commit-Position: refs/heads/master@{#40496}
2016-10-21 10:05:42 +00:00
jgruber
bac992a114 [regexp] Use consistent map checks for fast paths
These map checks were implemented for TF code already. This CL makes
sure that parts implemented in C++ follow the same logic, which is:

An object is an unmodified regexp if:
1) it's a receiver,
2) its map is the initial regexp map,
3) its prototype is a receiver,
4) and its prototype's map is the initial prototype's initial map.

We can now be smarter in @@replace and @@split since checking maps
(unlike the previous check of RegExp.prototype.exec) is not observable,
so we can perform fast-path checks at a time of our choosing.

BUG=v8:5339,v8:5434,v8:5123

Review-Url: https://chromiumcodereview.appspot.com/2434983002
Cr-Commit-Position: refs/heads/master@{#40495}
2016-10-21 09:58:38 +00:00
hpayer
a007dfc18e [heap] Move typed slot filtering logic into sweeper.
Additionally, remove all code related to the old-style slots filtering and black area end markers.

BUG=chromium:648568

Review-Url: https://chromiumcodereview.appspot.com/2440683002
Cr-Commit-Position: refs/heads/master@{#40494}
2016-10-21 09:05:00 +00:00
shiyu.zhang
1b08c7a777 Add basic instruction latency modeling for ia32 and x64 respectively.
The bigcore shares same instruction latency table as smallcore (ATOM).
The accurate latency modeling will benefit the instruction scheduler for
ia32 and x64 without introducing extra regression.

Review-Url: https://chromiumcodereview.appspot.com/2130153003
Cr-Commit-Position: refs/heads/master@{#40493}
2016-10-21 09:00:14 +00:00
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