Commit Graph

35400 Commits

Author SHA1 Message Date
bmeurer
4ee6fdf38b [turbofan] Fix a couple of invalid Uint32Constant/Int32Constant uses.
The contract for TurboFan is that we use NumberConstants for any kind
of number value until the representation selection picks concrete
representations, i.e. Int32Constant or Float64Constant. We will soon
be able to also guard this contract with DCHECKs.

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

Review-Url: https://codereview.chromium.org/2499573002
Cr-Commit-Position: refs/heads/master@{#40908}
2016-11-11 08:08:53 +00:00
jyan
c7ebb14c3c s390: fix overflowing offset in std and ld
use StoreDouble and LoadDouble function to avoid overflowing
offset used in std and ld

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

Review-Url: https://codereview.chromium.org/2492913002
Cr-Commit-Position: refs/heads/master@{#40907}
2016-11-10 21:56:09 +00:00
yangguo
f56685d064 Revert of Compiling an array literal should be context-independent. (patchset #5 id:80001 of https://codereview.chromium.org/2479123002/ )
Reason for revert:
speculative revert to fix https://uberchromegw.corp.google.com/i/client.v8/builders/V8%20Mac%20GC%20Stress/builds/9646/steps/Mjsunit%20%28flakes%29/logs/debug-scopes

Original issue's description:
> Compiling an array literal should be context-independent.
>
> We are removing use of the debugger context. When the debugger triggers
> compilation, we may not have a context from which to create a JSArray.
>
> R=ishell@chromium.org

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

Review-Url: https://codereview.chromium.org/2481363009
Cr-Commit-Position: refs/heads/master@{#40906}
2016-11-10 17:48:54 +00:00
mlippautz
5af14e2482 [heap] Record pretenuring feedback for moved pages
Record feedback for moved pages. Aligns the behavior of the copying and moving
evacuator.

BUG=chromium:651354

Review-Url: https://codereview.chromium.org/2494723002
Cr-Commit-Position: refs/heads/master@{#40905}
2016-11-10 17:11:15 +00:00
rmcilroy
f50f19eb19 [Interpreter] Fix logical-or/and to ensure it always visits the lhs.
BUG=chromium:664146

Review-Url: https://codereview.chromium.org/2495543002
Cr-Commit-Position: refs/heads/master@{#40904}
2016-11-10 16:31:00 +00:00
gsathya
cb6c8e48cc [promises] Move CreateResolvingFunctions to c++
- A new runtime function (%create_resolving_functions) is installed to
  call the CreateResolvingFunctions builtin from JS.

- Three new builtins are created - resolve and reject functions and a
  third function that creates a new JSFunctions from these
  resolve/reject builtins.

- The promise reject function is installed on the context temporarily
  as internal_promise_reject. This should go away once we remove
  PromiseSet.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2459283004
Cr-Commit-Position: refs/heads/master@{#40903}
2016-11-10 16:05:08 +00:00
ishell
45b9f15f44 [runtime] Treat empty property cells properly when doing Object.freeze() on a global object.
BUG=chromium:663750, chromium:664123

Review-Url: https://codereview.chromium.org/2495563002
Cr-Commit-Position: refs/heads/master@{#40902}
2016-11-10 16:01:15 +00:00
ahaas
665a5d17ac [wasm] Imported WebAssembly function are never wrapped.
According to the spec, import wrappers are only generated for JavaScript
functions, not for WebAssembly function. If an imported WebAssembly
function does not have the expected type, then a type error is thrown.

R=titzer@chromium.org, rossberg@chromium.org
TEST=mjsunit/wasm/test-import-export-wrapper

Review-Url: https://codereview.chromium.org/2486943005
Cr-Commit-Position: refs/heads/master@{#40901}
2016-11-10 15:05:52 +00:00
jarin
c71e5e1294 [crankshaft] Always force number representation for increment.
BUG=chromium:664087

Review-Url: https://codereview.chromium.org/2491333002
Cr-Commit-Position: refs/heads/master@{#40900}
2016-11-10 14:51:18 +00:00
bjaideep
6f4464ecb6 PPC/s390: Fix FullCodeGen to include CallICs and CallConstruct in the total ic count.
Port 832439ab8f

Original commit message:

    FullCodeGen does not include CallICs in the total ic count. Fix it by
    making calls to CallIC to go through CallIC function, which keeps track
    of the total number of ICs.

R=mythria@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2492803002
Cr-Commit-Position: refs/heads/master@{#40899}
2016-11-10 14:45:15 +00:00
bjaideep
a5467aae1e PPC/s390: [turbofan] Advance bytecode offset after lazy deopt.
Port 93c6595200

Original commit message:

    This changes {FrameState} nodes modeling "after" states to use bytecode
    offsets pointing to the deoptimizing bytecode. This is in sync with the
    normal execution, as the bytecode offset is advanced after operations
    complete in regular bytecode handlers.

    The change is necessary to ensure lazy deoptimized frames contain an
    accurate bytecode offset while they are on the stack. Such frames can be
    inspected by various stack walks. The continuation builtin will advance
    the bytecode offset upon return.

R=mstarzinger@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2486393005
Cr-Commit-Position: refs/heads/master@{#40898}
2016-11-10 14:42:09 +00:00
mstarzinger
25d2268ecc [crankshaft] Fix constant folding of HDiv instruction.
R=jarin@chromium.org
TEST=mjsunit/regress/regress-crbug-662367
BUG=chromium:662367

Review-Url: https://codereview.chromium.org/2486923004
Cr-Commit-Position: refs/heads/master@{#40897}
2016-11-10 14:27:52 +00:00
jkummerow
5c03cb7922 [stubs] Port KeyedStoreIC_Megamorphic stub to Turbofan
BUG=v8:5269,v8:5561

Review-Url: https://codereview.chromium.org/2444353002
Cr-Commit-Position: refs/heads/master@{#40896}
2016-11-10 14:23:57 +00:00
jkummerow
cc2a2771a6 [stubs] Fix CodeStubAssembler::TrapAllocationMemento
to actually trap allocation mementos.

Review-Url: https://codereview.chromium.org/2487943005
Cr-Commit-Position: refs/heads/master@{#40895}
2016-11-10 13:47:41 +00:00
bmeurer
6d533403f9 [crankshaft] Not all HAdd instructions produce a number.
BUG=chromium:664084
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2494703002
Cr-Commit-Position: refs/heads/master@{#40894}
2016-11-10 13:11:28 +00:00
jkummerow
eca64a2a8c [ic] Drop TimerEventScopes from *IC_Miss runtime functions
This is mostly a performance experiment. If it provides no speedup,
it can be reverted to keep IC miss events in timeline plots.
Otherwise, the RuntimeCallStats system is the replacement tool for
investigating performance issues related to IC misses.

This effectively reverts 1f8adc15 / r21736.

Review-Url: https://codereview.chromium.org/2480343002
Cr-Commit-Position: refs/heads/master@{#40893}
2016-11-10 13:10:25 +00:00
ulan
d5f22440a2 Fix -Wsign-compare warnings in parser, scanner, regexp, runtime.
BUG=v8:5614

Review-Url: https://codereview.chromium.org/2493553002
Cr-Commit-Position: refs/heads/master@{#40892}
2016-11-10 12:54:54 +00:00
ulan
3505406bc7 [wasm] Fix -Wsign-compare warnings.
BUG=v8:5614

Review-Url: https://codereview.chromium.org/2487673004
Cr-Commit-Position: refs/heads/master@{#40891}
2016-11-10 12:51:05 +00:00
ishell
f15373fdab [ic] Detailize some elements store specific runtime call stats counters.
BUG=v8:5561

Review-Url: https://codereview.chromium.org/2489293002
Cr-Commit-Position: refs/heads/master@{#40890}
2016-11-10 12:39:43 +00:00
mythria
832439ab8f Fix FullCodeGen to include CallICs and CallConstruct in the total ic count.
FullCodeGen does not include CallICs in the total ic count. Fix it by
making calls to CallIC to go through CallIC function, which keeps track
of the total number of ICs.

BUG=

Review-Url: https://codereview.chromium.org/2451703002
Cr-Commit-Position: refs/heads/master@{#40889}
2016-11-10 12:11:27 +00:00
mythria
f445f69244 [Crankshaft] Fine tune merging of Ignition and FCG feedback for binary/compare ops.
Ignition does not collect information about lhs and rhs types. It  collects
information about the combined type of lhs, rhs and result types. Since ignition
combines the feedback, sometimes we may collect less precise information than
FCG. This impacts performance of some benchmarks like audio-beat-detection. This
cl tries to mitigate this affect by passing only full-codegen feedback when the
combined FCG feedback is same as the feedback collected by ignition.

BUG=

Review-Url: https://codereview.chromium.org/2488983002
Cr-Commit-Position: refs/heads/master@{#40888}
2016-11-10 12:09:47 +00:00
mstarzinger
93c6595200 [turbofan] Advance bytecode offset after lazy deopt.
This changes {FrameState} nodes modeling "after" states to use bytecode
offsets pointing to the deoptimizing bytecode. This is in sync with the
normal execution, as the bytecode offset is advanced after operations
complete in regular bytecode handlers.

The change is necessary to ensure lazy deoptimized frames contain an
accurate bytecode offset while they are on the stack. Such frames can be
inspected by various stack walks. The continuation builtin will advance
the bytecode offset upon return.

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

Review-Url: https://codereview.chromium.org/2487173002
Cr-Commit-Position: refs/heads/master@{#40887}
2016-11-10 11:35:22 +00:00
ulan
98e06c342e [ignition] Fix -Wsign-compare warnings.
BUG=v8:5614

Review-Url: https://codereview.chromium.org/2492553003
Cr-Commit-Position: refs/heads/master@{#40886}
2016-11-10 11:25:44 +00:00
jgruber
806b350482 Fast-path in SlowFlatten for ConsStrings with empty first part
TurboFan can create ConsStrings with empty first parts (for history on
this decision, see da27e0c886). Add a
fast-path for such cases in String::SlowFlatten.

BUG=

Review-Url: https://codereview.chromium.org/2489273002
Cr-Commit-Position: refs/heads/master@{#40885}
2016-11-10 11:24:07 +00:00
yangguo
e5c1929c09 Compiling an array literal should be context-independent.
We are removing use of the debugger context. When the debugger triggers
compilation, we may not have a context from which to create a JSArray.

R=ishell@chromium.org

Review-Url: https://codereview.chromium.org/2479123002
Cr-Commit-Position: refs/heads/master@{#40884}
2016-11-10 11:17:11 +00:00
rmcilroy
f633218b62 [Interpreter] Remove all Ldr style bytecodes and replace with Star lookahead.
We seem to get some small wins from avoiding the Ldr bytecodes, probably due
to reduced icache pressure since there are less bytecode handlers. Replace
the Ldr bytecodes with Star lookahead inlined into the Lda versions.

Also fixes IsAccumulatorLoadWithoutEffects to include LdaContextSlot and
LdaCurrentContextSlot

BUG=v8:4280

Review-Url: https://codereview.chromium.org/2489513005
Cr-Commit-Position: refs/heads/master@{#40883}
2016-11-10 10:42:36 +00:00
ishell
6aa16edf36 [runtime] Ensure Object.freeze() deoptimizes code that depends on global property cells.
BUG=chromium:663750

Review-Url: https://codereview.chromium.org/2488223002
Cr-Commit-Position: refs/heads/master@{#40882}
2016-11-10 10:37:26 +00:00
neis
a9f593ef6b [compiler,modules] Introduce JS operators for module loads and stores.
With this CL, the bytecode graph builder no longer translates module
loads/stores as runtime calls but in terms of two new JS operators.  These are
lowered in typed-lowering to a sequence of LoadField's.

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

Review-Url: https://codereview.chromium.org/2489863003
Cr-Commit-Position: refs/heads/master@{#40881}
2016-11-10 10:21:19 +00:00
ulan
ade3bc6da9 [heap] Fix -Wsign-compare warnings
BUG=v8:5614

Review-Url: https://codereview.chromium.org/2489933002
Cr-Commit-Position: refs/heads/master@{#40880}
2016-11-10 10:16:35 +00:00
ulan
4d5f58799c [turbofan] Fix -Wsign-compare warnings.
BUG=v8:5614

Review-Url: https://codereview.chromium.org/2490973002
Cr-Commit-Position: refs/heads/master@{#40879}
2016-11-10 10:03:08 +00:00
mlippautz
58a753053c [api] Remove marking persistents as partially dependent
Also remove the flag scavenge_reclaim_unmodified_objects which has been
defaulted to true for quite some time now.

BUG=chromium:651354

Review-Url: https://codereview.chromium.org/2486173002
Cr-Commit-Position: refs/heads/master@{#40878}
2016-11-10 09:29:48 +00:00
jgruber
3098e24909 [debug-wrapper] Add caught/uncaught to exception pauses
BUG=v8:5530

Review-Url: https://codereview.chromium.org/2480293009
Cr-Commit-Position: refs/heads/master@{#40877}
2016-11-10 09:05:29 +00:00
jgruber
e730d08846 Simplify accesses to Script::line_ends
line_ends is either undefined (if uninitialized) or a fixed array (after
Script::InitLineEnds). All accesses from JS have been removed, therefore
we can skip assigning a COW map and remove the accessor.

Review-Url: https://codereview.chromium.org/2490903002
Cr-Commit-Position: refs/heads/master@{#40876}
2016-11-10 08:00:28 +00:00
jgruber
fab116be0e [inspector] Add exception caught/uncaught status to protocol
This adds information about an exception's caught/uncaught status to the
Runtime.paused event in the data parameter:

{
    "method": "Debugger.paused",
    "params": {
        "callFrames": [
	    [...]
        ],
        "data": {
            "description": "666",
            "type": "number",
            "uncaught": true,  <---
            "value": 666
        },
        "hitBreakpoints": [],
        "reason": "exception"
    }
}

BUG=v8:5530

Review-Url: https://codereview.chromium.org/2488733003
Cr-Commit-Position: refs/heads/master@{#40875}
2016-11-10 07:58:48 +00:00
bmeurer
fa9e404bf0 [turbofan] Address a couple of Type-related TODOs.
This cleans up a few Type related TODOs, i.e. removing the now useless
kSmi and kHeapNumber members from TypeCache.

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

Review-Url: https://codereview.chromium.org/2488183002
Cr-Commit-Position: refs/heads/master@{#40874}
2016-11-10 06:53:50 +00:00
mtrofin
5657433e57 [wasm] cctest - explicit WriteOneByte null termination opt-out
Turns out WriteOneByte writes '\0' by default.

BUG=

Review-Url: https://codereview.chromium.org/2494603002
Cr-Commit-Position: refs/heads/master@{#40873}
2016-11-10 05:17:40 +00:00
gsathya
9e07c96fed [typedarrays] Remove duplicate initial map creation
Previously we created a duplicate map because we couldn't set the
correct ElementsKind when we created the function. This patch updates
the ElementsKind field of the existing map directly instead of
creating a new one.

This patch also correctly sets the instance_size when we create the
map the first time.

Review-Url: https://codereview.chromium.org/2486193003
Cr-Commit-Position: refs/heads/master@{#40872}
2016-11-10 01:49:53 +00:00
lpy
bc37b518e4 [Tracing] Fix crash of --enable-tracing.
When we use unique_ptr on tracing controller and release it to platform,
unique_ptr will crash when we try to start tracing with trace config, this patch
replaces it with raw pointer and delete it explicitly at the end when needed.

TBR=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2488003002
Cr-Commit-Position: refs/heads/master@{#40871}
2016-11-09 20:44:52 +00:00
bbudge
472cb045c5 [Turbofan] Reduce register allocation work when we can.
- Track representations of virtual registers in InstructionSequence.
- Skip extra aliasing work when no floats or SIMD registers are used.

LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2468233004
Cr-Commit-Position: refs/heads/master@{#40870}
2016-11-09 18:49:45 +00:00
ishell
0700bc1bf8 [stubs] Ensure CSA_ASSERT and CSA_SLOW_ASSERT do not produce unused instructions in release mode.
... and make them applicable outside of CSA.

Nice bonus is that the assert condition instructions will now appear inside [Assert / ]Assert brackets.

BUG=

Review-Url: https://codereview.chromium.org/2489743002
Cr-Commit-Position: refs/heads/master@{#40869}
2016-11-09 18:22:46 +00:00
rmcilroy
abad9b2ff9 [Interpreter] Add IsInterpreted() to JSFunction and use to fix test-heap tests.
Adds an IsInterpreted() function to both SharedFunctionInfo and JSFunction.
This is used to fix the test-heap code-aging tests since Ignition doesn't
age code.

BUG=v8:4680

Review-Url: https://codereview.chromium.org/2481433002
Cr-Commit-Position: refs/heads/master@{#40868}
2016-11-09 17:20:02 +00:00
lpy
1f96226bc2 [Tracing] Fix inaccurate time accumulation in runtime statistics.
In tracing we collect runtime statistics data based on top level trace events,
in this patch we force to clear the whole runtime statistics stack when we
enter top level trace events.

Review-Url: https://codereview.chromium.org/2483583002
Cr-Commit-Position: refs/heads/master@{#40867}
2016-11-09 17:08:37 +00:00
heimbuef
da3e222525 [Parser] Added SMI cache
With the very same SMIs making up a big chunk
of the parser zone (especially for asm.js) it
makes sense to cache the AstValues for them.
This is not ideal yet, but already saves
hundreds (sic!) MBs of memory for Unity games.

Review-Url: https://codereview.chromium.org/2485423002
Cr-Commit-Position: refs/heads/master@{#40866}
2016-11-09 16:12:33 +00:00
ahaas
d91bed67d6 [wasm] Only immutable imported globals are valid initializer expressions
R=titzer@chromium.org
TEST=unittests/WasmModuleVerifyTest.DataSegmentWithImmutableGlobal, unittests/WasmModuleVerifyTest.DataSegmentWithMutableImportedGlobal, unittests/WasmModuleVerifyTest.DataSegmentWithImmutableImportedGlobal

Review-Url: https://codereview.chromium.org/2493433002
Cr-Commit-Position: refs/heads/master@{#40865}
2016-11-09 15:52:36 +00:00
kozyatinskiy
dd4ce25cde [inspector] fix positions for single expression arrow function
Currently function like "() => 239" contains offset 3 as begin of function and 8 as end of function.
This CL changes this to 6 and 9 respectively.

BUG=chromium:566801
R=yangguo@chromium.org,dgozman@chromium.org
TBR=adamk@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2488493003
Cr-Commit-Position: refs/heads/master@{#40864}
2016-11-09 15:37:14 +00:00
jarin
12af4128d1 [turbofan] Enable accessor inlining when compiling from bytecode.
Review-Url: https://codereview.chromium.org/2486223002
Cr-Commit-Position: refs/heads/master@{#40863}
2016-11-09 14:42:57 +00:00
ivica.bogosavljevic
0cf5623220 MIPS: Fix bad RegisterConfiguration usage in InstructionSequence unit tests.
Test InstructionSequenceTest has been initialized with a testing RegisterConfiguration
instance defined in instruction-sequence-unittest.h, whereas class ExplicitOperand which
is being tested used RegisterConfiguration from instruction.cc. In case these two
instances are different, the tests would fail. The issue is fixed by using the same
instance of RegisterConfiguration both for test code and code under test.

Additionally, the tests in register-allocator-unittest.cc use hardcoded values
for register and begin failing is the hardcoded register is not available for
allocation. Fix by forcing the use of allocatable registers only.

TEST=unittests.MoveOptimizerTest.RemovesRedundantExplicit,unittests.RegisterAllocatorTest.SpillPhi
BUG=

Review-Url: https://codereview.chromium.org/2433093002
Cr-Commit-Position: refs/heads/master@{#40862}
2016-11-09 13:47:46 +00:00
bmeurer
82b315ce75 [turbofan] Add support for accessing Uint8ClampedArrays.
This adds a new NumberToUint8Clamped simplified operator that does the
round ties to even + clamping necessary to store to Uint8ClampedArrays.

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

Review-Url: https://codereview.chromium.org/2489563004
Cr-Commit-Position: refs/heads/master@{#40861}
2016-11-09 13:34:02 +00:00
rmcilroy
ed35983ab7 [Interpreter] Remove Ldr[Named/Keyed]Property bytecodes and use Star Lookahead instead.
The Ldr[Named/Keyed]Property bytecodes are problematic for the deoptimizer when
inlining accessors in TurboFan. Remove them and replace with a Star lookahead
in the bytecode handlers for Lda[Named/Keyed]Property.

BUG=v8:4280

Review-Url: https://codereview.chromium.org/2485383002
Cr-Commit-Position: refs/heads/master@{#40860}
2016-11-09 13:16:37 +00:00
mstarzinger
62688795ab [turbofan] Stage escape analysis optimization.
This stages escape analysis by implying --turbo-escape by the --turbo
flag. It broadens the exposure of the optimization in question.

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

Review-Url: https://codereview.chromium.org/1992913005
Cr-Commit-Position: refs/heads/master@{#40859}
2016-11-09 12:52:33 +00:00