Commit Graph

36063 Commits

Author SHA1 Message Date
jochen
c6d421ff9a Introduce a separate FunctionLiteral ID for Eval
Top level SharedFunctionInfos will end up in a scripts SFI list, but
eval'd SFIs shouldn't. Separate IDs will allow for adding a
corresponding DCHECK.

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

Review-Url: https://codereview.chromium.org/2533303006
Cr-Commit-Position: refs/heads/master@{#41421}
2016-12-01 12:03:20 +00:00
mstarzinger
f8fec66f0b [turbofan] Workaround for unknown array literal length.
This fixes the existing workaround in {BytecodeGraphBuilder} where the
number of elements in an array literal is unknown just from the bytecode
alone and needs to be deduced from the constant elements.

Note that this is just a quick fix to prevent calling the fast-clone
stub for boilerplates that are too big to fit on a regular page. In the
long run we need something more solid here.

R=mvstanton@chromium.org
TEST=mjsunit/regress/regress-crbug-669850
BUG=chromium:669850

Review-Url: https://codereview.chromium.org/2542633002
Cr-Commit-Position: refs/heads/master@{#41420}
2016-12-01 12:01:00 +00:00
zhengxing.li
0d0d834e67 [X87] [crankshaft] Always use Label:kFar as lable dist in DoWrapReceiver() for debug mode.
Currently In LCodeGen::DoWrapReceiver(), the x87 jitted code's size for debug mode between label's define and bind
  exceeds 128 bytes whether FLAG_deopt_every_n_times is set or not.

  So always use Label:kFar as label distance in LCodeGen::DoWrapReceiver() for debug mode.

  This CL also unify the label's distance value to avoid potential bugs caused by unconsistent distance value usage
  for the same label when DeoptEveryNTimes() return true.

BUG=

Review-Url: https://codereview.chromium.org/2539403002
Cr-Commit-Position: refs/heads/master@{#41419}
2016-12-01 10:48:31 +00:00
jgruber
360b7668ea [regexp] Skip result construction in test, @@match, @@search
We can skip RegExpResult construction on the fast path for several functions to
be more efficient.

BUG=v8:5330,v8:5674

Review-Url: https://codereview.chromium.org/2543483003
Cr-Commit-Position: refs/heads/master@{#41418}
2016-12-01 10:29:47 +00:00
ishell
fce55b528f [stubs] Use CSA::IsHeapNumberMap() instead of manual map comparing.
Bonus: fixed a couple of places where 32-bit comparison was used.

BUG=

Review-Url: https://codereview.chromium.org/2543873003
Cr-Commit-Position: refs/heads/master@{#41417}
2016-12-01 10:16:11 +00:00
bradnelson
71cc94dae3 [wasm][asm.js] Allow a function to be exported more than once.
Allow a function to be exported multiple times in a asm.js
module.
Remarkably, this had not been working before.

BUG=670057
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2535723009
Cr-Commit-Position: refs/heads/master@{#41416}
2016-12-01 10:13:01 +00:00
petermarshall
a328143eb3 Move desugaring of super calls with trailing spread to one runtime call.
Unfortunately we have to split this up into two cases: those with exactly one spread argument as the final argument, and all others, due to any side-effects of evaluation being visible.

This is in preparation for a new bytecode which handles super calls.

BUG=v8:5659

Review-Url: https://codereview.chromium.org/2540593003
Cr-Commit-Position: refs/heads/master@{#41415}
2016-12-01 09:42:37 +00:00
jgruber
65b2ab90ff [regexp] Refactor RegExp.prototype.exec
This refactors portions of exec into a new function without RegExpResult
construction, which will be used in the future by test, @@match, and @@search
fast paths.

Unnecessary ToString and ToLength calls as well as repeated map checks were
removed.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2540153002
Cr-Commit-Position: refs/heads/master@{#41414}
2016-12-01 09:36:08 +00:00
mstarzinger
91ea744c74 [interpreter] Fix --print-ast dumping the AST twice.
R=neis@chromium.org
BUG=v8:5700

Review-Url: https://codereview.chromium.org/2538173002
Cr-Commit-Position: refs/heads/master@{#41413}
2016-12-01 09:23:38 +00:00
mstarzinger
8242966399 [turbofan] Add size DCHECK for inline allocations.
This ensure that all inline allocations generated by {JSCreateLowering}
will fit into a regular heap page. Allocations targeting LO-space must
be done via a slower runtime call.

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

Review-Url: https://codereview.chromium.org/2533353003
Cr-Commit-Position: refs/heads/master@{#41412}
2016-12-01 09:22:35 +00:00
clemensh
db0c86fa5f [base] Define CHECK comparison for signed vs. unsigned
The current CHECK/DCHECK implementation fails statically if a signed
value is compared against an unsigned value. The common solution is to
cast on each caller, which is tedious and error-prone (might hide bugs).
This CL implements signed vs. unsigned comparisons by executing up to
two comparisons. For example, if i is int32_t and u is uint_32_t, a
DCHECK_LE(i, u) would create the check
i <= 0 || static_cast<uint32_t>(i) <= u.
For checks against constants, at least one of the checks can be removed
by compiler optimizations.

The tradeoff we have to make is to sometimes silently execute an
additional comparison. And we increase code complexity of course, even
though the usage is just as easy (or even easier) as before.

The compile time impact seems to be minimal:
I ran 3 full compilations for Optdebug on my local machine, one time on
the current ToT, one time with this CL plus http://crrev.com/2524093002.
Before: 143.72 +- 1.21 seconds
Now: 144.18 +- 0.67 seconds

In order to check that the new comparisons are working, I refactored
some DCHECKs in wasm to use the new magic, and added unit test cases.

R=ishell@chromium.org, titzer@chromium.org
CC=ahaas@chromium.org, bmeurer@chromium.org

Committed: https://crrev.com/5925074a9dab5a8577766545b91b62f2c531d3dc
Review-Url: https://codereview.chromium.org/2526783002
Cr-Original-Commit-Position: refs/heads/master@{#41275}
Cr-Commit-Position: refs/heads/master@{#41411}
2016-12-01 08:53:04 +00:00
machenbach
c71fc9902d [build] Use MSVS 2015 by default.
BUG=chromium:603131
LOG=y

Committed: https://crrev.com/6b9c49cac101d1a373ae1a098b7959f8aff848ac
Review-Url: https://codereview.chromium.org/2533813002
Cr-Original-Commit-Position: refs/heads/master@{#41407}
Cr-Commit-Position: refs/heads/master@{#41410}
2016-12-01 08:50:57 +00:00
machenbach
48a522b643 Revert of [build] Use MSVS 2015 by default. (patchset #5 id:80001 of https://codereview.chromium.org/2533813002/ )
Reason for revert:
Breaks CI dbg builder:
https://build.chromium.org/p/client.v8/builders/V8%20Win32%20-%20debug%20builder/builds/13817

Original issue's description:
> [build] Use MSVS 2015 by default.
>
> BUG=chromium:603131
> LOG=y
>
> Committed: https://crrev.com/6b9c49cac101d1a373ae1a098b7959f8aff848ac
> Cr-Commit-Position: refs/heads/master@{#41407}

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

Review-Url: https://codereview.chromium.org/2538493007
Cr-Commit-Position: refs/heads/master@{#41409}
2016-12-01 08:35:28 +00:00
jgruber
2c3fe6d961 [regexp] Migrate @@split to TurboFan
This shows around a 2.2x speedup compared to the old JS implementation (and
3.5x compared to CPP) for the fast path.

Adds ToUint32 to CodeStubAssembler.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2532403002
Cr-Commit-Position: refs/heads/master@{#41408}
2016-12-01 08:25:20 +00:00
machenbach
6b9c49cac1 [build] Use MSVS 2015 by default.
BUG=chromium:603131
LOG=y

Review-Url: https://codereview.chromium.org/2533813002
Cr-Commit-Position: refs/heads/master@{#41407}
2016-12-01 08:16:31 +00:00
ofrobots
965ed36446 fix typo in .gitignore
R=franzih@chromium.org, kozyatinskiy@chromium.org, machenbach@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2540323003
Cr-Commit-Position: refs/heads/master@{#41406}
2016-12-01 07:49:45 +00:00
franzih
1d7122beac [fullcodegen] Remove deprecated support for computed property names.
This code is no longer used in full-codegen since all computed property
names in object literals go through Ignition first.

BUG=v8:5657

Review-Url: https://codereview.chromium.org/2543643002
Cr-Commit-Position: refs/heads/master@{#41405}
2016-12-01 05:52:05 +00:00
v8-autoroll
0baf6fa456 Update V8 DEPS.
Rolling v8/build: 4e4ff82..ac12d5e

Rolling v8/buildtools: 991f459..102c163

Rolling v8/third_party/android_tools: https://chromium.googlesource.com/android_tools/+log/811a2c3..b43a6a2

Rolling v8/third_party/catapult: 2dd86f1..582ccd4

Rolling v8/tools/clang: f81598c..ccd4a12

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

Review-Url: https://codereview.chromium.org/2538233003
Cr-Commit-Position: refs/heads/master@{#41404}
2016-12-01 04:20:18 +00:00
bradnelson
00ec48335e [wasm] [asm.js] Ignore unused function tables in AsmWasmBuilder.
Incremental parsing of asm.js means we can see function tables that
are unused in the AsmWasmBuilder before they've been initialized.

BUG=669899
R=aseemgarg@chromium.org

Review-Url: https://codereview.chromium.org/2546553002
Cr-Commit-Position: refs/heads/master@{#41403}
2016-12-01 02:27:30 +00:00
kozyatinskiy
d6c2f4de9d Roll third_party/inspector_protocol to 715b83a3cfb45ce6c67b6c6fdd2c16391b5db896
This roll includes:
  - [inspector_protocol] always use weak pointer in DispatcherImpl::{command.name} [1]

[1] https://codereview.chromium.org/2545613002/

BUG=chromium:668358
TBR=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2541253002
Cr-Commit-Position: refs/heads/master@{#41402}
2016-12-01 01:35:23 +00:00
kozyatinskiy
891e31241c [inspector] fixed Debugger.getPossibleBreakpoints
If we just call CreateDebugInfo in GetPossibleBreakpoints then we won't call PrepareFunctionForBreakPoints and won't be able to step into this function or pause at breakpoint inside.

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

Review-Url: https://codereview.chromium.org/2540943002
Cr-Commit-Position: refs/heads/master@{#41401}
2016-12-01 00:26:37 +00:00
eholk
bf35d15e52 [wasm] OOB traps: build protected instruction list during codegen
During codegen, we build a list mapping protected instructions to their
associated landing pads. This will ultimately by used by the signal handler to
recover from out of bounds faults and throw a JS exception.

This is mostly pulled from my larger in-progress CL at
https://codereview.chromium.org/2371833007/.

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

Review-Url: https://codereview.chromium.org/2500443004
Cr-Commit-Position: refs/heads/master@{#41400}
2016-11-30 22:32:03 +00:00
tebbi
9b20a7b7a3 [turbofan] fixed uninhabited type handling in ObjectState representation selection
R=jarin@chromium.org

BUG=v8:668517

Review-Url: https://codereview.chromium.org/2536353003
Cr-Commit-Position: refs/heads/master@{#41399}
2016-11-30 21:45:53 +00:00
eholk
4ab4bbe9b1 [wasm] Add ProtectedStore instruction
This is necessary for signal-based out of bounds handling in WebAssembly.

Adds a ProtectedStore instruction that is analogous to the previously added
ProtectedLoad instruction. Rather than using bounds checks, ProtectedStore emits
an out of line section of code that throws a JavaScript exception and provides
the necessary metadata for a signal handler to be able to find the out of line
code.

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

Review-Url: https://codereview.chromium.org/2516413003
Cr-Commit-Position: refs/heads/master@{#41398}
2016-11-30 19:51:53 +00:00
bbudge
9e3feefff2 [Turbofan] Modify ARM vswp assembler test to use integers.
Attempt to fix or get insight into failing vswp test on V8 ARM bot.

LOG=N
BUG=

Review-Url: https://codereview.chromium.org/2539533005
Cr-Commit-Position: refs/heads/master@{#41397}
2016-11-30 19:45:08 +00:00
caitp
d4918463a9 [accessors] handle writable changing during ArrayLengthSetter
The "writable" property descriptor may legally change during the call to
AnythingToArrayLength(). This change needs to be honoured before calling
JSArray::SetLength(). The change is only honoured when the "length"
property was previously writable, so that changes during a call to
DefineOwnPropertyIgnoreAttributes() is ignored.

BUG=v8:5688
R=cbruni@chromium.org, verwaest@chromium.org, jkummerow@chromium.org

Review-Url: https://codereview.chromium.org/2543553002
Cr-Commit-Position: refs/heads/master@{#41396}
2016-11-30 19:13:51 +00:00
sampsong
a6b5abf854 S390: remove move before Mul32 for s390x
BUG=

R=jyan@ca.ibm.com,joransiu@ca.ibm.com,michael_dawson@ca.ibm.com,bjaideep@ca.ibm.com

Review-Url: https://codereview.chromium.org/2536203003
Cr-Commit-Position: refs/heads/master@{#41395}
2016-11-30 18:51:36 +00:00
caitp
77df8c67d9 [typedarrays] remove invalid optimization in NAMEConstructor()
Before, we were treating objects with the builtin ArrayValues iterator
method as array-like, where the iterator would iterate through to the
full length of the object.

This optimization was not sound, because it does not ensure that the
next method hasn't been modified. Even if it hasn't been modified,
it's entirely possible to be modified during iteration. Thus, this
optimization has been removed due to its observability.

BUG=v8:5699
R=littledan@chromium.org, cbruni@chromium.org

Review-Url: https://codereview.chromium.org/2544503002
Cr-Commit-Position: refs/heads/master@{#41394}
2016-11-30 17:13:31 +00:00
leszeks
80b920124c Deprecate the BASE_EMBEDDED macro
This was causing more confusion than benefit, so we're removing it.

It's re-defined to empty for now, to avoid touching the ~100 files which
use it, we can remove it completely during a quiet period when it's less
likely to conflict with other work.

Review-Url: https://codereview.chromium.org/2535383005
Cr-Commit-Position: refs/heads/master@{#41393}
2016-11-30 16:31:05 +00:00
neis
9ef7ab1e2e [compiler] Remove context value input from JSLoadContext and JSStoreContext.
JS operators always have an implicit context input, so just use that instead.

BUG=

Review-Url: https://codereview.chromium.org/2541813002
Cr-Commit-Position: refs/heads/master@{#41392}
2016-11-30 15:46:08 +00:00
ulan
ec90ccb5ab [heap] Bump up old generation limit for huge memory devices.
This is an experiment to see the impact of the limit on OOM crashes.

BUG=chromium:667388

Review-Url: https://codereview.chromium.org/2514313004
Cr-Commit-Position: refs/heads/master@{#41391}
2016-11-30 15:25:26 +00:00
ishell
c819616376 [ic] Prevent KeyedStoreIC from being generic when storing doubles to integer typed arrays.
BUG=chromium:666947

Review-Url: https://codereview.chromium.org/2539013002
Cr-Commit-Position: refs/heads/master@{#41390}
2016-11-30 15:24:13 +00:00
jarin
e19f43df61 [crankshaft] Disable escape analysis of nested objects.
BUG=chromium:669024

Review-Url: https://codereview.chromium.org/2531163006
Cr-Commit-Position: refs/heads/master@{#41389}
2016-11-30 15:07:16 +00:00
clemensh
6572b5622e [wasm] Remove raw byte pointers from WasmModule
These byte pointers (module_start and module_end) were only valid
during decoding. During instantiation or execution, they can get
invalidated by garbage collection.
This CL removes them from the WasmModule struct, and introduces a new
ModuleStorage struct as interface to the wasm wire bytes.
Since the storage is often needed together with the ModuleEnv, a new
ModuleStorageEnv struct holds both a ModuleEnv and a ModuleStorage.
The pointers in the ModuleStorage should never escape the live range of
this struct, as they might point into a SeqOneByteString or ArrayBuffer.
Therefore, the WasmInterpreter needs to create its own copy of the
whole module.
Runtime functions that previously used the raw pointers in WasmModule
(leading to memory errors) now have to use the SeqOneByteString in the
WasmCompiledModule.

R=titzer@chromium.org
BUG=chromium:669518

Review-Url: https://codereview.chromium.org/2540133002
Cr-Commit-Position: refs/heads/master@{#41388}
2016-11-30 15:03:06 +00:00
rmcilroy
6d90507a7c [Turbofan] Disable JSFrameSpecialization for interpreted frames.
JSFrameSpecialization depends on the layout of the frame and doesn't work
with interpreted frames. Disable it since it is only used for OSR from asmjs code, which shouldn't go through the bytecode graph builder in many cases.

BUG=669517

Review-Url: https://codereview.chromium.org/2538823002
Cr-Commit-Position: refs/heads/master@{#41387}
2016-11-30 14:03:51 +00:00
jochen
a1473f5306 Split parsing of functions and top-level code into two separate methods
Also move them to a separate interface header to avoid having to include
parser.h so much

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

Review-Url: https://codereview.chromium.org/2534393002
Cr-Commit-Position: refs/heads/master@{#41386}
2016-11-30 13:21:37 +00:00
shiyu.zhang
86af70afb0 [turbofan] Remove redundant cmp operands swap.
Remove redundant operands swap for compare operation.

BUG=

Review-Url: https://codereview.chromium.org/2507683002
Cr-Commit-Position: refs/heads/master@{#41385}
2016-11-30 12:32:57 +00:00
jgruber
2f17d5f8e8 [js-perf-test] Move SubRegExp class definition outside loop
Defining the subclass within the loop significantly affects subsequent
test results. For instance, the Search benchmark is 50% slower if the
subclass is defined within the loop.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2537253003
Cr-Commit-Position: refs/heads/master@{#41384}
2016-11-30 12:20:17 +00:00
hpayer
9d1488e4b0 [heap] Reduce store buffer size to increase chance to run concurrent store buffer processing thread more often.
BUG=

Review-Url: https://codereview.chromium.org/2529623002
Cr-Commit-Position: refs/heads/master@{#41383}
2016-11-30 12:17:28 +00:00
ahaas
4d75ea6082 [wasm] Move wasm runtime functions to runtime-wasm.cc
I removed {IsWasmInstance} because it is not used anywhere, and I moved
ThrowWasmError to runtime-wasm.cc

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2541633003
Cr-Commit-Position: refs/heads/master@{#41382}
2016-11-30 10:37:17 +00:00
titzer
a0c518627f [wasm] Add a flag --wasm-opt to test optimizations in the WASM pipeline.
R=ahaas@chromium.org,bradnelson@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2528033002
Cr-Commit-Position: refs/heads/master@{#41381}
2016-11-30 10:36:14 +00:00
neis
000dea2fa4 [compiler] Remove dead code from js-generic-lowering.
JSLoadContext and JSStoreContext are always reduced in js-typed-lowering.

R=mstarzinger@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2535253002
Cr-Commit-Position: refs/heads/master@{#41380}
2016-11-30 10:14:17 +00:00
clemensh
5a6483ffda [inspector] Avoid unneeded heap allocations
v8::Global is movable, so no need to heap-allocate them.

R=yangguo@chromium.org, kozyatinskiy@chromium.org

Review-Url: https://codereview.chromium.org/2537433002
Cr-Commit-Position: refs/heads/master@{#41379}
2016-11-30 09:23:34 +00:00
rmcilroy
8037e98e44 [Interpreter] Remove skips for tests that no longer seem to be flaky.
BUG=v8:4680

Review-Url: https://codereview.chromium.org/2541563002
Cr-Commit-Position: refs/heads/master@{#41378}
2016-11-30 09:21:37 +00:00
zhengxing.li
77a9da6b20 X87: [stubs] Port builtin for Array.push fast-case from Crankshaft to TF.
port df2578d2ec (r41368)

  original commit message:
  Improves performance in simple, single element case by 5% and in multiple
  elements cases by 2%.

BUG=

Review-Url: https://codereview.chromium.org/2540803004
Cr-Commit-Position: refs/heads/master@{#41377}
2016-11-30 09:07:15 +00:00
leszeks
7d10f69ca3 [turbofan] Remove bytecode analysis unit test
Blocking roll: https://codereview.chromium.org/2537173002/

NOTRY=true

Review-Url: https://codereview.chromium.org/2532103004
Cr-Commit-Position: refs/heads/master@{#41376}
2016-11-30 09:04:01 +00:00
neis
ee8e1464d7 Check some more invariants on SFIs.
This adds consistency checks for function kind and scope type to
SharedFunctionInfoVerify.

It also fixes an inconsistency in the creation of a ScopeInfo.

R=adamk@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2537093002
Cr-Commit-Position: refs/heads/master@{#41375}
2016-11-30 08:04:54 +00:00
neis
881bacffe3 [ast] Mark removed scopes as such.
When removing a scope (see FinalizeBlockScope), remember the removal by making
the scope its own sibling.  This avoid recalculating the information later on.

R=adamk@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2536993003
Cr-Commit-Position: refs/heads/master@{#41374}
2016-11-30 07:59:56 +00:00
v8-autoroll
fee261af79 Update V8 DEPS.
Rolling v8/build: 11a223f..4e4ff82

Rolling v8/third_party/catapult: 3950931..2dd86f1

Rolling v8/tools/clang: 4d70bef..f81598c

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

Review-Url: https://codereview.chromium.org/2539733003
Cr-Commit-Position: refs/heads/master@{#41373}
2016-11-30 04:22:41 +00:00
bradnelson
14e05c1046 [wasm] asm.js - Parse and convert asm.js to wasm a function at a time.
Make the AsmWasmBuilder drive the process of typing and potentially parsing
function bodies. This will allow us to keep only a single asm.js function's
AST in memory as we convert to WebAssembly.
This is needed to keep our memory footprint low.

Add some additional output to a few tests that's helpful to see which stage they fail at.

BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
LOG=N
R=marja@chromium.org,adamk@chromium.org,aseemgarg@chromium.org,titzer@chromium.org

Review-Url: https://codereview.chromium.org/2398023002
Cr-Commit-Position: refs/heads/master@{#41372}
2016-11-30 00:26:05 +00:00