Commit Graph

42216 Commits

Author SHA1 Message Date
Sathya Gunasekaran
dbfe4a49d8 [Modules] Introduce ScriptOrModule and HostDefinedOptions
This patch introduces a new container type ScriptOrModule which
provides the name and the host defined options of the script/module.

This patch also introduces a new PrimitivesArray that can hold
Primitive values, which the embedder can use to store metadata.

The HostDefinedOptions is passed to V8 through the ScriptOrigin, and
passed back to the embedder through HostImportModuleDynamically for
module loading.

Bug: v8:5785, v8:6658, v8:6683
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I56c26fc9a680b273ac0a6691e5ad75f15b8dc80a
Reviewed-on: https://chromium-review.googlesource.com/622158
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47724}
2017-08-31 00:28:56 +00:00
Jaroslav Sevcik
30d8255fdb [turbofan] Fix bounds check elimination for safe-integer-add.
Bug: chromium:760434
Change-Id: I95bcf33f334349de0a81f574ba64128b8e1b2ebd
Reviewed-on: https://chromium-review.googlesource.com/643192
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47723}
2017-08-30 19:27:21 +00:00
Adam Klein
de046f5fb4 [ast] Make CaseClause a plain ZoneObject, not an Expression
CaseClause never made sense as an Expression; this CL allows us to
remove several UNREACHABLEs and slim down the representation of
CaseClause by removing its source position (which was only used
in prettyprinting).

The only real fallout of this change is that SourceRangeMap now
stores its keys as ZoneObject*, rather than AstNode*, but since
there's already compile time typechecking for inserting items
into the map this shouldn't cause any ill effects.

While modifying CaseClause, also removed the dead body_target()
accessor (and related member variable). Thus this CL overall
reduces the memory needed for each CaseClause by two words.

Bug: v8:6092
Change-Id: I0021c0590a69e29305c41ec6105c8824ae0cc25b
Reviewed-on: https://chromium-review.googlesource.com/639316
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47722}
2017-08-30 16:47:29 +00:00
Michael Lippautz
730928ebbe [heap] Remove CS expectation from test
TEST=cctest/test-heap/EnsureAllocationSiteDependentCodesProcessed

Bug: 
Change-Id: I803d6b33258175da32fa79ba9b839e67d5ba11bf
Reviewed-on: https://chromium-review.googlesource.com/643210
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47721}
2017-08-30 15:53:50 +00:00
Leszek Swirski
769b259750 [ignition] Only perform interrupt checks for backward jumps
Jumps (and returns) in Ignition update the interrupt budget, and call
into the runtime if the budget drops below zero. Since forward jumps
only ever increase the budget, we don't need to generate this check or
the call for them at all.

Change-Id: I8c4ae15edab39a3a5725a98f38efba3a16243d91
Reviewed-on: https://chromium-review.googlesource.com/643209
Reviewed-by: Mythri Alle <mythria@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47720}
2017-08-30 15:09:16 +00:00
Tobias Tebbi
9286415434 [turbofan] add escape analysis support for CompareMaps
Bug: v8:6761
Change-Id: I65f70cb192fc9cd9a06a0ba8a02532ff24ad1387
Reviewed-on: https://chromium-review.googlesource.com/643206
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47719}
2017-08-30 15:04:46 +00:00
John Barboza
0353a1ef9d Avoid disassembling Interpreted Regexp code
I found that v8 will crash when --print-code is turned on while Regexp
is interpreted. It crashes when trying to print Relocation info during
Disassembly. It should probably avoid printing out disassembly when the
Code object is a bytecode regexp.

Bug: 
Change-Id: I35b531cb03996a303248652871452266c78fee38
Reviewed-on: https://chromium-review.googlesource.com/642127
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#47718}
2017-08-30 14:19:36 +00:00
Clemens Hammacher
765e6f03d6 [wasm] [cleanup] Remove VALIDATE macro
It has exactly the inverse meaning of CHECK_ERROR. Since CHECK_ERROR is
used in the majority of the cases, and is more readable in most cases,
this CL replaces all uses of VALIDATE by CHECK_ERROR.
It also includes a few minor refactorings of the touched code.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: I3d6b3b8bfd131e14f0d852b07622382b11b488f0
Reviewed-on: https://chromium-review.googlesource.com/643268
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47717}
2017-08-30 14:14:26 +00:00
Ben L. Titzer
016d53f921 Reland "[wasm] Handle non-asm-js case in WasmCompiledModule::GetAsmJsSourcePosition."
This is a reland of 15fe64c0e5
Original change's description:
> [wasm] Handle non-asm-js case in WasmCompiledModule::GetAsmJsSourcePosition.
> 
> This hides more implementation details and simplifies callers.
> 
> R=ahaas@chromium.org
> 
> Bug: 
> Change-Id: I4809611c55b810a3b0674713e12f3f17401e6c9c
> Reviewed-on: https://chromium-review.googlesource.com/620713
> Reviewed-by: Andreas Haas <ahaas@chromium.org>
> Commit-Queue: Ben Titzer <titzer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47434}

Change-Id: Ica097f43e5f9122eb44b537822f9021d5eab2703
Reviewed-on: https://chromium-review.googlesource.com/643207
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47716}
2017-08-30 14:11:06 +00:00
Ben L. Titzer
a88e54c2df Inline Script::SetEvalOrigin() into its (one) caller.
Script::SetEvalOrigin() could do a stackwalk depending on whether one of
its arguments is a sentinel value. This is somewhat surprising behavior,
and since this function has just one caller, it makes more sense to do
this in that location.

R=mstarzinger@chromium.org

Bug: 
Change-Id: Iddd38b42d9a3a8f4898aafb20fe165dfee51d516
Reviewed-on: https://chromium-review.googlesource.com/643386
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47715}
2017-08-30 14:08:48 +00:00
jgruber
7efb553721 Fix test-serialize/BuiltinsHaveBuiltinIdForLazyDeserialization
intl_date_time_format_function is only set in i18n builds. Use
opaque_reference_function to test for Builtins::kIllegal instead.

TBR=yangguo@chromium.org
NOTREECHECKS=true
NOTRY=true

Bug: v8:6624
Change-Id: I0631862e6e022d222b52dceb58a8fe65f7d6a4e8
Reviewed-on: https://chromium-review.googlesource.com/643506
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47714}
2017-08-30 13:48:26 +00:00
Leszek Swirski
d2881cd320 [objects] Use field definition macro for bytecode array
Use the DEFINE_FIELD_OFFSET_CONSTANTS macro to define the fields in the
BytecodeArray layout description.

Change-Id: I89ff2d7cd967aa1a503cbedd5d95dcd80f4d038c
Reviewed-on: https://chromium-review.googlesource.com/643130
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47713}
2017-08-30 13:09:56 +00:00
jgruber
3121449b54 [builtins] Add the builtin_id to SharedFunctionInfo
Lazy deserialization needs to determine the underlying builtin by looking at
the SharedFunctionInfo.

This packs the builtin_id into the SFI::function_data field, and adds
convenience functions to Code as a drive-by addition.

Bug: v8:6624
Change-Id: I59093815aa6937342302153ebc95dd60edb0064e
Reviewed-on: https://chromium-review.googlesource.com/641490
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47712}
2017-08-30 12:42:46 +00:00
Clemens Hammacher
71ea6b8f58 [wasm] [cleanup] Rename "checked" to "validate"
And reuse the CHECK_ERROR and VALIDATE macros.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: Ibeabdf0815418b6c70e2441ed9267261eb8883b6
Reviewed-on: https://chromium-review.googlesource.com/643131
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47711}
2017-08-30 12:28:46 +00:00
Michael Lippautz
9619b7f23c [heap] Factor out the barrier from Scavenger and add tests
Bug: chromium:738865, chromium:750084
Change-Id: Ife30da4be118cd6f3212e84752978ebb39500f15
Reviewed-on: https://chromium-review.googlesource.com/641414
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47710}
2017-08-30 12:05:56 +00:00
Ben L. Titzer
c48f40d0d9 [wasm] Decoder should narrow unreachable types on the stack.
R=rossberg@chromium.org

Bug: v8:6651
Change-Id: Iaa9217cacded9bdd3f0a35775275e79c231c272a
Reviewed-on: https://chromium-review.googlesource.com/642969
Reviewed-by: Andreas Rossberg <rossberg@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47709}
2017-08-30 11:49:16 +00:00
jgruber
89b6ef0cdb [snapshot] Store builtin offsets during serialization
To deserialize builtins individually, we need to preserve their starting
offsets within the serialized data.

Bug: v8:6624
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I48a48330aeb63de2c8cfcbea6fb94e1b2917495c
Reviewed-on: https://chromium-review.googlesource.com/637774
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47708}
2017-08-30 11:44:16 +00:00
Michael Lippautz
47037bdc6c [heap] Allow allocating Struct and Tuple* in new space
Aligns behavior with other allocate calls in factory that allow
choosing the generation depending on the use case.

Bug: v8:6771
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I63b95de7e664a51af8ca24a75f2122dfe1792c42
Reviewed-on: https://chromium-review.googlesource.com/642799
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47707}
2017-08-30 10:59:39 +00:00
Peter Marshall
36ef81b6ea [heap] Replace all uses of List with std::vector.
Bug: v8:6333
Change-Id: I5a38c1bcc6cd3b030ea2dd57fb2198009e8920e6
Reviewed-on: https://chromium-review.googlesource.com/638290
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47706}
2017-08-30 10:20:00 +00:00
jgruber
70a516387a Reland "[snapshot] Move builtins to dedicated snapshot area"
This is a reland of 49e3bfd572
Original change's description:
> [snapshot] Move builtins to dedicated snapshot area
> 
> As a first step towards lazy builtin deserialization, this CL moves
> builtins to their own dedicated area in the snapshot blob, physically
> located after startup data and before context-specific data.
> 
> The startup- and partial serializers now serialize all seen builtins as
> references, i.e. they only encode the relevant builtin id (taking care
> to preserve special behavior around the interpreter trampoline and
> CompileLazy). Builtins are later fully serialized by the
> BuiltinSerializer. The separate blobs are finally glued together by
> CreateSnapshotBlob.
> 
> Deserialization takes the same steps: when we see builtin reference
> bytecodes before builtins have been deserialized, we push to a list of
> deferred builtin references. After builtin deserialization, this list is
> iterated and all builtin references are fixed up.
> 
> Bug: v8:6624
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
> Change-Id: Idee42fa9c92bdbe8d5b8c4b8bf3ca9dd39634004
> Reviewed-on: https://chromium-review.googlesource.com/610225
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47596}

Bug: v8:6624
Change-Id: I8bfac56c482d992987c270bf0fea7acd9e4ca0c7
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/638271
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47705}
2017-08-30 09:46:40 +00:00
Maya Lekova
68eabceb15 Fix wrongly handled exception in CheckProxyHasTrap
Bug: chromium:760268
Change-Id: Id9b24ddee61926a5d1324d7da12efccf2c1eb9c2
Reviewed-on: https://chromium-review.googlesource.com/642798
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Maya Lekova <mslekova@google.com>
Cr-Commit-Position: refs/heads/master@{#47704}
2017-08-30 08:36:28 +00:00
Mostyn Bramley-Moore
c58460b25f jumbo: build some slow-to-compile sources separately
Daniel Bratell reports:
> v8 had a couple of files that were very slow to compile before jumbo
> and if those now end up in the same translation unit, then I can see
> how that translation unit can take an extreme time to get through
> the compiler.
>
> From one of my test builds (times in seconds):
> 49.7 v8_base/objects.o
> 44.0 v8_base/code-stub-assembler.o
> 32.9 v8_base/api.o
> 30.5 v8_base/elements.o
> 25.9 v8_builtins_generators/builtins-regexp-gen.o
> 22.8 v8_base/parser.o
> 21.2 v8_base/heap.o
>
> All of these are in the slowest 0.1% ninja jobs so they are extreme
> in some way. I think I would just exclude them all (or at least the
> 30s+ ones) completely from jumbo.

BUG=chromium:746958

Change-Id: I01741109def4f9ac7c946319374076eb7b9d03b6
Reviewed-on: https://chromium-review.googlesource.com/637971
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47703}
2017-08-30 08:23:28 +00:00
Enrico Bacis
ece1e2d149 [wasm] Add tests to check memory in inter-module calls
This CL introduces two tests to verify that the correct memory is
accessed when a wasm module invokes an wasm function imported from a
second module that accesses its (i.e., second module's) memory.

The first test verifies that the second module's memory is accessed in
case the first module does not have memory. In the second test, both the
modules have memory.

R=ahaas@chromium.org,clemensh@chromium.org,gdeepti@chromium.org

Change-Id: I75c3a5335583a91af0e7e4179c482142165b1c01
Reviewed-on: https://chromium-review.googlesource.com/637837
Commit-Queue: Enrico Bacis <enricobacis@google.com>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47702}
2017-08-30 07:41:40 +00:00
Peter Marshall
2261a0ddf6 [cleanup] Replace List with std::vector in IC, Handle code.
Bug: v8:6333
Change-Id: I53d321292b0a2c7b7f72ee90bd119484f163bdc1
Reviewed-on: https://chromium-review.googlesource.com/637913
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47701}
2017-08-30 07:35:00 +00:00
Sergei D
11ba497cd8 Delegate getting current wall-clock time to the Platform interface.
To enable executing code in a context of a particular time or date (e.g. when
codepath depends on whether it's say evening or New Year) there is a need for
a way to provide it bypassing actual system time.

Bug: chromium:751993
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Iee35d97b74345f63fff814a65a6f134d7c970341
Reviewed-on: https://chromium-review.googlesource.com/598666
Commit-Queue: Sergei Datsenko <dats@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47700}
2017-08-30 06:28:09 +00:00
Tobias Tebbi
46473f827f [turbofan] delete old implementation of escape analysis
Bug: 
Change-Id: Ib9e0d0844ad5e7bc6cd038f736546cad77669321
Reviewed-on: https://chromium-review.googlesource.com/641530
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47699}
2017-08-30 06:03:29 +00:00
Benedikt Meurer
8efc5f0425 [fix] Properly use CHECK instead of DCHECK.
Cleanup for 562663d545.

Bug: v8:6702
Change-Id: I7fbacbe6e4b52dc56d810cab3123b497329be3ca
Tbr: jarin@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/641874
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47698}
2017-08-30 05:56:44 +00:00
Benedikt Meurer
562663d545 [cleanup] Unify enum cache handling.
Introduce a proper empty_descriptor_array, which has the proper layout
(length is 2 and the two fields are set properly). Also add a special
EnumCache class and a matching empty_enum_cache. The contract now is
that we only need to check the EnumLength on the map to know whether we
are allowed to use the enum cache. This greatly simplifies the handling
of the enum cache (and also the descriptor arrays), especially for the
future work on optimizing keyed access via the enum cache indices.

Bug: v8:6702
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I5ef517a3041163cd65ef003f691139ea52233e83
Reviewed-on: https://chromium-review.googlesource.com/641030
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47697}
2017-08-30 05:29:16 +00:00
Jaroslav Sevcik
e84eceabbe [turbofan] Fix loop variable analysis to account for safe-integer-subtract
Bug: chromium:760434
Change-Id: I50ed6779f79ed1b17053a0a0f2013cae53091a3a
Reviewed-on: https://chromium-review.googlesource.com/641873
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47696}
2017-08-30 05:21:36 +00:00
Adam Klein
1720131946 [testrunner] Make --no-network the default, introduce --network flag to enable
Also rename options key from "no_network" to "network" to avoid
too many levels of double-negatives.

Change-Id: I6d29edce8abde64199b27ef0f3453ab370a9937b
Reviewed-on: https://chromium-review.googlesource.com/642516
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47695}
2017-08-30 00:42:55 +00:00
Jaideep Bajwa
e5b93bd57f PPC/s390: [Interpreter] Adapt Call bytecode handlers to drop their stack-frame.
Port 51a1514016

Original Commit Message:

    This change adapts the Call bytecode handlers such that they don't require
    a stack frame. It does this by modifying the call bytecode handler to
    tail-call the Call or InterpreterPushArgsAndCall builtins. As a result, the
    callee function will return to the InterpreterEntryTrampoline when it returns
    (since this is the return address on the interpreter frame), which is
    adapted to dispatch to the next bytecode handler. The return bytecode
    handler is modified to tail-call a new InterpreterExitTramoline instead
    of returning to the InterpreterEntryTrampoline.

    Overall this significanlty reduces the amount of stack space required for
    interpreter frames, increasing the maximum depth of recursive calls from
    around 6000 to around 12,500 on x64.

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

Change-Id: Ieac490d82098c13741080061eda762d54baf8c04
Reviewed-on: https://chromium-review.googlesource.com/639315
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#47694}
2017-08-29 22:46:46 +00:00
Franziska Hinkelmann
a861ebb762 [runtime] Delete extra variables
No need to reassign those JSTypedArrays.

Bug: v8:6704
Change-Id: Ide1f8bb119285b57ea85b8e710358c917244f801
Reviewed-on: https://chromium-review.googlesource.com/641474
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47693}
2017-08-29 18:37:44 +00:00
Adam Klein
a1aa3b2405 [parser] Give all Blocks kNoSourcePosition
There was only one case where this wasn't the case, having to do with
variable declarations, and for that case the information need not
actually be stored on the block, but should rather be propagated
to the VariableProxy.

Bug: v8:6092
Change-Id: I0d0025ec73d3dd4f9402606105d3e883a9417283
Reviewed-on: https://chromium-review.googlesource.com/639911
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47692}
2017-08-29 18:23:24 +00:00
Adam Klein
232b1af3ca [parser] Simplify callers of NewBlock
The vast majority of callers pass null |labels| and kNoSourcePosition,
so make those the default arguments.

Bug: v8:6092
Change-Id: Ifac3f0d49f56b680ec75b1a7afde5e5e788d9cfd
Reviewed-on: https://chromium-review.googlesource.com/639761
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47691}
2017-08-29 18:04:25 +00:00
Adam Klein
ce05578aa6 [api] Mark non-Isolate constructors of String::Utf8Value/Value for deprecation
Also remove last internal callers of the to-be-deprecated APIs.

Bug: v8:2487
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng;master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id72cf363eac86e4b4dbf7df83bdb848071260b90
Reviewed-on: https://chromium-review.googlesource.com/639326
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47690}
2017-08-29 17:42:34 +00:00
Adam Klein
f5dca8a08c [ast] Slim down Block by one pointer, moving labels_ storage to subclass
The vast majority of blocks we create in the parser have no associated
labels, so it seems silly to waste a pointer on labels_ for all such
blocks.

This is accomplished by delegating responsibility for labels storage to
each subclass of BreakableStatement, and then further-specializing Block
by creating a new subclass, LabeledBlock.

Bug: v8:6092
Change-Id: I88c824639254e5890b25a86cc156bfc4310bf2b1
Reviewed-on: https://chromium-review.googlesource.com/639063
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47689}
2017-08-29 17:40:14 +00:00
Adam Klein
ea9e9d4ee5 [parser] Remove dead from code in PreParser
Also a few bits of related dead code in Parser.

Bug: v8:6092
Change-Id: Ie30aa1bd769b78fec2563fc6ba82ef0bcd7668bb
Reviewed-on: https://chromium-review.googlesource.com/639311
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47688}
2017-08-29 17:36:24 +00:00
Clemens Hammacher
9ee7e4ec98 [wasm] Fix throwing and catching exceptions
This reimplements functionality that was present before the decoder
refactoring. It's implemented a bit differently though by generating
the code for re-throwing an uncaught exception earlier (when generating
code for the catch).

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

Bug: v8:6600
Change-Id: Ie2f11837851c0602ab31506fa63475fc2d0b5047
Reviewed-on: https://chromium-review.googlesource.com/641550
Commit-Queue: Brad Nelson <bradnelson@chromium.org>
Reviewed-by: Brad Nelson <bradnelson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47687}
2017-08-29 16:58:54 +00:00
Jakob Kummerow
693e8ac59f [js-perf-tests] Fix Modules benchmarks
The score is computed based on how often the benchmark's function can
be run within one second. Simply importing a Module repeatedly doesn't
do any work, so to make the test score meaningful, we must wrap the
payload into a function that can be called explicitly for every run.

NOTRY=true

Bug: v8:1569
Change-Id: Iadaed6df1f1652d8860271e327c505f0b8f20c2d
Reviewed-on: https://chromium-review.googlesource.com/639396
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47686}
2017-08-29 16:50:44 +00:00
Michael Starzinger
29208428c1 [turbofan] Assume deoptimization support in create lowering.
This simplfies the code for lowering of {JSCreateArguments} nodes under
the assumption that deoptimization support is always enabled, and that
arguments objects are only materialized for JavaScript frames and not
for internal stub frames.

R=tebbi@chromium.org

Change-Id: I5f86ae0f0442a03b516904d737c5a0eac293b5b9
Reviewed-on: https://chromium-review.googlesource.com/640381
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47685}
2017-08-29 16:04:14 +00:00
jgruber
7770b1d119 [regexp] Additional checks to flush out fuzzer crash
Crashes are still happening despite tentative fixes, but unfortunately
without a local repro. This adds a couple of additional checks to help
flush out the root cause.

TBR=yangguo@chromium.org

Bug: chromium:754422
Change-Id: Ib3c8a2e0271fc724a4351ce6aec8298cf520a20a
Reviewed-on: https://chromium-review.googlesource.com/640691
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47684}
2017-08-29 15:10:30 +00:00
Jeremy Roman
779bb1b172 [snapshot] Make the API external reference table const.
Chromium side: https://chromium-review.googlesource.com/c/chromium/src/+/639552

Bug: chromium:759831
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I1b217c4fa4c930733dcfab982879bf41936a3a83
Reviewed-on: https://chromium-review.googlesource.com/639551
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47683}
2017-08-29 14:15:10 +00:00
Ulan Degenbaev
5e284d9ab7 [heap] Temporarily bailout on transition array in concurrent marking.
The current processing of a transition array is not safe because the
targets in the array have conditional weakness, which can change
concurrently.

Bug: chromium:694255
Change-Id: I86bf7151af39307dc4101a0b0ca02ef7c704df53
Reviewed-on: https://chromium-review.googlesource.com/641410
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47682}
2017-08-29 14:03:09 +00:00
Peter Marshall
abaece06d2 [cleanup] Replace List with std::vector in cctests and d8.
Bug: v8:6333
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Iabaef0e63c81db503eb2f19bf63a1f77313f2a5a
Reviewed-on: https://chromium-review.googlesource.com/635591
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47681}
2017-08-29 13:29:26 +00:00
Clemens Hammacher
5e6d90932d [turbo] Fix --trace-turbo for wasm graphs
{info->optimization_id()} DCHECKS that {info->IsOptimizing()} is true.
Hence, it fails for graphs generated from wasm code.
The bug was introduced in
https://chromium-review.googlesource.com/c/v8/v8/+/592028.

R=mstarzinger@chromium.org
CC=leszeks@chromium.org

Change-Id: Ic192017fd7801797eb9ec7adc67a4bf94d219a7a
Reviewed-on: https://chromium-review.googlesource.com/640951
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47680}
2017-08-29 13:04:56 +00:00
Andreas Haas
8a70c23944 [wasm] Small cleanup in WasmCompiledModule::Reset()
Originally the call to RelocatableMemoryReferences() in
WasmCompiledModule::Reset() was guarded behind a condition.This
condition, however, is redundant, because it is checked later
again when the code is patched. This CL removes the check in
WasmCompiledModule::Reset().

R=clemensh@chromium.org

Change-Id: I10d277072f2223c2e067789a1efc3bd259f0ce5e
Reviewed-on: https://chromium-review.googlesource.com/640709
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47679}
2017-08-29 12:51:56 +00:00
Clemens Hammacher
54040fff71 Reland "[wasm] Refactor function body decoder"
This is a reland of 6b4dc039a6
Original change's description:
> [wasm] Refactor function body decoder
> 
> This refactoring separates graph building from wasm decoding. The
> WasmGraphBuilder is just a consumer of the decoded information.
> Decoding without any consumer (i.e. just validation) gets 16% faster by
> this refactoring, because no TFNode* have to be stored in the value
> stack, and all dynamic tests to determine whether the graph should be
> build are gone (measured on AngryBots; before: 110.2 +- 3.3ms, after:
> 92.2 +- 3.1 ms).
> 
> This new design will allow us to also attach other consumers, e.g. a
> new baseline compiler.
> 
> R=titzer@chromium.org
> 
> Bug: v8:6600
> Change-Id: I4b60f2409d871a16c3c52a37e515bcfb9dbb8f54
> Reviewed-on: https://chromium-review.googlesource.com/571010
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47671}

TBR=titzer@chromium.org

Bug: v8:6600
Change-Id: Idd867c5a1917437de5b6e3de5917cc1c9f194489
Reviewed-on: https://chromium-review.googlesource.com/640591
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47678}
2017-08-29 11:56:17 +00:00
Clemens Hammacher
5c9f083125 [gyp] Disable compiler warning
It's disabled in gn and on several platforms, so also disable it for
linux systems in general.

R=machenbach@chromium.org

Change-Id: Id5d0e5d30cc27c449d05352df6dd0aade5d9e6fd
Reviewed-on: https://chromium-review.googlesource.com/640708
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47677}
2017-08-29 11:52:47 +00:00
Michael Starzinger
94b521126b [wasm] Support max memory size in WasmModuleBuilder.
This adds support to specify the maximum memory size when building a
WebAssembly module. Default is not maximum, one can be explicitly set.
It is mainly used by the WebAssembly fuzzers to prevent OOMs.

R=ahaas@chromium.org
BUG=chromium:759973

Change-Id: Ibf5fa63a7e36e5f3b65ced528c73a65355d5632f
Reviewed-on: https://chromium-review.googlesource.com/640386
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47676}
2017-08-29 11:33:07 +00:00
Jaroslav Sevcik
1fb17815ad [turbofan] Make --trace-turbo-graph independent from --trace-turbo.
Bug: v8:5267
Change-Id: Ib93b4e5110061a0dcae0a6879f5d0e878cf1bf3f
Reviewed-on: https://chromium-review.googlesource.com/640704
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47675}
2017-08-29 11:14:47 +00:00