Commit Graph

926 Commits

Author SHA1 Message Date
bmeurer
662caac9d2 [turbofan] JSTypeOf, JSStrictEqual, JSStrictNotEqual and JSToBoolean are pure.
These operators are really pure on the JavaScript level, and were only
part of the effect chain to make sure we don't accidentially schedule
them right after raw allocations, which is no longer an issue since we
now have the concept of atomic regions.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35552}
2016-04-16 19:28:12 +00:00
rmcilroy
6dca319395 [Interpreter] No longer require context machine register in bytecode handlers
The current context is stored as a stack slot on the interpreter frame
and therefore we don't need to also maintain a machine register for the
context. Removes this register from bytecode handlers.

In the process modifies this frees up a register on ia32 to keep the
dispatch table pointer in a register rather than on a stack slot on
ia32.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35511}
2016-04-15 09:34:36 +00:00
mstarzinger
43c7c76f1d [turbofan] Use inline allocation for closures.
This changes closure creation to lower to inline allocations when
possible instead of going through the FastNewClosureStub. It allows us
to leverage all advantages of inline allocations on closures. Note that
it is only safe to embed the raw entry point of the compile lazy stub
into the code, because that stub is immortal and immovable.

R=mvstanton@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35499}
2016-04-14 15:19:17 +00:00
jarin
f5961f90b1 [turbofan] Change number operations to handle Undefined as well.
This allows us to remove the turbofan bailout that we introduced
as a response to crbug.com/589792.

BUG=chromium:589792
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35493}
2016-04-14 13:13:56 +00:00
rmcilroy
0c05e02f25 [Interpreter] Make dispatch table point to code entry instead of code objects.
Modifies Ignition to store code entry addresses in the dispatch table
rather than code objects. This allows the interpreter to avoid
calculating the code entry address from the code object on every
dispatch and provides a ~5-7% performance improvement on Octane with
Ignition.

This change adds ArchOpcode::kArchTailCallAddress to TurboFan to enable
tail call dispatch using these code addresses. It also adds a Dispatch
linkage creator (distinct from the stub linkage type used previously) to
allow targetting a code address target (which will diverge further from
the stub linkage type when we remove the context machine register in
Ignition).

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35480}
2016-04-14 10:04:26 +00:00
bmeurer
5b99eec342 [turbofan] Remove unused PlainPrimitiveToNumber operator.
At some point we thought about using this instead of JSToNumber, but now
there doesn't seem to be any reason for this anymore.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35469}
2016-04-14 07:42:22 +00:00
bradnelson
53bc649e88 [wasm] Adding metrics for Asm/Wasm.
Collecting:
Time histograms for: instantiate, decode module, decode function, compile, compile function.
Memory histograms for: decode peak, instantiate peak, compile function peak, min mem pages, max mem pages, function bytes, module bytes.
Range histograms of: functions per module.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
BUG= https://bugs.chromium.org/p/chromium/issues/detail?id=575167
TEST=None
R=ahaas@chromium.org,bmeurer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35467}
2016-04-14 07:30:14 +00:00
aseemgarg
1d37d4216b [wasm] optimized switch implementation in asm.js to wasm builder
This change implements switch as a balanced if/else tree or break table or
hybrid. A lot of asm.js modules are expected to extensively use switch
alongside function tables that can benefit from a better implementation.

BUG=v8:4203
TEST=mjsunit/asm-wasm
R=titzer@chromium.org,bradnelson@chromium.org,ahaas@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35455}
2016-04-13 21:56:42 +00:00
Miran.Karic
3b416c67f5 Adjust bytecode operand values for big endian.
Operand values in Bytecodes.DecodeBytecodeAndOperands test are encoded
in little endian format. The test calls Bytecodes::Decode function which
reads the operands but the values are byte swapped on big endian
machines. Added big endian encoded data which decodes correctly on BE
machines.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#35447}
2016-04-13 13:53:05 +00:00
Ilija.Pavlovic
0b479e4e81 MIPS: Enable big endian testing.
Enabled big endian testing for MIPS32 and MIPS64. The tests are also
adapted for big endian variant.

TEST=cctest/test-assembler-mips[64]
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35369}
2016-04-11 06:36:42 +00:00
jarin
03975befe3 [turbofan] Remove some clever-but-wrong bits from select lowering.
BUG=chromium:600593
LOG=n
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35347}
2016-04-08 08:26:13 +00:00
jacob.bramley
141324cfdc [arm] Implement Float(32|64)(Min|Max) using vsel.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35292}
2016-04-06 10:17:57 +00:00
titzer
e00a0c621c [wasm] Local decl parsing tweak.
R=ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35286}
2016-04-06 08:57:50 +00:00
oth
7f3442133e [interpreter] Add accumulator use description to bytecodes.
Anotates bytecodes with a description of how each uses the accumulator.

Validates annotations and uses of accumulator when generating bytecode
handlers.

Only prints the accumulator during tracing where used.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35281}
2016-04-06 07:57:56 +00:00
titzer
6dda75f23b [wasm] Refactor decoding of local declarations and make more robust.
R=ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35272}
2016-04-05 17:16:30 +00:00
jyan
99eea1e109 Disable Bytecodes.DecodeBytecodeAndOperands for big-endian.
Because the operands in this test are encoded in little endian format.
Therefore, their bytes are all swapped when reading them on big endian machine.

R=mbrandy@us.ibm.com,joransiu@ca.ibm.com,titzer@chromium.org,machenbach@chromium.org,bradnelson@chromium.org,ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35262}
2016-04-05 13:27:18 +00:00
jarin
4142bc6bc1 [turbofan] Restrict types in load elimination.
In simplified numbering, we make sanity checks based on types (e.g.,
NumberSubtract should take numbers as inputs), but this can be
violated if optimization passes make types less precise.

In this CL, we fix load elimination to make sure that types are
smaller in the store -> load elimination by taking an intersection
of the load's type with the store value's type and inserting a guard
with that type. Note that the load type comes from type feedback, so
it can be disjoint from the stored value type (in that case, this
must be dead code because the map chack for the load should prevent
us from using the stored value).

BUG=chromium:599412
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35259}
2016-04-05 12:30:14 +00:00
yangguo
1354b1bf37 [interpreter] statement position always overwrites earlier positions.
If a statement or expression does not produce any bytecode, it's position
should always be overwritten by a following statement position.

R=mstarzinger@chromium.org, vogelheim@chromium.org
BUG=v8:4680
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35252}
2016-04-05 09:14:19 +00:00
titzer
45d75bca5c [turbofan] Handle dead diamonds in scheduling and add a test.
The background here is that graphs generated from WASM are not trimmed.
That means there can be some floating control diamonds that are not
reachable from end. An assertion in the scheduler for phis from floating
diamonds checks that the use edge in this situation is the control edge,
but in general, any edge could cause this.

Scheduling still works without this assertion. The longer term fix
is to either trim the graphs (more compile time overhead for WASM)
or improve the scheduler's handling of dead code in the graph. Currently
it does not schedule dead code but the potential use positions of
dead code are used in the computation of the common dominator of uses. We could
recognize dead nodes in PrepareUses() and check in GetBlockForUse()
as per TODO.

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

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

Cr-Commit-Position: refs/heads/master@{#35245}
2016-04-04 17:45:59 +00:00
bmeurer
eaa92feb9a [builtins] Migrate Math.clz32 to a TurboFan builtin.
This allows us to remove the troublesome %_MathClz32 intrinsic and also
allows us to utilize the functionality that is already available in
TurboFan. Also introduce a proper NumberClz32 operator so we don't need
to introduce a machine operator at the JS level.

R=epertoso@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35208}
2016-04-01 14:36:32 +00:00
oth
0c32e98eab [interpreter] A few code coverage improvements.
Improves code coverage of bytecode array builder and constant
array builder.

Fixes initial index for constant pool slice for kQuad operands.

BUG=v8:4280,chromium:599000
LOG=N
TBR=rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35201}
2016-04-01 12:09:10 +00:00
jochen
cb7aa79b12 Expose a lower bound of malloc'd memory via heap statistics
We expect that the majority of malloc'd memory held by V8 is allocated
in Zone objects. Introduce an Allocator class that is used by Zones to
manage memory, and allows for querying the current usage.

BUG=none
R=titzer@chromium.org,bmeurer@chromium.org,jarin@chromium.org
LOG=n
TBR=rossberg@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35196}
2016-04-01 10:01:56 +00:00
ahaas
bd4fb28ecd [wasm] Int64Lowering of Word64Ror and Word64Rol.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35173}
2016-03-31 17:05:43 +00:00
ahaas
40bdbef975 [wasm] Int64Lowering of Int64Mul on ia32 and arm.
Int64Mul is lowered to a new turbofan operator, Int32MulPair. The new
operator takes 4 inputs an generates 2 outputs. The inputs are the low
word of the left input, high word of the left input, the low word of the
right input, and high word of the right input. The ouputs are the low
and high word of the result of the multiplication.

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

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

Cr-Commit-Position: refs/heads/master@{#35131}
2016-03-30 10:40:06 +00:00
ahaas
682df6dd33 [wasm] New attempt to implement the Int64Lowering of phis.
The new implementation deals with cycles in the TF graph in two steps:
1) The lowering of phis is delayed to avoid cyclic dependencies.
2) The replacement nodes of phis are created already when the phi is
   pushed onto the stack so that other nodes can use these replacements
   for their lowering.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35126}
2016-03-30 08:14:35 +00:00
ulan
bc272e9f7c Represent speed in GCTracer functions as double instead of int.
This avoids redundant casts, loss of precision, and potential overflows.

BUG=chromium:597310
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#35113}
2016-03-29 17:34:41 +00:00
ulan
c42b2c4493 Refactor the ring buffer in GCTracer.
Now instead of saving all event details in the ring buffer,
we save only the bytes and duration.

This reduces the GCTracer size from 20K to 3K and simplifies code.

BUG=chromium:597310
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#35104}
2016-03-29 12:52:05 +00:00
bmeurer
36ead519c8 [builtins] Provide Math.floor as TurboFan builtin.
This way we avoid the second deoptimization for the Math.floor and
Math.ceil builtins when -0 is involved. We still deoptimize the inlined
Crankshaft version in various cases, that's a separate issue.

The algorithm used for implement CodeStubAssembler::Float64Floor is
vaguely based on the fast math version used in the libm of various BSDs,
but had to be reengineered to match the EcmaScript specification.

R=epertoso@chromium.org
BUG=v8:2890, v8:4059
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35083}
2016-03-28 17:31:43 +00:00
oth
e718f49a76 [interpreter] Fix memory leak in Bytecodes::Decode().
BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35054}
2016-03-24 10:31:48 +00:00
machenbach
5d8969e417 [test] Disable flaky test on asan.
NOTRY=true
TBR=oth@chromium.org, rmcilroy@chromium.org, cbruni@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35036}
2016-03-23 16:11:50 +00:00
oth
afd2d68db9 [interpreter] Fix and test for printing of bytecodes.
BUG=v8:4280,v8:4747
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35024}
2016-03-23 10:23:48 +00:00
bmeurer
43fe7d6854 [builtins] Add support for JS builtins written in TurboFan.
This CL adds support for builtins with JavaScript linkage written using
the TurboFan CodeStubAssembler, but with a JSCall descriptor (which was
already supported thanks to a previous patch by Ben Smith). As a first
example, we convert the Math.sqrt builtin and thereby get rid of the
%_MathSqrt intrinsic, which causes trouble for the representation
selection pass in the JavaScript pipeline.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34989}
2016-03-22 13:25:54 +00:00
epertoso
d158bf14b3 [Interpreter] TurboFan implementation of intrinsics.
Introduces a bytecode whose handler executes the equivalent of %_IsArray and %_IsJSReceiver without a runtime call.

BUG=v8:4822
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#34983}
2016-03-22 11:36:05 +00:00
jarin
e1bd9af173 [turbofan] Add more sanity checks to representation inference.
The CL also add guard nodes to places where we assume that certain
values are numbers.

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

Cr-Commit-Position: refs/heads/master@{#34977}
2016-03-22 06:50:52 +00:00
oth
48d082af38 [interpreter] Add support for scalable operands.
This change introduces wide prefix bytecodes to support wide (16-bit)
and extra-wide (32-bit) operands. It retires the previous
wide-bytecodes and reduces the number of operand types.

Operands are now either scalable or fixed size. Scalable operands
increase in width when a bytecode is prefixed with wide or extra-wide.

The bytecode handler table is extended to 256*3 entries. The
first 256 entries are used for bytecodes with 8-bit operands,
the second 256 entries are used for bytecodes with operands that
scale to 16-bits, and the third group of 256 entries are used for
bytecodes with operands that scale to 32-bits.

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

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

Cr-Commit-Position: refs/heads/master@{#34955}
2016-03-21 17:09:49 +00:00
mlippautz
fdb0784d0a [heap] Remove LocalStoreBuffer and add slots in parallel
Now that we have page-local remembered sets (due to refilling in page
granularity) we can perform all updates on the sets during compaction in
parallel without caching slots locally.

BUG=chromium:524425
LOG=N
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#34952}
2016-03-21 16:01:01 +00:00
akos.palfi
04c4bbb445 Disable AstDecoderTest.All*MemCombinations for big-endian.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34912}
2016-03-19 23:18:43 +00:00
mvstanton
992ae64de0 Provide optimized support for the %GetOrdinaryHasInstance intrinsic.
This new intrinsic is used by the desugared ES6 instanceof implementation for
the cases when the F[@@hasInstance] property is null or undefined.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34866}
2016-03-17 15:46:59 +00:00
ahaas
7f19628a5b [wasm] Int64Lowering of Word64Ctz.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34811}
2016-03-16 12:16:00 +00:00
ahaas
5c16cac96d [wasm] Int64Lowering of Word64Clz.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34809}
2016-03-16 11:03:07 +00:00
ahaas
33c08596e1 [wasm] Int64Lowering of Int64Sub on ia32 and arm.
Int64Sub is lowered to a new turbofan operator, Int32SubPair. The new
operator takes 4 inputs an generates 2 outputs. The inputs are the low
word of the left input, high word of the left input, the low word of the
right input, and high word of the right input. The ouputs are the low
and high word of the result of the subtraction.

The implementation is very similar to the implementation of Int64Add.

@v8-arm-ports: please take a careful look at the implementation of sbc
in the simulator.

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

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

Cr-Commit-Position: refs/heads/master@{#34808}
2016-03-16 10:58:05 +00:00
jyan
3b5e84ab0e S390: Initial test changes and files checkin.
R=danno@chromium.org,jkummerow@chromium.org,jochen@chromium.org,joransiu@ca.ibm.com,michael_dawson@ca.ibm.com,mbrandy@us.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34795}
2016-03-15 18:09:36 +00:00
jyan
6b503884ae S390: Check in OWNER file on to s390 directory
R=danno@chromium.org,jkummerow@chromium.org,jochen@chromium.org,joransiu@ca.ibm.com,michael_dawson@ca.ibm.com,mbrandy@us.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34789}
2016-03-15 14:25:38 +00:00
ahaas
ccbf004293 [wasm] Int64Lowering of F64ReinterpretI64.
The implementation is done by storing to and then loading from memory.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34785}
2016-03-15 12:46:51 +00:00
ahaas
b484cc12f3 [wasm] Int64Lowering of I64ReinterpretF64.
The implementation is done by storing to and loading from memory.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34784}
2016-03-15 12:18:12 +00:00
ahaas
2e6f3e8607 [wasm] Int64Lowering of Word64Popcnt.
Word64Popcnt is lowered to Word32Popcnt(low-word) + Word32Popcnt(high_word).
Since the optional Word64Popcnt operator does not exist on 32 bit platforms,
I introduced a new operator "Word64PopcntPlaceholder" which is generated
in the WasmCompiler and then lowered in the Int64Lowering.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34777}
2016-03-15 10:42:08 +00:00
yangguo
3c1dc424d3 [ignition, debugger] correctly set position for return with elided bytecode.
We may not emit bytecode for the evaluation of the to-be-returned
expression. In that case we cannot set two return positions for a return
statement (one before and one after the expression evaluation). This
sets the interpreter apart from full-codegen.

Make sure that we always have the second of the two return positions.

Note that we end up with separate test cases for ignition and FCG.

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

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

Cr-Commit-Position: refs/heads/master@{#34771}
2016-03-15 08:28:03 +00:00
ahaas
c4c34eba30 [wasm] Int64Lowering: changing to DFS.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#34767}
2016-03-15 06:27:00 +00:00
titzer
ad91d1c6ca [wasm] Add I64Eqz operator.
R=ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34757}
2016-03-14 17:55:22 +00:00
ahaas
1b23079936 [wasm] Int64Lowering of Int64Add on ia32 and arm.
Int64Add is lowered to a new turbofan operator, Int32AddPair. The new
operator takes 4 inputs an generates 2 outputs. The inputs are the low
word of the left input, high word of the left input, the low word of the
right input, and high word of the right input. The ouputs are the low
and high word of the result of the addition.

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

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

Cr-Commit-Position: refs/heads/master@{#34747}
2016-03-14 15:34:19 +00:00