Commit Graph

35131 Commits

Author SHA1 Message Date
mstarzinger
ae24992839 [turbofan] Remove deprecated --turbo-from-bytecode flag.
This flag is on by default for now. Whenever heuristics in the compiler
pipeline decide to use Ignition+TurboFan, then {BytecodeGraphBuilder} is
active. Removing the flag reduces maintenance overhead.

R=mvstanton@chromium.org

Review-Url: https://codereview.chromium.org/2437103002
Cr-Commit-Position: refs/heads/master@{#40639}
2016-10-28 09:54:04 +00:00
cbruni
feb96acecd [stubs] Add more assertions in the CodeStubAssembler
BUG=

Review-Url: https://codereview.chromium.org/2446073002
Cr-Commit-Position: refs/heads/master@{#40638}
2016-10-28 09:45:21 +00:00
predrag.rudic
bc43d6fe78 MIPS: Fix Utf16CharacterStream scanner crash due to missaligned access
TEST=ctest/test-scanner-streams/CharacterStreams
BUG=

Review-Url: https://codereview.chromium.org/2415093002
Cr-Commit-Position: refs/heads/master@{#40637}
2016-10-28 09:18:19 +00:00
jgruber
83b560b0e5 [debugger] Various break-related functionality in test wrapper
This CL adds simple implementation of break and stepping-related functionality
as required by the debug-step.js test. This includes

* stepOver, stepInto, stepOut
* setBreakPoint
* clearBreakPoint
* evaluate

Some of these, e.g. setBreakPoint are not fully implemented for all cases but
only for the ones we need right now.

One interesting result of this is that using the inspector protocol is roughly
14x slower for debug-step.js (14s instead of 0.5s). One cause of this seems to
be iteration over all object properties in toProtocolValue, which is used to
serialize JS objects before being sent over the wire (e.g. FrameMirrors).  This
is something that should be fixed at some point. In the meantime, the test now
runs 100 instead of 1000 iterations.

BUG=v8:5530

Review-Url: https://codereview.chromium.org/2447073007
Cr-Commit-Position: refs/heads/master@{#40636}
2016-10-28 08:18:34 +00:00
jgruber
c8d2a8cf16 [debugger] Add initial skeleton for debug test wrapper
This adds a wrapper class around the inspector protocol for use in
debugger tests. The interface is intended to stay similar to the
currently exposed DebuggerContext.

Right now, we support adding a listener, (partial) handling of the
AfterCompile event, and enabling/disabling the debugger.

BUG=v8:5530

Review-Url: https://codereview.chromium.org/2451153003
Cr-Commit-Position: refs/heads/master@{#40635}
2016-10-28 07:21:37 +00:00
jgruber
534222d117 [regexp] Use SameValue in @@search as specced
BUG=v8:5339

Review-Url: https://codereview.chromium.org/2452923002
Cr-Commit-Position: refs/heads/master@{#40634}
2016-10-28 07:14:42 +00:00
clemensh
1cac34ed6b Fix detection of BUILTIN functions
In the asm.js to wasm pipeline, we generate an entry function with
BUILTIN code, but still attached to a TYPE_NORMAL script.
This fix avoids trying to set a breakpoint there, resulting in a crash
on DCHECK(shared->HasDebugInfo()).

Also add two inspector tests to track regressions.

BUG=v8:5568
R=titzer@chromium.org,mstarzinger@chromium.org

Review-Url: https://codereview.chromium.org/2457433002
Cr-Commit-Position: refs/heads/master@{#40633}
2016-10-28 06:48:44 +00:00
zhengxing.li
77ae68846b X87: [crankshaft] Support all oddballs for truncating TaggedToI changes.
port 7d383be9da (r40608)

  original commit message:
  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.

BUG=

Review-Url: https://codereview.chromium.org/2450093007
Cr-Commit-Position: refs/heads/master@{#40632}
2016-10-28 02:03:50 +00:00
bjaideep
4d6df11f2c s390x: Fix the logic to detect INT_MIN in simulator
Converting INT_MIN to positive should cause overflow,
which was not being captured. Fixed the logic to detect
if value is equal to INT_MIN and set the overflow code
accordingly.

R=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/2446113013
Cr-Commit-Position: refs/heads/master@{#40631}
2016-10-27 22:05:54 +00:00
yangguo
c29c6a294c [serializer] clean up root list items.
The first 32 root list items are a conscious choice in order for the
serializer to encode root references more efficiently.

R=hpayer@chromium.org

Review-Url: https://codereview.chromium.org/2458603002
Cr-Commit-Position: refs/heads/master@{#40630}
2016-10-27 17:32:40 +00:00
ulan
b7dae10e5b [heap] Add debug checks for linear allocation area top and limit.
BUG=chromium:659165

Review-Url: https://codereview.chromium.org/2455103002
Cr-Commit-Position: refs/heads/master@{#40629}
2016-10-27 16:08:35 +00:00
ahaas
0ddddcb862 [asmjs] Do constant folding for I32Asmjs(Div|Rem)S to avoid checks of constant divisors
This change makes the embenchen/copy benchmark a factor of 2 faster and
brings back the performance loss through graph trimming.

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

Review-Url: https://codereview.chromium.org/2453343002
Cr-Commit-Position: refs/heads/master@{#40628}
2016-10-27 16:02:54 +00:00
ishell
8ba4af44ea [ic] Remove unnecessary access rights checks from the IC handlers.
The reasons are:
1) Type feedback vectors are not shared between different native contexts and
   therefore the IC handler created for one native context will not be reused
   in other native context.
2) Access rights revocation is not supported at all, therefore given (1) once
   we pass the access check we don't have to check access rights again.

BUG=v8:5561

Review-Url: https://codereview.chromium.org/2455953002
Cr-Commit-Position: refs/heads/master@{#40627}
2016-10-27 15:54:00 +00:00
ishell
6ea4061b8d [ic] Load IC data handlers now support prototype chain checks with global and dictionary objects.
BUG=v8:5561

Review-Url: https://codereview.chromium.org/2449463002
Cr-Commit-Position: refs/heads/master@{#40626}
2016-10-27 15:32:51 +00:00
bjaideep
3a5056a26c PPC/s390: [crankshaft] Support all oddballs for truncating TaggedToI changes.
Port 7d383be9da

Original commit message:

    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=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/2455993002
Cr-Commit-Position: refs/heads/master@{#40625}
2016-10-27 14:33:03 +00:00
mstarzinger
375afe2acf [turbofan] Adapt test assumptions about OSR.
The assumptions that OSR code is installed on {JSFunction} objects no
longer holds with TurboFan and hence {assertOptimized} can report a
different result dependeing on how OSR code is treated. This is working
as intended.

R=mythria@chromium.org

Review-Url: https://codereview.chromium.org/2453313002
Cr-Commit-Position: refs/heads/master@{#40624}
2016-10-27 14:07:47 +00:00
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
cbruni
e2effcbc35 [tools] Support custom script injection for callstats.py
This is a poor-man's solution to trigger page interactions.

BUG=

Review-Url: https://codereview.chromium.org/2455623002
Cr-Commit-Position: refs/heads/master@{#40604}
2016-10-26 19:15:48 +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