Commit Graph

14058 Commits

Author SHA1 Message Date
jbroman
879f6599ee Initialize internal fields in Factory::NewJSTypedArray and NewJSDataView.
This was causing array buffer views created by ValueDeserializer to have
uninitialized internal fields, which lead to crashes in layout tests when
Blink tried to read those fields.

For array buffers, JSArrayBuffer::Setup is responsible for this logic
(as well as initializing the V8 fields); this is similar to that.

The runtime already seems to correctly initialize these for script-created
array buffer views as well, which is why this issue was not detected sooner.

Review-Url: https://codereview.chromium.org/2498413002
Cr-Commit-Position: refs/heads/master@{#41014}
2016-11-15 22:43:19 +00:00
luoe
e80cfa000b Generate inferred names for es6 class functions
Inferred names are currently generated for FunctionLiterals but not generated
for ClassLiterals. Without them, DevTools does not have enough information to
make descriptive descriptions.

E.g.
var x = {y: class{}};
var a = new x.y();
console.log(a);

This shows "Object{}" when it could be more descriptive "x.y {}"

BUG=v8:5621
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2488193003
Cr-Commit-Position: refs/heads/master@{#41013}
2016-11-15 21:58:50 +00:00
domenic
2f060955e8 Add markPromiseAsHandled V8 extra util
This will allow V8 extra consumers to mark a promise as handled without
adding redundant empty onRejected handlers. This is needed by streams as
discussed in https://github.com/whatwg/streams/issues/547.

BUG=chromium:654701

Review-Url: https://codereview.chromium.org/2498143002
Cr-Commit-Position: refs/heads/master@{#41012}
2016-11-15 21:25:52 +00:00
titzer
6e643f045c [wasm] Be more lenient on the names section.
R=clemensh@chromium.org,dschuff@chromium.org
BUG=v8:5632
LOG=Y

Review-Url: https://codereview.chromium.org/2501873003
Cr-Commit-Position: refs/heads/master@{#41011}
2016-11-15 20:55:55 +00:00
jshin
4f224b3995 Use a regular ICU API for el-Upper
ICU now supports uppercasing in Greek via its regular uppercasing API.
So, there's no need to use a slow transliteration API for uppercasing
in Greek.

This CL includes rolling ICU to ICU 58.1.

Besides, drop intl402/Intl/getCanonicalLocales/weird-cases from
test262.status because it passes now with ICU 58.1.

BUG=chromium:637001,v8:5012

Review-Url: https://codereview.chromium.org/2491333003
Cr-Commit-Position: refs/heads/master@{#41009}
2016-11-15 18:30:17 +00:00
clemensh
32077e01fb [wasm] Allocate a single script per wasm module
Before, we allocated one script per function per instance, and each
script referenced the wasm instance and the function index. Now we only
allocate one script per compiled wasm module, so the script also only
references this WasmCompiledModule, which causes changes to many interfaces.

Instead of fixing the disassemble API only used via debug.js, I decided
to drop it for now. Some later CL will reintroduce it via
DebugInterface.

BUG=v8:5530,chromium:659715
R=yangguo@chromium.org, titzer@chromium.org
CC=jgruber@chromium.org

Review-Url: https://codereview.chromium.org/2493823003
Cr-Commit-Position: refs/heads/master@{#41004}
2016-11-15 17:05:39 +00:00
cbruni
bb6a626b76 [counters] Implement off-isolate RuntimeCallStats for the Preparser
BUG=

Review-Url: https://codereview.chromium.org/2490643002
Cr-Commit-Position: refs/heads/master@{#41001}
2016-11-15 16:08:50 +00:00
jgruber
e29fcbee9c [regexp] Move RegExp.prototype[@@search] to TF
Implements upcoming changes to @@search according to
https://github.com/tc39/ecma262/pull/627.

This also adds SameValue to CodeStubAssembler and extracts a part of
CSA::TruncateTaggedToFloat64.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2438683005
Cr-Commit-Position: refs/heads/master@{#41000}
2016-11-15 16:06:20 +00:00
petermarshall
a63eeb485a Fastpath some spread-call desugaring.
Avoid using the iterator for arrays with fast elements where the iterator has
not been modified.

Only deals with the case where there is a single spread argument.

Improves the six-speed "spread" benchmark to 1.5x slower than baseline es5 implementation, compared to 19x slower previously.

BUG=v8:5511

Review-Url: https://codereview.chromium.org/2465253011
Cr-Commit-Position: refs/heads/master@{#40998}
2016-11-15 14:42:00 +00:00
tebbi
f71260b298 [turbofan] Make escape analysis fail silently for cyclic object states
R=bmeurer@chromium.org
BUG=v8:5634

Review-Url: https://codereview.chromium.org/2500143003
Cr-Commit-Position: refs/heads/master@{#40995}
2016-11-15 14:05:37 +00:00
jarin
7ae7e84340 Reland of [turbofan] Fix deoptimization of boolean bit constants. (patchset #1 id:1 of https://codereview.chromium.org/2495243002)
This reverts commit 1c9528c4c4.

BUG=chromium:664490

Review-Url: https://codereview.chromium.org/2503763003
Cr-Commit-Position: refs/heads/master@{#40994}
2016-11-15 13:55:57 +00:00
jarin
1900760e8f [turbofan] Fix deopt check for storing into constant field.
BUG=chromium:626986

Review-Url: https://codereview.chromium.org/2503863002
Cr-Commit-Position: refs/heads/master@{#40990}
2016-11-15 13:17:13 +00:00
dusan.simicic
961a45da69 Reland of "MIPS: Optimize load/store with large offset"
Currently, we are using the following sequence for load/store
with large offset (offset > 16b):
    lui at, 0x1234
    ori at, at, 0x5678
    add at, s0, at
    lw a0, 0(at)

This sequence can be optimized in the following way:
    lui at, 0x1234
    add at, s0, at
    lw a0, 0x5678(at)

BUG=

Review-Url: https://codereview.chromium.org/2503493002
Cr-Commit-Position: refs/heads/master@{#40988}
2016-11-15 12:00:45 +00:00
dusan.simicic
b725d5a797 MIPS[64]: Port '[turbofan] Use zr to store immediate zero'
Port 0322c20d17

Original commit message:
When storing an immediate integer or floating point zero, use the zero register
as the source value. This avoids the need to sometimes allocate a new register.

BUG=

Review-Url: https://codereview.chromium.org/2470133005
Cr-Commit-Position: refs/heads/master@{#40987}
2016-11-15 11:57:28 +00:00
verwaest
8b649a41ec [parser] Only log messages using the pending error handling
This shares the pending_error_handler from the parser to the preparser, allowing the preparser to directly log errors to it. This removes LogMessage from the loggers. ParserLogger::LogMessage was already unused, so this also removes error info from the preparse data altogether.

BUG=

Review-Url: https://codereview.chromium.org/2502633002
Cr-Commit-Position: refs/heads/master@{#40984}
2016-11-15 10:16:28 +00:00
ahaas
1bde83046e [wasm] Reimplement function verification in the module decoder.
This CL adds the function verification option to the module decoder.
Therefore we can remove the verification in wasm-module-runner.cc

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2496203002
Cr-Commit-Position: refs/heads/master@{#40977}
2016-11-14 19:46:19 +00:00
caitp
2a350ed457 [builtins] Take fast path in Array.prototype.keys() only if length is an Smi
Do not take the fast path for Array.prototype.keys() if the array length is not
guaranteed to be an Smi.

BUG=660925, v8:5388
R=bmeurer@chromium.org, mstarzinger@chromium.org

Review-Url: https://codereview.chromium.org/2496323002
Cr-Commit-Position: refs/heads/master@{#40976}
2016-11-14 18:52:25 +00:00
tebbi
c3a6ca68d0 This CL enables precise source positions for all V8 compilers. It merges compiler::SourcePosition and internal::SourcePosition to a single class used throughout the codebase. The new internal::SourcePosition instances store an id identifying an inlined function in addition to a script offset.
SourcePosition::InliningId() refers to a the new table DeoptimizationInputData::InliningPositions(), which provides the following data for every inlining id:
 - The inlined SharedFunctionInfo as an offset into DeoptimizationInfo::LiteralArray
 - The SourcePosition of the inlining. Recursively, this yields the full inlining stack.
Before the Code object is created, the same information can be found in CompilationInfo::inlined_functions().

If SourcePosition::InliningId() is SourcePosition::kNotInlined, it refers to the outer (non-inlined) function.
So every SourcePosition has full information about its inlining stack, as long as the corresponding Code object is known. The internal represenation of a source position is a positive 64bit integer.

All compilers create now appropriate source positions for inlined functions. In the case of Turbofan, this required using AstGraphBuilderWithPositions for inlined functions too. So this class is now moved to a header file.

At the moment, the additional information in source positions is only used in --trace-deopt and --code-comments. The profiler needs to be updated, at the moment it gets the correct script offsets from the deopt info, but the wrong script id from the reconstructed deopt stack, which can lead to wrong outputs. This should be resolved by making the profiler use the new inlining information for deopts.

I activated the inlined deoptimization tests in test-cpu-profiler.cc for Turbofan, changing them to a case where the deopt stack and the inlining position agree. It is currently still broken for other cases.

The following additional changes were necessary:
 - The source position table (internal::SourcePositionTableBuilder etc.) supports now 64bit source positions. Encoding source positions in a single 64bit int together with the difference encoding in the source position table results in very little overhead for the inlining id, since only 12% of the source positions in Octane have a changed inlining id.
 - The class HPositionInfo was effectively dead code and is now removed.
 - SourcePosition has new printing and information facilities, including computing a full inlining stack.
 - I had to rename compiler/source-position.{h,cc} to compiler/compiler-source-position-table.{h,cc} to avoid clashes with the new src/source-position.cc file.
 - I wrote the new wrapper PodArray for ByteArray. It is a template working with any POD-type. This is used in DeoptimizationInputData::InliningPositions().
 - I removed HInlinedFunctionInfo and HGraph::inlined_function_infos, because they were only used for the now obsolete Crankshaft inlining ids.
 - Crankshaft managed a list of inlined functions in Lithium: LChunk::inlined_functions. This is an analog structure to CompilationInfo::inlined_functions. So I removed LChunk::inlined_functions and made Crankshaft use CompilationInfo::inlined_functions instead, because this was necessary to register the offsets into the literal array in a uniform way. This is a safe change because LChunk::inlined_functions has no other uses and the functions in CompilationInfo::inlined_functions have a strictly longer lifespan, being created earlier (in Hydrogen already).

BUG=v8:5432

Review-Url: https://codereview.chromium.org/2451853002
Cr-Commit-Position: refs/heads/master@{#40975}
2016-11-14 17:22:32 +00:00
caitp
372d905d73 [tests] skip es6/array-iterator-turbo on deopt_fuzzer
BUG=v8:5388
R=bmeurer@chromium.org
NOTRY=true

Review-Url: https://codereview.chromium.org/2496063003
Cr-Commit-Position: refs/heads/master@{#40974}
2016-11-14 17:16:59 +00:00
ulan
71a7bca990 [heap] Use size_t for heap and space counters.
BUG=chromium:652721

Review-Url: https://codereview.chromium.org/2490523003
Cr-Commit-Position: refs/heads/master@{#40972}
2016-11-14 16:47:18 +00:00
clemensh
0c6fa1724f [wasm] Make reported "lines" on stack frames 1-based
In captured stack traces, all lines and columns must be 1-based.
Even though this makes things a bit ugly, we have to comply also for
wasm locations, where line and column encode function index and byte
offset (both are originally 0-based).

If we don't comply, the frontend might complain, as e.g. DevTools does.

BUG=chromium:659715
R=yangguo@chromium.org, kozyatinskiy@chromium.org
CC=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2493943002
Cr-Commit-Position: refs/heads/master@{#40971}
2016-11-14 16:00:54 +00:00
caitp
7f21e67b38 [builtins] implement JSBuiltinReducer for ArrayIteratorNext()
Adds a protector cell to prevent inlining (which will likely lead to deopt
loops) when a JSArrayIterator's array transitions from a fast JSArray to a
slow JSArray (such as, when the array is touched during iteration in a way
which triggers a map transition).

Also adds TODO comments relating to the spec update proposed by Dan at
https://github.com/tc39/ecma262/pull/724

BUG=v8:5388
R=bmeurer@chromium.org, mstarzinger@chromium.org
TBR=hpayer@chromium.org, ulan@chromium.org

Review-Url: https://codereview.chromium.org/2484003002
Cr-Commit-Position: refs/heads/master@{#40970}
2016-11-14 15:59:47 +00:00
jgruber
1c1edda7db Skip flaky debug-scopes test
BUG=v8:5619,chromium:664490

Review-Url: https://codereview.chromium.org/2503463002
Cr-Commit-Position: refs/heads/master@{#40968}
2016-11-14 15:02:30 +00:00
neis
4e32419be4 [debug] Extend a test and fix some typos.
R=jgruber@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2493533003
Cr-Commit-Position: refs/heads/master@{#40966}
2016-11-14 14:06:05 +00:00
rmcilroy
be9b820c44 Only treat possible eval calls going through 'with' as special.
This removes the POSSIBLY_EVAL_CALL call type, and instead uses OTHER_CALL
or WITH_CALL to decide whether to do the special LOOKUP_SLOT_CALL runtime
call to find the callee and possibly update the receiver with the with-object.
This means that eval calls out of 'with' blocks can now just do a normal
LdaLookupGlobalSlot operation, which can check the context chain for eval
extentions and fast-path the lookup if none exist.

BUG=661556

Review-Url: https://codereview.chromium.org/2487483004
Cr-Commit-Position: refs/heads/master@{#40965}
2016-11-14 13:35:04 +00:00
mstarzinger
79aee39f24 [builtins] Fix pointer comparison in ToString builtin.
This fixes the bogus {Word32Equal} comparison in the ToString builtin
implementing Object.prototype.toString to be a pointer-size {WordEqual}
comparison instead. Comparing just the lower half-word is insufficient
on 64-bit architectures.

R=jgruber@chromium.org
TEST=mjsunit/regress/regress-crbug-664506
BUG=chromium:664506

Review-Url: https://codereview.chromium.org/2496043003
Cr-Commit-Position: refs/heads/master@{#40963}
2016-11-14 12:44:29 +00:00
verwaest
733af7eb1a Only treat lookup-slot-calls going through 'with' special
This replaces LOOKUP_SLOT_CALL with WITH_CALL, and relies on regular lookup-slot handling in variable load to support other lookup slots (variables resolved in the context of sloppy eval). This allows optimizations for such variable loads to kick in for calls as well. We only need special handling for function calls in the context of with, since it changes the receiver of the call from undefined/global to the with-object.

This currently doesn't yet make it work for the direct eval call itself, since the POSSIBLY_EVAL_CALL flag is also used to deal with direct eval later.

BUG=

Review-Url: https://codereview.chromium.org/2480253006
Cr-Commit-Position: refs/heads/master@{#40962}
2016-11-14 12:24:12 +00:00
jarin
1c9528c4c4 Revert of [turbofan] Fix deoptimization of boolean bit constants. (patchset #1 id:1 of https://codereview.chromium.org/2495243002/ )
Reason for revert:
Seems to break GC stress.

Original issue's description:
> [turbofan] Fix deoptimization of boolean bit constants.
>
> BUG=chromium:664490

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

Review-Url: https://codereview.chromium.org/2502613002
Cr-Commit-Position: refs/heads/master@{#40961}
2016-11-14 12:11:00 +00:00
bmeurer
5667280310 [turbofan] Properly allocate constant-folded string.
When constant-folding S[K], make sure to return a String, and not the
character code as Number.

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

Review-Url: https://codereview.chromium.org/2503433002
Cr-Commit-Position: refs/heads/master@{#40960}
2016-11-14 11:58:09 +00:00
bmeurer
fae0e710fc Revert of MIPS: Optimize load/store with large offset (patchset #1 id:1 of https://codereview.chromium.org/2486283003/ )
Reason for revert:
Breaks CQ trybots now, i.e. https://build.chromium.org/p/tryserver.v8/builders/v8_linux_mipsel_compile_rel/builds/24703/steps/compile%20with%20ninja/logs/stdio

Original issue's description:
> MIPS: Optimize load/store with large offset
>
> Currently, we are using the following sequence for load/store with large offset (offset > 16b):
>
>     lui at, 0x1234
>     ori at, at, 0x5678
>     add at, s0, at
>     lw  a0, 0(at)
>
> This sequence can be optimized in the following way:
>
>     lui at, 0x1234
>     add at, s0, at
>     lw  a0, 0x5678(at)
>
> BUG=

TBR=ivica.bogosavljevic@imgtec.com,miran.karic@imgtec.com,v8-mips-ports@googlegroups.com,dusan.simicic@imgtec.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/2500863003
Cr-Commit-Position: refs/heads/master@{#40959}
2016-11-14 11:44:05 +00:00
ulan
e5b152264e Enable -Wsign-compare compiler warnings.
BUG=v8:5614

Review-Url: https://codereview.chromium.org/2493193002
Cr-Commit-Position: refs/heads/master@{#40958}
2016-11-14 10:49:15 +00:00
yangguo
08f09ed71b 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
BUG=chromium:664577

Review-Url: https://codereview.chromium.org/2479123002
Cr-Commit-Position: refs/heads/master@{#40956}
2016-11-14 10:46:33 +00:00
Miran.Karic
6f556b3394 Add icu libraries to unittests dependencies
In component build, unittests did not link with icu libraries, which
caused errors. By adding icu libraries to dependencies unittests links
correctly.

BUG=
TEST=unittests/*

Review-Url: https://codereview.chromium.org/2479863002
Cr-Commit-Position: refs/heads/master@{#40955}
2016-11-14 10:01:21 +00:00
dusan.simicic
6d054f7658 MIPS: Optimize load/store with large offset
Currently, we are using the following sequence for load/store with large offset (offset > 16b):

    lui at, 0x1234
    ori at, at, 0x5678
    add at, s0, at
    lw  a0, 0(at)

This sequence can be optimized in the following way:

    lui at, 0x1234
    add at, s0, at
    lw  a0, 0x5678(at)

BUG=

Review-Url: https://codereview.chromium.org/2486283003
Cr-Commit-Position: refs/heads/master@{#40953}
2016-11-14 09:57:54 +00:00
jarin
297a969aad [turbofan] Fix deoptimization of boolean bit constants.
BUG=chromium:664490

Review-Url: https://codereview.chromium.org/2495243002
Cr-Commit-Position: refs/heads/master@{#40951}
2016-11-14 09:30:19 +00:00
verwaest
942604dfb2 Add test for making private symbols non-enumerable
BUG=chromium:664411

Review-Url: https://codereview.chromium.org/2498963002
Cr-Commit-Position: refs/heads/master@{#40950}
2016-11-14 09:17:07 +00:00
yangguo
c759a3d847 [serializer] small fixes for blink snapshot.
Changes include:
 - Adding V8_EXPORT macro for SnapshotCreator
 - Removing outdated DCHECKs.
 - Allow nullptr as external reference. This required a...
 - Refactoring of hashmaps used by the serializer.
 - Remove external references for counters. These are not used
   anywhere for isolates that are being serialized.
 - Put template infos into the partial snapshot cache.
 - Remove unnecessary presubmit check for external references.
   mksnapshot crashes if external references are missing.

R=jochen@chromium.org, vogelheim@chromium.org
BUG=chromium:617892

Review-Url: https://codereview.chromium.org/2490783004
Cr-Commit-Position: refs/heads/master@{#40949}
2016-11-14 07:17:59 +00:00
jbroman
94142ed8c9 ValueSerializer: Replace use of std::vector with a delegate-allocated buffer.
BUG=chromium:148757

Review-Url: https://codereview.chromium.org/2492943002
Cr-Commit-Position: refs/heads/master@{#40943}
2016-11-12 21:50:26 +00:00
jwolfe
87ca9283b0 Stage harmony trailing commas
BUG=v8:5051
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2484223004
Cr-Commit-Position: refs/heads/master@{#40942}
2016-11-11 23:42:55 +00:00
yangguo
389d0dd115 [debugger,compiler] do not recompile already compiled inner functions.
GetSharedFunctionInfo will compile inner functions if we get the
compile-eager hint, even if the shared function info already exists, and
the function already has been compiled. This breaks suspended generator
objects.

R=mstarzinger@chromium.org, neis@chromium.org
BUG=v8:5575

Review-Url: https://codereview.chromium.org/2494043002
Cr-Commit-Position: refs/heads/master@{#40936}
2016-11-11 15:53:33 +00:00
yangguo
70bedcb1ef [debugger] do not use asm validator for debug code.
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2492713005
Cr-Commit-Position: refs/heads/master@{#40934}
2016-11-11 15:13:31 +00:00
verwaest
135b9f9360 Make private symbols non-enumerable
Methods in the runtime that enumerate over properties should never deal with private symbols. Most commonly such methods only loop over enumerable properties. This fix avoids accidentally handling private symbols in methods that only deal with enumerable properties. Methods that need to look at non-enumerable properties as well still have to manually filter private symbols (e.g., the KeyAccumulator).

BUG=chromium:664411

Review-Url: https://codereview.chromium.org/2499593002
Cr-Commit-Position: refs/heads/master@{#40932}
2016-11-11 15:05:29 +00:00
ulan
f18d56d130 Fix more -Wsign-compare warnings in heap, mips, base, etc.
BUG=v8:5614

Review-Url: https://codereview.chromium.org/2496913002
Cr-Commit-Position: refs/heads/master@{#40931}
2016-11-11 14:56:10 +00:00
leszeks
f6701a8cbd Reland: [compiler] Fix flipped boolean checks in marked tier-up
Fixes incorrect checks for handle validity when checking the compiled
code, as well as incorrect uses of tst in arm and ppc flag checking
code. Also adds a test that the tier-up works correctly.

Reland of https://codereview.chromium.org/2448933002

BUG=v8:5512

Review-Url: https://codereview.chromium.org/2497573003
Cr-Commit-Position: refs/heads/master@{#40930}
2016-11-11 14:17:00 +00:00
ulan
8ddc260d3b [parser, serializer] Fix more -Wsign-compare warnings.
BUG=v8:5614

Review-Url: https://codereview.chromium.org/2481013010
Cr-Commit-Position: refs/heads/master@{#40927}
2016-11-11 13:54:26 +00:00
franzih
6d84f2d9ed [turbofan] Optimize ToName conversion.
ToName conversion, i.e., ToPropertykey() is the
identify for strings and symbols.

BUG=v8:5623

Review-Url: https://codereview.chromium.org/2494073002
Cr-Commit-Position: refs/heads/master@{#40924}
2016-11-11 13:05:45 +00:00
bmeurer
7d24f1aefa [turbofan] Introduce an ExternalPointer type.
This adds a new ExternalPointer type, which is an Internal type that is
used for ExternalReferences and other pointer values, like the pointers
into the asm.js heap. It also adds a PointerConstant operator, which we
use to represents these raw constants (we can probably remove that
particular operator again once WebAssembly ships with the validator).

R=mvstanton@chromium.org
BUG=v8:5267,v8:5270

Review-Url: https://codereview.chromium.org/2494753003
Cr-Commit-Position: refs/heads/master@{#40923}
2016-11-11 13:04:47 +00:00
ahaas
e3c7324a2e [wasm] Check data segments for zero-sized memory.
According to the spec data segments are allowed even if the memory size
is zero. However, if one of the data segments has a length greater than
0, then module instantiation should fail.

I also changed the exception type in LoadDataSegments to TypeError,
because that's the exception type for all exceptions which can happen
during instantiation.

R=titzer@chromium.org, rossberg@chromium.org
TEST=cctest/test-run-wasm-module/EmptyMemoryEmptyDataSegment, cctest/test-run-wasm-module/EmptyMemoryNonEmptyDataSegment

Review-Url: https://codereview.chromium.org/2483053005
Cr-Commit-Position: refs/heads/master@{#40922}
2016-11-11 13:03:50 +00:00
jkummerow
567904f1a7 [ic] Fix elements conversion in KeyedStoreGeneric
A SmiUntag() was missing when loading the old backing store's length.

BUG=chromium:664469

Review-Url: https://codereview.chromium.org/2492783004
Cr-Commit-Position: refs/heads/master@{#40921}
2016-11-11 13:02:10 +00:00
bmeurer
bad42b387f Revert of [compiler] Fix flipped boolean checks in marked tier-up (patchset #7 id:120001 of https://codereview.chromium.org/2478323002/ )
Reason for revert:
Breaks deopt fuzzer:
https://build.chromium.org/p/client.v8/builders/V8%20Deopt%20Fuzzer/builds/14872/steps/Deopt%20Fuzz%20on%20Ubuntu-12.04/logs/stdio

Original issue's description:
> [compiler] Fix flipped boolean checks in marked tier-up
>
> Fixes incorrect checks for handle validity when checking the compiled
> code, as well as incorrect uses of tst in arm and ppc flag checking
> code. Also adds a test that the tier-up works correctly.

TBR=rmcilroy@chromium.org,leszeks@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/2492523007
Cr-Commit-Position: refs/heads/master@{#40919}
2016-11-11 12:40:17 +00:00
ulan
2bd1ee96a5 [ignition] Fix more -Wsign-compare warnings.
BUG=v8:5614

Review-Url: https://codereview.chromium.org/2493183002
Cr-Commit-Position: refs/heads/master@{#40918}
2016-11-11 12:13:12 +00:00
jgruber
b32ee40de8 [debug-wrapper] Conditional breaks, locals, evaluate, scopes
This CL adds support for:
* conditional breaks in setBreakpoint,
* locals in frame.local{Count,Name,Value},
* evaluation on a frame in frame.evaluate,
* and more detailed scope information in scopeObject.

Uses of several functions that are not covered by the
inspector protocol and are only used in tests have been removed.

Local handling has been modified to also include arguments as locals.
Inspector differs in this regard from our FrameDetails in that
arguments are always shown as locals. Argument-related functions
were removed.

BUG=v8:5530

Review-Url: https://codereview.chromium.org/2491543002
Cr-Commit-Position: refs/heads/master@{#40917}
2016-11-11 12:08:34 +00:00
ulan
758b317ce5 [turbofan] Fix more -Wsign-compare warnings.
BUG=v8:5614

Review-Url: https://codereview.chromium.org/2493173002
Cr-Commit-Position: refs/heads/master@{#40916}
2016-11-11 12:01:08 +00:00
leszeks
712a46cc3f [compiler] Fix flipped boolean checks in marked tier-up
Fixes incorrect checks for handle validity when checking the compiled
code, as well as incorrect uses of tst in arm and ppc flag checking
code. Also adds a test that the tier-up works correctly.

Review-Url: https://codereview.chromium.org/2478323002
Cr-Commit-Position: refs/heads/master@{#40915}
2016-11-11 11:57:54 +00:00
ulan
9c25d5dc6e [wasm] Fix more -Wsign-compare warnings.
BUG=v8:5614

Review-Url: https://codereview.chromium.org/2492793005
Cr-Commit-Position: refs/heads/master@{#40914}
2016-11-11 11:56:05 +00:00
titzer
fa9c25cebf [wasm] Move all heap-allocated WASM structures into wasm-objects.h.
This CL moves all heap-allocated WASM data structures, both ones
that are bonafide JSObjects and ones that are FixedArrays only, into a
consistent place with consistent layout. Note that not all accessors are complete, and I haven't fully spread the new static typing goodness
to all places in the code.

R=ahaas@chromium.org,rossberg@chromium.org
CC=gdeepti@chromium.org,mtrofin@chromium.org,clemensh@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2490663002
Cr-Commit-Position: refs/heads/master@{#40913}
2016-11-11 11:13:17 +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
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
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
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
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
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
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
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
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
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
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
jgruber
8f22fcec24 [debug] Disable debug events if JS execution is disallowed
We cannot generate debug events if JS execution is disallowed since
vital debugging logic is still implemented in JS. Return early from
Debug::OnException if that is the case.

BUG=chromium:662674

Review-Url: https://codereview.chromium.org/2491443002
Cr-Commit-Position: refs/heads/master@{#40858}
2016-11-09 12:30:33 +00:00
ahaas
ac183d492f [wasm] Fix bounds check in LoadDataSegments.
The bounds check in LoadDataSegment was off by one. I also improved the
error message, and fixed an issue where data was initialized even if
the bounds check failed.

In InstantiateModuleForTesting I allow instantiation of modules without
exports. This check was legacy code from the time where instantiation
and execution was still combined in a single function.

R=titzer@chromium.org, rossberg@chromium.org
TEST=cctest/test-run-wasm-module/InitDataAtTheUpperLimit

Review-Url: https://codereview.chromium.org/2486183002
Cr-Commit-Position: refs/heads/master@{#40856}
2016-11-09 11:41:23 +00:00
ahaas
bd472ffac3 [wasm] Data section without memory causes a validation error
Another spec issue.

R=titzer@chromium.org, rossberg@chromium.org
TEST=unittests/WasmModuleVerifyTest.DataWithoutMemory

Review-Url: https://codereview.chromium.org/2486973003
Cr-Commit-Position: refs/heads/master@{#40855}
2016-11-09 10:37:17 +00:00
ahaas
4db05d405b [wasm] Indirect calls without function table cause validation errors.
The spec defines that indirect calls in WebAssembly code should cause a
validation error if no function table exists.

The CL contains the following changes:
1) Throw a validation error for indirect calls if the function table
   not exist.
2) Do not create TF nodes to throw a runtime error for indirect calls
   if the function table does not exist.
3) Fix existing unit tests by creating a dummy function table.
4) Add new a new test which tests that indirect calls without function
   table cause a validation error.

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

TEST=unittests/AstDecoderTest.IndirectCallsWithoutTableCrash

Review-Url: https://codereview.chromium.org/2484623002
Cr-Commit-Position: refs/heads/master@{#40852}
2016-11-09 08:37:44 +00:00
littledan
5975c47a6a Avoid calling out to JS during stack overflow
If an exception is thrown when there is a Promise being created, the Promise
catch prediction code would call into a part implemented in JavaScript to see if
the Promise has a catch handler. If it is not possible to call back into JS,
e.g., due to a stack overflow, then this would lead to a crash. This patch
"speculates" that, if it's impossible to call back into JavaScript, then the
error is unhandled, avoding the issue. In a future patch, the catch prediction
logic should be entirely written in C++, but this patch adds a minimal fix to
be more friendly to backports.

BUG=chromium:662935
R=jgruber

Review-Url: https://codereview.chromium.org/2487833002
Cr-Commit-Position: refs/heads/master@{#40851}
2016-11-09 07:53:08 +00:00
bradnelson
3f2db58c89 [wasm] [asm.js] Don't allow bad return types from a global constant
We recently allowed global constants in asm.js validated code.
When used in a return statement, these need to be of an allowed type.

BUG=660813
R=jpp@chromium.org,aseemgarg@chromium.org

Review-Url: https://codereview.chromium.org/2481103002
Cr-Commit-Position: refs/heads/master@{#40850}
2016-11-08 23:32:04 +00:00
jkummerow
87332fdf67 [arm] Fix custom addition in MacroAssembler::[Fast]Allocate
Don't rely on carry flags you didn't set yourself.

BUG=chromium:663402

Review-Url: https://codereview.chromium.org/2484283002
Cr-Commit-Position: refs/heads/master@{#40848}
2016-11-08 18:19:30 +00:00
rmcilroy
ba5885cc8b [Interpreter] Ensure ValueOf is only called once for post-increment operations.
BUG=chromium:662418

Review-Url: https://codereview.chromium.org/2473223004
Cr-Commit-Position: refs/heads/master@{#40846}
2016-11-08 17:03:16 +00:00
ahaas
387817f5bb [wasm] Always trap for memory accesses with offset=uint32_max.
We handle this case specially because otherwise we would have to do
complicated overflow detection.

R=titzer@chromium.org
TEST=cctest/test-run-wasm/RunWasmCompiled_LoadMaxUint32Offset

Review-Url: https://codereview.chromium.org/2490533003
Cr-Commit-Position: refs/heads/master@{#40844}
2016-11-08 15:47:20 +00:00
jgruber
0cb3897179 [debugger] Basic scope functionality and exception events in wrapper
BUG=v8:5530

Review-Url: https://codereview.chromium.org/2487673002
Cr-Commit-Position: refs/heads/master@{#40840}
2016-11-08 14:54:10 +00:00
ahaas
9604b06e26 [wasm] Mutable globals cannot be exported
R=titzer@chromium.org, rossberg@chromium.org
TEST=unittests/WasmModuleVerifyTest.ExportMutableGlobal

Review-Url: https://codereview.chromium.org/2481263003
Cr-Commit-Position: refs/heads/master@{#40838}
2016-11-08 14:19:06 +00:00
yangguo
7159662b31 Add spread call micro-benchmarks.
Taken from http://kpdecker.github.io/six-speed/

Review-Url: https://codereview.chromium.org/2467483002
Cr-Commit-Position: refs/heads/master@{#40837}
2016-11-08 14:17:18 +00:00
neis
083e465f3b [compiler] Whenever we want source positions, record that in the CompilationInfo.
With this CL, we set the is_source_positions_enabled flag on CompilationInfo when
- a command line flag is enabled that requires Turbofan to preserve source position
  information (e.g. --trace-deopt), and
- when profiling is enabled.

This also removes the --turbo-source-positions flag.

The goal is to eventually only track source position information when needed.

R=mstarzinger@chromium.org
BUG=v8:5439

Review-Url: https://codereview.chromium.org/2484163003
Cr-Commit-Position: refs/heads/master@{#40836}
2016-11-08 14:02:08 +00:00
jgruber
4d6ff7dfaa [debugger] Stepping and break-related functions in wrapper
This adds clearStepping plus the family of
{set,clear}BreakOn{,Uncaught}Exception functions.

BUG=v8:5530

Review-Url: https://codereview.chromium.org/2482903002
Cr-Commit-Position: refs/heads/master@{#40834}
2016-11-08 13:54:37 +00:00
ulan
984e6aed3e [heap] Remove js call rate heuristic from memory reducer.
This is an experiment to check whether the heuristics is still useful.

BUG=

Review-Url: https://codereview.chromium.org/2482163002
Cr-Commit-Position: refs/heads/master@{#40833}
2016-11-08 13:48:11 +00:00
ahaas
e4bae13309 [wasm] Mutable globals cannot be imported
This fixes another spec tests.

R=rossberg@chromium.org, titzer@chromium.org
TEST=WasmModuleVerifyTest.ImportTable_mutable_global

Review-Url: https://codereview.chromium.org/2484803002
Cr-Commit-Position: refs/heads/master@{#40831}
2016-11-08 13:25:47 +00:00
titzer
68fdaf6dea [wasm] Wrap start function in a JS->WASM wrapper before calling it during initialization.
BUG=v8:5599
R=ahaas@chromium.org

Review-Url: https://codereview.chromium.org/2483193002
Cr-Commit-Position: refs/heads/master@{#40830}
2016-11-08 12:37:09 +00:00
ishell
03a1eb5ad7 [ic] Resurrect access checks for primitive and global proxy receivers.
The access check is generated as a:
- Equality check of an execution-time and a compile-time native contexts
  for primitive receivers.
- Equality check of an execution-time and a compile-time native contexts
  or equality check of a respective security tokens for global proxy receivers.
- No-op for other kinds of receivers.

BUG=v8:5561

Review-Url: https://codereview.chromium.org/2482913002
Cr-Commit-Position: refs/heads/master@{#40829}
2016-11-08 12:35:32 +00:00
jarin
5d89844130 [crankshaft] FIx for in deopt at the end of the loop.
We really should deopt before the for-in index increment.

BUG=chromium:662904

Review-Url: https://codereview.chromium.org/2476423003
Cr-Commit-Position: refs/heads/master@{#40828}
2016-11-08 12:33:56 +00:00
yangguo
a168eb15bc [debugger] do not accidentally pop contexts in bytecode
R=jgruber@chromium.org, mstarzinger@chromium.org
BUG=v8:5610

Review-Url: https://codereview.chromium.org/2482133002
Cr-Commit-Position: refs/heads/master@{#40827}
2016-11-08 12:13:48 +00:00
neis
cc3195abda [modules] Disable Crankshaft for functions referencing module variables.
Also add a primitive mjsunit test that uses such a function optimized by
Turbofan.

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

Review-Url: https://codereview.chromium.org/2472143002
Cr-Commit-Position: refs/heads/master@{#40826}
2016-11-08 11:45:34 +00:00
neis
dd155e47bd [ignition,modules] Introduce bytecodes for loading/storing module variables.
This introduces two new bytecodes LdaModuleVariable and StaModuleVariable,
replacing the corresponding runtime calls.

Support in the bytecode graph builder exists only in the form of runtime calls.

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2471033004
Cr-Commit-Position: refs/heads/master@{#40825}
2016-11-08 11:01:40 +00:00
jgruber
60d60fd716 [debugger] Migrate more debugger tests to inspector
This moves all tests currently working with the inspector debugger wrapper to
test/debugger.

BUG=v8:5530

Review-Url: https://codereview.chromium.org/2480223002
Cr-Commit-Position: refs/heads/master@{#40824}
2016-11-08 10:39:08 +00:00
ahaas
0ab9ecc23a [wasm] Fix a memory leak in test-run-wasm-module.
The memory leak is fixed by calling the GC at the end of the tests. The GC collects the WasmModuleWrapper objects, which deallocates WasmModule c++ object. For the mjsunit tests the GC is already called because of the --invoke_weak_callbacks flag.

BUG=chromium:662388

Review-Url: https://codereview.chromium.org/2476643003
Cr-Commit-Position: refs/heads/master@{#40822}
2016-11-08 10:34:34 +00:00
machenbach
34aec495e9 [test] Isolate files the perf runner depends on
BUG=chromium:616879
NOTRY=true
TBR=mtrofin@chromium.org

Review-Url: https://codereview.chromium.org/2476273003
Cr-Commit-Position: refs/heads/master@{#40821}
2016-11-08 10:25:13 +00:00
gdeepti
625767df91 [wasm] Linear/Exported memory maximum property should be set when maximum is defined.
- When module bytes have a memory maximum defined, compiled module object should set maximum memory
 - Exported memory objects should set maximum value on the memory objects
 - Update tests to use declared maximum values.

R=ahaas@chromium.org

Review-Url: https://codereview.chromium.org/2474333003
Cr-Commit-Position: refs/heads/master@{#40820}
2016-11-08 09:55:27 +00:00
jgruber
5a44be9a25 [debugger] Add entire directory to files in .isolate
Previously, tests in the newly added test/debugger/debug directory were
not executed on CQ.

BUG=v8:5530

Review-Url: https://codereview.chromium.org/2484713002
Cr-Commit-Position: refs/heads/master@{#40819}
2016-11-08 08:48:57 +00:00
bjaideep
e1a57a03b2 [wasm] fix TestInterruptLoop for Big Endian platform
Using Read/WriteLittleEndianValue method to access native
memory. This will perform byte reversal depending on the
endianness of the patform.

Testcase was added in CL: https://codereview.chromium.org/2405293002

R=ahaas@chromium.org, titzer@chromium.org
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2479043003
Cr-Commit-Position: refs/heads/master@{#40815}
2016-11-07 23:26:05 +00:00
jarin
7f801ff35b [crankshaft] Do not optimize argument access if any parameter is context-allocated.
Note: This CL might regress code that relies on such arguments access.
In that case, we could still optimize the access if it accesses at
constant index (and the argument at that index is not context-allocated).

If any code relies on a general access to context-allocated arguments,
we would need to analyze the function for assignment to the arguments - this
might be quite tricky.

BUG=chromium:662845

Review-Url: https://codereview.chromium.org/2484723002
Cr-Commit-Position: refs/heads/master@{#40813}
2016-11-07 19:10:15 +00:00
machenbach
32ec567df1 Revert of [wasm] Indirect calls without function table cause validation errors. (patchset #3 id:40001 of https://codereview.chromium.org/2484623002/ )
Reason for revert:
Speculative revert for blocking roll:
https://codereview.chromium.org/2479233002/

Original issue's description:
> [wasm] Indirect calls without function table cause validation errors.
>
> The spec defines that indirect calls in WebAssembly code should cause a
> validation error if no function table exists.
>
> The CL contains the following changes:
> 1) Throw a validation error for indirect calls if the function table
>    not exist.
> 2) Do not create TF nodes to throw a runtime error for indirect calls
>    if the function table does not exist.
> 3) Fix existing unit tests by creating a dummy function table.
> 4) Add new a new test which tests that indirect calls without function
>    table cause a validation error.
>
> R=rossberg@chromium.org
> CC=titzer@chromium.org
>
> TEST=unittests/AstDecoderTest.IndirectCallsWithoutTableCrash

TBR=rossberg@chromium.org,titzer@chromium.org,ahaas@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/2479283002
Cr-Commit-Position: refs/heads/master@{#40811}
2016-11-07 17:57:54 +00:00
neis
08da5c98cf [compiler] Generalize context load/store operations in code-stub-assembler.
The existing Load/StoreContextElement operations take the index as an int.  This
CL adds versions that take the index as a Node.  These already existed in the
interpreter-assembler, from which they are now removed.

R=mstarzinger@chromium.org, rmcilroy@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2473003004
Cr-Commit-Position: refs/heads/master@{#40810}
2016-11-07 17:42:49 +00:00
neis
21463f73e9 [modules] Maintain array of cells for imports and local exports.
This makes use of the newly introduced cell indices to speed up variable
accesses. Imports and local exports are now directly stored in (separate)
arrays. In the future, we may merge the two arrays into a single one, or
even into the module context.

This CL also replaces the LoadImport and LoadExport runtime functions with
a single LoadVariable taking a variable index as argument (rather than a
name).

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2465283004
Cr-Commit-Position: refs/heads/master@{#40808}
2016-11-07 16:23:47 +00:00
jgruber
39b86ad453 Manually complete failed revert
The revert somehow lost the contents of regress-2825.js.

NOTRY=true
NOPRESUBMIT=true
NOTREECHECKS=true
BUG=chromium:662928

Review URL: https://codereview.chromium.org/2483863002 .

Cr-Commit-Position: refs/heads/master@{#40806}
2016-11-07 15:46:50 +00:00
jgruber
d5948caed5 Revert of [debugger] Migrate more debugger tests to inspector (patchset #2 id:20001 of https://codereview.chromium.org/2480223002/ )
Reason for revert:
http://build.chromium.org/p/client.v8/builders/V8%20Linux%20gcc%204.8/builds/9724

Original issue's description:
> [debugger] Migrate more debugger tests to inspector
>
> This moves all tests currently working with the inspector debugger wrapper to
> test/debugger.
>
> BUG=v8:5530

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

Review-Url: https://codereview.chromium.org/2480283002
Cr-Commit-Position: refs/heads/master@{#40805}
2016-11-07 15:11:46 +00:00
jgruber
9e07e0005d [debugger] Migrate more debugger tests to inspector
This moves all tests currently working with the inspector debugger wrapper to
test/debugger.

BUG=v8:5530

Review-Url: https://codereview.chromium.org/2480223002
Cr-Commit-Position: refs/heads/master@{#40804}
2016-11-07 14:58:59 +00:00
verwaest
32105d214d [parser] Give preparser and parser independent loggers
This
- removes the ParserRecorder base class,
- devirtualizes the LogFunction and LogMessage functions,
- reuses the SingletonLogger for all preparser calls

In a subsequent step the preparser should probably log directly to the CompleteParserRecorder rather than indirectly through the singleton logger...

BUG=

Review-Url: https://codereview.chromium.org/2474393003
Cr-Commit-Position: refs/heads/master@{#40803}
2016-11-07 13:23:23 +00:00
ahaas
3de5204737 [wasm] Indirect calls without function table cause validation errors.
The spec defines that indirect calls in WebAssembly code should cause a
validation error if no function table exists.

The CL contains the following changes:
1) Throw a validation error for indirect calls if the function table
   not exist.
2) Do not create TF nodes to throw a runtime error for indirect calls
   if the function table does not exist.
3) Fix existing unit tests by creating a dummy function table.
4) Add new a new test which tests that indirect calls without function
   table cause a validation error.

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

TEST=unittests/AstDecoderTest.IndirectCallsWithoutTableCrash

Review-Url: https://codereview.chromium.org/2484623002
Cr-Commit-Position: refs/heads/master@{#40802}
2016-11-07 12:37:27 +00:00
ahaas
15d4984b9c [wasm] Compare the maximum memory size with the spec limit, not with the V8 limit
The maximum memory size is a user-defined upper limit for the size of
the memory of a WebAssembly instance. The actual limit is the minimum of
the user-defined limit and the V8 limit. With this CL we allow the
user-defined limit to be greater than the V8 limit, which is required by
the spec.

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

TEST=unittests/WasmModuleVerifyTest.MaxMaximumMemorySize

Review-Url: https://codereview.chromium.org/2484643002
Cr-Commit-Position: refs/heads/master@{#40801}
2016-11-07 12:26:19 +00:00
jgruber
ea48d0942a [debugger] Further stepping support in test wrapper
This CL adds further support to the test wrapper. We are now able to
run almost all mjsunit/debug-step-* tests using the inspector backend.

debug-stepframe-* tests are not yet supported since inspector does not
know a 'frame' step type.

The interface has also been improved to be able to move these tests to
inspector mostly without modification.

BUG=v8:5330

Review-Url: https://codereview.chromium.org/2466273005
Cr-Commit-Position: refs/heads/master@{#40800}
2016-11-07 12:25:24 +00:00
cbruni
072ea0c836 [tests] Change CodeStubAssemblerTester code type to BUILTIN
Drive-by-fix 1: be more precise in machine representations for
AllocateNameDictionary to make --turbo_verify_machine_graph happy.

Drive-by-fix 2: Improve graph verifier output by printing input
representation.

BUG=

Review-Url: https://codereview.chromium.org/2475913002
Cr-Commit-Position: refs/heads/master@{#40797}
2016-11-07 11:03:32 +00:00
cbruni
7344f4f0ff [tests] Enable Object.create JSPerf tests
R=jkummerow@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2461993002
Cr-Commit-Position: refs/heads/master@{#40796}
2016-11-07 11:03:31 +00:00
jgruber
f354558c80 [regexp] Fix a test case for RE.proto[@@search]
The test case did not test anything in its original form. Fix it and add
documentation.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2481733002
Cr-Commit-Position: refs/heads/master@{#40794}
2016-11-07 09:51:40 +00:00
yangguo
acd0c3cf76 [debugger] fix blacklisted tests.
BUG=v8:5581

R=jgruber@chromium.org

Review-Url: https://codereview.chromium.org/2469043003
Cr-Commit-Position: refs/heads/master@{#40793}
2016-11-07 09:43:57 +00:00
bmeurer
a758c19761 [turbofan] Properly rename receiver on CheckHeapObject.
We need to rename the receiver on CheckHeapObject, because we
don't canonicalize numbers in SignedSmall range, and thus we
the representation selection can hand out TaggedSigned values
for receiver uses, even though we checked for TaggedPointerness
first.

Note that this is rather hacky and just intended to fix the bug
ASAP. We need to think about how to deal with representations in
earlier compilation stages.

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

Review-Url: https://codereview.chromium.org/2485563002
Cr-Commit-Position: refs/heads/master@{#40792}
2016-11-07 08:41:34 +00:00
ahaas
3a445b219e Fix typo in test-import-export-wrapper.js
TBR=mtrofin@chromium.org
NOTRY=true

Review-Url: https://codereview.chromium.org/2481133002
Cr-Commit-Position: refs/heads/master@{#40791}
2016-11-07 08:12:13 +00:00
bmeurer
5f120e3801 [test] Drop flaky test mjsunit/compiler/deopt-arguments-oob.
TBR=machenbach@chromium.org
NOTRY=true

Review-Url: https://codereview.chromium.org/2477303002
Cr-Commit-Position: refs/heads/master@{#40790}
2016-11-07 07:39:53 +00:00
bmeurer
d6ff45afad [crankshaft] Fix deoptimization loop w/ non-monomorphic arguments access.
In Crankshaft we unconditionally assume that accesses to arguments[i] will
be in-bounds and don't take into account IC feedback that would eventually
teach us about out-of-bounds accesses that have happened in the past, so
there's no real guard to protect the bounds check in optimized code.

TEST=mjsunit/compiler/deopt-arguments-oob
R=jarin@chromium.org
BUG=v8:5606

Review-Url: https://codereview.chromium.org/2481053002
Cr-Commit-Position: refs/heads/master@{#40787}
2016-11-07 06:39:34 +00:00
kozyatinskiy
f0fb658386 [inspector] added Debugger.getPossibleBreakpoints method
This method iterates through all shared function info which are related to passed script, compiles debug code for SFI in range if needed and returns possible break locations.

BUG=chromium:566801
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2465553003
Cr-Commit-Position: refs/heads/master@{#40783}
2016-11-04 19:59:48 +00:00
vogelheim
3019b49764 Fix memory leak in test-scanner.cc.
BUG=chromium:662388

Review-Url: https://codereview.chromium.org/2468423008
Cr-Commit-Position: refs/heads/master@{#40781}
2016-11-04 18:54:14 +00:00
adamk
010770085b Remove always-true --harmony-restrictive-declarations flag
The flag has been on since at least Chrome 53.

R=littledan@chromium.org

Review-Url: https://codereview.chromium.org/2478883002
Cr-Commit-Position: refs/heads/master@{#40780}
2016-11-04 18:50:41 +00:00
littledan
3a5c693310 Allow the global object to be frozen through the global template
This patch fixes two bugs in V8 to allow the global object to have a frozen proto:
- The immutable prototype map check is done on the map of the "real receiver",
  the one that's found after the hidden prototype traversal, rather than
  the object that SetPrototype is called on.
- The immutable prototype bit from the ObjectTemplate used to instantiate
  the global object, as passed to Context::New, is respected when instantiating
  the global object.

R=adamk
BUG=v8:5149

Review-Url: https://codereview.chromium.org/2474843003
Cr-Commit-Position: refs/heads/master@{#40778}
2016-11-04 18:37:59 +00:00
mstarzinger
0121988134 [compiler] Remove --ignition-preserve-bytecode flag.
This removes the deprecated flag in question which has been enabled by
default a while ago. All components can by now deal with activations of
a single function being mixed between Ignition and other compilers. The
maintenance overhead to support a mode that clears bytecode is no longer
warranted.

R=rmcilroy@chromium.org
BUG=v8:4280

Review-Url: https://codereview.chromium.org/2475203003
Cr-Commit-Position: refs/heads/master@{#40776}
2016-11-04 16:09:01 +00:00
jbroman
39a1c9678e Support structured clone of compiled WebAssembly modules.
Compatible with the current (unshipped) Blink implementation.

BUG=chromium:148757

Review-Url: https://codereview.chromium.org/2471923002
Cr-Commit-Position: refs/heads/master@{#40775}
2016-11-04 15:35:55 +00:00
mstarzinger
9906b3e677 [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/2472413002
Cr-Commit-Position: refs/heads/master@{#40773}
2016-11-04 15:08:12 +00:00
verwaest
4ff2cafe93 Preparse lazy function parameters
Parameters of a lazily parsed function used to be parsed eagerly, and parameter
handling was split between Parser::ParseFunctionLiteral and
ParseEagerFunctionBody, leading to inconsistencies.

After this CL, we preparse (lazy parse) the parameters of lazily parsed
functions.

(For arrow functions, we cannot do that ofc.)

This is needed for later features (PreParser with scope analysis).

-- CL adapted from marja's https://codereview.chromium.org/2411793003/

BUG=

Review-Url: https://codereview.chromium.org/2472063002
Cr-Commit-Position: refs/heads/master@{#40771}
2016-11-04 15:04:29 +00:00
henrique.ferreiro
dfcd545682 Remove the 'caller' property from the strict-mode arguments map
This was removed from ECMAScript in the September 2016 TC39 meeting, see https://github.com/tc39/ecma262/issues/670.

BUG=v8:5535

Review-Url: https://codereview.chromium.org/2430383004
Cr-Commit-Position: refs/heads/master@{#40770}
2016-11-04 14:30:29 +00:00
yangguo
581614eeea [debugger] simplify fetching scripts for inspector.
The old code path is going to be removed with the debug context api.

R=kozyatinskiy@chromium.org

Review-Url: https://codereview.chromium.org/2465833002
Cr-Commit-Position: refs/heads/master@{#40768}
2016-11-04 13:55:26 +00:00
predrag.rudic
586e4a8951 MIPS64: Fix NoBarrierAtomicValue.Construction test failure on big-endian
Reason for the failure is that the test enumeration is 32-bit wide, whereas
AtomicWord is 64-bit wide on 64-bit machines. On 64-big endian, this loads the random four bytes located after the 32-bit value that is tested.

BUG=
TEST=unittests/NoBarrierAtomicValue.Construction

Review-Url: https://codereview.chromium.org/2464703003
Cr-Commit-Position: refs/heads/master@{#40767}
2016-11-04 13:45:12 +00:00
vogelheim
cadcd787cf V8 support for cached accessors.
Some accessors requires little to no computation at all, its result can be
cached in a private property, avoiding the call overhead.
Calls to the getter are translated into a cheap property load.

Follow-on to crrev.com/2347523003, from peterssen@google.com

BUG=chromium:634276, v8:5548

Review-Url: https://codereview.chromium.org/2405213002
Cr-Commit-Position: refs/heads/master@{#40765}
2016-11-04 13:03:18 +00:00
machenbach
9598e6eb84 Revert of [debugger] simplify fetching scripts for inspector. (patchset #6 id:100001 of https://codereview.chromium.org/2465833002/ )
Reason for revert:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/11118

Rule of thumb: As long as the tests have not migrated yet, you most certainly need a blink rebase whenever you change expectations.

Original issue's description:
> [debugger] simplify fetching scripts for inspector.
>
> The old code path is going to be removed with the debug context api.
>
> R=kozyatinskiy@chromium.org

TBR=kozyatinskiy@chromium.org,yangguo@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/2473273005
Cr-Commit-Position: refs/heads/master@{#40764}
2016-11-04 13:00:25 +00:00
yangguo
1dba86339f [test] no longer disable turbofan for serializer tests.
This is no longer necessary. Isolates created for serialization
have optimization disabled anyways.

R=jkummerow@chromium.org

Review-Url: https://codereview.chromium.org/2479823002
Cr-Commit-Position: refs/heads/master@{#40761}
2016-11-04 12:29:41 +00:00
yangguo
7cfdd66afa [debugger] simplify fetching scripts for inspector.
The old code path is going to be removed with the debug context api.

R=kozyatinskiy@chromium.org

Review-Url: https://codereview.chromium.org/2465833002
Cr-Commit-Position: refs/heads/master@{#40759}
2016-11-04 11:07:20 +00:00
ivica.bogosavljevic
4125ba8bbd MIPS64: Port ARM64: [turbofan] Avoid zero-extension after a 32-bit load
Port f07d2cdd6a

Original commit message:
A load instruction will implicitely clear the top 32 bits when writing to a W
register. This patch avoids generating a `mov` instruction to zero-extend the
result in this case.

For example, this occurs in the generated code for dispatching to the next
bytecode in the interpreter:

  kind = BYTECODE_HANDLER
  name = LdaZero
  compiler = turbofan
  Instructions (size = 36)
  0x32e64c60     0  add x19, x19, #0x1 (1)
  0x32e64c64     4  ldrb w0, [x20, x19]
  0x32e64c68     8  mov w0, w0
                    ^^^^^^^^^^
  0x32e64c6c    12  lsl x0, x0, #3
  0x32e64c70    16  ldr x1, [x21, x0]
  0x32e64c74    20  movz x0, #0x0
  0x32e64c78    24  br x1

Review-Url: https://codereview.chromium.org/2469253002
Cr-Commit-Position: refs/heads/master@{#40758}
2016-11-04 10:51:04 +00:00
dcheng
7fede7bb98 Set global proxy internal field count based on the global object template.
BUG=v8:5588
R=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2475433008
Cr-Commit-Position: refs/heads/master@{#40755}
2016-11-04 10:02:36 +00:00
yangguo
62937cf533 [test] Speed up some slow tests.
- split up cctest/test-api/Threading*
- shortened mjsunit/math-floor-part*
- split up cctest/test-serialize/CustomSnapshotDataBlob
- skipped mjsunit/regress/regress-crbug-474297 unless gc-stress
- shortened cctest/test-serialize/CodeSerializerLargeCodeObject

R=jkummerow@chromium.org

Review-Url: https://codereview.chromium.org/2470143004
Cr-Commit-Position: refs/heads/master@{#40753}
2016-11-04 09:04:28 +00:00
yangguo
c20f27a254 Add inspector tests to default tests to run locally.
R=machenbach@chromium.org

Review-Url: https://codereview.chromium.org/2474863002
Cr-Commit-Position: refs/heads/master@{#40751}
2016-11-04 08:50:07 +00:00
machenbach
8108a294a7 [test] Fix space in test expectation
BUG=v8:5598
TBR=adamk@chromium.org
NOTRY=true

Review-Url: https://codereview.chromium.org/2479793003
Cr-Commit-Position: refs/heads/master@{#40750}
2016-11-04 08:42:30 +00:00
adamk
288d9ffd95 Skip flaky test-api/SetJitCodeEventHandler on turbofan_opt/no_snap builds
R=machenbach@chromium.org
BUG=v8:5457
NOTRY=true
NOTREECHECKS=true

Review-Url: https://codereview.chromium.org/2471113004
Cr-Commit-Position: refs/heads/master@{#40747}
2016-11-04 07:26:21 +00:00
caitp
cbadac5528 [builtins] fix Allocate() call in ReduceStringIterator()
Use a NumberConstant op rather than an Int32Constant to make assertions in
v8::internal::compiler::EscapeAnalysis::ProcessAllocation() happy.

BUG=v8:5598
R=bmeurer@chromium.org, franzih@chromium.org

Review-Url: https://codereview.chromium.org/2478643002
Cr-Commit-Position: refs/heads/master@{#40746}
2016-11-04 05:45:15 +00:00
franzih
0f7ea219f0 [compiler] Delete extra map check.
Use HeapConstant for string_iterator_map rather than loading it
manually. This avoids unnecessary map checks.

BUG= v8:3822,v8:5267

Review-Url: https://codereview.chromium.org/2479563003
Cr-Commit-Position: refs/heads/master@{#40741}
2016-11-03 21:25:59 +00:00
ulan
3c96c5e232 Revert of [heap] Add a guard for restarting the memory reducer after mark-compact. (patchset #1 id:1 of https://chromiumcodereview.appspot.com/2433933005/ )
Reason for revert:
Speculative revert to see impact on crbug.com/659531

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

TBR=hpayer@chromium.org,davidroutier17@gmail.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=

Review-Url: https://codereview.chromium.org/2472053003
Cr-Commit-Position: refs/heads/master@{#40737}
2016-11-03 17:27:04 +00:00
heimbuef
495354ffda Used ZoneChunkList in deoptimizer to conserve memory.
Exchanged the ZoneList for a ZoneChunkList to avoid
unnecessary growing.

Review-Url: https://codereview.chromium.org/2468183004
Cr-Commit-Position: refs/heads/master@{#40736}
2016-11-03 17:16:21 +00:00
mstarzinger
e637154b8a [wasm] Fix compiled-module-management lifetime issues.
This makes sure the test in question does not rely on specific lifetime
characteristics for local variables within a function. Note that these
lifetimes are not specified by JavaScript and are not observable within
JavaScript proper. The natives syntax however makes it observable.

BUG=v8:5345
TEST=mjsunit/wasm/compiled-module-management
R=mtrofin@chromium.org

Review-Url: https://codereview.chromium.org/2474053002
Cr-Commit-Position: refs/heads/master@{#40733}
2016-11-03 15:53:56 +00:00
ahaas
7f58be6b38 [wasm] Store the function_index directly in the js-to-wasm wrapper.
If a WebAssembly function is exported, its js-to-wasm wrapper has a
field which contains a reference to the WebAssembly function.
Originally this reference was an index into the export table, which
then contains an index into the function table, which then contains
the metadata of the WebAssembly function.

With this CL we use the index into the function table directly as
the reference to the WebAssembly function.

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

Review-Url: https://codereview.chromium.org/2472103002
Cr-Commit-Position: refs/heads/master@{#40729}
2016-11-03 14:28:37 +00:00
danno
2445a502dd [stubs] Add a utility class to generate code to access builtin arguments
With an instance of CodeStubArguments, builtin stub generators can generate code
that accesses the receiver passed to the builtin, as well as access and iterate
over the variable number of arguments that are passed in.

Review-Url: https://codereview.chromium.org/2469273003
Cr-Commit-Position: refs/heads/master@{#40726}
2016-11-03 12:53:47 +00:00
rmcilroy
5bbc5e8eb7 [Tests] Remove skips from tests which no longer timeout on Ignition + Msan.
BUG=v8:4680

Review-Url: https://codereview.chromium.org/2467223005
Cr-Commit-Position: refs/heads/master@{#40724}
2016-11-03 12:42:45 +00:00
bmeurer
10033749fd [turbofan] CheckBounds cannot be used within asm.js.
Also properly deal with constant indices for String element access in
the JSNativeContextSpecialization.

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

Review-Url: https://codereview.chromium.org/2474013002
Cr-Commit-Position: refs/heads/master@{#40723}
2016-11-03 12:35:04 +00:00
predrag.rudic
f04a9b4936 Fix 'MIPS: Fix Utf16CharacterStream scanner crash due to missaligned access'
Removed a wrong condition test in  TwoByteExternalBufferedStream. This changed fixes errors that may occur under some conditions.

Review-Url: https://codereview.chromium.org/2469723002
Cr-Commit-Position: refs/heads/master@{#40722}
2016-11-03 12:32:16 +00:00
ulan
e7aa6f91b3 [heap] Exclude the owner of the linear allocation area from evacuation.
This ensures that incremental marking step does not change the top and limit
pointers of the old space, which is needed for allocation folding.

For more info see:
https://bugs.chromium.org/p/chromium/issues/detail?id=659165#c13

BUG=chromium:659165

Review-Url: https://codereview.chromium.org/2469273002
Cr-Commit-Position: refs/heads/master@{#40720}
2016-11-03 12:13:23 +00:00
rmcilroy
c887113d93 [Tests] Fix some concurrent optimization tests on Ignition.
BUG=v8:4680

Review-Url: https://codereview.chromium.org/2467223004
Cr-Commit-Position: refs/heads/master@{#40718}
2016-11-03 11:00:45 +00:00
mstarzinger
b02e7fb86e [turbofan] Disable usage of {maybe_assigned} variable flag.
This disables the usage of the {maybe_assigned} flag that the variable
resolution computes for each variable on non-asm.js code. Note that the
analysis is fundamentally broken for destructuring and top-level lexical
variables. Also note that this still uses the analysis for asm.js code
even though it is not validated. One can still trigger the bug by using
invalid constructs within a function marked with "use asm". The fix is
intentionally minimal so that it can be merged to release branches.

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

Review-Url: https://codereview.chromium.org/2471523005
Cr-Commit-Position: refs/heads/master@{#40716}
2016-11-03 10:24:06 +00:00
verwaest
4fa2ebcbe0 Turn Scope::locals_ into a ThreadedList
This turns the ZoneList with minimum 6 words overhead into a linked list through variables, using 2 words for the empty list. Additionally the average number of pointers per entry goes down to the optimal 1 per variable that's in a list.

This does introduce 1 pointer unnecessary overhead for dynamic variables. If that becomes a problem we could distinguish between variables in lists and variables not in lists. We can distinguish them at construction-time.

BUG=v8:5209

Review-Url: https://codereview.chromium.org/2475433002
Cr-Commit-Position: refs/heads/master@{#40714}
2016-11-03 10:07:12 +00:00
danno
4447405b17 [builtins]: Uniformly push argument count in TF-generated builtins
Review-Url: https://codereview.chromium.org/2467513002
Cr-Commit-Position: refs/heads/master@{#40712}
2016-11-03 08:37:01 +00:00
ahaas
a3b77d560e [wasm] Fix br_table in the wasm interpreter to use varuint32.
The wasm interpreter crashed because it interpreted the table of
br_table as a table of uint8, but according to the spec it is a table of
varint32. Therefore the wasm interpreter misinterpreted 0x80 0x00 as 128
and not as 0, which caused a crash.

R=tizer@chromium.org
BUG=chromium:660262
TEST=cctest/test-run-wasm/RunWasmInterpreted_Regression_660262

Review-Url: https://codereview.chromium.org/2463063002
Cr-Commit-Position: refs/heads/master@{#40708}
2016-11-02 17:07:00 +00:00
rmcilroy
0fbf7243c6 [Interpreter] Remove skips from mjsunit tests which now pass.
BUG=v8:4680

Review-Url: https://codereview.chromium.org/2469283002
Cr-Commit-Position: refs/heads/master@{#40706}
2016-11-02 14:47:11 +00:00
jochen
bf77741d43 Reland "Create internal fields on global proxy objects"
Original CL description:
> Create internal fields on global proxy objects
>
> BUG=v8:5588
> R=verwaest@chromium.org

BUG=v8:5588
TBR=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2472573004
Cr-Commit-Position: refs/heads/master@{#40705}
2016-11-02 14:40:31 +00:00
verwaest
5a18685e08 Thread decls-list through Declaration using a ThreadedList
This reduces per-scope overhead from minimally 6 words to 2 words, with one additional pointer per entry, rather than an average of 2 per entry for larger-than-4 element lists. For temp zone parsed functions it additionally makes the declaration-list actually freeable.

This introduces ThreadedList to implement the details of dealing with such a list.

BUG=v8:5209

Review-Url: https://codereview.chromium.org/2457393003
Cr-Commit-Position: refs/heads/master@{#40703}
2016-11-02 14:08:47 +00:00
littledan
baf0ec31ec Allow immutable prototype templates to inherit
To enable the global object prototype chain to be frozen, all objects
in the chain need to be marked as immutable prototype exotic objects.
However, a bug in the previous implementation of immutable prototype
exotic objects left the check in place when initially setting up the
object, which made it impossible to allow inheritance chains. This
patch removes that mistaken check.

BUG=v8:5149

Review-Url: https://codereview.chromium.org/2449163004
Cr-Commit-Position: refs/heads/master@{#40702}
2016-11-02 13:59:25 +00:00
jkummerow
5ce9760672 Revert of [ic] Experiment: disable map-specific handler cache. (patchset #1 id:1 of https://codereview.chromium.org/2462973003/ )
Reason for revert:
Causes performance regressions (up to 10% on the "IC" bucket). :-(

Original issue's description:
> [ic] Experiment: disable map-specific handler cache.
>
> IC data handlers support most of the hot cases nowdays. Let's see if
> the map-specific code cache still help us to improve things.
>
> BUG=v8:5561

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

Review-Url: https://codereview.chromium.org/2474653002
Cr-Commit-Position: refs/heads/master@{#40701}
2016-11-02 13:50:06 +00:00
danno
9e2fd36c3b [stubs]: Support 1->2 byte copies in CopyStringCharacters
In the process, add a more general mechanism for passing around
and amending list of CodeStubAssembler Variables. That change
makes it possible to more easily add Variables to loops that are
generated by utility functions, e.g. BuildFastLoop.

LOG=N

Review-Url: https://codereview.chromium.org/2461363002
Cr-Commit-Position: refs/heads/master@{#40700}
2016-11-02 13:19:27 +00:00
danno
fe552636be [turbofan] Support variable size argument removal in TF-generated functions
This is preparation for using TF to create builtins that handle variable number of
arguments and have to remove these arguments dynamically from the stack upon
return.

The gist of the changes:
- Added a second argument to the Return node which specifies the number of stack
  slots to pop upon return in addition to those specified by the Linkage of the
  compiled function.
- Removed Tail -> Non-Tail fallback in the instruction selector. Since TF now should
  handles all tail-call cases except where the return value type differs, this fallback
  was not really useful and in fact caused unexpected behavior with variable
  sized argument popping, since it wasn't possible to materialize a Return node
  with the right pop count from the TailCall without additional context.
- Modified existing Return generation to pass a constant zero as the additional
  pop argument since the variable pop functionality

LOG=N

Review-Url: https://codereview.chromium.org/2446543002
Cr-Commit-Position: refs/heads/master@{#40699}
2016-11-02 13:15:57 +00:00
rmcilroy
ea5d4c1525 [Interpreter] Remove unused --ignition-eager flag.
BUG=v8:4280

Review-Url: https://codereview.chromium.org/2463353002
Cr-Commit-Position: refs/heads/master@{#40697}
2016-11-02 11:17:48 +00:00
bmeurer
3f3bacc319 [turbofan] Assign proper types to Parameter nodes.
R=epertoso@chromium.org

Review-Url: https://codereview.chromium.org/2223873002
Cr-Commit-Position: refs/heads/master@{#40695}
2016-11-02 09:34:08 +00:00
neis
24b1c1abfc [modules] Add namespace import snippet to test-bytecode-generator.
R=rmcilroy@chromium.org
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2460403002
Cr-Commit-Position: refs/heads/master@{#40694}
2016-11-02 09:30:42 +00:00
machenbach
c61902e072 Revert of [turbofan] Support variable size argument popping in TF-generated functions (patchset #13 id:240001 of https://codereview.chromium.org/2446543002/ )
Reason for revert:
Seems to break arm64 sim debug and blocks roll:
https://build.chromium.org/p/client.v8.ports/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20debug/builds/3294

Original issue's description:
> [turbofan] Support variable size argument removal in TF-generated functions
>
> This is preparation for using TF to create builtins that handle variable number of
> arguments and have to remove these arguments dynamically from the stack upon
> return.
>
> The gist of the changes:
> - Added a second argument to the Return node which specifies the number of stack
>   slots to pop upon return in addition to those specified by the Linkage of the
>   compiled function.
> - Removed Tail -> Non-Tail fallback in the instruction selector. Since TF now should
>   handles all tail-call cases except where the return value type differs, this fallback
>   was not really useful and in fact caused unexpected behavior with variable
>   sized argument popping, since it wasn't possible to materialize a Return node
>   with the right pop count from the TailCall without additional context.
> - Modified existing Return generation to pass a constant zero as the additional
>   pop argument since the variable pop functionality
>
> LOG=N

TBR=bmeurer@chromium.org,mstarzinger@chromium.org,epertoso@chromium.org,danno@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2473643002
Cr-Commit-Position: refs/heads/master@{#40691}
2016-11-02 07:49:17 +00:00
kozyatinskiy
d5055bc932 Roll third_party/inspector_protocol to cf45a6e89b17cdc9eeacdef4c003fcc55f7ec2a0
This roll includes one change: "[inspector_protocol] support fall through and moveable Maybe" [1].

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

BUG=none
R=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2469063002
Cr-Commit-Position: refs/heads/master@{#40687}
2016-11-01 22:33:39 +00:00
machenbach
b19abf5371 Revert "Create internal fields on global proxy objects"
This reverts commit 26547761ef.

Breaks layout tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/bui...

See also:
https://github.com/v8/v8/wiki/Blink-layout-tests

BUG=v8:5588
TBR=jochen@chromium.org, verwaest@chromium.org, hablich@chromium.org

Review-Url: https://codereview.chromium.org/2467073002
Cr-Commit-Position: refs/heads/master@{#40686}
2016-11-01 20:40:09 +00:00
ishell
a52ffd44fd [ic] Experiment: disable map-specific handler cache.
IC data handlers support most of the hot cases nowdays. Let's see if
the map-specific code cache still help us to improve things.

BUG=v8:5561

Review-Url: https://codereview.chromium.org/2462973003
Cr-Commit-Position: refs/heads/master@{#40685}
2016-11-01 11:18:36 +00:00
adamk
a1381990a7 Remove --harmony-* flags for new Object static methods
Both --harmony-object-values-entries and --harmony-object-own-property-descriptors
are on by default in v8 5.4, which has now shipped to
stable as Chrome 54.

R=caitp@igalia.com

Review-Url: https://codereview.chromium.org/2464733003
Cr-Commit-Position: refs/heads/master@{#40683}
2016-10-31 22:53:35 +00:00
lpy
9c78194343 [Tracing] Remove unused excluded categories list.
We only need included categories list, excluded categories list will only work
if we use regular expression in categories list, which is not supported in V8.

TBR=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2462143002
Cr-Commit-Position: refs/heads/master@{#40681}
2016-10-31 19:45:20 +00:00
ahaas
da90034e02 [wasm] Do not run the infinite loop test if FLAG_dump_wasm_module is true
By not dumping the module of the test, we avoid adding code of an
infinite loop to the corpus of the wasm fuzzer.

R=bradnelson@chromium.org

NOTRY=true

Review-Url: https://codereview.chromium.org/2460313002
Cr-Commit-Position: refs/heads/master@{#40680}
2016-10-31 17:56:37 +00:00
danno
5319b50c85 [turbofan] Support variable size argument removal in TF-generated functions
This is preparation for using TF to create builtins that handle variable number of
arguments and have to remove these arguments dynamically from the stack upon
return.

The gist of the changes:
- Added a second argument to the Return node which specifies the number of stack
  slots to pop upon return in addition to those specified by the Linkage of the
  compiled function.
- Removed Tail -> Non-Tail fallback in the instruction selector. Since TF now should
  handles all tail-call cases except where the return value type differs, this fallback
  was not really useful and in fact caused unexpected behavior with variable
  sized argument popping, since it wasn't possible to materialize a Return node
  with the right pop count from the TailCall without additional context.
- Modified existing Return generation to pass a constant zero as the additional
  pop argument since the variable pop functionality

LOG=N

Review-Url: https://codereview.chromium.org/2446543002
Cr-Commit-Position: refs/heads/master@{#40678}
2016-10-31 16:54:24 +00:00
jgravelle
fb96618ee0 Add Shell::PrintErr and expose it in the d8 shell as printErr
This function is implemented in other JavaScript shells

BUG=None

R=titzer

Review-Url: https://codereview.chromium.org/2458963003
Cr-Commit-Position: refs/heads/master@{#40677}
2016-10-31 16:40:33 +00:00
jbroman
fa33489ffd Remove DCHECK that transferred array buffers are neutered or shared.
While this seems like it should be true, the array buffer is not actually
neutered until the end of cloning. This is so that, if an exception is thrown
during serialization, the original array buffer is not left neutered. As a
result, Blink will not have neutered the buffer.

This fixes some DCHECK failures during layout tests.

BUG=chromium:148757

Review-Url: https://codereview.chromium.org/2466563002
Cr-Commit-Position: refs/heads/master@{#40675}
2016-10-31 15:23:30 +00:00
jgruber
16310b2e39 [debugger] Ensure debug listeners do not throw
This exposes a couple of broken tests that used to silently throw within
the listener. Mark these as failing for now

BUG=v8:5330, v8:5581

Review-Url: https://codereview.chromium.org/2460833002
Cr-Commit-Position: refs/heads/master@{#40672}
2016-10-31 14:56:44 +00:00
jochen
26547761ef Create internal fields on global proxy objects
BUG=v8:5588
R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2467463002
Cr-Commit-Position: refs/heads/master@{#40670}
2016-10-31 14:16:24 +00:00
neis
6442156635 [test] Skip the debug-liveedit-double-call mjsunit test.
It's marked as [PASS, FAIL] but keeps showing up as a test failure for me.

R=mstarzinger@chromium.org
BUG=v8:5587

Review-Url: https://codereview.chromium.org/2461343002
Cr-Commit-Position: refs/heads/master@{#40668}
2016-10-31 12:22:33 +00:00
ahaas
c4119758d8 [wasm] Use correct parameter type in wasm-run-utils.h
Due to a typo wasm-run-utils used the type of the first parameter for
all parameters. This caused problems if not all parameters had the same
type.

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

Review-Url: https://codereview.chromium.org/2463743002
Cr-Commit-Position: refs/heads/master@{#40667}
2016-10-31 10:51:51 +00:00
mstarzinger
b4b436de6a [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.

patch from issue 2427953002 at patchset 120001 (http://crrev.com/2427953002#ps120001)

R=mvstanton@chromium.org,rmcilroy@chromium.org

Review-Url: https://codereview.chromium.org/2453973004
Cr-Commit-Position: refs/heads/master@{#40663}
2016-10-31 09:43:43 +00:00
bmeurer
7201bad99d [turbofan] Properly deal with out-of-bounds fields in EscapeAnalysis.
Conflicting type feedback on Load/StoreICs can lead to out-of-bounds
field access, which is essentially dead code, but EscapeAnalysis was
confused about those. For now, mark the objects as escaping in these
cases, middle-term we want to deal better with this kind of compile-
time known dead code.

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

Review-Url: https://codereview.chromium.org/2459273002
Cr-Commit-Position: refs/heads/master@{#40662}
2016-10-31 06:43:25 +00:00
titzer
b7aff1ff64 [wasm] Support for restricted table imports.
This CL implements basic table import functionality.

Missing: growing of tables (WebAssembly.Grow) doesn't change dispatch tables
Missing: allowing larger table imports than minimum size

R=rossberg@chromium.org,bradnelson@chromium.org
BUG=v8:5507

Review-Url: https://codereview.chromium.org/2454503005
Cr-Commit-Position: refs/heads/master@{#40661}
2016-10-29 21:07:38 +00:00
kozyatinskiy
f7f591ab6b [inspector] migrate scriptParsed and getCompiledScripts to native
* Introduced DebugInterface::Script - native wrapper on internal::Script.
* Migrated getCompildScripts and scriptParsed to native wrapper.

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://codereview.chromium.org/2449213002
Cr-Commit-Position: refs/heads/master@{#40660}
2016-10-29 02:18:16 +00:00
alph
aee3542fcf [profiler] Emit runtime call stats into sampling profile
These are added to the sampler stack trace when RCS are
enabled.
Resource name for a RCS frame is reported as "V8Runtime".
Counter names match ones from src/counters.h

BUG=chromium:660428

Review-Url: https://codereview.chromium.org/2461003002
Cr-Commit-Position: refs/heads/master@{#40658}
2016-10-28 20:18:12 +00:00
machenbach
9b25707b2a [test] Fix a few flag configurations to make fuzzer happy.
BUG=chromium:660457
TBR=mbarbella@chromium.org, yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2464453002
Cr-Commit-Position: refs/heads/master@{#40657}
2016-10-28 20:14:13 +00:00
machenbach
bc0ee727df Revert of [wasm] Support for restricted table imports. (patchset #7 id:120001 of https://codereview.chromium.org/2454503005/ )
Reason for revert:
GC stress failures:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/builds/8857

Original issue's description:
> [wasm] Support for restricted table imports.
>
> This CL implements basic table import functionality.
>
> Missing: growing of tables (WebAssembly.Grow) doesn't change dispatch tables
> Missing: allowing larger table imports than minimum size
>
> R=rossberg@chromium.org,bradnelson@chromium.org
> BUG=v8:5507

TBR=bradnelson@chromium.org,rossberg@chromium.org,titzer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5507

Review-Url: https://codereview.chromium.org/2456193006
Cr-Commit-Position: refs/heads/master@{#40656}
2016-10-28 18:58:54 +00:00
eholk
96d12ac6dd [wasm] make WebAssembly.Instance require a WebAssembly.Memory
BUG=

Review-Url: https://codereview.chromium.org/2460773003
Cr-Commit-Position: refs/heads/master@{#40654}
2016-10-28 18:13:28 +00:00
titzer
404e215458 [wasm] Support for restricted table imports.
This CL implements basic table import functionality.

Missing: growing of tables (WebAssembly.Grow) doesn't change dispatch tables
Missing: allowing larger table imports than minimum size

R=rossberg@chromium.org,bradnelson@chromium.org
BUG=v8:5507

Review-Url: https://codereview.chromium.org/2454503005
Cr-Commit-Position: refs/heads/master@{#40652}
2016-10-28 18:03:50 +00:00
ulan
e12f9a113a [heap] Do not wait for marking deque uncommit task on tear down.
Cancelable task already guarantees proper waiting.

BUG=

Review-Url: https://codereview.chromium.org/2462553002
Cr-Commit-Position: refs/heads/master@{#40647}
2016-10-28 13:53:00 +00:00
ahaas
aff3ef2108 [wasm] Start function must not have a return value.
R=titzer@chromium.org
TEST=mjsunit/wasm/start-function

Review-Url: https://codereview.chromium.org/2458983002
Cr-Commit-Position: refs/heads/master@{#40646}
2016-10-28 13:36:03 +00:00
leszeks
d2caa302a7 [ignition] Add bytecodes for loads/stores in the current context
The majority of context slot accesses are to the local context (current context
register and depth 0), so this adds bytecodes to optimise for that case.

This cuts down bytecode size by roughly 1% (measured on Octane and Top25).

Review-Url: https://codereview.chromium.org/2459513002
Cr-Commit-Position: refs/heads/master@{#40641}
2016-10-28 10:11:06 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
ahaas
1fe7a91751 [wasm] Fix memory leak in wasm-module-runner.cc
BUG=chromium:658057
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2446593002
Cr-Commit-Position: refs/heads/master@{#40586}
2016-10-26 12:08:50 +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
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
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
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
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
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
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
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
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
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
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