Commit Graph

32358 Commits

Author SHA1 Message Date
oth
a451bd1a68 Reland "[interpeter] Move to table based peephole optimizer."
Original issue's description:
> [interpeter] Move to table based peephole optimizer.
>
> Introduces a lookup table for peephole optimizations.
>
> Fixes some tests using BytecodePeepholeOptimizer::Write() that should
> have been update to use BytecodePeepholeOptimizer::WriteJump().
>
> BUG=v8:4280
> LOG=N
>
> Committed: https://crrev.com/f4234422b93b21a286b0f31799009bcbe8b90b9e
> Cr-Commit-Position: refs/heads/master@{#37819}

BUG=v8:4280
LOG=N

Review-Url: https://codereview.chromium.org/2164583002
Cr-Commit-Position: refs/heads/master@{#37866}
2016-07-19 11:56:33 +00:00
jochen
460e0b80a9 Move SetObjectPrototype to JSObject
I plan to use this from ApiNatives, so move it to a common location.

BUG=
R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2161613002
Cr-Commit-Position: refs/heads/master@{#37865}
2016-07-19 11:30:34 +00:00
nikolaos
24291c326b [parser] Rewritable expressions should not be valid variable references
This patch restores the status of rewritable expressions, which
were not considered valid variable references before CL 2126233002,
regardless of the type of the wrapped expression.

R=mstarzinger@chromium.org, verwaest@chromium.org
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2158853002
Cr-Commit-Position: refs/heads/master@{#37864}
2016-07-19 11:30:33 +00:00
marja
09a854c72b Put FunctionLiterals into temp_zone too.
This reduces memory usage when parsing (because temp_zones are discarded
every now and then) and work done by FuncNameInferrer.

BUG=

Review-Url: https://codereview.chromium.org/2156013002
Cr-Commit-Position: refs/heads/master@{#37863}
2016-07-19 11:14:07 +00:00
mythria
1eadc76419 [Interpreter] Collect type feedback for 'new' in the bytecode handler
Collect type feedback in the bytecode handler for 'new' bytecode. The
current implementation does not collect allocation site feedback.

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

Review-Url: https://codereview.chromium.org/2153433002
Cr-Commit-Position: refs/heads/master@{#37862}
2016-07-19 11:10:33 +00:00
marija.antic
dcf8251ecf MIPS: Fix 'Port [turbofan] Introduce integer multiplication with overflow.'
Port 8e18a5f2a0

Failing on r6 due to wrong registers used in macro assembler.

TEST=test-run-machops/RunInt32MulWithOverflowImm
BUG=

Review-Url: https://codereview.chromium.org/2165533002
Cr-Commit-Position: refs/heads/master@{#37861}
2016-07-19 11:10:32 +00:00
yangguo
4de5e1456e [debug] add test case for scope iterator using correct language mode.
TBR=mstarzinger@chromium.org
BUG=v8:5207

Review-Url: https://codereview.chromium.org/2154393003
Cr-Commit-Position: refs/heads/master@{#37860}
2016-07-19 11:07:03 +00:00
bmeurer
e0b8707c78 [turbofan] Fix typing rule for number addition.
R=jarin@chromium.org
BUG=chromium:629435

Review-Url: https://codereview.chromium.org/2161013002
Cr-Commit-Position: refs/heads/master@{#37859}
2016-07-19 10:08:13 +00:00
verwaest
4f552f5a17 Introduce parent ScopeState class and track the scope through the state in the parser
This will allow us to move more state from Scope into ScopeState and lazily allocate full Scopes only when needed.

BUG=v8:5209

Review-Url: https://codereview.chromium.org/2160593002
Cr-Commit-Position: refs/heads/master@{#37858}
2016-07-19 10:08:12 +00:00
yangguo
7c3ddd2cf4 [debug] use correct language mode when parsing eval for scope iterator.
R=mstarzinger@chromium.org
BUG=v8:5207

Review-Url: https://codereview.chromium.org/2159113002
Cr-Commit-Position: refs/heads/master@{#37857}
2016-07-19 09:55:02 +00:00
sxa
6f68f30ba5 [build] Add force_dynamic_crt option to build a static library with /MD on windows
Adds option to build a V8 library statically, but with the options on
windows that allows it to be subsequently included in another DLL. On
Windows this is required for it to correclty link against the correct
C++ runtime. Require for our Node.js shared library build.

Reference:  https://github.com/nodejs/node/pull/7487

BUG=
R=machenbach@chromium.org, michael_dawson@ca.ibm.com

Committed: https://crrev.com/9cf88c1c364cf76c1e745aa63196768435e8ef5d
Review-Url: https://codereview.chromium.org/2149963002
Cr-Original-Commit-Position: refs/heads/master@{#37814}
Cr-Commit-Position: refs/heads/master@{#37856}
2016-07-19 09:55:01 +00:00
martyn.capewell
ceb0afbef6 [turbofan] ARM64: Tweak code gen for cmp with sxtw
For 64-bit cmp, replace the if clause with InputOperand2_64(), and apply the
same change to cmn.

BUG=

Review-Url: https://codereview.chromium.org/2160643002
Cr-Commit-Position: refs/heads/master@{#37855}
2016-07-19 09:35:16 +00:00
ahaas
9be015a254 [builtins] Introduce a builtin for Abort().
Calling Runtime::kAbort through a builtin instead of the c-entry stub
will allow to generate the call in a background thread, because a
builtin provides its own handle, whereas a code stub does not.

@v8-mips-ports: Could you take a special look at the padding that is
done in MacroAssembler::Abort()?

R=bmeurer@chromium.org, titzer@chromium.org, mstarzinger@chromium.org, v8-mips-ports@googlegroups.com, v8-arm-ports@googlegroups.com

Review-Url: https://codereview.chromium.org/2156923002
Cr-Commit-Position: refs/heads/master@{#37854}
2016-07-19 08:33:16 +00:00
bmeurer
15f99cd5b5 [turbofan] Properly handle bit->float64 representation changes.
BUG=chromium:629062
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2155323003
Cr-Commit-Position: refs/heads/master@{#37853}
2016-07-19 08:29:52 +00:00
mstarzinger
ca72704783 [turbofan] Allow deopt reasons without source positions.
This allows to pass deoptimization reasons to the profiler without the
requirement of always providing a source position. The absence of deopt
reasons is now communicated via a sentinel as the deopt id value. The
deoptimization reasons recently added to TurboFan are now passed to the
profiler.

R=bmeurer@chromium.org
TEST=cctest/test-cpu-profiler

Review-Url: https://codereview.chromium.org/2159793002
Cr-Commit-Position: refs/heads/master@{#37852}
2016-07-19 08:23:00 +00:00
nikolaos
ee48d322d7 [parser] Refactor some CHECK_OK calls
R=adamk@chromium.org, littledan@chromium.org
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2154253002
Cr-Commit-Position: refs/heads/master@{#37851}
2016-07-19 08:06:33 +00:00
bmeurer
173313e297 [crankshaft] Guard against side effects in Array.prototype.shift lowering.
We need to pay attention to potential side effects from parameter
evaluation when inlining the fast case Array.prototype.shift.

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

Review-Url: https://codereview.chromium.org/2161943002
Cr-Commit-Position: refs/heads/master@{#37850}
2016-07-19 06:43:04 +00:00
bmeurer
0abba43524 [stubs] Improve code generation for ToBoolean.
Introduce a proper CodeStubAssembler::BranchIfToBooleanIsTrue helper
method, that branches to if_true/if_false labels depending on whether
the value that is passed would yield true or false when fed to
ToBoolean. Use this helper to implement the bytecode handlers w/o having
to materialize the temporary booleans and essentially branching twice.
The CodeStubAssembler::BranchIfToBooleanIsTrue helper favors the most
likely case of a Boolean constant now.

Also migrate the ToBooleanStub to a ToBoolean TurboFan builtin, that
also uses the helper method under the hood.

Remove the now obsolete Oddball::to_boolean field.

R=hpayer@chromium.org, rmcilroy@chromium.org, yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2151163002
Cr-Commit-Position: refs/heads/master@{#37849}
2016-07-19 06:16:14 +00:00
marija.antic
08d61aa0b3 MIPS: Port '[turbofan] Add ia32 support for 4 and 16 byte moves and swaps.'
Port of 26ecb4a1d7

TEST=mjsunit/es6/math-fround

Review-Url: https://codereview.chromium.org/2156123002
Cr-Commit-Position: refs/heads/master@{#37848}
2016-07-19 05:43:31 +00:00
v8-autoroll
c372af17b7 Update V8 DEPS.
Rolling v8/base/trace_event/common to f8c51e1c3b08cd1c03986f098732b87ba98a3475

Rolling v8/build to 1303552bdbd1791ad26b62f7c7052cbbf0326574

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

Review-Url: https://codereview.chromium.org/2161933002
Cr-Commit-Position: refs/heads/master@{#37847}
2016-07-19 03:30:46 +00:00
weiliang.lin
2e6628c487 [x64] fixed "vmovups reg, mem"
BUG=

Review-Url: https://codereview.chromium.org/2158923002
Cr-Commit-Position: refs/heads/master@{#37846}
2016-07-19 03:14:10 +00:00
ivica.bogosavljevic
4d0c8c7714 MIPS: Fix deoptimization failure in WordCompare
In case of deoptimization after WordCompare test, the control flow is lost in the
unoptimized version of the code because wrong register is used for comparision
(a0 instead of v0)

TEST=mjsunit/regress/regress-3717
BUG=

Review-Url: https://codereview.chromium.org/2160533003
Cr-Commit-Position: refs/heads/master@{#37845}
2016-07-18 20:32:19 +00:00
thakis
6e5077a450 improve grammar in comment
Review-Url: https://codereview.chromium.org/2160633002
Cr-Commit-Position: refs/heads/master@{#37844}
2016-07-18 15:52:21 +00:00
jochen
e01fef39f3 Move function map creation code from boostrapper to factory
I want to use those methods from ApiNatives so move them to a shared
location.

BUG=
R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2156153002
Cr-Commit-Position: refs/heads/master@{#37843}
2016-07-18 15:39:09 +00:00
jochen
02ba244125 Reland^2 "Don't compile functions in a context the caller doesn't have access to"
Original issue's description:
> Don't compile functions in a context the caller doesn't have access to
>
> Instead just return undefined
>
> A side effect of this is that it's no longer possible to compile
> functions in a detached context.
>
> BUG=chromium:541703
> R=verwaest@chromium.org,bmeurer@chromium.org

BUG=chromium:541703
R=verwaest@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng

Review-Url: https://codereview.chromium.org/2155503004
Cr-Commit-Position: refs/heads/master@{#37842}
2016-07-18 15:35:45 +00:00
machenbach
78f813c1e4 [gn] Fix v8_enable_gdbjit default
Broke in https://codereview.chromium.org/2116913002/ due
to rebase.

BUG=chromium:474921
NOTRY=true
TBR=jochen@chromium.org, dpranke@chromium.org

Review-Url: https://codereview.chromium.org/2156993002
Cr-Commit-Position: refs/heads/master@{#37841}
2016-07-18 14:52:59 +00:00
verwaest
c908f4b8df Turn the unresolved-references list into a linked list using the VariableProxies themselves
This is a first step towards reducing memory usage by scopes in the parser. Peak zone memory usage on octane-codeload goes down by ~10%

BUG=

Review-Url: https://codereview.chromium.org/2159573002
Cr-Commit-Position: refs/heads/master@{#37840}
2016-07-18 13:56:23 +00:00
machenbach
9f640c93f4 [gn] Fix remaining ia32/x86 misconfigurations
BUG=chromium:474921
NOTRY=true
TBR=jochen@chromium.org, vogelheim@chromium.org

Review-Url: https://codereview.chromium.org/2156063003
Cr-Commit-Position: refs/heads/master@{#37839}
2016-07-18 13:37:45 +00:00
yangguo
aa601a6a67 [builtins] move array builtins into its own file.
R=jgruber@chromium.org
BUG=v8:5197

Review-Url: https://codereview.chromium.org/2158793003
Cr-Commit-Position: refs/heads/master@{#37838}
2016-07-18 13:17:49 +00:00
jgruber
4fbffba4da Don't call into JS from within stack trace generation
Calling into JS from stack trace generation becomes an issue during
stack overflows: we'd detect a stack overflow, attempt to create an
exception, call into JS, detect a stack overflow, and repeat.

R=yangguo@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2147193002
Cr-Commit-Position: refs/heads/master@{#37837}
2016-07-18 12:56:23 +00:00
rmcilroy
3633282270 Remove unused V8.CodegenFractionCrankshaft counter.
BUG=chromium:610407

Review-Url: https://codereview.chromium.org/2156073002
Cr-Commit-Position: refs/heads/master@{#37836}
2016-07-18 12:43:13 +00:00
daniel.bevenius
d52b403f51 Minor typos in v8.h code documentation.
When reading through the source code (v8.h) I found some minor typos
which I wanted to report.

BUG=

Review-Url: https://codereview.chromium.org/2130513002
Cr-Commit-Position: refs/heads/master@{#37835}
2016-07-18 12:39:49 +00:00
verwaest
3cd82879e6 Reorder fields of AstNode subclasses for better packing
BUG=

Review-Url: https://codereview.chromium.org/2149663003
Cr-Commit-Position: refs/heads/master@{#37834}
2016-07-18 12:32:58 +00:00
yangguo
a51f429772 [regexp] Fix case-insensitive matching for one-byte subjects.
The bug occurs because we do not canonicalize character class ranges
before adding case equivalents. While adding case equivalents, we abort
early for one-byte subject strings, assuming that the ranges are sorted.
Which they are not.

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

Review-Url: https://codereview.chromium.org/2159683002
Cr-Commit-Position: refs/heads/master@{#37833}
2016-07-18 12:03:37 +00:00
jarin
86110796f6 [turbofan] Eliminate checkpoints before return in common op reducer.
This makes sure that we preserve call's tailness even if we have
introduced a loop exit between the call and the return.

BUG=chromium:628773

Review-Url: https://codereview.chromium.org/2155123002
Cr-Commit-Position: refs/heads/master@{#37832}
2016-07-18 11:56:54 +00:00
mvstanton
47aaac6442 [Turbofan]: Eliminate the check for -0 if it's not possible/observable.
In int32 multiplication, if we have a positive integer as input, then we know we can't produce a -0 answer. The same is true if truncation is applied (x * y | 0). Without this information, we have to rather annoyingly check if the result of multiplication is 0, then OR the inputs to check for negativity, and possibly return -0. In TurboFan, we'll deopt in this case.

BUG=

Review-Url: https://codereview.chromium.org/2154073002
Cr-Commit-Position: refs/heads/master@{#37831}
2016-07-18 11:37:23 +00:00
yangguo
98080817bc [builtins] remove redundant list of generator declarations.
R=bmeurer@chromium.org
BUG=v8:5197

Review-Url: https://codereview.chromium.org/2152923003
Cr-Commit-Position: refs/heads/master@{#37830}
2016-07-18 11:30:43 +00:00
bbudge
3266433462 [Turbofan] Add simd128 fixed live ranges to inactive.
LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2157873002
Cr-Commit-Position: refs/heads/master@{#37829}
2016-07-18 11:07:49 +00:00
georgia.kouveli
c598796643 [ARM] Generate flag setting instructions for arm.
Based on 317dc0578.

BUG=

Review-Url: https://codereview.chromium.org/2152253002
Cr-Commit-Position: refs/heads/master@{#37828}
2016-07-18 10:21:37 +00:00
franzih
3a1296a20e [builtins] Object.prototype.toString() as TurboFan stub.
For angular.js on Speedometer, this results in 8.96%
speed up, i.e., the tests take on average 762ms
with this patch, 837ms without.

BUG= v8:5175

Review-Url: https://codereview.chromium.org/2134803002
Cr-Commit-Position: refs/heads/master@{#37827}
2016-07-18 10:05:14 +00:00
ahaas
4ee07936b8 [wasm] Turn on arm64 tests.
These tests seem to pass just fine.

R=titzer@chromium.org

BUG=v8:4795

Review-Url: https://codereview.chromium.org/2162433002
Cr-Commit-Position: refs/heads/master@{#37826}
2016-07-18 09:52:09 +00:00
bangfu.tao
b8227914bc Bug fix: android-run.py
BUG=
A bug in android-run.py, which caused the android_arm.release.check throws error:

data/local/tmp/v8/test/mjsunit/wasm/function-prototype.js:7: Error loading file

load("test/mjsunit/wasm/wasm-constants.js");

Review-Url: https://codereview.chromium.org/2070323002
Cr-Commit-Position: refs/heads/master@{#37825}
2016-07-18 09:45:23 +00:00
jochen
ad93c01aa5 Track peak Zone memory usage and report it via HeapStatistics
BUG=
R=ulan@chromium.org,verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2153423002
Cr-Commit-Position: refs/heads/master@{#37824}
2016-07-18 09:32:01 +00:00
bmeurer
db635d5b72 [turbofan] Add support for eager/soft deoptimization reasons.
So far TurboFan wasn't adding the deoptimization reasons for eager/soft
deoptimization exits that can be used by either the DevTools profiler or
the --trace-deopt flag. This adds basic support for deopt reasons on
Deoptimize, DeoptimizeIf and DeoptimizeUnless nodes and threads through
the reasons to the code generation.

Also moves the DeoptReason to it's own file (to resolve include cycles)
and drops unused reasons.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2161543002
Cr-Commit-Position: refs/heads/master@{#37823}
2016-07-18 09:25:16 +00:00
machenbach
a4053e027d Revert of Add force_dynamic_crt to build as static library but with /MD on windows (patchset #3 id:40001 of https://codereview.chromium.org/2149963002/ )
Reason for revert:
Fails gyp build with chromium:
https://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/builds/37051

Blocks roll:
https://codereview.chromium.org/2157903002/

Please add the trybot ios-simulator on reland.

Original issue's description:
> [build] Add force_dynamic_crt option to build a static library with /MD on windows
>
> Adds option to build a V8 library statically, but with the options on
> windows that allows it to be subsequently included in another DLL. On
> Windows this is required for it to correclty link against the correct
> C++ runtime. Require for our Node.js shared library build.
>
> Reference:  https://github.com/nodejs/node/pull/7487
>
> BUG=
> R=machenbach@chromium.org, michael_dawson@ca.ibm.com
>
> Committed: https://crrev.com/9cf88c1c364cf76c1e745aa63196768435e8ef5d
> Cr-Commit-Position: refs/heads/master@{#37814}

TBR=michael_dawson@ca.ibm.com,franzih@chromium.org,sxa@uk.ibm.com
# 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/2155073002
Cr-Commit-Position: refs/heads/master@{#37822}
2016-07-18 09:21:34 +00:00
oth
eae40165e1 Revert of [interpeter] Move to table based peephole optimizer. (patchset #38 id:730001 of https://codereview.chromium.org/2118183002/ )
Reason for revert:
Break MIPS port.

Original issue's description:
> [interpeter] Move to table based peephole optimizer.
>
> Introduces a lookup table for peephole optimizations.
>
> Fixes some tests using BytecodePeepholeOptimizer::Write() that should
> have been update to use BytecodePeepholeOptimizer::WriteJump().
>
> BUG=v8:4280
> LOG=N
>
> Committed: https://crrev.com/f4234422b93b21a286b0f31799009bcbe8b90b9e
> Cr-Commit-Position: refs/heads/master@{#37819}

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

Review-Url: https://codereview.chromium.org/2161563002
Cr-Commit-Position: refs/heads/master@{#37821}
2016-07-18 08:54:56 +00:00
yangguo
c06ad0867e [builtins] remove redundant builtins lists.
R=bmeurer@chromium.org
BUG=v8:5197

Review-Url: https://codereview.chromium.org/2155633002
Cr-Commit-Position: refs/heads/master@{#37820}
2016-07-18 08:48:18 +00:00
oth
f4234422b9 [interpeter] Move to table based peephole optimizer.
Introduces a lookup table for peephole optimizations.

Fixes some tests using BytecodePeepholeOptimizer::Write() that should
have been update to use BytecodePeepholeOptimizer::WriteJump().

BUG=v8:4280
LOG=N

Review-Url: https://codereview.chromium.org/2118183002
Cr-Commit-Position: refs/heads/master@{#37819}
2016-07-18 08:34:59 +00:00
mstarzinger
a95cdbb4b4 [turbofan] Fix deopt point for [[ToObject]] lazy bailout.
This fixes the deoptimization information for the lazy bailout point
after a [[ToObject]] operation inserted for with statements. The result
value was pushed on the operand stack but erroneously ignored and left
on the operand stack by the FullCodeGenerator.

R=jarin@chromium.org
TEST=mjsunit/regress/regress-5205
BUG=v8:5205

Review-Url: https://codereview.chromium.org/2158443002
Cr-Commit-Position: refs/heads/master@{#37818}
2016-07-18 08:08:47 +00:00
marja
3e5872f1e1 AstValueFactory: Add paranoid null checks for debugging.
crbug.com/518788 looks like AstValueFactory::strings_ would contain
nullptrs which shouldn't be possible. This CL makes us crash earlier
before putting nullptrs into it. It's paranoid, since Zone should
already crash before returning nullptr.

BUG=518788
LOG=n
R=adamk@chromium.org

Review-Url: https://codereview.chromium.org/2156513002
Cr-Commit-Position: refs/heads/master@{#37817}
2016-07-18 08:08:46 +00:00