Commit Graph

24282 Commits

Author SHA1 Message Date
cbruni
6dd16e8eb1 [left-trimming] Avoid creating duplicate handles in builtins.cc
EnsureJSArrayWithWritableFastElements

Having several handles pointing to the backing store of an array that gets
left-trimmed might cause the gc to start marking a stale-handle still pointing
to the old backing-store start. By introducing a separate handle scope for
EnsureJSArrayWithWritableFastElements we avoid this issue. Additionally a
SLOW_DCHECK in Heap::LeftTrimFixedArray ensurse that there are no more than one
active handle pointing to the backing store.

BUG=chr:585787
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34022}
2016-02-16 09:51:09 +00:00
hpayer
b6a86e7725 [heap] Refactor FreeListCategory.
BUG=chromium:587026
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34021}
2016-02-16 09:49:43 +00:00
mstarzinger
aa31ff31a8 [turbofan] Remove support for LazyBailout operators.
The LazyBailout operator (modelled as a nop-call) was introduced for
placing a deoptimization point into exception handlers. Now that we are
no longer re-entering lazy deoptimized code, the support can be removed.

R=jarin@chromium.org
BUG=v8:4195
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34020}
2016-02-16 09:48:57 +00:00
bmeurer
d057adc83e Revert of [turbofan] Combine GenericLoweringPhase and ChangeLoweringPhase. (patchset #1 id:1 of https://codereview.chromium.org/1697133002/ )
Reason for revert:
Seems to tank stuff.

Original issue's description:
> [turbofan] Combine GenericLoweringPhase and ChangeLoweringPhase.
>
> There's no need to use a dedicated ChangeLoweringPhase before we go to
> GenericLoweringPhase; instead that change lowering (which is really
> simplified lowering by now) should run together with generic lowering.
>
> R=jarin@chromium.org
>
> Committed: https://crrev.com/0835ed9caf44427755065eb45f9187678ec9844c
> Cr-Commit-Position: refs/heads/master@{#34008}

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

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

Cr-Commit-Position: refs/heads/master@{#34019}
2016-02-16 08:25:38 +00:00
verwaest
77751e93a6 [runtime] Avoid prefix PrepareForDataProperty in TransitionToDataProperty
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34018}
2016-02-16 08:21:36 +00:00
rmcilroy
84a225d1e4 [Turbofan] Save and restore lr in OutOfLineRecordWrite when frame is elided.
Fixes a bug in Ignition on Arm64 where lr gets trashed in StaContextSlot
which causes the stack walker to get confused and crash.

BUG=v8:4680
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34016}
2016-02-16 07:49:16 +00:00
bmeurer
242404923d [crankshaft] Remove the global arguments object from the HGraph.
This was actually only necessary for dealing with %_Arguments and
%_ArgumentsLength in Crankshaft, which have been removed recently,
so there's no need to keep this piece of awesomeness around any
longer.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34015}
2016-02-16 07:30:41 +00:00
danno
fd8fd05cc5 [turbofan] Add an operator to access the parent frame pointer
This functionality is useful for stubs that need to walk the stack. The new
machine operator, LoadParentFramePointer dosn't force the currently compiling
method to have a frame in contrast to LoadFramePointer. Instead, it adapts
accordingly when frame elision is possible, making efficient stack walks
possible without incurring a performance penalty for small stubs that can
benefit from frame elision.

R=bmeurer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34014}
2016-02-16 07:29:16 +00:00
verwaest
d99cbb7a74 [runtime] Turn MigrateFastTo* into static helpers
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34013}
2016-02-16 05:57:26 +00:00
zhengxing.li
b8162581bd X87: [compiler] Sanitize entry points to LookupSlot access.
port 4ff159bd28be36a39a1f8416cdf8fccafd3c2f95(r33880)

  original commit message:
  Add dedicated %LoadLookupSlot, %LoadLookupSlotInsideTypeof,
  %LoadLookupSlotForCall, %StoreLookupSlot_Sloppy and
  %StoreLookupSlot_Strict runtime entry points and use them
  appropriately in the various compilers. This way we can
  finally drop the machine operators from the JS graph level
  completely in TurboFan.

  Also drop the funky JSLoadDynamic operator from TurboFan,
  which was by now just a small wrapper around the runtime
  call to %LoadLookupSlot.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34012}
2016-02-16 05:06:59 +00:00
zhengxing.li
8c3a00ad43 X87: [Interpreter] Make InterpreterAssembler a subclass of CodeStubAssembler.
port d1c28849c77892ec74e58891aba44d5bfda8c0ba(r33873)

  original commit message:
  Moves InterpreterAssembler out of the compiler directory and into the
  interpreter directory. Makes InterpreterAssembler as subclass of
  CodeStubAssembler.

  As part of this change, the special bytecode dispatch linkage type
  is removed and instead we use a InterfaceDispatchDescriptor and
  a normal CodeStub linkage type.

  Removes a bunch of duplicated logic in InterpreterAssembler and
  instead uses the CodeStubAssembler logic. Refactors Interpreter
  with these changes.

  Modifies CodeStubAssembler to add the extra operations required
  by the Interpreter (extra call types, raw memory access and some extra
  binary ops). Also adds the ability for subclasses to add extra
  prologue and epilogue operations around calls, which is required
  for the Interpreter.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34011}
2016-02-16 04:52:12 +00:00
bradnelson
a26d0ac676 Add command line flags to dump asm.js -> wasm conversion data.
BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=manual
R=titzer@chromium.org,aseemgarg@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34009}
2016-02-16 03:03:22 +00:00
bmeurer
0835ed9caf [turbofan] Combine GenericLoweringPhase and ChangeLoweringPhase.
There's no need to use a dedicated ChangeLoweringPhase before we go to
GenericLoweringPhase; instead that change lowering (which is really
simplified lowering by now) should run together with generic lowering.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34008}
2016-02-15 19:16:50 +00:00
verwaest
8a286ecee2 [runtime] Optimize MigrateFastToFast for the transition case
This avoids quite expensive computation further downstream.

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

Cr-Commit-Position: refs/heads/master@{#34007}
2016-02-15 19:03:08 +00:00
mbrandy
5ca122a120 PPC: Support immediate indices for StoreWriteBarrier.
Port 4eff883bce
     c72b49bddc

Original commit message:
    Ideally we would not need the StoreWriteBarrier instructions at all,
    but represent the RecordWrite functionality as machine subgraph, but
    that'll take some time to get there. In the mean time we can have a
    shorter instruction sequence by recognizing immediate indices here.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34006}
2016-02-15 19:01:02 +00:00
mbrandy
ea08453c7f PPC: [runtime] Turn ArgumentAccessStub into FastNewSloppyArgumentsStub.
Port e0129d0f87

Original commit message:
    Turn the fast case of ArgumentsAccessStub into a new stub
    FastNewSloppyArgumentsStub, which is similar to the existing
    FastNewStrictArgumentsStub, although not polished yet, and the slow
    case always went to the runtime anyway, so we can just directly emit
    a runtime call there.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34005}
2016-02-15 19:00:12 +00:00
mbrandy
dd23044a60 PPC: [crankshaft] Fix Math.min(0, 0)
Port 0d59772b2b

Original commit message:
    for the special case where the same register is used as both left and
    right input.

R=jkummerow@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34004}
2016-02-15 18:58:47 +00:00
balazs.kilvady
3b980234c8 MIPS64: Fix '[runtime] Introduce FastNewStrictArgumentsStub to optimize strict arguments.'
Port 09d8453547

Original commit message:
The FastNewStrictArgumentsStub is very similar to the recently added
FastNewRestParameterStub, it's actually almost a copy of it, except that
it doesn't have the fast case we have for the empty rest parameter. This
patch improves strict arguments in TurboFan and fullcodegen by up to 10x
compared to the previous version.

Also introduce proper JSSloppyArgumentsObject and JSStrictArgumentsObject
for the in-object properties instead of having them as constants in the
Heap class.

Drive-by-fix: Use this stub and the FastNewRestParameterStub in the
interpreter to avoid the runtime call overhead for strict arguments
and rest parameter creation.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34003}
2016-02-15 17:30:59 +00:00
cbruni
8eb09facb5 [counters] adding more counters and trace-events
V8 tracks already most useful information, but lacks proper tracing scopes
that make it possible to distinguish certain events from each other.
- add trace-scope to track lazy-parsing due to optimization
- add trace-scope to track code optimization

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34002}
2016-02-15 17:29:32 +00:00
bmeurer
86d1b7e83d [turbofan] Robustify the GraphTrimmer.
The GraphTrimmer should not ever see a dead node, except for the roots
that are explicitly fed into it. To defend against this, turn the
condition into a DCHECK.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34001}
2016-02-15 17:28:46 +00:00
bmeurer
73eae4c26a [turbofan] Make pipeline.h independent of compiler.h.
Eventually compiler.h might need to depend on the Pipeline to manage its
life cycle for concurrent recompilation, so we should not have the
cyclic include dependency here.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34000}
2016-02-15 17:27:21 +00:00
titzer
3a0377a48d [wasm] Clean up handling of function names.
R=ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33999}
2016-02-15 16:00:19 +00:00
jkummerow
5aa2cb3bcc [crankshaft] Replace stub cache harvesting with a bit of type propagation
Harvesting maps from the stub cache for megamorphic ICs is both slow
(linear in the size of the stub cache) and imprecise (as it finds all
maps that have a cached handler for the given property name).
In the canonical megamorphic situation, this type feedback is useless
anyway. The interesting case is when we can filter it down to a single
map; however in these cases it is often possible to derive this map
just by looking at the HGraph, which is both faster and more reliable.

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

Cr-Commit-Position: refs/heads/master@{#33998}
2016-02-15 15:22:00 +00:00
jkummerow
0d59772b2b [crankshaft][arm][mips][mips64] Fix Math.min(0, 0)
for the special case where the same register is used as both left and
right input.

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

Cr-Commit-Position: refs/heads/master@{#33996}
2016-02-15 14:43:02 +00:00
verwaest
4c41d007d9 [runtime] Add fast path to update LookupIterator in simple cases
By not calling ReloadPropertyInformation, we avoid expensive descriptor array lookup.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33995}
2016-02-15 14:14:25 +00:00
jacob.bramley
c72b49bddc [arm] Allow immediate-index write barriers.
This is effectively a port of 4eff883b (r27731).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33994}
2016-02-15 13:46:30 +00:00
titzer
e2f3003f2c [turbofan] Enforce that C calls do not use floating point params.
Passing floating point params to/from C has never quite worked correctly,
but we've never enforced the restriction early in the CallDescriptor
creation process because of unittests. Fix unittests to make their own
simple call descriptors and not rely on the C ones.

R=bmeurer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33993}
2016-02-15 13:25:23 +00:00
bmeurer
1d9e9c830b [turbofan] Assign better types to various String builtins.
Properly type String.prototype.concat, String.prototype.charCodeAt,
and String.prototype.toLowerCase/toUpperCase in TurboFan. Also assign
better type to %_StringCharFromCode.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33991}
2016-02-15 11:57:28 +00:00
titzer
232b97dd10 [test] Clean up a couple TODOs.
R=bmeurer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33990}
2016-02-15 11:18:43 +00:00
martyn.capewell
357e014329 Reland of [turbofan] ARM: Improve AND instruction selection
Improve instruction selector for mask and shift operations by using cheaper
instructions where possible, in preference to UBFX.

Reverted because it was suspected of causing a couple of flaky tests to fail,
but investigation suggests this is unlikely.

Original review: https://codereview.chromium.org/1677023002

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33988}
2016-02-15 11:10:12 +00:00
bmeurer
e0129d0f87 [runtime] Turn ArgumentAccessStub into FastNewSloppyArgumentsStub.
Turn the fast case of ArgumentsAccessStub into a new stub
FastNewSloppyArgumentsStub, which is similar to the existing
FastNewStrictArgumentsStub, although not polished yet, and the slow
case always went to the runtime anyway, so we can just directly emit
a runtime call there.

R=mstarzinger@chromium.org

Committed: https://crrev.com/55b0b4f6d572531eec00ab6ebd8f6feb7c584e04
Cr-Commit-Position: refs/heads/master@{#33973}

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

Cr-Commit-Position: refs/heads/master@{#33986}
2016-02-15 10:39:41 +00:00
zhengxing.li
63a59fa341 X87: Preserve argument count for calls.
port 5de27c343bbf898ca87246caa1e83e533ec44561(r33865)

  original commit message:
  Calls use registers for target, new_target and argument count.
  We don't always respect argument count. It didn't bite us in the past
  because the code paths where we clobbered it never used it, though
  in future it could be an issue.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33984}
2016-02-15 09:46:22 +00:00
yangguo
125ac66bf6 [debugger] fix debug command processor wrt restart frame.
R=jkummerow@chromium.org
BUG=v8:4757
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33983}
2016-02-15 09:37:21 +00:00
titzer
14296d642f [crankshaft] TODO bankruptcy.
R=verwaest@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33982}
2016-02-15 09:26:09 +00:00
titzer
bc1d408535 [turbofan] Delete empty ir-operations.txt file.
R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33980}
2016-02-15 09:20:31 +00:00
titzer
4bce03b69c [wasm] Clean up some DCHECKS in asm->wasm.
R=ahaas@chromium.org,aseemgarg@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33979}
2016-02-15 09:08:50 +00:00
titzer
5c5c6e38e2 [wasm] Add support for a start function.
Add a section identifier for declaring a start function as an index into
the function table. (This could also be done as a decl flag on the
function, but don't feel strongly here, since we probably want to redo
this when adding an import/export section.)

The start function must accept no parameters. Its return value is
currently ignored.

R=binji@chromium.org,bradnelson@chromium.org
BUG=chromium:575167
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#33978}
2016-02-15 08:59:16 +00:00
oth
e768bcca24 [interpreter] Support for ES6 super keyword.
Adds support for ES6 super keyword and performing loads, stores, and
calls to super class members.

Implements SetHomeObject and enables ThisFunctionVariable.

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

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

Cr-Commit-Position: refs/heads/master@{#33977}
2016-02-15 08:19:07 +00:00
machenbach
f0561ac5d9 Revert of [runtime] Turn ArgumentAccessStub into FastNewSloppyArgumentsStub. (patchset #2 id:20001 of https://codereview.chromium.org/1695633003/ )
Reason for revert:
[Sheriff] Breaks ASAN with mipsel compile:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20ASAN%20mipsel%20-%20debug%20builder/builds/4558/

Original issue's description:
> [runtime] Turn ArgumentAccessStub into FastNewSloppyArgumentsStub.
>
> Turn the fast case of ArgumentsAccessStub into a new stub
> FastNewSloppyArgumentsStub, which is similar to the existing
> FastNewStrictArgumentsStub, although not polished yet, and the slow
> case always went to the runtime anyway, so we can just directly emit
> a runtime call there.
>
> R=mstarzinger@chromium.org
>
> Committed: https://crrev.com/55b0b4f6d572531eec00ab6ebd8f6feb7c584e04
> Cr-Commit-Position: refs/heads/master@{#33973}

TBR=mstarzinger@chromium.org,jarin@chromium.org,bmeurer@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/1701653002

Cr-Commit-Position: refs/heads/master@{#33976}
2016-02-15 08:03:14 +00:00
jarin
5418896400 Make the frame inspector use TranslatedState rather than the full deoptimizer.
This is mostly preparation for allowing the function closure to be materialized.

As a drive-by fix, I have added ignition source position support to the frame inspector (this fixed some ignition test failures).

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

Cr-Commit-Position: refs/heads/master@{#33975}
2016-02-15 07:36:57 +00:00
bmeurer
359ba8e0df [turbofan] Remove the function reload hack for OSR.
Initially we were unable to address certain stack slots in the callee
part of the frame, including the function marker, therefore we had to
hack a reload of the function register into the OSR prologue. Now that
we are able to address all stack slots, we no longer need this hack.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33974}
2016-02-15 07:31:38 +00:00
bmeurer
55b0b4f6d5 [runtime] Turn ArgumentAccessStub into FastNewSloppyArgumentsStub.
Turn the fast case of ArgumentsAccessStub into a new stub
FastNewSloppyArgumentsStub, which is similar to the existing
FastNewStrictArgumentsStub, although not polished yet, and the slow
case always went to the runtime anyway, so we can just directly emit
a runtime call there.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33973}
2016-02-15 07:05:14 +00:00
bmeurer
052dc9e019 [turbofan] Lower object and array literals in JSCreateLowering.
This adds initial support for inline allocation of object and array
literals to the JSCreateLowering pass. It's basically identical to
what Crankshaft does.

This also unstages the TurboFan escape analysis, as the lowering seems
to trigger a bunch of bugs in it; those bugs will be fixed separately,
and we will re-enable escape analysis afterwards.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33972}
2016-02-15 06:43:10 +00:00
zhengxing.li
e59af013f7 X87: [runtime] Optimize and unify rest parameters.
port 3ef573e9f127345cd9d04d7f9f5e51bf169ae103(r33809)

  original commit message:
  Replace the somewhat awkward RestParamAccessStub, which would always
  call into the runtime anyway with a proper FastNewRestParameterStub,
  which is basically based on the code that was already there for strict
  arguments object materialization. But for rest parameters we could
  optimize even further (leading to 8-10x improvements for functions with
  rest parameters), by fixing the internal formal parameter count:

  Every SharedFunctionInfo has a formal_parameter_count field, which
  specifies the number of formal parameters, and is used to decide whether
  we need to create an arguments adaptor frame when calling a function
  (i.e. if there's a mismatch between the actual and expected parameters).
  Previously the formal_parameter_count included the rest parameter, which
  was sort of unfortunate, as that meant that calling a function with only
  the non-rest parameters still required an arguments adaptor (plus some
  other oddities). Now with this CL we fix, so that we do no longer
  include the rest parameter in that count. Thereby checking for rest
  parameters is very efficient, as we only need to check whether there is
  an arguments adaptor frame, and if not create an empty array, otherwise
  check whether the arguments adaptor frame has more parameters than
  specified by the formal_parameter_count.

  The FastNewRestParameterStub is written in a way that it can be directly
  used by Ignition as well, and with some tweaks to the TurboFan backends
  and the CodeStubAssembler, we should be able to rewrite it as
  TurboFanCodeStub in the near future.

  Drive-by-fix: Refactor and unify the CreateArgumentsType which was
  different in TurboFan and Ignition; now we have a single enum class
  which is used in both TurboFan and Ignition.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33971}
2016-02-15 06:40:48 +00:00
zhengxing.li
d72bd65499 X87: [heap] Move to page lookups for SemiSpace, NewSpace, and Heap containment methods.
port cfbd25617cfb8177bbb6377280e23ec356eb2373(r33857)

  original commit message:
  Preparing the young generation for (real) non-contiguous backing memory, this
  change removes object masks that are used to compute containment in semi and new
  space. The masks are replaced by lookups for object tags and page headers, where
  possible.

  Details:
  - Use the fast checks (page header lookups) for containment in regular code.
  - Use the slow version that masks out the page start adress and iterates all
    pages of a space for debugging/verification.
  - The slow version works for off-heap/unmapped memory.
  - Encapsulate all checks for the old->new barrier in Heap::RecordWrite().

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33970}
2016-02-15 06:37:52 +00:00
zhengxing.li
7c37571c39 X87: [turbofan] Add TruncateFloat32ToUint32 operator to Turbofan.
port 2166bd8ce5 (r33797)

  original commit message:

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33969}
2016-02-15 06:37:02 +00:00
zhengxing.li
d75ddc588e X87: [turbofan] Add RoundUint32ToFloat32 operator to Turbofan.
port 187b3f2845 (r33796)

  original commit message:

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33967}
2016-02-15 01:30:38 +00:00
bmeurer
d0c503667e [turbofan] Specialize loads of the native context.
When we specialize to the native context, we can replace loads of the
NATIVE_CONTEXT_INDEX in any known context with the appropriate native
context for that context. This allows us to constant-fold and further
optimize things like %reflect_construct, which are inserted by the
parser.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33965}
2016-02-14 10:43:16 +00:00
bradnelson
f9ee14e519 Allow looser heap accesses historically emitted by Emscripten.
Older versions of Emscripten appear to emit Asm.js containing:
HEAP8[x] with x in int
As opposed to the spec legal construct:
HEAP8[x>>0] with x in int

As older programs and even benchmarks such as Embenchen
include these constructs, support them for compatibility.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=test-asm-validator,mjsunit/asm-wasm
R=aseemgarg@chromium.org,titzer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33964}
2016-02-13 06:21:35 +00:00
mbrandy
fb10f8fafd PPC: [runtime] Introduce FastNewStrictArgumentsStub to optimize strict arguments.
Port 09d8453547

Original commit message:
    The FastNewStrictArgumentsStub is very similar to the recently added
    FastNewRestParameterStub, it's actually almost a copy of it, except that
    it doesn't have the fast case we have for the empty rest parameter. This
    patch improves strict arguments in TurboFan and fullcodegen by up to 10x
    compared to the previous version.

    Also introduce proper JSSloppyArgumentsObject and JSStrictArgumentsObject
    for the in-object properties instead of having them as constants in the
    Heap class.

    Drive-by-fix: Use this stub and the FastNewRestParameterStub in the
    interpreter to avoid the runtime call overhead for strict arguments
    and rest parameter creation.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33963}
2016-02-12 23:13:45 +00:00
mbrandy
c8257c4c79 PPC: [Interpreter] Save and restore dispatch table pointer during calls.
Port a2935d63df

Original commmit message:
    Saves and restores the dispatch pointer during calls to enable the debugger to
    switch the dispatch table used by a function during it's execution.

    Also moves the accumulator and context nodes to be Variables so that they will
    be properly merged across branches.

R=rmcilroy@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:4280,v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33962}
2016-02-12 23:12:53 +00:00
adamk
1003785ced Remove AssignmentExpressionFlags enum, handle error checking in callers
This is hopefully the last in a series of cleanup patches around
destructuring assignment. It simplifies the ParseAssignmentExpression
API, making the callers call CheckDestructuringElement() where appropriate.
CheckDestructuringElement has been further simplified to only emit the
errors that the parser depends on it emitting.

I've also beefed up the test coverage in test-parsing.cc to
handling all the destructuring flags being on, which caught an oddity
in how we disallow initializers in spreads in patterns (we need to treat
RewritableAssignmentExpressions as Assignments for the purpose of
error checking).

Finally, I added a few helper methods to ParserBase to handle a few
classes of expressions (assignments and literals-as-patterns).

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

Cr-Commit-Position: refs/heads/master@{#33961}
2016-02-12 22:38:46 +00:00
kozyatinskiy
4b54c07dd1 Ignore pause on debugger statement when breakpoints are disabled
This behavior was changed in https://codereview.chromium.org/1402913002.
It's pretty usefull to have ability to disable debugger statement for our users.

BUG=chromium:583515
LOG=N
R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33960}
2016-02-12 20:55:36 +00:00
mattloring
f3cdf8a9f0 Allocation sampling for paged/large object spaces
This change expands allocation sampling to include old, map, code, and large object spaces. This involved refactoring much of the observation logic out of NewSpace into Space and overriding as needed in sub-classes.

Additionally, the sampling heap profiler now maintains a pair of heap observers. One observer is used for observing new space and resetting the inline allocation limit to be periodically notified of allocations. The other observes allocation across the other spaces where there is no additional work required to observe allocations.

Tests have been updated to ensure that allocations are observed correctly for Paged and LargeObject spaces.

R=ofrobots@google.com, hpayer@chromium.org, ulan@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33959}
2016-02-12 19:50:41 +00:00
titzer
92b9424ff3 [turbofan] Fix small redundancy in register allocator per TODO.
R=mtrofin@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33957}
2016-02-12 18:17:45 +00:00
bradnelson
821c603e0c Adding support for asm.js foreign globals.
Since wasm has no direct notion of foreign globals,
pass the ffi object on to the AsmWasmBuilder
so that foreign globals can be extracted at module
instantiation time.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=mjsunit/asm-wasm
R=titzer@chromium.org,aseemgarg@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33956}
2016-02-12 17:31:48 +00:00
titzer
54404c4731 Clean up some random TODO(titzer)s and spelling mistakes.
R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33955}
2016-02-12 17:30:20 +00:00
alph
14a1dec8d0 Unflake SampleWhenFrameIsNotSetup
Recent flake happened bacause all the samples landed into native code.
The patch makes sure we collect enough JS samples.

BUG=v8:4751
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33953}
2016-02-12 16:02:46 +00:00
oth
47c08f5f71 [interpreter] Add bytecodes for JumpIfNotHole with constant
Adds JumpIfNotHoleConstant and JumpIfNotHoleConstantWide bytecodes
and removes JumpIfHole bytecode.

In situations with large numbers of constants, the generator would
fail because an 8-bit constant could not be reserved for
JumpIfHole/JumpIfNotHole and so a 16-bit constant would be reserved.
Then when patching the bytecode the patcher would discover there was
no wide constant variant of the emitted jump.

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

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

Cr-Commit-Position: refs/heads/master@{#33952}
2016-02-12 15:24:43 +00:00
mbrandy
d00644a011 PPC: [es6] Further fixing of tail Calls.
Port e519e6fadf

Original commit message:
    1) Update profiling counters in Full codegen.
    2) Call Runtime::kTraceTailCall when tracing is on

    test/mjsunit/es6/tail-call-simple.js is disabled for now, because Turbofan does not fully support TCO yet.

R=ishell@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:4698
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33951}
2016-02-12 15:12:48 +00:00
verwaest
2649611109 [runtime] Speed up Object::ToObject with JSReceiver argument.
This avoids having to read the context and call through from the inlined
path in the JSReceiver case.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33949}
2016-02-12 14:15:04 +00:00
bmeurer
c67262d4ea [runtime] Remove obsolete %ObjectEquals runtime entry.
There are only two uses of %_ObjectEquals left, which should actually
use strict equality instead, so there's no need to keep this special
logic at all.

R=mvstanton@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33948}
2016-02-12 14:07:59 +00:00
machenbach
5ad177b1a7 Revert of [turbofan] Ship turbofan try-catch. (patchset #1 id:1 of https://codereview.chromium.org/1694743003/ )
Reason for revert:
[Sheriff] Might break layout tests unintended.

Original issue's description:
> [turbofan]  Ship turbofan try-catch.
>
> Committed: https://crrev.com/5bb459ba4daa34e5ed2fca0dd146aa18f9b6b036
> Cr-Commit-Position: refs/heads/master@{#33938}

TBR=mstarzinger@chromium.org,bmeurer@chromium.org,jarin@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/1688403003

Cr-Commit-Position: refs/heads/master@{#33947}
2016-02-12 14:07:09 +00:00
verwaest
eb6d46de9f [builtins] Remove superfluous fixed array allocation
Speeds up Object.keys by another ~10-20% :)

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

Cr-Commit-Position: refs/heads/master@{#33945}
2016-02-12 13:43:24 +00:00
bmeurer
98aec4a719 [runtime] Kill %Arguments and %ArgumentsLength.
This removes support for the %Arguments and %ArgumentsLength runtime
entries and their intrinsic counterparts. If you need variable arguments
in any builtin, either use (strict) arguments object or rest parameters,
which are both compositional across inlining (in TurboFan), and not that
much slower compared to the %_Arguments hackery.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33943}
2016-02-12 12:25:23 +00:00
ulan
ea39270193 Make all GCs from memory reducer incremental.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33940}
2016-02-12 11:40:04 +00:00
bmeurer
fd940f5c6b [builtins] Rewrite String.fromCharCode w/o %_Arguments.
This is the very last use of %_Arguments and %_ArgumentsLength,
and also the main blocker for not inlining builtins.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33939}
2016-02-12 11:23:40 +00:00
jarin
5bb459ba4d [turbofan] Ship turbofan try-catch.
Review URL: https://codereview.chromium.org/1694743003

Cr-Commit-Position: refs/heads/master@{#33938}
2016-02-12 11:22:53 +00:00
jarin
ab3b3bec86 [turbofan] Unwind and jump to the catch handler in the deoptimizer.
The idea here is to perform the handler lookup in the deoptimizer, and then take the information from the handler table to build the catch handler frame in the deoptimizer. Specifically, we use the pc offset, context location and stack height (in full-code) to tweak the output frame.

Sadly, this still requires nasty voodoo for the liveness analyzer so that it keeps variables alive if they are used in the catch handler.

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

Cr-Commit-Position: refs/heads/master@{#33936}
2016-02-12 10:15:32 +00:00
bmeurer
0e79d8c71f [builtins] Remove almost all remaining uses of %_Arguments and %_ArgumentsLength.
There's only one last user of %_Arguments and %_ArgumentsLength left,
the rest was updated to either strict mode arguments object or to not
use arguments at all.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33935}
2016-02-12 10:07:59 +00:00
epertoso
61a4c528b7 [turbofan] Fix a bug in the RawMachineAssembler
This was causing code like:

REX.W cmpq r9,r8
setzl r8l
movzxbl r8,r8
REX.W cmpq r8,0x0
jz 185

(note the cmpq instead of cmpl above) on x64 instead of:

REX.W cmpq r9,r8
jnz 149

http://crrev.com/1677503002 is now obsolete and has been reverted.

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

Cr-Commit-Position: refs/heads/master@{#33934}
2016-02-12 10:03:14 +00:00
mstarzinger
5bbcdfe680 Reland of [interpreter] Correctly thread through catch prediction. (patchset #1 id:1 of https://codereview.chromium.org/1695613002/ )
Reason for revert:
No fix needed, original CL was perfectly fine!

Original issue's description:
> Revert of [interpreter] Correctly thread through catch prediction. (patchset #1 id:1 of https://codereview.chromium.org/1690973002/ )
>
> Reason for revert:
> Depends on the reverted https://codereview.chromium.org/1691723002
>
> Original issue's description:
> > [interpreter] Correctly thread through catch prediction.
> >
> > This change correctly sets the {CatchPrediction} field in exception
> > handler tables for bytecode and optimized code. It also adds tests
> > independent of promise handling for this prediction, to ensure all our
> > backends are in sync on their prediction.
> >
> > R=rmcilroy@chromium.org,yangguo@chromium.org
> > TEST=mjsunit/compiler/debug-catch-prediction
> > BUG=v8:4674
> > LOG=n
> >
> > Committed: https://crrev.com/ba55f5594cb0b4a1a1e9b35d87fe54afe2d93f3b
> > Cr-Commit-Position: refs/heads/master@{#33906}
>
> TBR=rmcilroy@chromium.org,yangguo@chromium.org,mstarzinger@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=v8:4674
>
> Committed: https://crrev.com/c5229b311968fd638a6cd537c341b1055eb7be97
> Cr-Commit-Position: refs/heads/master@{#33922}

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

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

Cr-Commit-Position: refs/heads/master@{#33933}
2016-02-12 09:52:23 +00:00
mstarzinger
a5941ae424 Reland of [interpreter] Make d8's TryCatch block be verbose. (patchset #1 id:1 of https://codereview.chromium.org/1694523003/ )
Reason for revert:
No fix needed, original CL was perfectly fine!

Original issue's description:
> Revert of [interpreter] Make d8's TryCatch block be verbose. (patchset #3 id:40001 of https://codereview.chromium.org/1691723002/ )
>
> Reason for revert:
> [Sheriff] Speculative revert. Breaks
> https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/builds/3944
>
> Somehow 3a2fbc3a4e seems to hide it again and then 699e1081a6 lets it show up again.
>
> Reproduced locally.
>
> Original issue's description:
> > [interpreter] Make d8's TryCatch block be verbose.
> >
> > This changes "d8" to no longer report exceptions as being "caught" when
> > it comes to the catch prediction mechanism in our debugger. This treats
> > scripts as being truly top-level when it comes to exception handling and
> > will allow us to properly test the catch prediction mechanism using just
> > mjsunit tests alone.
> >
> > R=yangguo@chromium.org
> > BUG=v8:4674
> > LOG=n
> >
> > Committed: https://crrev.com/fb1de271a6bc2c89a1682db8c151cf5fcda86c45
> > Cr-Commit-Position: refs/heads/master@{#33898}
>
> TBR=yangguo@chromium.org,mstarzinger@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=v8:4674
>
> Committed: https://crrev.com/f9eef1f33d2e5cde8cb948424e7ebf509090aa59
> Cr-Commit-Position: refs/heads/master@{#33921}

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

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

Cr-Commit-Position: refs/heads/master@{#33931}
2016-02-12 09:12:59 +00:00
yangguo
e1c645d1f4 [regexp] ship unicode regexps.
R=rossberg@chromium.org
BUG=v8:2952
LOG=N

Committed: https://crrev.com/3a2fbc3a4ed2802b52659df2209b930200d63b29
Cr-Commit-Position: refs/heads/master@{#33899}

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

Cr-Commit-Position: refs/heads/master@{#33927}
2016-02-12 06:45:09 +00:00
jarin
c0198937d8 Handlify DeoptimizedFrameInfo, remove custom GC iteration.
TBR=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33926}
2016-02-12 05:50:23 +00:00
bmeurer
09d8453547 [runtime] Introduce FastNewStrictArgumentsStub to optimize strict arguments.
The FastNewStrictArgumentsStub is very similar to the recently added
FastNewRestParameterStub, it's actually almost a copy of it, except that
it doesn't have the fast case we have for the empty rest parameter. This
patch improves strict arguments in TurboFan and fullcodegen by up to 10x
compared to the previous version.

Also introduce proper JSSloppyArgumentsObject and JSStrictArgumentsObject
for the in-object properties instead of having them as constants in the
Heap class.

Drive-by-fix: Use this stub and the FastNewRestParameterStub in the
interpreter to avoid the runtime call overhead for strict arguments
and rest parameter creation.

R=jarin@chromium.org
TBR=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33925}
2016-02-12 05:11:03 +00:00
bradnelson
413c266817 Only allow |0 and *1.0 for asm validator foreign variables.
Require that foreign variable imports have a correct type annotation,
_including_ checking the value of the multiplier is 0 or 1.0 as appropriate.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=test-asm-validator
R=aseemgarg@chromium.org,titzer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33923}
2016-02-12 01:50:44 +00:00
adamk
c5229b3119 Revert of [interpreter] Correctly thread through catch prediction. (patchset #1 id:1 of https://codereview.chromium.org/1690973002/ )
Reason for revert:
Depends on the reverted https://codereview.chromium.org/1691723002

Original issue's description:
> [interpreter] Correctly thread through catch prediction.
>
> This change correctly sets the {CatchPrediction} field in exception
> handler tables for bytecode and optimized code. It also adds tests
> independent of promise handling for this prediction, to ensure all our
> backends are in sync on their prediction.
>
> R=rmcilroy@chromium.org,yangguo@chromium.org
> TEST=mjsunit/compiler/debug-catch-prediction
> BUG=v8:4674
> LOG=n
>
> Committed: https://crrev.com/ba55f5594cb0b4a1a1e9b35d87fe54afe2d93f3b
> Cr-Commit-Position: refs/heads/master@{#33906}

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

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

Cr-Commit-Position: refs/heads/master@{#33922}
2016-02-12 00:43:13 +00:00
machenbach
f9eef1f33d Revert of [interpreter] Make d8's TryCatch block be verbose. (patchset #3 id:40001 of https://codereview.chromium.org/1691723002/ )
Reason for revert:
[Sheriff] Speculative revert. Breaks
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/builds/3944

Somehow 3a2fbc3a4e seems to hide it again and then 699e1081a6 lets it show up again.

Reproduced locally.

Original issue's description:
> [interpreter] Make d8's TryCatch block be verbose.
>
> This changes "d8" to no longer report exceptions as being "caught" when
> it comes to the catch prediction mechanism in our debugger. This treats
> scripts as being truly top-level when it comes to exception handling and
> will allow us to properly test the catch prediction mechanism using just
> mjsunit tests alone.
>
> R=yangguo@chromium.org
> BUG=v8:4674
> LOG=n
>
> Committed: https://crrev.com/fb1de271a6bc2c89a1682db8c151cf5fcda86c45
> Cr-Commit-Position: refs/heads/master@{#33898}

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

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

Cr-Commit-Position: refs/heads/master@{#33921}
2016-02-11 23:11:08 +00:00
Adam Klein
7332d10617 Fix SharedFunctionInfo::name flattening nosnap failures
The name must be flattened before allocating the SFI to avoid the GC
seeing the uninitialized state.

BUG=v8:4659
LOG=n
TBR=rossberg@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33920}
2016-02-11 19:55:09 +00:00
adamk
f539f5c88b Stage --harmony-function-name
BUG=v8:3699
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#33919}
2016-02-11 19:13:12 +00:00
adamk
b8a4aeaee0 Remove kIsPossibleArrowFormals option from ParseAssignmentExpression
The path used by that option only comes into play when default parameters
are allowed but destructuring assignment is disallowed. Removing it
allows the removal of one implementation of ParseExpression, and makes
it clearer which code will be dead once all the destructuring flags
are removed.

Also made the |flags| param strongly typed instead of an int.

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

Cr-Commit-Position: refs/heads/master@{#33918}
2016-02-11 19:10:57 +00:00
verwaest
c2aa8f38b0 [runtime] Speed up allocating instances in the runtime by having a quick-check for inobject slack tracking.
This speeds up
https://github.com/kpdecker/six-speed/blob/master/tests/object-assign/object-assign.es5
by over 5%.

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

Cr-Commit-Position: refs/heads/master@{#33917}
2016-02-11 19:06:43 +00:00
verwaest
2646b62a5c [runtime/heap] Introduce CopyFixedArrayUpTo to match CopyFixedArrayAndGrow, copying to a smaller array.
This allows the helper to avoid write barriers while copying, speeding up Object.keys by 5-10%.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33916}
2016-02-11 18:59:19 +00:00
adamk
0b271defa5 Cleanup destructuring-related error reporting in ParserBase
Several minor cleanups to error handling in expression parsing:
  - Remove duplication of binding and assignment error reporting.
  - RecordBindingPatternError calls are changed to shorter BindingPatternUnexpectedToken
    calls where possible.
  - No-op error recording calls are removed.

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

Cr-Commit-Position: refs/heads/master@{#33915}
2016-02-11 18:57:12 +00:00
adamk
58a9bc5b53 Force SharedFunctionInfo::name() to be a flat string
This fact is depended upon by, at least, Parser::ParseLazy, and quite
likely by other code. There was already code in %FunctionSetName
enforcing this invariant. This patch adds similar code to
Factory::NewSharedFunctionInfo().

BUG=v8:4659
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33914}
2016-02-11 18:53:02 +00:00
balazs.kilvady
8eaf90b82c MIPS: Refine 'MIPS: Fix FPU min, max, mina, maxa in simulator.'
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33913}
2016-02-11 18:23:44 +00:00
akos.palfi
b44bea94f9 MIPS: Fix '[runtime] Optimize and unify rest parameters.'
Fixes a register-clobbering problem. The Branch() instruction can overwrite the 'at' register, so it can't be used as scratch in Allocate(). Added DCHECK to avoid this in the future.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33912}
2016-02-11 17:42:29 +00:00
ishell
d12dbab466 [es6] More efficient way of marking AST call expressions in tail positions.
Instead of doing a full function body traversal we collect return expressions and mark them after function parsing.

And since we rewrite do-expressions so that the result is explicitly assigned to a result variable the statements marking will never hit so I removed it from the AST.

BUG=v8:4698
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33911}
2016-02-11 17:40:16 +00:00
ssanfilippo
2f0ac9a2cd Reland of [Interpreter] Rename GetCountOperand to GetRegisterCountOperand.
Apparently, this BytecodeArrayIterator method was missed during the
previous refactor. No other (collateral) change was done.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33909}
2016-02-11 16:43:00 +00:00
mlippautz
ffcff3a0f2 [heap] Cleanup MemoryChunk's declarations
- Remove unused methods that we should never actually use like SetArea() or
  set_size().
- Live bytes are now reported with --trace-live-bytes and not gc-verbose.

BUG=chromium:581076
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33908}
2016-02-11 16:39:21 +00:00
mstarzinger
2749ebba33 [interpreter] Deprecate DeleteLookupSlot bytecode.
This replaces the bytecode in question with a runtime call within the
bytecode stream. The tradeoff is to safe one bytecode opcode for more
expensive encoding of lookup slot deletion.

R=rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33907}
2016-02-11 16:16:51 +00:00
mstarzinger
ba55f5594c [interpreter] Correctly thread through catch prediction.
This change correctly sets the {CatchPrediction} field in exception
handler tables for bytecode and optimized code. It also adds tests
independent of promise handling for this prediction, to ensure all our
backends are in sync on their prediction.

R=rmcilroy@chromium.org,yangguo@chromium.org
TEST=mjsunit/compiler/debug-catch-prediction
BUG=v8:4674
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33906}
2016-02-11 16:14:42 +00:00
yangguo
9249890124 [interpreter, debugger] implement bytecode break location iterator.
R=rmcilroy@chromium.org, vogelheim@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33904}
2016-02-11 15:31:20 +00:00
machenbach
699e1081a6 Revert of [regexp] ship unicode regexps. (patchset #1 id:1 of https://codereview.chromium.org/1689113002/ )
Reason for revert:
[Sheriff] Speculative revert for gc stress failures:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20gc%20stress/builds/1726

Blamelists are screwed up currently...

Original issue's description:
> [regexp] ship unicode regexps.
>
> R=rossberg@chromium.org
> BUG=v8:2952
> LOG=N
>
> Committed: https://crrev.com/3a2fbc3a4ed2802b52659df2209b930200d63b29
> Cr-Commit-Position: refs/heads/master@{#33899}

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

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

Cr-Commit-Position: refs/heads/master@{#33902}
2016-02-11 15:14:21 +00:00
cbruni
0949bce524 [counter] Properly measure own-time of runtime counters.
By keeping track of the stack of counters we can properly subtract the
subcounter times and properly measure the own-time spent in each runtime
function. This is useful to get more details for builtins like HandleApiCall
which are typical top-level entries for chome which previously prevent
measurements of sub-calls to builtins/runtime functions.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33901}
2016-02-11 14:49:27 +00:00
machenbach
4e95426ae6 Revert of [Interpreter] Rename GetCountOperand to GetRegisterCountOperand. (patchset #1 id:20001 of https://codereview.chromium.org/1691433002/ )
Reason for revert:
[Sheriff] Breaks the tree:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20builder/builds/13892

Blamelists are wrong because of overloaded master. The trybots on this CL might have been outdated by the time of commit... Please rebase and retry.

Original issue's description:
> [Interpreter] Rename GetCountOperand to GetRegisterCountOperand.
>
> Apparently, this BytecodeArrayIterator method was missed during the
> previous refactor. No other (collateral) change was done.
>
> BUG=v8:4280
> LOG=N
>
> Committed: https://crrev.com/3781ca79f5c48b55d7f0bf6df370ec11515a1466
> Cr-Commit-Position: refs/heads/master@{#33897}

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

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

Cr-Commit-Position: refs/heads/master@{#33900}
2016-02-11 14:14:12 +00:00
yangguo
3a2fbc3a4e [regexp] ship unicode regexps.
R=rossberg@chromium.org
BUG=v8:2952
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33899}
2016-02-11 14:06:33 +00:00
mstarzinger
fb1de271a6 [interpreter] Make d8's TryCatch block be verbose.
This changes "d8" to no longer report exceptions as being "caught" when
it comes to the catch prediction mechanism in our debugger. This treats
scripts as being truly top-level when it comes to exception handling and
will allow us to properly test the catch prediction mechanism using just
mjsunit tests alone.

R=yangguo@chromium.org
BUG=v8:4674
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33898}
2016-02-11 14:05:24 +00:00
ssanfilippo
3781ca79f5 [Interpreter] Rename GetCountOperand to GetRegisterCountOperand.
Apparently, this BytecodeArrayIterator method was missed during the
previous refactor. No other (collateral) change was done.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33897}
2016-02-11 14:03:50 +00:00
yangguo
269840c496 [regexp] Fix RegExp.prototype.toString.
Initial fix was simply wrong.

R=verwaest@chromium.org
BUG=v8:4524
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33896}
2016-02-11 13:23:20 +00:00
verwaest
6b89c6941b [builtins] Add an initial fast-path to Object.assign.
In the case of a simple fast-mode receiver without fancy properties, we
can just walk over the descriptor array to find all its initial property
names. As long as the map stays the same, we can also use that
descriptor array to figure out how to handle the properties.

This speeds up
https://github.com/kpdecker/six-speed/tree/master/tests/object-assign by
~2x.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33895}
2016-02-11 13:17:49 +00:00
rmcilroy
a2935d63df [Interpreter] Save and restore dispatch table pointer during calls.
Saves and restores the dispatch pointer during calls to enable the debugger to
switch the dispatch table used by a function during it's execution.

Also moves the accumulator and context nodes to be Variables so that they will
be properly merged across branches.

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

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

Cr-Commit-Position: refs/heads/master@{#33894}
2016-02-11 13:11:07 +00:00
cbruni
e355542149 [counters] moving runtime counters to counter.h
Additionally list C++ builtins as well under --runtime_call_stats.
Let's try to keep all counters in one place, that makes it a bit
easier to maintain and especially discard unused ones.

BUG=

Committed: https://crrev.com/6bc71431995d49d4ca4a2ea9c75e5add5f345225
Cr-Commit-Position: refs/heads/master@{#33847}

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

Cr-Commit-Position: refs/heads/master@{#33893}
2016-02-11 12:30:30 +00:00
yangguo
42309697c1 [regexp] parse RegExpUnicodeEscapeSequence according to spec.
See http://tc39.github.io/ecma262/#prod-RegExpUnicodeEscapeSequence

R=erik.corry@gmail.com, erikcorry@chromium.org
BUG=v8:2952
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33892}
2016-02-11 12:29:29 +00:00
jarin
9dd5fe296b Use SharedFunctionInfo rather than the JSFunction in the deoptimizer (first step).
This removes uses of JSFunction by the (proper) deoptimizer. This will be useful
when we escape analyze JSFunction away. Unfortunately, the debugger still needs
JSFunction, so escape analysis would not work yet.

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

Cr-Commit-Position: refs/heads/master@{#33891}
2016-02-11 12:03:55 +00:00
mvstanton
d69ce04d03 Implement symbol @@hasInstance for ES6 instanceof support.
BUG=

Committed: https://crrev.com/5833e8e8a437cd66405784263ccc45e73470fd42
Cr-Commit-Position: refs/heads/master@{#33870}

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

Cr-Commit-Position: refs/heads/master@{#33890}
2016-02-11 11:59:22 +00:00
cbruni
bab059707d Revert of [counters] moving runtime counters to counter.h (patchset #1 id:1 of https://codereview.chromium.org/1688783005/ )
Reason for revert:
failing gc-stress tests

Original issue's description:
> Reland of [counters] moving runtime counters to counter.h (patchset #1 id:1 of https://codereview.chromium.org/1681923003/ )
>
> Reason for revert:
> This CL was not the cause for the TSAN failures, the instruction-selector backend for x64 emitted  a wrong compare which accidentally showed up with tsan + code moves.
> The instruction-selectors changes have been reverted with https://codereview.chromium.org/1693433002
>
> Original issue's description:
> > Revert of [counters] moving runtime counters to counter.h (patchset #1 id:1 of https://codereview.chromium.org/1678973002/ )
> >
> > Reason for revert:
> > [Sheriff] Breaks TSAN:
> > https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/7727
> >
> > Original issue's description:
> > > [counters] moving runtime counters to counter.h
> > >
> > > Additionally list C++ builtins as well under --runtime_call_stats.
> > > Let's try to keep all counters in one place, that makes it a bit
> > > easier to maintain and especially discard unused ones.
> > >
> > > BUG=
> > >
> > > Committed: https://crrev.com/6bc71431995d49d4ca4a2ea9c75e5add5f345225
> > > Cr-Commit-Position: refs/heads/master@{#33847}
> >
> > TBR=jarin@chromium.org,cbruni@chromium.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=
> >
> > Committed: https://crrev.com/2d669b96639517cfc33e6fc6d4c3814587bc7366
> > Cr-Commit-Position: refs/heads/master@{#33848}
>
> TBR=jarin@chromium.org,machenbach@chromium.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=
>
> Committed: https://crrev.com/ad943fe44ede22b90b871e1233334dff5ff545c3
> Cr-Commit-Position: refs/heads/master@{#33887}

TBR=jarin@chromium.org,machenbach@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/1687313002

Cr-Commit-Position: refs/heads/master@{#33889}
2016-02-11 11:56:30 +00:00
cbruni
ad943fe44e Reland of [counters] moving runtime counters to counter.h (patchset #1 id:1 of https://codereview.chromium.org/1681923003/ )
Reason for revert:
This CL was not the cause for the TSAN failures, the instruction-selector backend for x64 emitted  a wrong compare which accidentally showed up with tsan + code moves.
The instruction-selectors changes have been reverted with https://codereview.chromium.org/1693433002

Original issue's description:
> Revert of [counters] moving runtime counters to counter.h (patchset #1 id:1 of https://codereview.chromium.org/1678973002/ )
>
> Reason for revert:
> [Sheriff] Breaks TSAN:
> https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/7727
>
> Original issue's description:
> > [counters] moving runtime counters to counter.h
> >
> > Additionally list C++ builtins as well under --runtime_call_stats.
> > Let's try to keep all counters in one place, that makes it a bit
> > easier to maintain and especially discard unused ones.
> >
> > BUG=
> >
> > Committed: https://crrev.com/6bc71431995d49d4ca4a2ea9c75e5add5f345225
> > Cr-Commit-Position: refs/heads/master@{#33847}
>
> TBR=jarin@chromium.org,cbruni@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=
>
> Committed: https://crrev.com/2d669b96639517cfc33e6fc6d4c3814587bc7366
> Cr-Commit-Position: refs/heads/master@{#33848}

TBR=jarin@chromium.org,machenbach@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33887}
2016-02-11 11:14:01 +00:00
ishell
e519e6fadf [es6] Further fixing of tail Calls.
1) Update profiling counters in Full codegen.
2) Call Runtime::kTraceTailCall when tracing is on

test/mjsunit/es6/tail-call-simple.js is disabled for now, because Turbofan does not fully support TCO yet.

BUG=v8:4698
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33886}
2016-02-11 10:27:10 +00:00
ishell
e82588f647 [crankshaft] Disable Crankshaft when it sees a tail call.
This CL also removes tail call support made so far from Crankshaft.

BUG=v8:4698
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33885}
2016-02-11 09:59:18 +00:00
epertoso
a979a5c0cf Revert of [turbofan] Fixes the code generation for branches on x64 when the condition is Word64Equal. (patchset #1 id:1 of https://codereview.chromium.org/1677503002/ )
Reason for revert:
Code like the example given in the CL description was produced, for example, by code-stub-assembler.cc.

Reverting this, and try to fix the root cause instead.

Original issue's description:
> [turbofan] Fixes the code generation for branches on x64 when the condition is Word64Equal.
>
> Before:
>
> REX.W cmpq r9,r8
> setzl r8l
> movzxbl r8,r8
> REX.W cmpq r8,0x0
> jz 185
>
> After:
>
> REX.W cmpq r9,r8
> jnz 149
>
> Committed: https://crrev.com/75cc8352d06aada2e9131fdae793299ef73fb639
> Cr-Commit-Position: refs/heads/master@{#33784}

TBR=bmeurer@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.

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

Cr-Commit-Position: refs/heads/master@{#33884}
2016-02-11 09:49:23 +00:00
jarin
6de51c4dc7 Remove the JS_FRAME_FUNCTION deoptimizer translation.
JS_FRAME_FUNCTION can be expressed using the STACK_SLOT translation.

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

Cr-Commit-Position: refs/heads/master@{#33882}
2016-02-11 08:25:04 +00:00
bmeurer
f6db05660e [builtins] Remove bunch of uses of %_Arguments and %_ArgumentsLength.
There are a bunch of places in our builtins where we use %_Arguments and
%_ArgumentsLength for no good reason, as arguments object and/or rest
parameter is as good and performant in these cases. Now the only uses
of %_Arguments and %_ArgumentsLength left are in string.js, which
requires dedicated investigation.

CQ_INCLUDE_TRYBOTS=tryserver.v8:v8_linux_nosnap_dbg
R=yangguo@chromium.org

Committed: https://crrev.com/2160429fd458e3c095475e718c97f77ac90d906f
Cr-Commit-Position: refs/heads/master@{#33834}

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

Cr-Commit-Position: refs/heads/master@{#33881}
2016-02-11 07:13:15 +00:00
bmeurer
4ff159bd28 [compiler] Sanitize entry points to LookupSlot access.
Add dedicated %LoadLookupSlot, %LoadLookupSlotInsideTypeof,
%LoadLookupSlotForCall, %StoreLookupSlot_Sloppy and
%StoreLookupSlot_Strict runtime entry points and use them
appropriately in the various compilers. This way we can
finally drop the machine operators from the JS graph level
completely in TurboFan.

Also drop the funky JSLoadDynamic operator from TurboFan,
which was by now just a small wrapper around the runtime
call to %LoadLookupSlot.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33880}
2016-02-11 06:24:28 +00:00
mbrandy
0c3f7e931e PPC: Preserve argument count for calls.
Port 5de27c343b

Original commit message:
    Calls use registers for target, new_target and argument count.
    We don't always respect argument count. It didn't bite us in the past
    because the code paths where we clobbered it never used it, though
    in future it could be an issue.

R=mvstanton@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33878}
2016-02-10 20:28:09 +00:00
mbrandy
1ab7f2f840 PPC: [heap] Move to page lookups for SemiSpace, NewSpace, and Heap containment methods
Port cfbd25617c

Original commit message:

    Preparing the young generation for (real) non-contiguous backing memory, this
    change removes object masks that are used to compute containment in semi and new
    space. The masks are replaced by lookups for object tags and page headers, where
    possible.

    Details:
    - Use the fast checks (page header lookups) for containment in regular code.
    - Use the slow version that masks out the page start adress and iterates all
      pages of a space for debugging/verification.
    - The slow version works for off-heap/unmapped memory.
    - Encapsulate all checks for the old->new barrier in Heap::RecordWrite().

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

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

Cr-Commit-Position: refs/heads/master@{#33877}
2016-02-10 20:09:34 +00:00
mbrandy
d4bdd76726 PPC: Mark null and undefined as undetectable, and use it to handle abstract equality comparison in the generic compare ic
Port 3ce9e808c5

Original commit message:
    Marking as undetectable makes abstract equality of null, undefined, and
    other undetectable objects easier. Supporting it in the generic compare
    IC significantly speeds up dynamic comparison between those values and
    JSReceivers by not falling back to the runtime.

R=verwaest@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33876}
2016-02-10 20:08:47 +00:00
hpayer
0ecdd93282 [heap] Improve IncrementalMarking::UpdateMarkingDequeAfterScavenge.
Black allocation during scavenges will push objects on the marking deque that point to to-space. They should not be cleared.

BUG=chromium:561449
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33875}
2016-02-10 20:01:33 +00:00
ssanfilippo
8bfd4a5ac9 [Interpreter] Handle negative ints in generate-bytecode-expectations.
The previous implementation used GetRawOperand(), which allows a nicely
unified handling of all scalar types, but returns an unsigned type.
Because of this, generate-bytecode-expectations couldn't properly handle
negative numbers.

This commit differentiate between different types of scalar operands and
uses the appropriate getter from i::interpreter::BytecodeArrayIterator,
thus correctly handling signed types where needed.

Two new helpers have been added to i::interpreter::Bytecodes:

 * IsImmediateOperandType()
 * IsIndexOperandType()

with the intuitive semantic.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33874}
2016-02-10 18:35:56 +00:00
rmcilroy
d1c28849c7 [Interpreter] Make InterpreterAssembler a subclass of CodeStubAssembler.
Moves InterpreterAssembler out of the compiler directory and into the
interpreter directory. Makes InterpreterAssembler as subclass of
CodeStubAssembler.

As part of this change, the special bytecode dispatch linkage type
is removed and instead we use a InterfaceDispatchDescriptor and
a normal CodeStub linkage type.

Removes a bunch of duplicated logic in InterpreterAssembler and
instead uses the CodeStubAssembler logic. Refactors Interpreter
with these changes.

Modifies CodeStubAssembler to add the extra operations required
by the Interpreter (extra call types, raw memory access and some extra
binary ops). Also adds the ability for subclasses to add extra
prologue and epilogue operations around calls, which is required
for the Interpreter.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33873}
2016-02-10 16:39:32 +00:00
yangguo
e0d0c96a53 [regexp] experimental implementation for \p property class.
Currently we only support general categories for property classes.

R=erik.corry@gmail.com, erikcorry@chromium.org, littledan@chromium.org
BUG=v8:4743
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33872}
2016-02-10 16:24:05 +00:00
machenbach
99a58d30d2 Revert of Implement symbol @@hasInstance for ES6 instanceof support. (patchset #2 id:20001 of https://codereview.chromium.org/1683043003/ )
Reason for revert:
[Sheriff] Breaks:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20nosnap%20-%20debug/builds/1382/

Original issue's description:
> Implement symbol @@hasInstance for ES6 instanceof support.
>
> BUG=
>
> Committed: https://crrev.com/5833e8e8a437cd66405784263ccc45e73470fd42
> Cr-Commit-Position: refs/heads/master@{#33870}

TBR=bmeurer@chromium.org,mvstanton@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/1686123002

Cr-Commit-Position: refs/heads/master@{#33871}
2016-02-10 16:22:01 +00:00
mvstanton
5833e8e8a4 Implement symbol @@hasInstance for ES6 instanceof support.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33870}
2016-02-10 14:34:51 +00:00
yangguo
24b40f35f4 [debugger] introduce abstract interface for break location.
The break location heavily relies on relocation info. This change
abstracts that away. Currently there is only one implementation for
this interface, for JIT code. Future changes will introduce an
implementation to iterate bytecode arrays.

R=rmcilroy@chromium.org, vogelheim@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33869}
2016-02-10 14:20:04 +00:00
verwaest
83c66d8222 [TypeFeedbackVector/Crankshaft] Fix private symbol feedback.
This reduces runtime of https://github.com/kpdecker/six-speed/blob/master/tests/for-of-array/for-of-array.es6 by 40%.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33868}
2016-02-10 14:12:36 +00:00
verwaest
9ad61e6d81 [builtins] Speedup Object.keys by adding a fast path for objects without elements, interceptors, ...
This speeds up the for-of-object benchmark at
http://kpdecker.github.io/six-speed/ by >2x.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33867}
2016-02-10 13:50:21 +00:00
jkummerow
4f62af4234 Tweak type info threshold.
Let the world know (if it cares) that this is the kind of
silliness that JS engines have to partake in if they want
to look good on Sunspider (this should give 5% overall).

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

Cr-Commit-Position: refs/heads/master@{#33866}
2016-02-10 13:41:16 +00:00
mvstanton
5de27c343b Preserve argument count for calls.
Calls use registers for target, new_target and argument count.
We don't always respect argument count. It didn't bite us in the past
because the code paths where we clobbered it never used it, though
in future it could be an issue.

BUG=
R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33865}
2016-02-10 13:36:04 +00:00
yangguo
35b6ca2528 [json parser] add position to error message.
R=jochen@chromium.org, verwaest@chromium.org
BUG=chromium:585724
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33864}
2016-02-10 11:28:53 +00:00
yangguo
1d5a50d35d [regexp] implement RegExp.prototype.toString for non-RegExp receiver.
R=littledan@chromium.org, verwaest@chromium.org
BUG=v8:4524
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33862}
2016-02-10 10:53:32 +00:00
verwaest
0fc7b2c41f Drop null/undefined check if we already check for IsUndetectable in BuildCompareNil
Since https://codereview.chromium.org/1683643002/ null and undefined are
also marked as undetectable. If we anyway need to check for that case,
we can drop the null/undefined checks.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33861}
2016-02-10 10:40:22 +00:00
mstarzinger
1986a486bf [interpreter] CompilationInfo::unoptimized_code only for OSR.
The field in question is only needed when the optimizing compiler is
triggered via OSR. All other paths (e.g. from bytecode stream) should
not rely on the unoptimized code being present.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33860}
2016-02-10 10:28:12 +00:00
littledan
defcc64244 Use a for-of loop in Array.from
If Array.from is passed an iterable, then it will copy the contents
to the newly created Array (or subclass). The iteration protocol here
includes calling IteratorClose if the loop is exited early due to an
exception thrown. This patch converts Array.from to use a for-of loop
rather than explicitly invoking the iteration protocol so that, when
IteratorClose is invoked on early for-of exit, then Array.from will
call IteratorClose in the appropriate case.

R=neis
LOG=Y
BUG=v8:4739

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

Cr-Commit-Position: refs/heads/master@{#33859}
2016-02-10 09:57:17 +00:00
verwaest
3ce9e808c5 Mark null and undefined as undetectable, and use it to handle abstract equality comparison in the generic compare ic
Marking as undetectable makes abstract equality of null, undefined, and
other undetectable objects easier. Supporting it in the generic compare
IC significantly speeds up dynamic comparison between those values and
JSReceivers by not falling back to the runtime.

MIPS port contributed by Balazs Kilvady <balazs.kilvady@imgtec.com>

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

Cr-Commit-Position: refs/heads/master@{#33858}
2016-02-10 09:56:26 +00:00
mlippautz
cfbd25617c [heap] Move to page lookups for SemiSpace, NewSpace, and Heap containment methods
Preparing the young generation for (real) non-contiguous backing memory, this
change removes object masks that are used to compute containment in semi and new
space. The masks are replaced by lookups for object tags and page headers, where
possible.

Details:
- Use the fast checks (page header lookups) for containment in regular code.
- Use the slow version that masks out the page start adress and iterates all
  pages of a space for debugging/verification.
- The slow version works for off-heap/unmapped memory.
- Encapsulate all checks for the old->new barrier in Heap::RecordWrite().

BUG=chromium:581412
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33857}
2016-02-10 09:47:16 +00:00
mstarzinger
582be2ba09 [interpreter] Make it possible to optimize without parse.
This makes sure we can run through the TurboFan pipeline without having
to parse the source when using the bytecode stream as input. This path
is now being tested by the BytecodeGraphTester helper.

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

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

Cr-Commit-Position: refs/heads/master@{#33856}
2016-02-10 09:16:38 +00:00
neis
ff97dc820d [proxies] Implement spec change to consistency check in [[SetPrototypeOf]].
See https://github.com/tc39/ecma262/pull/331.

R=rossberg
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33855}
2016-02-10 08:07:40 +00:00
bmeurer
9ee47bbc09 [turbofan] No need to load the feedback vector on the JS graph level.
Fix JSLoadGlobal/JSStoreGlobal, JSLoadNamed/JSStoreNamed and
JSLoadProperty/JSStoreProperty to take the current function closure
instead of the type feedback as input, and load the feedback vector
from the closure as required (in JSGenericLowering). There's still
JSLoadDynamic left to be done, and then we don't have any machine
operators in the initial JS graph left.

There'll be more refactoring on the JSGenericLowering in a follow-up
CL, which takes care of the current code duplication and also tries
to use the more efficient LoadIC/KeyedLoadIC instead of the current
LoadICInOptimizedCode/KeyedLoadICInOptimizedCode (and same for store
ICs) whenever possible.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33854}
2016-02-10 07:00:52 +00:00
mstarzinger
c507f9e111 [interpreter] Thread through language mode some more.
This threads the language mode from the bytecode to the node creation
site in the bytecode graph builder. It only adapts the places where such
threading is applicable without considering strong mode. The remaining
uses of the language mode accessors are only required because of strong
mode.

R=mythria@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33852}
2016-02-09 16:42:51 +00:00
epertoso
e345815599 Do not eagerly instantiate accessors' JSFunction.
BUG=

Committed: https://crrev.com/4d46b510caf534d770ce19a01a11b8796304471b
Cr-Commit-Position: refs/heads/master@{#33812}

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

Cr-Commit-Position: refs/heads/master@{#33851}
2016-02-09 16:28:39 +00:00
martyn.capewell
5ac796b553 Revert of [turbofan] ARM: Improve AND instruction selection (patchset #1 id:1 of https://codereview.chromium.org/1677023002/ )
Reason for revert:
Possibly causing Mozilla test failures - will investigate.

Original issue's description:
> [turbofan] ARM: Improve AND instruction selection
>
> Improve instruction selector for mask and shift operations by using cheaper
> instructions where possible, in preference to UBFX.
>
> BUG=
>
> Committed: https://crrev.com/53d9c12977f07f55b6f2a72128b8d02c4c857845
> Cr-Commit-Position: refs/heads/master@{#33843}

TBR=bmeurer@chromium.org,jarin@chromium.org,danno@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/1681953003

Cr-Commit-Position: refs/heads/master@{#33850}
2016-02-09 15:12:00 +00:00
mlippautz
8902513e4d [heap] Collaborating sweeper tasks
Instead of only sweeping a specific space, let tasks work together once they have
swept their corresponding space.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33849}
2016-02-09 15:09:18 +00:00
machenbach
2d669b9663 Revert of [counters] moving runtime counters to counter.h (patchset #1 id:1 of https://codereview.chromium.org/1678973002/ )
Reason for revert:
[Sheriff] Breaks TSAN:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/7727

Original issue's description:
> [counters] moving runtime counters to counter.h
>
> Additionally list C++ builtins as well under --runtime_call_stats.
> Let's try to keep all counters in one place, that makes it a bit
> easier to maintain and especially discard unused ones.
>
> BUG=
>
> Committed: https://crrev.com/6bc71431995d49d4ca4a2ea9c75e5add5f345225
> Cr-Commit-Position: refs/heads/master@{#33847}

TBR=jarin@chromium.org,cbruni@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/1681923003

Cr-Commit-Position: refs/heads/master@{#33848}
2016-02-09 15:04:45 +00:00
cbruni
6bc7143199 [counters] moving runtime counters to counter.h
Additionally list C++ builtins as well under --runtime_call_stats.
Let's try to keep all counters in one place, that makes it a bit
easier to maintain and especially discard unused ones.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33847}
2016-02-09 13:14:15 +00:00
martyn.capewell
53d9c12977 [turbofan] ARM: Improve AND instruction selection
Improve instruction selector for mask and shift operations by using cheaper
instructions where possible, in preference to UBFX.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33843}
2016-02-09 11:14:24 +00:00
ulan
edde7b28f6 Filter out invalid slots in store buffer eagerly during object transition.
BUG=chromium:578883
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#33841}
2016-02-09 10:48:23 +00:00
hpayer
bf521632ca Tenure long-living descriptor arrays.
BUG=chromium:580971
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33840}
2016-02-09 10:25:02 +00:00
mstarzinger
b881c908a1 Switch GetConcurrentlyOptimizedCode to MaybeHandle.
The function in question can already return an empty handle in the case
of failures. This makes that contract explicit by using MaybeHandle like
all other compiler API functions.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33839}
2016-02-09 09:47:57 +00:00
yangguo
33c78c39d7 [regexp] simplify unanchored advance for unicode regexps.
When doing advance at the start of an unanchored unicode regexp,
we do not have to care about surrogate pairs. If we actually advance
into the middle of a surrogate pair, the only choice is to also
consume trail surrogate as nothing else can match from there.

This reduces the emitted code slightly. By not having choice in the
loop, we do not have to push backtrack onto the stack, preventing
stack overflow.

R=erik.corry@gmail.com, erikcorry@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33838}
2016-02-09 09:11:24 +00:00
yangguo
5082eaee5f [regexp] fix off-by-one in UnicodeRangeSplitter.
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33837}
2016-02-09 09:10:31 +00:00
mstarzinger
3c8edd316f [interpreter] Workaround for unused frame states.
This is a temporary workaround for bytecodes which are not guaranteed
to actually use the frame states being created for them. One example
for this are runtime calls to intrinsics, or to runtime functions for
which the frame state count is zero in Linkage::FrameStateInputCount.

This will eventually be reworked into a more generic mechanism that
attaches frame states in the BytecodeGraphBuilder::VisitBytecodes
iteration method itself, instead of in the individual visitors.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33836}
2016-02-09 08:41:18 +00:00
bmeurer
dca275bac9 Revert of [builtins] Remove bunch of uses of %_Arguments and %_ArgumentsLength. (patchset #1 id:1 of https://codereview.chromium.org/1678953004/ )
Reason for revert:
Breaks tree

Original issue's description:
> [builtins] Remove bunch of uses of %_Arguments and %_ArgumentsLength.
>
> There are a bunch of places in our builtins where we use %_Arguments and
> %_ArgumentsLength for no good reason, as arguments object and/or rest
> parameter is as good and performant in these cases. Now the only uses
> of %_Arguments and %_ArgumentsLength left are in string.js, which
> requires dedicated investigation.
>
> R=yangguo@chromium.org
>
> Committed: https://crrev.com/2160429fd458e3c095475e718c97f77ac90d906f
> Cr-Commit-Position: refs/heads/master@{#33834}

TBR=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/1677063005

Cr-Commit-Position: refs/heads/master@{#33835}
2016-02-09 08:03:25 +00:00
bmeurer
2160429fd4 [builtins] Remove bunch of uses of %_Arguments and %_ArgumentsLength.
There are a bunch of places in our builtins where we use %_Arguments and
%_ArgumentsLength for no good reason, as arguments object and/or rest
parameter is as good and performant in these cases. Now the only uses
of %_Arguments and %_ArgumentsLength left are in string.js, which
requires dedicated investigation.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33834}
2016-02-09 07:17:52 +00:00
bmeurer
00f7d1f5f8 [intrinsics] Kill the %_IsMinusZero intrinsic.
By now only the default %TypedArray%.prototype.sort compare function
and the JS implementation of SameValueZero were still using the odd
%_IsMinusZero intrinsic, whose semantics both included a number check
(actually HeapNumber test) plus testing if the heap number stores the
special -0 value. In both cases we already know that we deal with
number so we can reduce it to a simple number test for -0, which can
be expressed via dividing 1 by that value and checking the sign of
the result. In case of the compare function, we can be even smarter
and work with the reciprocal values in case x and y are equal to 0
(although long term we should probably rewrite the fast case for
the typed array sorting function in C++ anyway, which will be way,
way faster than our handwritten callback-style, type-feedback
polluted JS implementation).

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33833}
2016-02-09 06:28:53 +00:00
mbrandy
e0dc2cd5b6 PPC: Fix "[compiler] Remove the special case "prototype" load in class literals."
R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33831}
2016-02-08 22:25:09 +00:00
mbrandy
ceaccc911e PPC: [turbofan] Add TruncateFloat32ToUint32 operator to Turbofan.
Port 2166bd8ce5

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

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

Cr-Commit-Position: refs/heads/master@{#33830}
2016-02-08 22:12:42 +00:00
mbrandy
605aced062 PPC: [runtime] Optimize and unify rest parameters.
Port 3ef573e9f1

Original commit message:
    Replace the somewhat awkward RestParamAccessStub, which would always
    call into the runtime anyway with a proper FastNewRestParameterStub,
    which is basically based on the code that was already there for strict
    arguments object materialization. But for rest parameters we could
    optimize even further (leading to 8-10x improvements for functions with
    rest parameters), by fixing the internal formal parameter count:

    Every SharedFunctionInfo has a formal_parameter_count field, which
    specifies the number of formal parameters, and is used to decide whether
    we need to create an arguments adaptor frame when calling a function
    (i.e. if there's a mismatch between the actual and expected parameters).
    Previously the formal_parameter_count included the rest parameter, which
    was sort of unfortunate, as that meant that calling a function with only
    the non-rest parameters still required an arguments adaptor (plus some
    other oddities). Now with this CL we fix, so that we do no longer
    include the rest parameter in that count. Thereby checking for rest
    parameters is very efficient, as we only need to check whether there is
    an arguments adaptor frame, and if not create an empty array, otherwise
    check whether the arguments adaptor frame has more parameters than
    specified by the formal_parameter_count.

    The FastNewRestParameterStub is written in a way that it can be directly
    used by Ignition as well, and with some tweaks to the TurboFan backends
    and the CodeStubAssembler, we should be able to rewrite it as
    TurboFanCodeStub in the near future.

    Drive-by-fix: Refactor and unify the CreateArgumentsType which was
    different in TurboFan and Ignition; now we have a single enum class
    xwhich is used in both TurboFan and Ignition.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:2159
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33829}
2016-02-08 22:11:31 +00:00
binji
7a004a02da [wasm] Put the condition last in kExprBrIf.
To bring V8 into line with the proposed design changes in:

 https://github.com/WebAssembly/design/pull/489

(This CL is forked from https://codereview.chromium.org/1634673002/.
That CL doesn't merge cleanly, and I can't update it.)

TBR=titzer@chromium.org
LOG=Y
BUG=chromium:575167

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

Cr-Commit-Position: refs/heads/master@{#33828}
2016-02-08 21:19:26 +00:00
littledan
43cd128eff Stage --harmony-species flag, enabling Symbol.species
This patch moves Symbol.species support to the "experimental JavaScript
features" flag. While @@species is still a performance hit, it doesn't seem
like it would make the web unusably slow; shipping would still have to
wait on fixing the performance regression, but staging this version should
yield valuable web compatibility information.

R=cbruni
BUG=v8:4093
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#33827}
2016-02-08 21:18:17 +00:00
littledan
e1de522afa Extend subarray web compatibility fix to --harmony-species
ES2016 TypedArray subclassing semantics break the Node.js Buffer module,
also used on the web. I wrote a pull request against the web and Node
versions to fix the issue, but the pull request has not yet been granted,
and this is blocking shipping the change. For now, this patch extends the
web compatibility workaround to the --harmony-species flag, so that
Symbol.species and associated subclassing semantics can ship independently.

R=cbruni
BUG=v8:4665
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#33826}
2016-02-08 21:16:49 +00:00
mbrandy
46bf5aa240 PPC: [turbofan] Add RoundUint32ToFloat32 operator to Turbofan.
Port 187b3f2845

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

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

Cr-Commit-Position: refs/heads/master@{#33825}
2016-02-08 21:07:26 +00:00
akos.palfi
770a1bf53a MIPS: Fix '[interpreter] move the dispatch table off heap.'
TEST=cctest/test-interpreter/InterpreterTryCatch,
     cctest/test-run-bytecode-graph-builder/BytecodeGraphBuilderTryCatch,
     cctest/test-run-bytecode-graph-builder/BytecodeGraphBuilderTryFinally2

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33824}
2016-02-08 20:53:13 +00:00
mbrandy
4d85caff1b PPC: New page local store buffer.
Port bb883395a8

Original commit message:
    This replaces the global remembered set with per-page remembered sets.

    Each page in the old space, map space, and large object space keeps track of
    the set of slots in the page pointing to the new space.

    The data structure for storing slot sets is a two-level bitmap, which allows
    us to remove the store buffer overflow and SCAN_ON_SCAVENGE logic.

    Design doc: https://goo.gl/sMKCf7

R=ulan@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=chromium:578883
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#33823}
2016-02-08 20:44:24 +00:00
mstarzinger
5fdf5c1e4d [interpreter] Remove special "prototype" load in class literals.
This allows us to remove the somewhat awkward BuildLoadObjectField
from the BytecodeGraphBuilder and also allows us to simplify the
bytecode stream for class literals.

R=oth@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33820}
2016-02-08 15:20:32 +00:00
mythria
90721a51a3 [Interpreter] Adds support for const/let variables to interpreter.
Adds implementation and tests to support const/let variables in the
interpreter.

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

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

Cr-Commit-Position: refs/heads/master@{#33819}
2016-02-08 14:14:57 +00:00
caitpotter88
e708dd54b9 reland [es7] refactor and fix Object.values() / Object.entries()
Previously, Object.values() and Object.entries() were piggy-backing on
Object.keys(). This meant that they would pre-filter non-enumerable properties,
violating the runtime behaviour of the methods. Unfortunately, this does not
match the current proposal text.

Also incorporates several tests verifying this behaviour based on tests included
in the ChakraCore implementation.

In this reland, the new patch fills up the longer-lasting FixedArray with
`undefined` to avoid the crash in Heap::Verify().

Originally reviewed at https://codereview.chromium.org/1637753004

BUG=v8:4663
LOG=N
R=adamk@chromium.org, rossberg@chromium.org, littledan@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33818}
2016-02-08 14:11:05 +00:00
mstarzinger
664110f882 Remove --stop-at flag from several backends.
The flag in question is a debug-only flag supported by full-codegen and
Crankshaft only. In it's current form there are some unresolved issues:
- The flag is defeated by inlining in Crankshaft.
- The flag is not supported by TurboFan.
- The flag is not supported by Ignition.

Instead of addressing the above issues and increasing maintenance cost
for all backends and also given the "slim" test coverage, this CL fully
removes the support from all backends.

R=bmeurer@chromium.org,jkummerow@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33817}
2016-02-08 13:57:39 +00:00
verwaest
d2503c4dbd Mark maps having a hidden prototype rather than maps of hidden prototypes.
Generally we only care whether the next object is a hidden prototype.
It's simpler to check whether the current object has a hidden prototype
instead of walking to the next prototype and checking its map.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33816}
2016-02-08 13:50:23 +00:00
bmeurer
1ffa4547a7 [compiler] Remove the special case "prototype" load in class literals.
This allows us to remove the somewhat awkward BuildLoadObjectField
from the AstGraphBuilder and also allows us to simplify fullcodegen
for class literals.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33815}
2016-02-08 13:14:26 +00:00
machenbach
0e6f0964f0 Revert of Do not eagerly instantiate accessors' JSFunction. (patchset #9 id:180001 of https://codereview.chromium.org/1609233002/ )
Reason for revert:
[Sheriff] Breaks gcmole:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20gcmole/builds/6260

Original issue's description:
> Do not eagerly instantiate accessors' JSFunction.
>
> BUG=
>
> Committed: https://crrev.com/4d46b510caf534d770ce19a01a11b8796304471b
> Cr-Commit-Position: refs/heads/master@{#33812}

TBR=verwaest@chromium.org,epertoso@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/1679683004

Cr-Commit-Position: refs/heads/master@{#33814}
2016-02-08 12:48:34 +00:00
bmeurer
07e9921f5a [turbofan] Introduce JSCreateLowering for optimizing JSCreate nodes.
This moves the JSCreate related functionality from JSTypedLowering into
a dedicated JSCreateLowering reducer. This is in preparation of landing
the support for optimized literals in TurboFan, which would blow up
JSTypedLowering quite seriously otherwise.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33813}
2016-02-08 12:33:59 +00:00
epertoso
4d46b510ca Do not eagerly instantiate accessors' JSFunction.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33812}
2016-02-08 12:26:16 +00:00
yangguo
07d40b74b6 [serializer] Ensure immortal immovable roots are deserialized correctly.
The serializer collects objects in iteration order, not in allocation
order. This means that the deserializer will put these objects in
iteration order onto the reserved pages as well. There is no guarantee
that objects that were on the first page will end up on the first page
after deserialization.

Until now we got lucky, since we only ever need one space per page for
the default snapshot. For roots, the iteration order and allocation
order also do not differ enough to cause any issue for immortal
immovable root objects. These objects need to stay on the first page of
its allocated space to not move.

However, let's make sure it stays this way, and we realize soon enough
if this assumption does not hold.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33810}
2016-02-08 10:48:58 +00:00
bmeurer
3ef573e9f1 [runtime] Optimize and unify rest parameters.
Replace the somewhat awkward RestParamAccessStub, which would always
call into the runtime anyway with a proper FastNewRestParameterStub,
which is basically based on the code that was already there for strict
arguments object materialization. But for rest parameters we could
optimize even further (leading to 8-10x improvements for functions with
rest parameters), by fixing the internal formal parameter count:

Every SharedFunctionInfo has a formal_parameter_count field, which
specifies the number of formal parameters, and is used to decide whether
we need to create an arguments adaptor frame when calling a function
(i.e. if there's a mismatch between the actual and expected parameters).
Previously the formal_parameter_count included the rest parameter, which
was sort of unfortunate, as that meant that calling a function with only
the non-rest parameters still required an arguments adaptor (plus some
other oddities). Now with this CL we fix, so that we do no longer
include the rest parameter in that count. Thereby checking for rest
parameters is very efficient, as we only need to check whether there is
an arguments adaptor frame, and if not create an empty array, otherwise
check whether the arguments adaptor frame has more parameters than
specified by the formal_parameter_count.

The FastNewRestParameterStub is written in a way that it can be directly
used by Ignition as well, and with some tweaks to the TurboFan backends
and the CodeStubAssembler, we should be able to rewrite it as
TurboFanCodeStub in the near future.

Drive-by-fix: Refactor and unify the CreateArgumentsType which was
different in TurboFan and Ignition; now we have a single enum class
which is used in both TurboFan and Ignition.

R=jarin@chromium.org, rmcilroy@chromium.org
TBR=rossberg@chromium.org
BUG=v8:2159
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33809}
2016-02-08 10:08:50 +00:00
ivica.bogosavljevic
b23d5389e0 Reland of MIPS: Add FPXX support to MIPS32R2
Fix failures on MIPS simulator because incomplete
handling of MTHC1 and MFHC1 in Fp32 mode
Fix failures on older kernels that have problems with
MTHC1 and MFHC1 in kernel FPU emulation

Original issue's description:
> Revert of MIPS: Add FPXX support to MIPS32R2 (patchset #3
> id:40001 of https://codereview.chromium.org/1586223004/ )
>
> Reason for revert:
> Revert patch due to a number of failures appearing on the > MIPS v8 simulator
>
> Original issue's description:
>> MIPS: Add FPXX support to MIPS32R2
>>
>> The JIT code generated by V8 is FPXX compliant
>> when v8 compiled with FPXX flag. This allows the code to
>> run in both FP=1 and FP=0 mode. It also alows v8 to be used
>> as a library by both FP32 and FP64 binaries.
>>
>> BUG=
>>
>> Committed: https://crrev.com/95110dde666158a230a823fd50a68558ad772320
>> Cr-Commit-Position: refs/heads/master@{#33576}

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33808}
2016-02-08 09:44:19 +00:00
jacob.bramley
8643391f0d [arm64] Allow immediate-index write barriers.
This is effectively a port of 4eff883b (r27731).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33807}
2016-02-08 09:11:00 +00:00
ulan
bb883395a8 New page local store buffer.
This replaces the global remembered set with per-page remembered sets.

Each page in the old space, map space, and large object space keeps track of
the set of slots in the page pointing to the new space.

The data structure for storing slot sets is a two-level bitmap, which allows
us to remove the store buffer overflow and SCAN_ON_SCAVENGE logic.

Design doc: https://goo.gl/sMKCf7

BUG=chromium:578883
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#33806}
2016-02-08 08:51:38 +00:00
verwaest
df71183380 [crankshaft] Allow inlining of base constructors
This speeds up base constructor instantiation by ~3x.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33805}
2016-02-08 08:42:16 +00:00
bmeurer
9257db7781 [runtime] Set constructor field on preallocated maps.
The preallocated JSAccessorPropertyDescriptor, JSDataPropertyDescriptor and
JSIteratorResult had the constructor field unset, which in turn causes
GetCreationContext() to fail for those instances.

R=verwaest@chromium.org
BUG=v8:4738
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33802}
2016-02-08 07:00:29 +00:00
yangguo
9acdc8844d Fix mips broken by 91009c50.
TBR=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33801}
2016-02-08 06:58:26 +00:00
bmeurer
f3b0dbb5e7 [runtime] We don't need an actual instance type for JSIteratorResult.
It's fine to use JS_OBJECT_TYPE for JSIteratorResult and only have a
preallocated initial map for them to avoid unnecessary polymorphism
from generators / builtin iterators. The instance type doesn't
provide any advantage, since we always have to treat JSIteratorResult
objects as regular JSObjects later.

R=yangguo@chromium.org
TBR=hpayer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33800}
2016-02-08 06:55:46 +00:00
ishell
da213b6e37 [api] Make ObjectTemplate::SetNativeDataProperty() work even if the ObjectTemplate does not have a constructor.
Previously ObjectTemplate::New() logic relied on the fact that all the accessor properties are already installed in the initial map of the function object of the constructor FunctionTemplate.
When the FunctionTemplate were instantiated the accessors of the instance templates from the whole inheritance chain were accumulated and added to the initial map.
ObjectTemplate::SetSetAccessor() used to explicitly ensure that the ObjectTemplate has a constructor and therefore an initial map to add all accessors to.

The new approach is to add all the accessors and data properties to the object exactly when the ObjectTemplate is instantiated. In order to keep it fast we now cache the object boilerplates in the Isolate::template_instantiations_cache (the former function_cache), so the object creation turns to be a deep copying of the boilerplate object.

BUG=chromium:579009
LOG=Y

Committed: https://crrev.com/6a118774244d087b5979e9291d628a994f21d59d
Cr-Commit-Position: refs/heads/master@{#33674}

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

Cr-Commit-Position: refs/heads/master@{#33798}
2016-02-06 18:10:36 +00:00
jing.bao
2166bd8ce5 [turbofan] Add TruncateFloat32ToUint32 operator to Turbofan.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33797}
2016-02-06 18:09:35 +00:00
jing.bao
187b3f2845 [turbofan] Add RoundUint32ToFloat32 operator to Turbofan.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33796}
2016-02-06 18:08:09 +00:00
zhengxing.li
0067ed0f26 X87: [fullcode] Change fullcode to compile finally using the token approach.
port 334d17946c (r33780)

  original commit message:
  This change should unify handling of finally blocks in Turbofan's
  AstGraphBuilder and in full-code. This should enable smooth deoptimization
  from finally blocks.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33794}
2016-02-06 18:05:53 +00:00
aseemgarg
0e22baac12 fix int type coercion in asm to wasm
R=bradnelson@chromium.org
BUG=https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST=asm-wasm.js
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33793}
2016-02-06 00:57:02 +00:00
mbrandy
69941bcaf1 PPC: [fullcode] Change fullcode to compile finally using the token approach.
Port 334d17946c

Original commit message:

    This change should unify handling of finally blocks in Turbofan's
    AstGraphBuilder and in full-code. This should enable smooth deoptimization
    from finally blocks.

R=jarin@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33792}
2016-02-05 20:50:37 +00:00
balazs.kilvady
a58c750ccc MIPS: Fix FPU min, max, mina, maxa in simulator.
BUG=
TEST=cctest/test-assembler-mips/min_max, cctest/test-assembler-mips/mina_maxa, cctest/test-assembler-mips64/min_max, cctest/test-assembler-mips64/mina_maxa

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

Cr-Commit-Position: refs/heads/master@{#33790}
2016-02-05 17:59:05 +00:00
mtrofin
3dc2635d3b [turbofan] Validate split-edge form
We assume split-edge form throughout the register allocation pipeline,
so added validation in isel.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33789}
2016-02-05 16:44:37 +00:00
mlippautz
f222240374 [platform] Add NumberOfAvailableBackgroundThreads
The call can be used by the embedder to provide information on the workers
executing background tasks.

BUG=chromium:524425
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33788}
2016-02-05 15:37:37 +00:00
machenbach
bdfcc61325 Revert of [es7] refactor and fix Object.values() / Object.entries() (patchset #6 id:100001 of https://codereview.chromium.org/1637753004/ )
Reason for revert:
[Sheriff] Breaks gc stress:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20gc%20stress/builds/1642

Original issue's description:
> [es7] refactor and fix Object.values() / Object.entries()
>
> Previously, Object.values() and Object.entries() were piggy-backing on
> Object.keys(). This meant that they would pre-filter non-enumerable properties,
> violating the runtime behaviour of the methods. Unfortunately, this does not
> match the current proposal text.
>
> Also incorporates several tests verifying this behaviour based on tests included
> in the ChakraCore implementation.
>
> BUG=v8:4663
> LOG=N
> R=adamk@chromium.org, rossberg@chromium.org, littledan@chromium.org
>
> Committed: https://crrev.com/5c5ccd9d7f8693990d1a9eb26ba3a94f376dcf0b
> Cr-Commit-Position: refs/heads/master@{#33782}

TBR=littledan@chromium.org,adamk@chromium.org,cbruni@chromium.org,rossberg@chromium.org,caitpotter88@gmail.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4663

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

Cr-Commit-Position: refs/heads/master@{#33787}
2016-02-05 15:36:02 +00:00
mstarzinger
8b4e1042ae [turbofan] Deprecate --turbo-try-finally flag.
R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33786}
2016-02-05 15:20:44 +00:00
rmcilroy
b9f42396e7 [Interpreter] Ensure StackCheck bytecode handler is in split-edge form.
BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33785}
2016-02-05 15:10:43 +00:00
epertoso
75cc8352d0 [turbofan] Fixes the code generation for branches on x64 when the condition is Word64Equal.
Before:

REX.W cmpq r9,r8
setzl r8l
movzxbl r8,r8
REX.W cmpq r8,0x0
jz 185

After:

REX.W cmpq r9,r8
jnz 149

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

Cr-Commit-Position: refs/heads/master@{#33784}
2016-02-05 15:01:09 +00:00
ahaas
563539a3d6 [wasm] min/max does not return signaling NaNs anymore.
To avoid returning a signaling NaN the result is multiplied by 1.0.

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

BUG=4733
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#33783}
2016-02-05 15:00:24 +00:00
caitpotter88
5c5ccd9d7f [es7] refactor and fix Object.values() / Object.entries()
Previously, Object.values() and Object.entries() were piggy-backing on
Object.keys(). This meant that they would pre-filter non-enumerable properties,
violating the runtime behaviour of the methods. Unfortunately, this does not
match the current proposal text.

Also incorporates several tests verifying this behaviour based on tests included
in the ChakraCore implementation.

BUG=v8:4663
LOG=N
R=adamk@chromium.org, rossberg@chromium.org, littledan@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33782}
2016-02-05 14:38:34 +00:00
yangguo
91009c5095 [interpreter] move the dispatch table off heap.
This makes the dispatch table similar to the builtins code list and makes
sure that the dispatch table does not move.

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

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

Cr-Commit-Position: refs/heads/master@{#33781}
2016-02-05 14:33:11 +00:00
jarin
334d17946c [fullcode] Change fullcode to compile finally using the token approach.
This change should unify handling of finally blocks in Turbofan's
AstGraphBuilder and in full-code. This should enable smooth deoptimization
from finally blocks.

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

Cr-Commit-Position: refs/heads/master@{#33780}
2016-02-05 14:15:26 +00:00
mstarzinger
badaf79f30 [interpreter] Rename HandlerTable::depth field.
This makes the field in question more generic by renaming it from the
previous "depth" to "data". Pure refactoring, no function change.

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

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

Cr-Commit-Position: refs/heads/master@{#33779}
2016-02-05 13:52:11 +00:00
zhengxing.li
a0f6d5ed94 [debugger] Use code offsets from frame summary in FromFrame Function.
The CL 33579 (https://codereview.chromium.org/1618343002) use code offsets instead of raw PC where possible.

But the offset maybe come from an optimized frame, not the un-optimized frame that FromCodeOffset and BreakIndexFromCodeOffset function expect.
So The offset from optimized frame can't be used in FromCodeOffset and  BreakIndexFromCodeOffset function.

This CL use the frame summary to find the corresponding code offset in unoptimized code according to Yang's suggestion.

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

Cr-Commit-Position: refs/heads/master@{#33778}
2016-02-05 13:50:35 +00:00
jkummerow
5d2c09a829 Fix Array.prototype.sort for *_STRING_WRAPPER_ELEMENTS
Trying to sort a string should throw a TypeError, proper handling
of elements just needs to get out of the way.

BUG=chromium:584188
LOG=n
R=cbruni@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33777}
2016-02-05 13:36:51 +00:00
titzer
59b922fb4e [wasm] Put the condition last in kExprSelect.
To bring V8 into line with the proposed design changes in:

 https://github.com/WebAssembly/design/pull/489

R=ahaas@chromium.org,bradnelson@chromium.org
LOG=Y
BUG=chromium:575167
BUG=v8:4735

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

Cr-Commit-Position: refs/heads/master@{#33776}
2016-02-05 13:34:53 +00:00
yangguo
85eff14c37 [interpreter] source positions should not be emitted for dead code.
R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33775}
2016-02-05 13:29:45 +00:00
bmeurer
da5f4a6ad8 [builtins] Migrate Object.getOwnPropertyDescriptor to C++.
The implementation of Object.getOwnPropertyDescriptor always called into
C++ anyway, so there's no need to have this JavaScript wrapper around at
all.

CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_chromium_rel_ng
R=yangguo@chromium.org

Committed: https://crrev.com/3fdd37b028f4711d0f6dcb038f575ce08ef0cfa3
Cr-Commit-Position: refs/heads/master@{#33379}

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

Cr-Commit-Position: refs/heads/master@{#33773}
2016-02-05 13:12:11 +00:00
jochen
14e8ee0763 Always load data for access check callbacks
R=verwaest@chromium.org
BUG=none
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33771}
2016-02-05 12:56:18 +00:00
yangguo
8a2d571734 [bootstrapper] extra natives must not use natives syntax.
R=bmeurer@chromium.org, domenic@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33770}
2016-02-05 12:33:55 +00:00
cbruni
d037e6d6e7 [telemetry] Counter Cleanups
- remove unused counters
- add "ic" prefix to all ic-counters
- add more counter: maps-created, global deopts (not used yet)

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33768}
2016-02-05 12:22:48 +00:00
jarin
52f2dbcac1 [turbofan] Reducers should revisit end after merging to it.
Review URL: https://codereview.chromium.org/1675433003

Cr-Commit-Position: refs/heads/master@{#33767}
2016-02-05 11:01:44 +00:00
mvstanton
3f36e658c8 Revert of Type Feedback Vector lives in the closure (patchset #2 id:40001 of https://codereview.chromium.org/1668103002/ )
Reason for revert:
Must revert for now due to chromium api natives issues.

Original issue's description:
> Type Feedback Vector lives in the closure
>
> (RELAND: the problem before was a missing write barrier for adding the code
> entry to the new closure. It's been addressed with a new macro instruction
> and test. The only change to this CL is the addition of two calls to
> __ RecordWriteCodeEntryField() in the platform CompileLazy builtin.)
>
> We get less "pollution" of type feedback if we have one vector per native
> context, rather than one for the whole system. This CL moves the vector
> appropriately.
>
> We rely more heavily on the Optimized Code Map in the SharedFunctionInfo. The
> vector actually lives in the first slot of the literals array (indeed there is
> great commonality between those arrays, they can be thought of as the same
> thing). So we make greater effort to ensure there is a valid literals array
> after compilation.
>
> This meant, for performance reasons, that we needed to extend
> FastNewClosureStub to support creating closures with literals. And ultimately,
> it drove us to move the optimized code map lookup out of FastNewClosureStub
> and into the compile lazy builtin.
>
> The heap change is trivial so I TBR Hannes for it...
> Also, Yang has had a look at the debugger changes already and approved 'em. So he is TBR style too.
> And Benedikt reviewed it as well.
>
> TBR=hpayer@chromium.org, yangguo@chromium.org, bmeurer@chromium.org
>
> BUG=
>
> Committed: https://crrev.com/bb31db3ad6de16f86a61f6c7bbfd3274e3d957b5
> Cr-Commit-Position: refs/heads/master@{#33741}

TBR=bmeurer@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/1670813005

Cr-Commit-Position: refs/heads/master@{#33766}
2016-02-05 10:48:35 +00:00
mvstanton
14fa68a305 Revert of PPC: Type Feedback Vector lives in the closure (patchset #1 id:1 of https://codereview.chromium.org/1671553002/ )
Reason for revert:
issues with chromium api natives, must revert for now, thanks.

Original issue's description:
> PPC: Type Feedback Vector lives in the closure
>
> Port bb31db3ad6
>
> Original commit message:
>     (RELAND: the problem before was a missing write barrier for adding the code
>     entry to the new closure. It's been addressed with a new macro instruction
>     and test. The only change to this CL is the addition of two calls to
>     __ RecordWriteCodeEntryField() in the platform CompileLazy builtin.)
>
>     We get less "pollution" of type feedback if we have one vector per native
>     context, rather than one for the whole system. This CL moves the vector
>     appropriately.
>
>     We rely more heavily on the Optimized Code Map in the SharedFunctionInfo. The
>     vector actually lives in the first slot of the literals array (indeed there is
>     great commonality between those arrays, they can be thought of as the same
>     thing). So we make greater effort to ensure there is a valid literals array
>     after compilation.
>
>     This meant, for performance reasons, that we needed to extend
>     FastNewClosureStub to support creating closures with literals. And ultimately,
>     it drove us to move the optimized code map lookup out of FastNewClosureStub
>     and into the compile lazy builtin.
>
>     The heap change is trivial so I TBR Hannes for it...
>     Also, Yang has had a look at the debugger changes already and approved 'em. So he is TBR style too.
>     And Benedikt reviewed it as well.
>
> R=mvstanton@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
> BUG=
>
> Committed: https://crrev.com/753ad25efa4790ea7c80aceecfa223c3436ca36f
> Cr-Commit-Position: refs/heads/master@{#33753}

TBR=joransiu@ca.ibm.com,jyan@ca.ibm.com,michael_dawson@ca.ibm.com,mbrandy@us.ibm.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33765}
2016-02-05 10:45:14 +00:00
mvstanton
0ff456af62 Revert of X87: Type Feedback Vector lives in the closure. (patchset #1 id:1 of https://codereview.chromium.org/1672643002/ )
Reason for revert:
Bugs with chromium api natives, must revert for now.

Original issue's description:
> X87: Type Feedback Vector lives in the closure.
>
>   port bb31db3ad6 (r33741)
>
>   original commit message:
>   (RELAND: the problem before was a missing write barrier for adding the code
>   entry to the new closure. It's been addressed with a new macro instruction
>   and test. The only change to this CL is the addition of two calls to
>   __ RecordWriteCodeEntryField() in the platform CompileLazy builtin.)
>
>   We get less "pollution" of type feedback if we have one vector per native
>   context, rather than one for the whole system. This CL moves the vector
>   appropriately.
>
>   We rely more heavily on the Optimized Code Map in the SharedFunctionInfo. The
>   vector actually lives in the first slot of the literals array (indeed there is
>   great commonality between those arrays, they can be thought of as the same
>   thing). So we make greater effort to ensure there is a valid literals array
>   after compilation.
>
>   This meant, for performance reasons, that we needed to extend
>   FastNewClosureStub to support creating closures with literals. And ultimately,
>   it drove us to move the optimized code map lookup out of FastNewClosureStub
>   and into the compile lazy builtin.
>
>   The heap change is trivial so I TBR Hannes for it...
>   Also, Yang has had a look at the debugger changes already and approved 'em. So he is TBR style too.
>   And Benedikt reviewed it as well.
>
> BUG=
>
> Committed: https://crrev.com/25bfba9329b93cb8ebefe1446e024005a4227a93
> Cr-Commit-Position: refs/heads/master@{#33759}

TBR=chunyang.dai@intel.com,weiliang.lin@intel.com,zhengxing.li@intel.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/1673613002

Cr-Commit-Position: refs/heads/master@{#33764}
2016-02-05 10:43:53 +00:00
neis
9096aef4c1 [generators] Remove full-codegen implementation of yield*.
The recently introduced desugaring of yield* renders this code dead.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33762}
2016-02-05 08:54:01 +00:00
ishell
3c71bd1846 [es6] Fix tail Call nodes marking.
TBR=rossberg@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33761}
2016-02-05 08:46:51 +00:00
zhengxing.li
c357a87a79 X87: [generators] Implement Generator.prototype.return.
port dbd8640813 (r33744)

  original commit message:
  Note: This is currently only used by yield*, we still need to support it in
  other places (such as for-of loops).  It can be used manually of course.

  (This CL does not touch the full-codegen implementation of yield* because that
  code is already dead.  The yield* desugaring already supports return and doesn't
  need to be touched.)

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33760}
2016-02-05 07:41:34 +00:00
zhengxing.li
25bfba9329 X87: Type Feedback Vector lives in the closure.
port bb31db3ad6 (r33741)

  original commit message:
  (RELAND: the problem before was a missing write barrier for adding the code
  entry to the new closure. It's been addressed with a new macro instruction
  and test. The only change to this CL is the addition of two calls to
  __ RecordWriteCodeEntryField() in the platform CompileLazy builtin.)

  We get less "pollution" of type feedback if we have one vector per native
  context, rather than one for the whole system. This CL moves the vector
  appropriately.

  We rely more heavily on the Optimized Code Map in the SharedFunctionInfo. The
  vector actually lives in the first slot of the literals array (indeed there is
  great commonality between those arrays, they can be thought of as the same
  thing). So we make greater effort to ensure there is a valid literals array
  after compilation.

  This meant, for performance reasons, that we needed to extend
  FastNewClosureStub to support creating closures with literals. And ultimately,
  it drove us to move the optimized code map lookup out of FastNewClosureStub
  and into the compile lazy builtin.

  The heap change is trivial so I TBR Hannes for it...
  Also, Yang has had a look at the debugger changes already and approved 'em. So he is TBR style too.
  And Benedikt reviewed it as well.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33759}
2016-02-05 07:23:34 +00:00
zhengxing.li
acab11e0cb X87: Write barrier for storing a code entry, and usage in CompileLazy builtin.
port 477e133698 (r33718)

  original commit message:

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33758}
2016-02-05 07:05:58 +00:00
aseemgarg
f060922369 Add Foreign Functions to asm to wasm
R=bradnelson@chromium.org
BUG=https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST=asm-wasm.js
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33757}
2016-02-05 02:07:58 +00:00
adamk
21c045a2fa Support computed properties for ES2015 Function.name
Adds a new runtime function, %DefineDataPropertyInLiteral, which
takes a fifth argument specifying whether the property and value
are syntactically such that the value is a function (or class)
literal that should have its name set at runtime.

The new runtime call also allows us to eliminate the now-redundant
%DefineClassMethod runtime function.

This should get much less ugly once we can desugar the "dynamic"
part of object literals in the parser (but that work is currently
blocked on having a performant way of desugaring literals).

BUG=v8:3699, v8:3761
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33756}
2016-02-04 22:36:48 +00:00
mbrandy
ca255fd5e6 PPC: Write barrier for storing a code entry, and usage in CompileLazy builtin.
Port 477e133698

R=mvstanton@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33755}
2016-02-04 22:12:24 +00:00
mbrandy
bedb3344aa PPC: [generators] Implement Generator.prototype.return.
Port dbd8640813

Original commit message:
    Note: This is currently only used by yield*, we still need to support it in
    other places (such as for-of loops).  It can be used manually of course.

    (This CL does not touch the full-codegen implementation of yield* because that
    code is already dead.  The yield* desugaring already supports return and doesn't
    need to be touched.)

R=neis@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:3566
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#33754}
2016-02-04 22:11:38 +00:00
mbrandy
753ad25efa PPC: Type Feedback Vector lives in the closure
Port bb31db3ad6

Original commit message:
    (RELAND: the problem before was a missing write barrier for adding the code
    entry to the new closure. It's been addressed with a new macro instruction
    and test. The only change to this CL is the addition of two calls to
    __ RecordWriteCodeEntryField() in the platform CompileLazy builtin.)

    We get less "pollution" of type feedback if we have one vector per native
    context, rather than one for the whole system. This CL moves the vector
    appropriately.

    We rely more heavily on the Optimized Code Map in the SharedFunctionInfo. The
    vector actually lives in the first slot of the literals array (indeed there is
    great commonality between those arrays, they can be thought of as the same
    thing). So we make greater effort to ensure there is a valid literals array
    after compilation.

    This meant, for performance reasons, that we needed to extend
    FastNewClosureStub to support creating closures with literals. And ultimately,
    it drove us to move the optimized code map lookup out of FastNewClosureStub
    and into the compile lazy builtin.

    The heap change is trivial so I TBR Hannes for it...
    Also, Yang has had a look at the debugger changes already and approved 'em. So he is TBR style too.
    And Benedikt reviewed it as well.

R=mvstanton@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33753}
2016-02-04 22:10:13 +00:00
caitpotter88
ee10b595f9 [esnext] implement Object.getOwnPropertyDescriptors() proposal
BUG=v8:4725
LOG=N
R=adamk@chromium.org, cbruni@chromium.org, rossberg@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33752}
2016-02-04 21:56:24 +00:00
alph
271f68ba02 Fix crash in SafeStackFrameIterator related to native frames entry/exit
There might be several ExternalCallbackScope's created
during the native callback. Remove the assert that is not
aligned with that.

Moreover this iterator must work for any kind of
stacks including corrupted ones.

BUG=v8:4705
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33751}
2016-02-04 20:00:48 +00:00
adamk
1c318a9e4c Remove is_parenthesized bit from Expression and PreParserExpression
This bit was ostensibly being used to provide appropriate syntax
errors for invalid destructuring assignment patterns, but adding a
single call to RecordPatternError() (in place of
BindingPatternUnexpectedToken()) seems to have replaced the need for it.

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

Cr-Commit-Position: refs/heads/master@{#33750}
2016-02-04 18:54:28 +00:00
adamk
3d56b0d7c0 Remove unused 'needs_init' member of ParsingResult
Also various related cleanup in ParseVariableDeclarations(). The only
changes in logic are explained below:

  - We were redundantly checking for parenthesized binding patterns;
    these are already ruled out by BindingPatternUnexpectedToken()
    calls in the places where we hit an LPAREN.
  - There's no need to default-initialize a LET-mode variable in a
    for-each loop, just as there isn't for CONST or CONST_LEGACY
    (ParseForStatement will take care of properly initializing all
    of the above).

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

Cr-Commit-Position: refs/heads/master@{#33749}
2016-02-04 18:44:33 +00:00
adamk
ea8f782799 Remove redundant/unnecessary variables and checks in ParseForStatement
Review URL: https://codereview.chromium.org/1663773003

Cr-Commit-Position: refs/heads/master@{#33748}
2016-02-04 18:39:22 +00:00
cbruni
07d05dddce [proxies] allow duplicate keys for [[OwnPropertyKeys]] trap.
BUG=v8:4724, v8:1543
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33747}
2016-02-04 17:55:35 +00:00
oth
1b436ae168 [interpreter] Support for ES6 class literals.
Port of class literal support from the
ast-graph-builder implementation.

R=rmcilroy@chromium.org,mstarzinger@chromium.org
BUG=v8:4280,v8:4682
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33746}
2016-02-04 17:47:38 +00:00
neis
dbd8640813 [generators] Implement Generator.prototype.return.
Note: This is currently only used by yield*, we still need to support it in
other places (such as for-of loops).  It can be used manually of course.

(This CL does not touch the full-codegen implementation of yield* because that
code is already dead.  The yield* desugaring already supports return and doesn't
need to be touched.)

BUG=v8:3566
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#33744}
2016-02-04 17:14:15 +00:00
neis
813f48ff7e Fix embarrassing bug in last-minute change to yield* CL.
R=littledan@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33743}
2016-02-04 16:36:39 +00:00
mvstanton
bb31db3ad6 Type Feedback Vector lives in the closure
(RELAND: the problem before was a missing write barrier for adding the code
entry to the new closure. It's been addressed with a new macro instruction
and test. The only change to this CL is the addition of two calls to
__ RecordWriteCodeEntryField() in the platform CompileLazy builtin.)

We get less "pollution" of type feedback if we have one vector per native
context, rather than one for the whole system. This CL moves the vector
appropriately.

We rely more heavily on the Optimized Code Map in the SharedFunctionInfo. The
vector actually lives in the first slot of the literals array (indeed there is
great commonality between those arrays, they can be thought of as the same
thing). So we make greater effort to ensure there is a valid literals array
after compilation.

This meant, for performance reasons, that we needed to extend
FastNewClosureStub to support creating closures with literals. And ultimately,
it drove us to move the optimized code map lookup out of FastNewClosureStub
and into the compile lazy builtin.

The heap change is trivial so I TBR Hannes for it...
Also, Yang has had a look at the debugger changes already and approved 'em. So he is TBR style too.
And Benedikt reviewed it as well.

TBR=hpayer@chromium.org, yangguo@chromium.org, bmeurer@chromium.org

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33741}
2016-02-04 15:41:23 +00:00
yangguo
86164a2573 [interpreter, debugger] implement debugger statement.
R=mstarzinger@chromium.org, rmcilroy@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33739}
2016-02-04 15:07:06 +00:00
zhengxing.li
ce16b44be3 x87: fixed x87 stack state in TurboFan
Unstructured control flow caused by excpetion handling leads to a wrong x87 stack
  state. This patch is to reset the x87 state at the hanlder entry point.

  Thanks for help from weiliang.lin@intel.com.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33738}
2016-02-04 14:57:35 +00:00
verwaest
b6a353129a Reland of [runtime] further dismantle AccessorInfoHandling, reducing it to the single API usecase.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33737}
2016-02-04 14:47:48 +00:00
yangguo
8208dd6a6b [serializer] add synchronize codes to detect mismatch.
Synchronize calls in the heap iterator have been put there for the
serializer, which never actually made use of them. This CL fixes that.

R=vogelheim@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33736}
2016-02-04 14:22:27 +00:00
neis
5269944a18 [generators] Desugar yield*.
This CL deals with yield* by desugaring it in the parser.  Hence the
full-codegen implementation of it becomes obsolete and can be removed in a
future CL.

The only change in semantics should be that the results of the iterator's next
and throw methods are checked to be objects, which didn't happen before but is
required by the spec.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33735}
2016-02-04 14:13:03 +00:00
yangguo
34645da5b9 [interpreter] do not serialize bytecode for snapshot.
Code compiled during snapshot are overwhelmingly for functions
that are only used for bootstrapping. It makes no sense to
include them in the startup snapshot, which bloats up the snapshot size
and slows down deserialization.

Snapshot sizes for comparison, for ia32:
w/o --ignition:   484k
w/ --ignition:    537k
bytecode removed: 489k

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

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

Cr-Commit-Position: refs/heads/master@{#33734}
2016-02-04 13:49:49 +00:00
mstarzinger
76bfc16bea [interpreter] Switch context during stack unwinding.
This implements proper context switching while unwinding the stack due
to an exception being handled in interpreted code. The context under
which the handler is scoped is being preserved in a dedicated register
while the try-block is running. Both, the stack unwinding machinery as
well as the graph builder, restore the context from that register.

R=rmcilroy@chromium.org,bmeurer@chromium.org
BUG=v8:4674
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33733}
2016-02-04 13:43:55 +00:00
rmcilroy
1ce720f2a4 [Interpreter] Add explicit StackCheck bytecodes on function entry and back branches.
Moves the stack check from the function entry trampoline to instead be
after function activation using an explicit StackCheck bytecode. Also
add stack checks on back edges of loops.

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

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

Cr-Commit-Position: refs/heads/master@{#33730}
2016-02-04 12:33:48 +00:00
sigurds
5aa72daa88 [turbofan] Delay initialization in escape analysis
This is also a refactoring of the merge function in
escape analysis.

BUG=v8:4586
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33728}
2016-02-04 11:24:34 +00:00
yangguo
876d35e228 [interpreter] add source positions for call and call-new.
This change adds the basic infrastructure to record source
positions for bytecode.

R=rmcilroy@chromium.org, vogelheim@chromium.org
BUG=v8:4960
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33726}
2016-02-04 10:50:18 +00:00
machenbach
5a0df034d1 [Ignition] Use separate startup data for ignition.
BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33724}
2016-02-04 10:18:11 +00:00
titzer
9c006b724e [wasm] Refactor handling of operands to bytecodes.
This cleans up and simplifyies handling the bytes followin an opcode
with little helper structs that will be useful in the interpreter and
already have been in keeping OpcodeArity and OpcodeLength up to date
with the decoder.

R=bradnelson@chromium.org, ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33723}
2016-02-04 10:16:47 +00:00
mythria
9aa612cb2c [Interpreter] Adds support for rest parameters to interpreter.
Adds implementation and tests for rest parameters to interpreter.

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

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

Cr-Commit-Position: refs/heads/master@{#33722}
2016-02-04 10:03:17 +00:00
ahaas
1101739898 [wasm] Initial commit for the Int64Reducer.
The goal of the Int64Reducer is to replace all int64 nodes in a tf graph
with a set of int32 nodes such that 64 bit tf functions can be executed
on 32 bit platforms. At the moment the Int64Reducer only replaces
Int64Constants, TruncateInt64ToInt32, and Word64And.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33721}
2016-02-04 09:41:23 +00:00
bmeurer
85306a0a9d [compiler] Allow optimization of functions with rest parameters.
The parser should have never done this. The AstNumbering takes
care of disabling compilers for certain language constructs.

TBR=rossberg@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33720}
2016-02-04 09:04:40 +00:00
mvstanton
477e133698 Write barrier for storing a code entry, and usage in CompileLazy builtin.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33718}
2016-02-04 08:16:11 +00:00
bmeurer
264fa75e52 [math] Fix Math.hypot to properly call ToNumber on all arguments.
The spec requires all Math functions to first call ToNumber on all
arguments before doing any other observable operation.  So early
return in case of Infinity is not valid.

Drive-by-fix: Remove the use of %_Arguments / %_ArgumentsLength and
use (strict) arguments instead of allocating a temporary InternalArray
explicitly.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33717}
2016-02-04 07:23:27 +00:00
bmeurer
db74cccf8a [i18n] Replace uses of %_Arguments/%_ArgumentsLength with arguments.
No need to micro-optimize here, and in almost all cases here, using
arguments should result in roughly the same code w/ Crankshaft anyway.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33716}
2016-02-04 06:51:35 +00:00
mtrofin
1ecf58f409 [turbofan] fine grained in-block move optimization
So far, we've been moving down gaps wholesale. This change moves
individual move operations instead. This improves some benchmarks,
and should overall reduce code size, because it improves the chance of
reducing the number of moves.

For example, there are improvements on x64 in Emscripten (Bullet, in
particular) , JetStream geomean, Embenchen (zlib).

In the process of making this change, I noticed we can separate the
tasks performed by the move optimizer, as follows:

- group gaps into 1
- push gaps down, jumping instructions (these 2 were together before)
- merge blocks (and then push gaps down)
- finalize

We can do without a finalization list. This avoids duplicating storage -
we already have the list of instructions; it also simplifies the logic, since,
with this change, we may process an instruction's gap twice.

Compile time doesn't regress much (see pathological cases), but we
may want to avoid the allocations of the few sets used in the new code.
I'll do that in a subsequent change.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33715}
2016-02-04 06:30:34 +00:00
adamk
8a4a5bf9e0 Remove flags for ES2015 features shipped in M48
This removes --harmony-completion, --harmony-concat-spreadable, and
--harmony-tolength and moves the appropriate tests from harmony/ to es6/.

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

Cr-Commit-Position: refs/heads/master@{#33712}
2016-02-03 20:51:46 +00:00
mbrandy
bb1d2817f8 PPC: Minor improvements to MathMaxMin.
R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33711}
2016-02-03 20:44:37 +00:00
mbrandy
32b484efc4 PPC: Call RecordWriteIntoCode when storing the target object in the reloc info.
Port 44ec23ac5f

R=hpayer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=chromium:561449
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33710}
2016-02-03 20:37:18 +00:00
kozyatinskiy
3c3d7e7be8 Revert "Removed support deprecated (//@|/*@) source(URL|MappingURL)="
A lot of deverlopers use deprecated sourceURL syntax. We should add console warning message before removing this.
Original CL: https://codereview.chromium.org/1495633002/

BUG=chromium:558998
LOG=Y
R=yangguo@chromium.org,hablich@chromium.org,adamk@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33709}
2016-02-03 18:45:36 +00:00
oth
3c64400f19 [interpreter] Unify meaning of register count operands.
Unifies the meaning of kRegCount8 and kRegCount16 across bytecodes.
Call and CallJSRuntime had a slightly different use of the register
count operand. From this change forth, register count operands are
always based off of the previous register operand.

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

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

Cr-Commit-Position: refs/heads/master@{#33707}
2016-02-03 15:22:46 +00:00
yangguo
aff7bd54be [regexp] fix zero-length matches for RegExp.prototype.@@split.
BUG=v8:4717
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33706}
2016-02-03 14:49:07 +00:00
mythria
8d3e1ca357 [Interpreter] Adds support for with statement to interpreter.
Adds implementation and tests for with statement to interprter.

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

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

Cr-Commit-Position: refs/heads/master@{#33705}
2016-02-03 14:41:37 +00:00
mstarzinger
e814457675 [interpreter] Clear pending message object on handler entry.
This clears the currently pending message object whenever a try-block or
a finally-block is being entered in interpreted code. The intention is
to avoid memory leaks introduced by the message object. Also the message
object is being restored when a finally-block exits.

R=rmcilroy@chromium.org
TEST=cctest/test-heap/MessageObjectLeak
BUG=v8:4674
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33704}
2016-02-03 13:52:46 +00:00
balazs.kilvady
ebac85c0a4 MIPS: Use PC relative instructions on r6.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33703}
2016-02-03 13:31:30 +00:00
titzer
007e14ce4b [wasm] Rename local_int32_count to local_i32_count and similar textual replacements.
R=ahaas@chromium.org,jfb@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33702}
2016-02-03 11:06:45 +00:00
verwaest
158cd5cb5e [runtime] Remove receiver==holder check in IntegerIndexedExotic lookup
This was inconsistent in the spec in case of has vs get, set. Removing
receiver==holder simplifies the lookup; so tentatively removing this
additional check which was broken until yesterday anyway. See
https://github.com/tc39/ecma262/issues/347 for more information.

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

Cr-Commit-Position: refs/heads/master@{#33701}
2016-02-03 10:30:40 +00:00
bradnelson
255f4507ec Drop the compileRun + asmCompileRun methods from wasm.
Now that we have full fledged module instantiation,
keeping alive a second interface seems clunky.

Droping it and switching the tests.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=test-asm-validator,asm-wasm,other wasm
R=titzer@chromium.org,aseemgarg@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33700}
2016-02-03 10:16:22 +00:00
jochen
a75b2c8f69 Add the data parameter back to the access check callback
BUG=none
R=verwaest@chromium.org
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33699}
2016-02-03 10:02:35 +00:00
hablich
db47a31fb9 Revert of [api] Make ObjectTemplate::SetNativeDataProperty() work even if the ObjectTemplate does not have a … (patchset #3 id:80001 of https://codereview.chromium.org/1642223003/ )
Reason for revert:
Fails a lot of layout tests and blocks the roll. Can be easily reproduced with a local Chromium checkout.

Reference: https://codereview.chromium.org/1652413003/

Original issue's description:
> [api] Make ObjectTemplate::SetNativeDataProperty() work even if the ObjectTemplate does not have a constructor.
>
> Previously ObjectTemplate::New() logic relied on the fact that all the accessor properties are already installed in the initial map of the function object of the constructor FunctionTemplate.
> When the FunctionTemplate were instantiated the accessors of the instance templates from the whole inheritance chain were accumulated and added to the initial map.
> ObjectTemplate::SetSetAccessor() used to explicitly ensure that the ObjectTemplate has a constructor and therefore an initial map to add all accessors to.
>
> The new approach is to add all the accessors and data properties to the object exactly when the ObjectTemplate is instantiated. In order to keep it fast we now cache the object boilerplates in the Isolate::template_instantiations_cache (the former function_cache), so the object creation turns to be a deep copying of the boilerplate object.
>
> This CL also prohibits non-primitive properties in ObjectTemplate to avoid potential cross-context leaks.
>
> BUG=chromium:579009
> LOG=Y
>
> Committed: https://crrev.com/6a118774244d087b5979e9291d628a994f21d59d
> Cr-Commit-Position: refs/heads/master@{#33674}

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

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

Cr-Commit-Position: refs/heads/master@{#33698}
2016-02-03 09:53:18 +00:00
neis
a973f73465 Expect JSReceiver in Runtime_DeleteLookupSlot, not just JSObject.
BUG=chromium:583260
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33697}
2016-02-03 09:49:22 +00:00
hablich
86dd673c2c Reland of [heap] Simplify distribution of remaining memory during sweeping & compaction (patchset #1 id:1 of https://codereview.chromium.org/1661723003/ )
Reason for revert:
Bisection results show that this was not the culprit.

Original issue's description:
> Revert of [heap] Simplify distribution of remaining memory during sweeping & compaction (patchset #2 id:80001 of https://codereview.chromium.org/1653973003/ )
>
> Reason for revert:
> Very likely blocking roll: https://codereview.chromium.org/1652413003/
>
> Original issue's description:
> > [heap] Simplify distribution of remaining memory during sweeping & compaction
> >
> > BUG=chromium:524425
> > LOG=N
> >
> > Committed: https://crrev.com/f72923526ccaa8faef5c977267b0c074c4a44dfa
> > Cr-Commit-Position: refs/heads/master@{#33668}
>
> TBR=hpayer@chromium.org,mlippautz@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=chromium:524425
>
> Committed: https://crrev.com/a9441b0e7a2a56c2047482a3cc66e3ca2255444b
> Cr-Commit-Position: refs/heads/master@{#33695}

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

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

Cr-Commit-Position: refs/heads/master@{#33696}
2016-02-03 09:44:23 +00:00
hablich
a9441b0e7a Revert of [heap] Simplify distribution of remaining memory during sweeping & compaction (patchset #2 id:80001 of https://codereview.chromium.org/1653973003/ )
Reason for revert:
Very likely blocking roll: https://codereview.chromium.org/1652413003/

Original issue's description:
> [heap] Simplify distribution of remaining memory during sweeping & compaction
>
> BUG=chromium:524425
> LOG=N
>
> Committed: https://crrev.com/f72923526ccaa8faef5c977267b0c074c4a44dfa
> Cr-Commit-Position: refs/heads/master@{#33668}

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

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

Cr-Commit-Position: refs/heads/master@{#33695}
2016-02-03 08:50:06 +00:00
bmeurer
8ecbc2c5d6 [runtime] Remove unused prefix_argc from GetCallerArguments.
We always call GetCallerArguments with 0 for prefix_argc, and so there's
no use in having that parameter at all.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33694}
2016-02-03 06:22:17 +00:00
bmeurer
e4e418f3ef [runtime] Make %FunctionGetScript and %FunctionGetSourceCode robust.
R=jarin@chromium.org
BUG=chromium:582703
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33693}
2016-02-03 06:01:19 +00:00
bradnelson
da632baac7 Switch to using Function(Any) for foreign functions, label declarations.
As it turns out checking for bare Type::Function is problematic,
switching to use Type::Function(Type::Any())).

Also labeling the type on foreign function declarations.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=test-asm-validator
R=aseemgarg@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33691}
2016-02-03 01:21:02 +00:00
verwaest
621bdd642c [runtime] Fix integer indexed property handling
This includes 2 fixes:
1) We didn't properly advance the holder when checking whether
Receiver==Holder, so we'd inadvertently block loading the property if
the first property we find is on the typed array.
2) Reflect.get may cause any object on the prototype chain of the holder
to be the receiver; so we need to recheck for this special state for
each object we perform lookup on.

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

Cr-Commit-Position: refs/heads/master@{#33689}
2016-02-02 17:02:23 +00:00
rmcilroy
72d768d1f9 Add counters to trace baseline code size.
BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33688}
2016-02-02 16:51:46 +00:00
hpayer
44ec23ac5f Call RecordWriteIntoCode when storing the target object in the reloc info on ARM and MIPS.
BUG=chromium:561449
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33687}
2016-02-02 15:39:34 +00:00
oth
ef93854ab9 [interpreter] Move temporary register allocator into own file.
Moves the temporary register allocator out of the bytecode array
builder into TemporaryRegisterAllocator class and adds unittests.
Particular must be taken around the translation window boundary
motivating the addition of tests.

Also adds a Clear() method to IdentityMap() which is called by
the destructor. This allows classes to hold an IdentityMap if
they are zone allocated. Classes must call Clear() before the zone
is re-cycled or face v8 heap corruption.

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

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

Cr-Commit-Position: refs/heads/master@{#33686}
2016-02-02 14:32:27 +00:00
mstarzinger
d8fd30b51f [interpreter] Remove obsolete ExchangeRegisters method.
R=oth@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33685}
2016-02-02 14:12:18 +00:00
jkummerow
d582d2bb2a More *_STRING_WRAPPER_ELEMENTS fixes
BUG=chromium:583257
LOG=n
R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33683}
2016-02-02 13:51:00 +00:00
bmeurer
7be5829971 [turbofan] Move creation stub fallbacks to JSGenericLowering.
Move all the code that deals with falling back to object creation via
stubs to JSGenericLowering, where we can already deal well with stub
calls. This includes JSCreateLiteralArray, JSCreateLiteralObject,
JSCreateClosure, JSCreateFunctionContext and JSCreateArray.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33682}
2016-02-02 13:34:02 +00:00
bmeurer
9750708e2b [turbofan] Remove untested no-deoptimization code path from JSGlobalObjectSpecialization.
We don't have proper test coverage for the no-deoptimization code paths
in the JSGlobalObjectSpecialization reducer, and we will properly never
have any use for that code, so it just adds complexity and code that
likely breaks over time (as its untested).

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33680}
2016-02-02 13:16:59 +00:00
akos.palfi
1f5c91e4d8 MIPS: Fix unaligned read/write operations in wasm.
TEST=cctest/test-run-wasm/*, cctest/test-run-wasm-module/*, unittests
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33678}
2016-02-02 12:45:31 +00:00
ahaas
23943d0e00 [wasm] Provide backoff implementations for the Fxx rounding instructions
If the architecture does not provide rounding instructions, then C
implementations of these rounding instructions are called. The C
implementations from math.h are used, function pointers are registered
as external references so that they can be call from the simulator.

R=titzer@chromium.org

BUG=575379

LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#33677}
2016-02-02 12:26:58 +00:00
yangguo
d77d657731 Revert of [regexp] implement /ui to mirror the implementation for /i. (patchset #2 id:20001 of https://codereview.chromium.org/1641613002/ )
Reason for revert:
This test fails:

assertEquals(["as"], /^a[\u017F]/ui.exec("as"));

The reason is that we end up with a character class that is not stand alone, so we do not perform case folding on it correctly (with unicode flag).

Original issue's description:
> [regexp] implement /ui to mirror the implementation for /i.
>
> R=erik.corry@gmail.com, erikcorry@chromium.org
>
> Committed: https://crrev.com/eea1a4c003c559c99bcc9f08aa7eadf931975aad
> Cr-Commit-Position: refs/heads/master@{#33655}

TBR=erik.corry@gmail.com,erikcorry@chromium.org,erikcorry@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#33676}
2016-02-02 11:44:45 +00:00
bmeurer
6b2001b6b7 [turbofan] Introduce proper ObjectIsReceiver operator.
Avoid the hacking in JSIntrinsicLowering and provide a proper simplified
operator ObjectIsReceiver instead that is used to implement %_IsJSReceiver
which is used by our JavaScript builtins and the JSInliner.

R=jarin@chromium.org
BUG=v8:4544
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33675}
2016-02-02 11:43:02 +00:00
ishell
6a11877424 [api] Make ObjectTemplate::SetNativeDataProperty() work even if the ObjectTemplate does not have a constructor.
Previously ObjectTemplate::New() logic relied on the fact that all the accessor properties are already installed in the initial map of the function object of the constructor FunctionTemplate.
When the FunctionTemplate were instantiated the accessors of the instance templates from the whole inheritance chain were accumulated and added to the initial map.
ObjectTemplate::SetSetAccessor() used to explicitly ensure that the ObjectTemplate has a constructor and therefore an initial map to add all accessors to.

The new approach is to add all the accessors and data properties to the object exactly when the ObjectTemplate is instantiated. In order to keep it fast we now cache the object boilerplates in the Isolate::template_instantiations_cache (the former function_cache), so the object creation turns to be a deep copying of the boilerplate object.

This CL also prohibits non-primitive properties in ObjectTemplate to avoid potential cross-context leaks.

BUG=chromium:579009
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#33674}
2016-02-02 11:42:01 +00:00
vogelheim
d472cf4484 Add native callbacks to FastAccessorAssembler.
(Trying to finish FastAccessorAssembler this week. This should make it easier to pick up the Blink side of this work later on.)

BUG=chromium:508898
SOUNDTRACK=http://youtu.be/i1EG-MKy4so
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#33671}
2016-02-02 11:03:57 +00:00
ahaas
3f4163cd24 [wasm] Backoff implementation for F64Trunc using std::trunc.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33670}
2016-02-02 11:03:56 +00:00
mstarzinger
7feaf896bb [interpreter] Make branch analysis result const again.
Now that the branch analysis result is no longer mutated by the graph
builder, it can be made const again to preserve immutability.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33669}
2016-02-02 10:47:26 +00:00
mlippautz
f72923526c [heap] Simplify distribution of remaining memory during sweeping & compaction
BUG=chromium:524425
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33668}
2016-02-02 10:39:15 +00:00
jkummerow
6da816198e Fix one more DCHECK for FAST_STRING_WRAPPER_ELEMENTS
This is a follow-up fix to f4872f74 / r33616.

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

Cr-Commit-Position: refs/heads/master@{#33667}
2016-02-02 10:14:46 +00:00
jacob.bramley
7c8e32cfd8 [arm][arm64] Minor improvements to MathMaxMin.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33666}
2016-02-02 10:03:52 +00:00
danno
1f28904b24 [compiler] Extend the functionality of CodeStubAssembler
After this change, the functionality of the CodeStubAssembler should be
sufficient to generate non-trivial stubs (e.g. the KeyedLoadIC) with control
flow, variables and probing of internal meta data structures.

Specifically this patch:

* introduces a Label class, which allows stubs to construct graphs that don't
  have linear control graphs.
* introduces a Variable class. Variables can be bound to Node* values at
  different points in a non-linear control flow graph. In conjunction with the
  Label machinery, the CodeStubAssembler ensures that Phi nodes are inserted at
  the "minimal" set of merge points.
* adds Tail calling support to other Stubs and to any arbitrary code whose
  interface can be described by a CallInterfaceDescriptor.
* provides new macros for accessing FixedArray elements that are optimized for
  use with Smi values.

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

Cr-Commit-Position: refs/heads/master@{#33664}
2016-02-02 09:42:54 +00:00
mlippautz
062fc9abcf [heap] Slightly optimize Heap::UpdateAllocationSite()
This function is called for every live object in new space.  We statically know
which version to call, so let's use templates here and eliminite a branch at
runtime.

BUG=chromium:524425
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33662}
2016-02-02 09:28:51 +00:00
bmeurer
8c04a35c83 [intrinsics] Remove %_IsFunction inline intrinsic.
There's no point in having %_IsFunction as inline intrinsic, as it
is only used in non performance critical code, which is already full
of runtime calls anyway, so %IsFunction will do the trick as well.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33660}
2016-02-02 09:14:07 +00:00
bmeurer
329c1e5397 [turbofan] Properly call %TraceExit on explicit return.
So far TurboFan only calls %TraceExit for the implicit
return of undefined, when the function contains no explicit
return statement. To make --trace useful, we also need to
call %TraceExit for ReturnStatement.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33659}
2016-02-02 09:12:25 +00:00
jochen
ae1f32a1cc Don't schedule second pass callbacks if there are no callbacks
BUG=none
R=haraken@chromium.org,hpayer@chromium.org
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33658}
2016-02-02 08:59:21 +00:00
bmeurer
c4d366fb0c [turbofan] Optimize dynamic variable load of global constant.
Don't insert a JSLoadGlobal node in the fast case of a dynamic variable
load if the target is a global constant.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33657}
2016-02-02 08:23:46 +00:00
jarin
ef35f11c43 Remove the template magic from types.(h|cc), remove types-inl.h.
This CL removes the Config templatization from the types. It is not
necessary anymore, after the HeapTypes have been removed.

The CL also changes the type hierarchy - the specific type kinds are
not inner classes of the Type class and they do not inherit from Type.
This is partly because it seems impossible to make this work without
templates. Instead, a new TypeBase class is introduced and all the
structural (i.e., non-bitset) types inherit from it.

The bitset type still requires the bit-munging hack and some nasty
reinterpret-casts to pretend bitsets are of type Type*. Additionally,
there is now the same hack for TypeBase - all pointers to the sub-types
of TypeBase are reinterpret-casted to Type*. This is to keep the type
constructors in inline method definitions (although it is unclear how
much that actually buys us).

In future, we would like to move to a model where we encapsulate Type*
into a class (or possibly use Type where we used to use Type*). This
would loosen the coupling between bitset size and pointer size, and
eventually we would be able to have more bits.

TBR=bradnelson@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33656}
2016-02-02 07:26:06 +00:00
yangguo
eea1a4c003 [regexp] implement /ui to mirror the implementation for /i.
R=erik.corry@gmail.com, erikcorry@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33655}
2016-02-02 07:09:36 +00:00
bmeurer
1f85ff077d [turbofan] Constant-fold ToNumber conversions.
We can constant-fold JSToNumber conversions during typed lowering
if the input is a known primitive constant (i.e. a string, oddball
or number). I.e. JSToNumber("123") can be constant-folded to 123.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33654}
2016-02-02 07:02:09 +00:00
zhengxing.li
8944d36fd5 X87: [builtins] Make Math.max and Math.min fast by default.
port cb9b801069 (r33582)

  original commit message:
  The previous versions of Math.max and Math.min made it difficult to
  optimize those (that's why we already have custom code in Crankshaft),
  and due to lack of ideas what to do about the variable number of
  arguments, we will probably need to stick in special code in TurboFan
  as well; so inlining those builtins is off the table, hence there's no
  real advantage in having them around as "not quite JS" with extra work
  necessary in the optimizing compilers to still make those builtins
  somewhat fast in cases where we cannot inline them (also there's a
  tricky deopt loop in Crankshaft related to Math.min and Math.max, but
  that will be dealt with later).

  So to sum up: Instead of trying to make Math.max and Math.min semi-fast
  in the optimizing compilers with weird work-arounds support %_Arguments
  %_ArgumentsLength, we do provide the optimal code as native builtins
  instead and call it a day (which gives a nice performance boost on some
  benchmarks).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33652}
2016-02-02 02:47:46 +00:00
caitpotter88
15da984326 [parser] report invalid rest parameter errors in Arrow functions
Based on vogelheim's CL at https://codereview.chromium.org/1657783002/

BUG=chromium:582626, v8:2700
LOG=N
R=adamk@chromium.org, rossberg@chromium.org, vogelheim@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33651}
2016-02-02 00:33:07 +00:00
littledan
11e8c03f94 Add UseCounters for some nonstandard JavaScript features
This patch adds a UseCounter for each of the following:
- Allowing duplicate sloppy-mode block-scoped function declarations
  in the exact same scope
- for-in loops with an initializer

The patch also refactors some of the declaration code to clean it up and
enable the first counter, and adds additional unit tests to nail down
the semantics of edge cases of sloppy-mode block-scoped function declarations.

BUG=v8:4693,chromium:579395
LOG=N
R=adamk

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

Cr-Commit-Position: refs/heads/master@{#33650}
2016-02-01 23:01:59 +00:00
sigurds
6298f4fc5b [turbofan] Improve some heuristics in escape analysis
BUG=v8:4586
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33648}
2016-02-01 19:59:10 +00:00
bradnelson
4529cb7b6f Adding flag for simd.js + asm->wasm.
Make it possible to switch on simd.js support when combined with asm.js
in the asm->wasm path.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=test-asm-validator
R=gdeepti@chromium.org,titzer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33644}
2016-02-01 18:25:38 +00:00
adamk
8f89ad740f Remove unnecessary ClassLiteral name member and simplify Function.name handling
A class's name is its constructor's name, so there's no need to treat it separately,
either in the parser or in code generation. The main parser use of the name is
for ES2015 Function.name handling, and this patch also cleans up handling there
by adding a new IsAnonymousFunctionDefinition() method to Expression (the name
comes from the spec).

Also removed unused ParserTraits::DefaultConstructor method.

BUG=v8:3699
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33643}
2016-02-01 17:44:42 +00:00
mbrandy
c3ff68b6b7 Detect cache line size on Linux for PPC hosts.
In the interest of generalization, this change:
- Consolidates cache line size detection for all interested
  architectures under base::CPU (currently leveraged by only
  PPC and ARM64).
- Differentiates between instruction vs data cache line sizes.

R=rmcilroy@chromium.org, jochen@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33642}
2016-02-01 15:03:21 +00:00
mstarzinger
8420d57524 [interpreter] Fix re-throw to not have frame-state.
The runtime call to Runtime::kReThrow does not need a frame-state node
attached, the frame-state input count is zero. This restructures the
graph builder to not instantiate a FrameStateBeforeAndAfter for it.

R=jarin@chromium.org
TEST=cctest/test-run-bytecode-graph-builder
BUG=v8:4674
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33641}
2016-02-01 14:02:02 +00:00
mstarzinger
7d07a6c489 [interpreter] Deprecate notion of an unreachable environment.
The notion of an unreachable environment is useful for a recursive
descent iteration (e.g. over an AST) where nodes are created on the
ascent path as well. For a flat iteration (e.g. over bytecode stream)
environments become unreachable at the end of a visitation function.
Hence any unreachable path can be represented by nulling the tracked
environment completely. This further reduces the number of redundant
nodes being created.

R=oth@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33639}
2016-02-01 12:18:13 +00:00
rmcilroy
d81edba721 [Interpreter] Set bytecode array in Runtime_SetCode.
Set the bytecode array correctly in Runtime_SetCode.
This fixes issues with building the snapshot with ignition enabled.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33638}
2016-02-01 12:13:21 +00:00
yangguo
ca6587c007 [regexp] do not store flags as bitfield in the parser.
This reverts a small part of e709aa24c0 in an attempt to recover
lost page_cycler performance.

R=jkummerow@chromium.org
BUG=chromium:580973
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33637}
2016-02-01 10:55:52 +00:00
mstarzinger
c207f10b09 [interpreter] Simplify BytecodeBranchAnalysis to minimum.
This simplifies the branch analysis we perform on the bytecode stream
down to the bare minimum that we need to build graphs. Note that we
still record all branch targets, even though only the backwards ones
would be needed, but this is essentially for free and might be useful
eventually.

R=oth@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33635}
2016-02-01 10:47:33 +00:00
mstarzinger
83a2c8ed7f [interpreter] Reachability is implied by live environment.
The reachability of a bytecode is implied by a live environment reaching
the bytecode during the abstract control flow simulation of the bytecode
iteration perfromed by the graph builder. There is no need to compute it
upfront anymore.

Also, the upfront computation was only an approximation when it came to
the reachability of an exception handler. This is why several tests for
translation of exception handlers can now be enabled.

R=oth@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33634}
2016-02-01 10:19:13 +00:00
mstarzinger
ee5b58d9f9 [interpreter] Simplify graph builder control flow simulation.
This simplifies how the BytecodeGraphBuilder simulates control flow by
reversing the propagation direction to forwards propagation. This is the
same direction as the data flow which is also a forward propagation. In
this way the analysis information needed at merge points is drastically
reduced while still retaining the same simulation power.

In short: We push down environments instead of pulling them.

R=oth@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33633}
2016-02-01 09:47:42 +00:00
nikolaos
077d70f0fe Avoid multiple rewriting of object key expressions
NonPatternRewrite was called more than once for the same AST
in the case of (computed) key expressions present in object
literals.  As an example, in:

   var x = { [[...42]]: 17 };

the array containing the spread would be desugared first and
then the resulting do-expression would again be desugared.

This could be problematic if a computed key expression contains
large nested array/object literals.

R=rossberg@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33632}
2016-02-01 09:18:41 +00:00
ahaas
a17bd3f3bc [wasm] Initialize the root register for WASM tests.
The root register is needed (at least on x64) to access
ExternalReferences.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33631}
2016-02-01 09:17:20 +00:00
littledan
4e982c0d35 Ship RegExp subclassing
This patch ships the first part of RegExp subclassing--defining
Symbol.{match,replace,search,split}, but keeping their original
definitions which are restricted to a RegExp receiver and do not
call out to the core 'exec' method. This is being shipped separately
because the two sets of extension points are separate features with
separate functionality. The amount of behavior which is held behind
the flag is very small, just exposing the symbols as properties of
Symbol--the behavior that the String methods call out to these Symbol
properties has already been shipping unflagged.

R=yangguo@chromium.org
BUG=v8:4305,v8:4343,v8:4344,v8:4345
LOG=Y
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel

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

Cr-Commit-Position: refs/heads/master@{#33629}
2016-02-01 07:22:48 +00:00
yangguo
a6aef2373c [regexp] fix indentation and variable shadowing.
TBR=brucedawson@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33628}
2016-02-01 07:20:53 +00:00
yangguo
835b038331 [debugger] correctly find function context.
In the debugger we are interested in getting the context for the
current frame, which is usually a function context. To do that,
we used to call Context::declaration_context, which may also
return a block context. This is wrong and can lead to crashes.
Instead, we now use a newly introduced Context::closure_context,
which skips block contexts. This works fine for the debugger,
since we have other means to find and materialize block contexts.

R=rossberg@chromium.org
BUG=chromium:582051
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33627}
2016-02-01 07:03:44 +00:00
bradnelson
83744a4bee Switching foreign function to be marked as functions at call sites.
On further reflection, marking the variable proxy at call sites
for foreign functions as a function is ok. Switching this.

Fixed a few IntersectResults that probably should be an explicit set_bounds.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=test-asm-validator
R=aseemgarg@chromium.org,titzer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33623}
2016-01-30 02:38:38 +00:00
bradnelson
43be96989f Accurately type foreign functions, and variables (attempt 2).
Associate a type with foreign functions at their callsite.
Associate a type with foreign variables.
More pervasively forbid computation in the module body.
Confirm foreign call arguments are exports.

Pass zone to more Type constructors, for consistency.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=test-asm-validator
R=aseemgarg@chromium.org,titzer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33622}
2016-01-29 22:33:04 +00:00
mbrandy
21bb9c6a39 PPC: Refactor checks for minus zero.
R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33620}
2016-01-29 20:40:37 +00:00
mbrandy
ceb2d18d82 PPC: Fix "Implement the function.sent proposal."
StoreP needs a scratch register for unaligned immediate offset.

R=neis@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:4700
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33619}
2016-01-29 19:34:36 +00:00
mbrandy
3641a44883 PPC: [builtins] Make Math.max and Math.min fast by default.
Port cb9b801069

Original commit message:
    The previous versions of Math.max and Math.min made it difficult to
    optimize those (that's why we already have custom code in Crankshaft),
    and due to lack of ideas what to do about the variable number of
    arguments, we will probably need to stick in special code in TurboFan
    as well; so inlining those builtins is off the table, hence there's no
    real advantage in having them around as "not quite JS" with extra work
    necessary in the optimizing compilers to still make those builtins
    somewhat fast in cases where we cannot inline them (also there's a
    tricky deopt loop in Crankshaft related to Math.min and Math.max, but
    that will be dealt with later).

    So to sum up: Instead of trying to make Math.max and Math.min semi-fast
    in the optimizing compilers with weird work-arounds support %_Arguments
    %_ArgumentsLength, we do provide the optimal code as native builtins
    instead and call it a day (which gives a nice performance boost on some
    benchmarks).

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33618}
2016-01-29 19:33:05 +00:00
mbrandy
0dc1e186e0 PPC: [for-in] Ensure that we learn from deopts within for-in loop bodies.
Port 0637f5f64c

Original commit message:
    If we deoptimize from TurboFan or Crankshaft into the body of a for-in
    loop and that for-in mode then switches to slow mode (i.e. has to call
    %ForInFilter), we have to record that feedback, because otherwise we
    might actually OSR into that loop assuming that it's fast mode still,
    or even worse recompile the function later when we call it again w/o
    having rerun the for-in loop in fullcodegen from the beginning (where
    was previously the only place we could learn).

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:3650
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33617}
2016-01-29 19:31:45 +00:00
jkummerow
f4872f7477 Introduce {FAST,SLOW}_STRING_WRAPPER_ELEMENTS
String wrappers (new String("foo")) are special objects: their string
characters are accessed like elements, and they also have an elements
backing store. This used to require a bunch of explicit checks like:

if (obj->IsJSValue() && JSValue::cast(obj)->value()->IsString()) {
  /* Handle string characters */
}
// Handle regular elements (for string wrappers and other objects)
obj->GetElementsAccessor()->Whatever(...);

This CL introduces new ElementsKinds for string wrapper objects (one for
fast elements, one for dictionary elements), which allow folding the
special-casing into new StringWrapperElementsAccessors.

No observable change in behavior is intended.

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

Cr-Commit-Position: refs/heads/master@{#33616}
2016-01-29 18:58:04 +00:00
machenbach
0e2854585b Revert of [runtime] further dismantle AccessorInfoHandling, reducing it to the single API usecase. (patchset #2 id:20001 of https://codereview.chromium.org/1643563002/ )
Reason for revert:
[Sheriff] Speculative revert for breaking webkit unit tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/4251

Original issue's description:
> [runtime] further dismantle AccessorInfoHandling, reducing it to the single API usecase.
>
> BUG=
>
> Committed: https://crrev.com/85aba7df84d397c7e47537292e6895bd8b26f440
> Cr-Commit-Position: refs/heads/master@{#33613}

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
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33615}
2016-01-29 18:49:03 +00:00
littledan
f3e41d96dd Fix Unicode string normalization with null bytes
Previously, String.prototype.normalize constructed its ICU input
string as a null-terminated string. This creates a bug for strings
which contain a null byte, which is allowed in ECMAScript. This
patch constructs the ICU string based on its length so that the
entire string is normalized.

R=jshin@chromium.org
BUG=v8:4654
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#33614}
2016-01-29 17:00:46 +00:00
verwaest
85aba7df84 [runtime] further dismantle AccessorInfoHandling, reducing it to the single API usecase.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33613}
2016-01-29 14:55:35 +00:00
bmeurer
0637f5f64c [for-in] Ensure that we learn from deopts within for-in loop bodies.
If we deoptimize from TurboFan or Crankshaft into the body of a for-in
loop and that for-in mode then switches to slow mode (i.e. has to call
%ForInFilter), we have to record that feedback, because otherwise we
might actually OSR into that loop assuming that it's fast mode still,
or even worse recompile the function later when we call it again w/o
having rerun the for-in loop in fullcodegen from the beginning (where
was previously the only place we could learn).

R=mstarzinger@chromium.org
BUG=v8:3650
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33612}
2016-01-29 12:30:20 +00:00
balazs.kilvady
b35a7aaf26 MIPS: Fix '[builtins] Make Math.max and Math.min fast by default.'
Port cb9b801069

Original commit message:
The previous versions of Math.max and Math.min made it difficult to
optimize those (that's why we already have custom code in Crankshaft),
and due to lack of ideas what to do about the variable number of
arguments, we will probably need to stick in special code in TurboFan
as well; so inlining those builtins is off the table, hence there's no
real advantage in having them around as "not quite JS" with extra work
necessary in the optimizing compilers to still make those builtins
somewhat fast in cases where we cannot inline them (also there's a
tricky deopt loop in Crankshaft related to Math.min and Math.max, but
that will be dealt with later).

So to sum up: Instead of trying to make Math.max and Math.min semi-fast
in the optimizing compilers with weird work-arounds support %_Arguments
%_ArgumentsLength, we do provide the optimal code as native builtins
instead and call it a day (which gives a nice performance boost on some
benchmarks).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33611}
2016-01-29 11:40:44 +00:00
weiliang.lin
5c7134a98e [wasm] register WASM code creation event for profilers
Also remove duplicate code Disassemble, which is already done in TF pipeline.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33610}
2016-01-29 11:22:09 +00:00
bmeurer
5a7bb33e3f [crankshaft] Fix another deopt loop in slow mode for-in.
The for-in slow mode implementation in Crankshaft unconditionally
deoptimizes when %ForInFilter returns undefined instead of just
skipping the item. Even worse, there's nothing we can learn from
that deopt, so we will eventually optimize again and hit exactly
the same problem again once we get back to optimized code.

R=mvstanton@chromium.org
BUG=v8:3650
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33609}
2016-01-29 11:00:05 +00:00
mstarzinger
579264e359 [interpreter] Refactor iterator access in BytecodeGraphBuilder.
This refactors how the BytecodeArrayIterator is passed to visitation
methods on the BytecodeGraphBuilder. We no longer pass it explicitly,
but use the field accessor instead. Note that const-ness is still
preserved and visitation methods are still not able to mutate the
iterator. The main goal of this refactoring is increased readability.

R=rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33607}
2016-01-29 10:15:39 +00:00
ahaas
645880373b [turbofan] Add the StackSlot operator to turbofan.
The StackSlot operator allows to allocate a spill slot on the stack. We
are going to use this operator to pass floats through pointers to c
functions, which we need for floating point rounding in the case where
the architecture does not provide rounding instructions.

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

Committed: https://crrev.com/7a693437787090d62d937b862e29521debcc5223
Cr-Commit-Position: refs/heads/master@{#33600}

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

Cr-Commit-Position: refs/heads/master@{#33606}
2016-01-29 09:43:54 +00:00
mstarzinger
9bc3a2f150 [interpreter] Move BytecodeGraphBuilder::Environment.
This moves the definition of the Environment class into the compilation
unit because it is only used there and not needed outside, the header
doesn't need to expose it.

R=rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#33605}
2016-01-29 09:27:05 +00:00
yangguo
54d9d19855 [regexp] stage unicode regexps.
R=littledan@chromium.org, rossberg@chromium.org
BUG=v8:2952
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#33604}
2016-01-29 09:24:00 +00:00
yangguo
bb6a53573c [regexp] restrict pattern syntax for unicode mode.
ES2015 Annex B.1.4 specifies a restricted pattern language for unicode
mode. This change reflects that, based on some test262 test cases.

R=littledan@chromium.org
BUG=v8:2952
LOG=N

Committed: https://crrev.com/e918c4ec464456a374098049ca22eac2107f6223
Cr-Commit-Position: refs/heads/master@{#33584}

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

Cr-Commit-Position: refs/heads/master@{#33603}
2016-01-29 09:21:16 +00:00
ahaas
11f7c2e63c Revert of [turbofan] Add the StackSlot operator to turbofan. (patchset #4 id:60001 of https://codereview.chromium.org/1645653002/ )
Reason for revert:
problems on Mac64

Original issue's description:
> [turbofan] Add the StackSlot operator to turbofan.
>
> The StackSlot operator allows to allocate a spill slot on the stack. We
> are going to use this operator to pass floats through pointers to c
> functions, which we need for floating point rounding in the case where
> the architecture does not provide rounding instructions.
>
> R=titzer@chromium.org, v8-arm-ports@googlegroups.com, v8-ppc-ports@googlegroups.com, v8-mips-ports@googlegroups.com
>
> Committed: https://crrev.com/7a693437787090d62d937b862e29521debcc5223
> Cr-Commit-Position: refs/heads/master@{#33600}

TBR=titzer@chromium.org,v8-arm-ports@googlegroups.com,v8-mips-ports@googlegroups.com,v8-ppc-ports@googlegroups.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#33601}
2016-01-29 08:19:06 +00:00
ahaas
7a69343778 [turbofan] Add the StackSlot operator to turbofan.
The StackSlot operator allows to allocate a spill slot on the stack. We
are going to use this operator to pass floats through pointers to c
functions, which we need for floating point rounding in the case where
the architecture does not provide rounding instructions.

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

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

Cr-Commit-Position: refs/heads/master@{#33600}
2016-01-29 08:08:22 +00:00
bmeurer
3251a03e81 [crankshaft] Make the for-in slow path compatible with the other compilers.
So far the for-in slow path in Crankshaft unconditionally called
%ForInFilter for every iteration of the for-in loop, without paying
attention to the possible enum cache equipped receiver map. So even
though we iterate the enum cache FixedArray associated with the map
we don't check the map, but always go to %ForInFilter. This would be
perfectly fine if the enum cache FixedArray would be immutable, but
due to some funny GC/runtime interaction kicking in, the enum cache
can be right trimmed while we are iterating it, and the only way to
detect this is to ensure that we check the map when accessing the
enum cache.

BUG=v8:3650,v8:4715
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33599}
2016-01-29 07:50:51 +00:00
machenbach
1a43ebbefd Revert of Accurately type foreign functions, and variables. (patchset #2 id:20001 of https://codereview.chromium.org/1642993002/ )
Reason for revert:
[Sheriff] Breaks arm x-compile:
https://build.chromium.org/p/client.v8/builders/V8%20Arm%20-%20debug%20builder/builds/7484/steps/compile/logs/stdio

Original issue's description:
> Accurately type foreign functions, and variables.
>
> Associate a type with foreign functions at their callsite.
> Associate a type with foreign variables.
> More pervasively forbid computation in the module body.
> Confirm foreign call arguments are exports.
>
> BUG= https://code.google.com/p/v8/issues/detail?id=4203
> TEST=test-asm-validator
> R=aseemgarg@chromium.org,titzer@chromium.org
> LOG=N
>
> Committed: https://crrev.com/b1d43d0b31e8aea7b31261764fef5bee4ad13903
> Cr-Commit-Position: refs/heads/master@{#33596}

TBR=aseemgarg@chromium.org,titzer@chromium.org,bradnelson@google.com,bradnelson@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= https://code.google.com/p/v8/issues/detail?id=4203

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

Cr-Commit-Position: refs/heads/master@{#33597}
2016-01-29 07:38:05 +00:00
bradnelson
b1d43d0b31 Accurately type foreign functions, and variables.
Associate a type with foreign functions at their callsite.
Associate a type with foreign variables.
More pervasively forbid computation in the module body.
Confirm foreign call arguments are exports.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=test-asm-validator
R=aseemgarg@chromium.org,titzer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33596}
2016-01-29 01:05:48 +00:00
titzer
716bc803a3 [wasm] Fix misaligned accesses and endianness issues in decoders.
R=ahaas@chromium.org,bradnelson@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33595}
2016-01-28 19:24:39 +00:00
rmcilroy
6399fce56b [Interpreter] Add option to trace bytecode execution.
Adds --trace-ignition flag which allows tracing of bytecodes as they
execute. As well as printing out the bytecode, this also prints out the
input and output registers to each operation. The generated output looks
as follows:

 -> 0x350cb46d5264 (139) : 49 fc fb 03 07    Call r4, r5, #3, [7]
      [ accumulator -> 0x177fba00bc99 <JS Array[2]> ]
      [          r4 -> 0x350cb46ce099 <JS Function InstallFunctions (SharedFunctionInfo 0x350cb46470c1)> ]
      [          r5 -> 0x350cb46cddc1 <an Object with map 0x35fdf590a3a9> ]
      [          r6 -> 0x350cb46d3f11 <JS Function Proxy (SharedFunctionInfo 0x350cb46d3e61)> ]
      [          r7 -> 2 ]
      [ accumulator <- 0x350cb4604189 <undefined> ]
 -> 0x350cb46d5978 (47) : 4b f8 00 00 00    CallRuntime [248], r0, #0
      [ accumulator -> 0x350cb4604189 <undefined> ]
      [ accumulator <- 0x350cb4604189 <undefined> ]
 -> 0x350cb46d597d (52) : 23 09             Ldar a0
      [ accumulator -> 0x350cb4604189 <undefined> ]
      [          a0 -> 0x350cb46d3f11 <JS Function Proxy (SharedFunctionInfo 0x350cb46d3e61)> ]
      [ accumulator <- 0x350cb46d3f11 <JS Function Proxy (SharedFunctionInfo 0x350cb46d3e61)> ]
 -> 0x350cb46d597f (54) : 24 fd             Star r3
      [ accumulator -> 0x350cb46d3f11 <JS Function Proxy (SharedFunctionInfo 0x350cb46d3e61)> ]
      [ accumulator <- 0x350cb46d3f11 <JS Function Proxy (SharedFunctionInfo 0x350cb46d3e61)> ]
      [          r3 <- 0x350cb46d3f11 <JS Function Proxy (SharedFunctionInfo 0x350cb46d3e61)> ]

Also adds support for --print_source and --print-ast to the interpreter.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33594}
2016-01-28 18:18:12 +00:00
hpayer
87b6e8806f [heap] Refactor IncrementalMarking::Stop().
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33593}
2016-01-28 16:58:29 +00:00
titzer
3668b2c0b3 [wasm] Fix CallIndirect with the case of no indirect function table.
R=ahaas@chromium.org,bradnelson@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33592}
2016-01-28 16:57:40 +00:00
mythria
d0e01b0ba0 [Interpreter] Adds a placeholder merge node when visiting jumps.
This is to fix a bug in the bytecode graph builder. This cl adds a new merge
node before we copy the environment on conditional/unconditional jumps. Since
these environments could be merged later, we add a place holder merge so that
the control dependencies are correctly merged. If we do not have a merge node
we may incorrectly merge the dependencies into the previous block.
For ex: test-run-variables/ContextStoreVariables in cctests.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33591}
2016-01-28 16:22:01 +00:00
mtrofin
d1083526a6 Preparing the terrain for frame elision. This change is necessary to
avoid jump threading erasing the reconstruction of a frame, if the
frame was elided.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33590}
2016-01-28 16:15:12 +00:00
Ilija.Pavlovic
dd64a6d8a1 MIPS64: Eliminate ABI-dependent definitions.
Compilation dependencies for O32 ABI are removed from the code and now
compilation will be done according n64 ABI only.

TEST=
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33589}
2016-01-28 16:04:19 +00:00
machenbach
8b5a7eb6bf Revert of [regexp] restrict pattern syntax for unicode mode. (patchset #6 id:120001 of https://codereview.chromium.org/1645573002/ )
Reason for revert:
[Sheriff] Breaks layout tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/4222

Original issue's description:
> [regexp] restrict pattern syntax for unicode mode.
>
> ES2015 Annex B.1.4 specifies a restricted pattern language for unicode
> mode. This change reflects that, based on some test262 test cases.
>
> R=littledan@chromium.org
> BUG=v8:2952
> LOG=N
>
> Committed: https://crrev.com/e918c4ec464456a374098049ca22eac2107f6223
> Cr-Commit-Position: refs/heads/master@{#33584}

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

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

Cr-Commit-Position: refs/heads/master@{#33588}
2016-01-28 15:27:12 +00:00