Commit Graph

22115 Commits

Author SHA1 Message Date
ishell
5c47c1c0d3 Filter invalid slots out from the SlotsBuffer after marking.
There are two reasons that could cause invalid slots appearance in SlotsBuffer:
1) If GC trims "tail" of an array for which it has already recorded a slots and then migrate another object to the "tail".
2) Tagged slot could become a double slot after migrating of an object to another map with "shifted" fields (for example as a result of generalizing immutable data property to a data field).

This CL also adds useful machinery that helps triggering incremental write barriers.

BUG=chromium:454297
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#27423}
2015-03-24 17:07:44 +00:00
marja
cb7279da81 [strong] Check strong mode free variables against the global object.
Gather references to unbound variables where the reference (VariableProxy) is
inside strong mode. Check them against the global object when a script is bound
to a context (during compilation).

This CL only checks unbound variables which are not inside lazy functions - TBD
how do we solve that; alternatives: add developer mode which disables laziness /
do the check whenever lazy functions are really compiled.

BUG=v8:3956
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#27422}
2015-03-24 16:46:59 +00:00
erikcorry
bb880058f6 Track how many pages trigger fallback strategies in GC
R=hpayer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27421}
2015-03-24 16:17:57 +00:00
dcarney
a3b7c8320e fix attribute lookup for all can read indexed interceptors
R=verwaest@chromium.org

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27420}
2015-03-24 16:10:06 +00:00
aandrey
fc1689392e Make debugger step into bound callbacks passed to Array.forEach.
BUG=chromium:450004
R=yangguo@chromium.org, kozyatinskiy@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#27419}
2015-03-24 16:02:12 +00:00
titzer
82004a5e46 [turbofan] Macro-ify the tracing code in RegisterAllocator.
R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27418}
2015-03-24 15:38:30 +00:00
mvstanton
821655fb57 Prevent leaks of cross context maps in the Oracle.
Some code in type-info.cc could allow a cross context map to be visible to
crankshaft. Tighten up this code to be certain that only a JSFunction, an
AllocationSite or a Symbol can be returned.

R=verwaest@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27417}
2015-03-24 15:37:23 +00:00
Michael Achenbach
f8ba595a3e Move entire CQ config to the V8 repository
R=machenbach@chromium.org
BUG=408675
LOG=n
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#27416}
2015-03-24 15:34:18 +00:00
svenpanne
20dce719ee Added %_HeapObjectGetMap and %_MapGetInstanceType intrinsics.
These are needed (among other things) for a TurboFan-generated
StringAddStub. Furthermore, they can be used to nuke the overly
complex %_IsInstanceType intrisic, it's completely expressible in
JavaScript now, but that will be done in a separate CL.

Alpha-sorted things a bit on the way to ease navigation.

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

Cr-Commit-Position: refs/heads/master@{#27415}
2015-03-24 15:20:57 +00:00
erikcorry
4c806802b5 Fix OOM bug 3976.
Also introduce --trace-fragmentation-verbose, and fix --always-compact.

R=ulan@chromium.org
BUG=v8:3976
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#27414}
2015-03-24 15:02:28 +00:00
titzer
6e75e34dd3 [turbofan] Address minor TODOs in simplified lowering.
R=jarin@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27413}
2015-03-24 15:01:21 +00:00
ulan
1efcca7f04 Reload length of retained_maps array after GC.
This fixes flaky GC stress failure:

> Fatal error in ../src/heap/mark-compact.cc, line 2127
> Check failed: retained_maps->Get(i)->IsWeakCell().

BUG=
TEST=test-heap/RegressArrayListGC

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

Cr-Commit-Position: refs/heads/master@{#27412}
2015-03-24 14:36:09 +00:00
mstarzinger
1fefa31df6 Remove CompilationInfoWithZone from public API.
This removes the CompilationInfoWithZone class from the header file
because it is more than a pure convenience class and shouldn't be used
outside of the compiler at all.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27411}
2015-03-24 14:17:17 +00:00
titzer
125d31ecfd [turbofan] Address minor TODOs in instruction selector.
R=dcarney@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27410}
2015-03-24 14:09:39 +00:00
titzer
9ac4ab799c [turbofan] Remove Instruction::IsControl() and Instruction::MarkAsControl()
R=dcarney@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27409}
2015-03-24 14:05:35 +00:00
dcarney
97eb0a0059 run phantom handle callbacks first
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27408}
2015-03-24 13:36:58 +00:00
dcarney
adeb82ef23 fix disposal of phantom handles in GlobalValueMap
additionally, add a drive by fix to WeakCallbackInfo

R=jochen@chromium.org, erikcorry@chromium.org

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27407}
2015-03-24 13:22:15 +00:00
jarin
0f94c96cbc Test for wrong arguments object materialization.
The test demonstrates a bad interaction between arguments object
materialization, escape analysis and exception handling.

We can return a wrong arguments object if we materialize arguments
object (using f.arguments) and then throw around f's frame so that f
does not clean up the materialized frame information (see the
MaterializedObjectStore in deoptimizer.h/.cc). If we enter another
function that has the same frame pointer and request an arguments object
of (or lazily deoptimize) that function, we can get the materialized
object of the original function.

We should clean up the materialized object store when we unwind the
stack.

BUG=v8:3985
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#27406}
2015-03-24 13:20:21 +00:00
titzer
01269228b8 [turbofan] Add RegisterAllocator::NewLiveRange() utility method.
R=dcarney@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27405}
2015-03-24 13:17:37 +00:00
aperez
00844d466b Cleanups needed for this-scoping in arrow functions
Remove Variable::IsValidReference(), and the Variable::is_valid_ref_
member: This was "false" only for "this", and for internal variables.
For the first, VariableProxy::is_this() can be used for the check
instead; and for internal variables, it is guaranteed they they will
not be written to (because the V8 code does not do it, and they are
not accessible from JavaScript).

The "bool is_this" parameter of VariableProxy() constructor is
changed to use Variable::Kind. This will allow to later on adding
a parameter to create unresolved variables of any kind, which in
turn will be used to make references to "this" initially unresolved,
and use the existing variable resolution mechanics for "this".

BUG=v8:2700
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#27404}
2015-03-24 13:08:34 +00:00
loislo
ae461b9ed0 CpuProfiler: push the collected information about deopts to cpu profiler
it is the last patch of https://codereview.chromium.org/1012633002

All that we need here is to push the collected info to the profiler
and convert it into actionable information about deopt.

On the Next: get the info accessible by embedder.

BUG=chromium:452067
LOG=n
TEST=DeoptAtFirstLevelInlinedSource, DeoptAtSecondLevelInlinedSource, DeoptUntrackedFunction

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

Cr-Commit-Position: refs/heads/master@{#27403}
2015-03-24 12:46:26 +00:00
caitpotter88
6fcc22dce1 [es6] call ToString() on template substitutions
BUG=v8:3980
R=arv@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#27402}
2015-03-24 12:44:01 +00:00
titzer
e62f754de7 [turbofan] Rename Node::RemoveAllInputs() to Node::NullAllInputs().
R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27401}
2015-03-24 12:40:13 +00:00
erikcorry
36d7aa6817 Fix out of date assert after PropertyCell enterbung
R=verwaest@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27400}
2015-03-24 12:16:20 +00:00
verwaest
c46a937220 If CallNew targets a constant global, set its state to monomorphic
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27399}
2015-03-24 12:05:55 +00:00
machenbach
310d75218e Revert of [V8] Removed SourceLocationRestrict (patchset #3 id:40001 of https://codereview.chromium.org/1022333004/)
Reason for revert:
[Sheriff] This seems to change layout test expectations of some tests, e.g.:
http://build.chromium.org/p/client.v8/builders/V8-Blink%20Linux%2064%20%28dbg%29/builds/2317

Expectation example:
https://storage.googleapis.com/chromium-layout-test-archives/V8-Blink_Linux_64__dbg_/2317/layout-test-results/fast/events/window-onerror-11-pretty-diff.html

Please add a needsmanualrebaseline expectation to the tests affected by this change on the blink side first before relanding.

Original issue's description:
> [V8] Removed SourceLocationRestrict
>
> This method uses in messages.js in GetSourceLine and GetPositionInLine. This methods uses in v8::Message API methods and there is no documentation about it.
> Method looks obsolete.
> One of the strange side effect is shown by attached issue.
>
> BUG=chromium:468781
> R=yangguo@chromium.org
> LOG=Y
>
> Committed: https://crrev.com/b563ceac0f95551a128a1403cdbacc7aefcdabaf
> Cr-Commit-Position: refs/heads/master@{#27374}

TBR=yangguo@chromium.org,kozyatinskiy@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:468781

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

Cr-Commit-Position: refs/heads/master@{#27398}
2015-03-24 12:04:43 +00:00
chunyang.dai
c9db590d3b X87: [stubs] Add missing interface descriptor for the CompareIC.
port e18e3cd4d8 (r27305)

original commit message:

  [stubs] Add missing interface descriptor for the CompareIC.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27397}
2015-03-24 10:23:46 +00:00
chunyang.dai
10cd7247a3 X87: Serializer: serialize internal references via object visitor.
port 7c149afb6c (r27275).

original commit message:

 Serializer: serialize internal references via object visitor.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27396}
2015-03-24 10:17:35 +00:00
chunyang.dai
62c546517f X87: Remove PropertyCell space
port 16c8485a35 (r27269).

original commit message:

  Replaces StoreGlobalCell / LoadGlobalCell with NamedField variants that use write barriers.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27395}
2015-03-24 10:10:59 +00:00
chunyang.dai
40de9c3f02 X87: Use platform specific stubs for vector-based Load/KeyedLoad.
port 34a1a76ddf (r27235)

original commit message:

  A hydrogen code stub is not the best approach because it builds a frame
  and doesn't have the technology to discard roots at tail call exits.
  Platform-specific stubs provide much better performance at this point.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27394}
2015-03-24 10:06:21 +00:00
jacob.bramley
a5ce9994a5 Revert "ARM64: use jssp for stack slots"
This reverts r21101. r21101 appears to be at fault for the ARM64
failures here: https://codereview.chromium.org/1023103003

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27393}
2015-03-24 09:51:35 +00:00
michael_dawson
f8183277c1 PPC: [es6] implement Reflect.apply() & Reflect.construct()
Port d21fd15467

Original commit message:
BUG=v8:3900
LOG=N

R=mbrandy@us.ibm.com, svenpanne@chromium.org, danno@chromium.org, jkummerow@chromium.org, dslomov@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27392}
2015-03-24 09:37:59 +00:00
michael_dawson
b051c7aabe PPC: [turbofan] Turn Math.clz32 into an inlinable builtin.
Port 3aa206b865

Original commit message:
R=dcarney@chromium.org, yangguo@chromium.org
BUG=v8:3952
LOG=n

R=mbrandy@us.ibm.com, svenpanne@chromium.org, danno@chromium.org, jkummerow@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27391}
2015-03-24 09:31:45 +00:00
michael_dawson
833364a7de PPC: [es6] generate rest parameters correctly for subclass constructors
commit bef80fcfd7

Original commit message:
BUG=v8:3977
R=dslomov@chromium.org, arv@chromium.org
LOG=N

R=mbrandy@us.ibm.com, svenpanne@chromium.org, danno@chromium.org, jkummerow@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27390}
2015-03-24 09:27:29 +00:00
yangguo
992751d0dc Revert of [es6] Object.getPrototypeOf should work with values (patchset #3 id:40001 of https://codereview.chromium.org/1014813003/)
Reason for revert:
Layout test failures. Please update layout test expectations before landing this, in order to not block the roll.

Original issue's description:
> [es6] Object.getPrototypeOf should work with values
>
> The final spec for Object.getPrototypeOf calls ToObject on the
> parameter, which means that it should only throw for null and
> undefined. For other non object values the prototype of the wrapper
> should be used.
>
> BUG=v8:3964
> LOG=N
> R=adamk, rossberg@chromium.org
>
> Committed: https://crrev.com/ea463a916bbe5994b0d2d04e8075058b373b2e2c
> Cr-Commit-Position: refs/heads/master@{#27354}

TBR=adamk@chromium.org,rossberg@chromium.org,arv@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:3964

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

Cr-Commit-Position: refs/heads/master@{#27389}
2015-03-24 09:19:26 +00:00
michael_dawson
cff4fb97dc PPC: Serializer: serialize internal references via object visitor.
Port 7c149afb6c

Original commit message:

R=mbrandy@us.ibm.com, svenpanne@chromium.org, danno@chromium.org, jkummerow@chromium.org

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27388}
2015-03-24 09:16:54 +00:00
michael_dawson
0fe88cb04d PPC: Load from PropertyCells using PropertyCell::kValueOffset rather than Cell::kValueOffset
Port dda2bd6f4f

Original commit message:

R=mbrandy@us.ibm.com, svenpanne@chromium.org, danno@chromium.org, jkummerow@chromium.org

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27387}
2015-03-24 09:15:52 +00:00
jochen
d19d0be8a0 Remove calls to IdleNotification()
All users should use IdleNotificationDeadline() instead

BUG=none
R=hpayer@chromium.org
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#27386}
2015-03-24 08:30:02 +00:00
chunyang.dai
5703794412 X87: Remove kind field from StackHandler.
port 15f8213809 (r27263)

original commit message:

 This relands commit 96f79568a9.

 This makes the Isolate::Throw logic not depend on a prediction of
 whether an exception is caught or uncaught. Such a prediction is
 inherently undecidable because a finally block can decide between
 consuming or re-throwing an exception depending on arbitray control
 flow.

 There still is a conservative prediction mechanism in place that
 components like the debugger or tracing can use for reporting.

 With this change we can get rid of the StackHandler::kind field, a
 pre-requisite to do table-based lookups of exception handlers.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27385}
2015-03-24 08:08:19 +00:00
yurys
aca7895353 Save heap object tracking data in heap snapshot
Every time embedder calls v8::HeapProfiler::GetHeapStats we store next unuassigned heap object id and timestamp of the request. This patch serializes all that data into heap snapshot so that embedder can restore allocation timeline.

BUG=chromium:467222
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#27384}
2015-03-24 05:50:04 +00:00
akos.palfi
fe0d860ba8 MIPS64: VectorICs: keyed element loads were kicking out non-smi keys unnecessarily
Port 6689cc27eb

Original commit message:
Handlers should be in charge of this work. The change uncovered a bug in
vector-ics related to keyed loads into strings. It's important for
StringCharCodeAtGenerator, a helper used in full code and in
LoadIndexedStringStub (a handler) to protect the vector and slot registers
when it makes a runtime call to convert a HeapNumber to a Smi.

It's still possible for the handler to MISS after this call, perhaps due
to out of bounds access. In that case, the vector and slot registers need
to be delivered safely to the MISS handler.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27383}
2015-03-23 22:45:17 +00:00
michael_dawson
8d4c7fea0d PPC: Disinherit PropertyCell from Cell
Port 8c0d289772

Original commit message:

R=mbrandy@us.ibm.com, svenpanne@chromium.org

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27382}
2015-03-23 21:41:55 +00:00
michael_dawson
890c0eac21 PPC: Remove kind field from StackHandler.
Port 15f8213809

Original commit message:
This relands commit 96f79568a9.

This makes the Isolate::Throw logic not depend on a prediction of
whether an exception is caught or uncaught. Such a prediction is
inherently undecidable because a finally block can decide between
consuming or re-throwing an exception depending on arbitray control
flow.

There still is a conservative prediction mechanism in place that
components like the debugger or tracing can use for reporting.

With this change we can get rid of the StackHandler::kind field, a
pre-requisite to do table-based lookups of exception handlers.

R=mbrandy@us.ibm.com, yangguo@chromium.org, svenpanne@chromium.org

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27381}
2015-03-23 21:32:56 +00:00
michael_dawson
c277e7efad PPC: Remove PropertyCell space
Port 16c8485a35

Original commit message:
Replaces StoreGlobalCell / LoadGlobalCell with NamedField variants that use write barriers.

R=mbrandy@us.ibm.com, svenpanne@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27380}
2015-03-23 21:31:43 +00:00
verwaest
1b16678f25 Properly handle non-JSFunction constructors in CanRetainOtherContext
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27379}
2015-03-23 19:24:58 +00:00
mstarzinger
11fb202f96 Move CompilationInfo::this_has_uses to HGraph::this_has_uses.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27378}
2015-03-23 19:11:29 +00:00
mvstanton
6689cc27eb VectorICs: keyed element loads were kicking out non-smi keys unnecessarily
Handlers should be in charge of this work. The change uncovered a bug in
vector-ics related to keyed loads into strings. It's important for
StringCharCodeAtGenerator, a helper used in full code and in
LoadIndexedStringStub (a handler) to protect the vector and slot registers
when it makes a runtime call to convert a HeapNumber to a Smi.

It's still possible for the handler to MISS after this call, perhaps due
to out of bounds access. In that case, the vector and slot registers need
to be delivered safely to the MISS handler.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27377}
2015-03-23 18:50:23 +00:00
mstarzinger
7421c7f598 Remove dangerous constructor from CompilationInfoWithZone.
This removes the stub-based constructor from CompilationInfoWithZone
as this class is more than a pure convenience class and only by chance
doesn't have an effect in the destructor.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27376}
2015-03-23 17:30:45 +00:00
ulan
f42e09aef2 Acquire a lock before checking for GC interrupt in JSON parser.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27375}
2015-03-23 17:16:14 +00:00
kozyatinskiy
b563ceac0f [V8] Removed SourceLocationRestrict
This method uses in messages.js in GetSourceLine and GetPositionInLine. This methods uses in v8::Message API methods and there is no documentation about it.
Method looks obsolete.
One of the strange side effect is shown by attached issue.

BUG=chromium:468781
R=yangguo@chromium.org
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#27374}
2015-03-23 16:33:19 +00:00