Rather check expressions used as patterns directly. Check parentheses by
tagging parenthesized expressions as parenthesized.
This allows us to drop UnexpectedPatternToken and makes it clear why a specific
token is unexpected (because it's invalid in a binding pattern).
This also more uniformly restores messages like "Invalid destructuring
assignment target".
Change-Id: Idd98e9116c85de4c2304cf1fef1baa097b67149d
Reviewed-on: https://chromium-review.googlesource.com/c/1349572
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57792}
Use gperf to generate a perfect hash table for keyword lookup. Adds a
python script which munges the output of gperf and adds additional
cleanup and optimisations.
Change-Id: I3656a7287dbd0688917893de3a671faef9e4578a
Reviewed-on: https://chromium-review.googlesource.com/c/1349240
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57790}
- Remove the InstallFunction variant which just passed its arguments
straight to JSObject::AddProperty
- Change InstallFunction to accept a String rather than a Symbol as all
symbol installation goes through InstallFunctionAtSymbol now. This way
we can avoid the call to Name::ToFunctionName as well
- Add an explicit helper InstallFunctionWithBuiltinId for installing
functions which have a builtin ID. These are always installed with
DONT_ENUM PropertyAttributes so we can remove that parameter, too.
- Remove PropertyAttributes from InstallFunction because it is always
DONT_ENUM.
Bug: v8:8238
Change-Id: I7af3d6d833d50065c20e198e21a72ef4a539c1ca
Reviewed-on: https://chromium-review.googlesource.com/c/1349284
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57789}
This reverts commit 38cd61d0e0.
Reason for revert: Layout test http/tests/asmjs/asm-warnings.html fails due to missing context.
See https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux_chromium_rel_ng/238991
crash log for renderer (pid <unknown>):
STDOUT: <empty>
STDERR: [1:1:1123/024436.020348:FATAL:script_state.h(140)] Check failed: !context.IsEmpty().
STDERR: #0 0x5556817298df base::debug::StackTrace::StackTrace()
STDERR: #1 0x55568167b5fb logging::LogMessage::~LogMessage()
STDERR: #2 0x55568154ed45 blink::ScriptState::From()
STDERR: #3 0x555683047aa9 blink::V8Initializer::MessageHandlerInMainThread()
STDERR: #4 0x5556801793c8 v8::internal::MessageHandler::ReportMessageNoExceptions()
STDERR: #5 0x555680178652 v8::internal::MessageHandler::ReportMessage()
STDERR: #6 0x5556802c2563 v8::internal::PendingCompilationErrorHandler::ReportWarnings()
STDERR: #7 0x55567fc8bcd3 v8::internal::(anonymous namespace)::FinalizeUnoptimizedCode()
STDERR: #8 0x55567fc8b668 v8::internal::Compiler::Compile()
STDERR: #9 0x55567fc8be6b v8::internal::Compiler::Compile()
STDERR: #10 0x55568033a36f v8::internal::__RT_impl_Runtime_CompileLazy()
STDERR: #11 0x5556808f2492 <unknown>
STDERR:
STDERR: [25209:25254:1123/024436.075700:WARNING:crash_handler_host_linux.cc(341)] Could not translate tid, attempt = 1 retry ...
The issue seems to be that we do require the context for when we report a compile error when finalizing the compilation.
Original change's description:
> [Compiler] Ensure unoptimized code generation is context independent.
>
> Now that Asm.js code is also context independent, move code to ensure context independence
> from BytecodeGenerator to FinalizeUnoptimizedCode.
>
> Change-Id: I7738eb3b347ea82764ecd3b5548dc82cb06d2f4e
> Reviewed-on: https://chromium-review.googlesource.com/c/1347483
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57730}
TBR=rmcilroy@chromium.org,mstarzinger@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Iaa15e608b35a3396ba51a03f996c6de1330f0016
Reviewed-on: https://chromium-review.googlesource.com/c/1349236
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57785}
The callback set with this function is already not used anymore.
R=yangguo@chromium.org
Bug: chromium:860637, v8:8238
Change-Id: I26f4528720e936dcc9b7b244dff7db97a4b43273
Reviewed-on: https://chromium-review.googlesource.com/c/1345989
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57783}
- Reuse CheckDestructuringElement for object rest destructuring,
- don't duplicate eval/arguments detection in object patterns,
- don't unnecessarily locally validate expression when async(...) is a call,
- don't classify pattern error for Property since it's only invalid as a binding pattern.
Change-Id: I0eaf6abff39a563c2d6dc07dfbb17071c0f76caf
Reviewed-on: https://chromium-review.googlesource.com/c/1349282
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57782}
This method is only used in a slow dcheck, thus omit it completely
otherwise.
R=ahaas@chromium.org
Bug: v8:8238
Change-Id: Ic23d0ff10a1dfe9f383237c99a365c2d3ee93e51
Reviewed-on: https://chromium-review.googlesource.com/c/1349233
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57781}
This implements sign extension for the arm32 port of Liftoff.
Bug: v8:6600
Change-Id: Ib9fb56835b92fa96af013fd3504395d24a27e10e
Reviewed-on: https://chromium-review.googlesource.com/c/1348429
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57779}
This implements type conversion for the arm32 port of Liftoff.
Bug: v8:6600
Change-Id: Id100df92dc5e9f9df1b7b26158e35bb36b742f10
Reviewed-on: https://chromium-review.googlesource.com/c/1348409
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57778}
+ fixing other files which were depending on context-inl.h pulling in the
missing includes.
BUG=v8:7490,v8:8238
Change-Id: I90d37599bdfb69ac8fd7e62b8fb78d9d77c77234
Reviewed-on: https://chromium-review.googlesource.com/c/1349277
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57775}
This changes the split from AssignmentPattern and BindingPattern to Pattern and
BindingPattern. Pattern collects all errors that are invalid in both assignment
and binding pattern contexts. Binding pattern additionally collects errors for
binding pattern contexts (property access isn't a valid target). The
distinction is piggybacked on to distinguish assignment vs binding pattern
errors since binding pattern verification will first throw the binding pattern
error.
Since we don't throw pattern error as binding pattern as well, this can mean
that a later binding pattern syntax error will show up before an early pattern
error. Since that just changes the message to another syntax violation, I think
that's fine.
Change-Id: Ib6a22c8d11c49eacc6667ae8ee5e98bababadd43
Reviewed-on: https://chromium-review.googlesource.com/c/1349273
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57774}
This helper cleans up the callsites of the Symbol.toPrimitive
installations. As a bonus, we can remove an unused CreateFunction
variant now.
Bug: v8:8238
Change-Id: I017acc9464d6179e8bf53767f8bbc953272b46ed
Reviewed-on: https://chromium-review.googlesource.com/c/1349275
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57773}
Add a path into embedder tracing on allocation. This is safe as as Blink
is not allowed to call into V8 during object construction.
This is a reland of caed2cc033.
Bug: chromium:843903
Change-Id: I7faa8413966f6b4d37f19b235d46bb09e4d47235
Bug: chromium:843903
Reviewed-on: https://chromium-review.googlesource.com/c/1349330
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57770}
- Remove an unused param from InstallFunction
- Remove an InstallFunction variant which just rearranges the order of
the arguments
- Consistently use const char* string literals as property names rather
than e.g. factory->return_string() just write "return" because it is
easier for humans to read. All the strings are internalized anyway and
this happens at mksnapshot time, so there is no performance penalty.
- Remove the maybe_prototype arguments to CreateFunction. We always know
at the callsite whether we have a prototype or not, so just call the
variant that takes a prototype or the new CreateFunction variant which
takes a Builtin::name.
- Rename a SimpleInstallFunction variant which was only used for symbols
to InstallFunctionAtSymbol. This also makes it clear that this is the
only case where property_name and function_name differ.
Bug: v8:8238
Change-Id: I2400de90ebe837694e777cff1419858037ee51cc
Reviewed-on: https://chromium-review.googlesource.com/c/1349271
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57769}
This reverts commit e64f7c0ae0.
Reason for revert: this breaks chromedriver_py_test on Mac and Windows. This blocks the roll.
Details:
- DEPS roll with V8 pointing to this commit fails: https://chromium-review.googlesource.com/c/chromium/src/+/1349251
- DEPS roll with V8 pointing to the parent of this commit succeeds: https://chromium-review.googlesource.com/c/chromium/src/+/1349214
Original change's description:
> Reland "[turbofan] Use feedback when reducing global loads/stores."
>
> This is a reland of 9c91b6877a after
> fixing undefined behavior in numeric conversion that caused trouble
> on arm32.
>
> Original change's description:
> > [turbofan] Use feedback when reducing global loads/stores.
> >
> > We already record the script context location or the property cell
> > as feedback of the global load/store IC, so Turbofan doesn't need
> > to do the lookups again.
> >
> > Change-Id: I6cbd2937de344729cd8e146b4ff85ddf3de6a56e
> > Reviewed-on: https://chromium-review.googlesource.com/c/1335691
> > Commit-Queue: Georg Neis <neis@chromium.org>
> > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#57555}
>
> Change-Id: Ic2d09025de02f92199755ac860bb9e91fa08f4ec
> Reviewed-on: https://chromium-review.googlesource.com/c/1340043
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Commit-Queue: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57649}
TBR=neis@chromium.org,bmeurer@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I7c9364d6a0bea6681fe9e25b28206cfc2c8557a7
Reviewed-on: https://chromium-review.googlesource.com/c/1349272
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57768}
This implements AssertUnreachable for the arm32 port of Liftoff.
Bug: v8:6600
Change-Id: I9aa5083dc1be175fc5f2f386d8aace021bab3b03
Reviewed-on: https://chromium-review.googlesource.com/c/1346335
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57767}
This implements popcnt, division and remainder on i32 for the arm32 port of Liftoff.
Bug: v8:6600
Change-Id: I2aac78596ef9799bf8fcfc791c0e946a8388f62f
Reviewed-on: https://chromium-review.googlesource.com/c/1346497
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57766}
This implements arithmetic operations on i32, comparisons, and conditional
jumps for the arm32 port of Liftoff.
Bug: v8:6600
Change-Id: Ib8d6e4dd99c725d9c5bff06d31c64e7ba4639297
Reviewed-on: https://chromium-review.googlesource.com/c/1346334
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57765}
This is a reland of a6e3cdd9b5
Now only changes ObjectTemplate::NewInstance.
Original change's description:
> [cleanup] Move methods to V8_DEPRECATED
>
> Updates ObjectTemplate::NewInstance and FunctionTemplate::GetFunction
> from V8_DEPRECATED_SOON to V8_DEPRECATED, now that they're unused in
> chrome.
>
> Bug: v8:7294, v8:7295, v8:8238
> Change-Id: Ic7cb2c410ff812f73cfd108551f2a1a20722df07
> Reviewed-on: https://chromium-review.googlesource.com/c/1344151
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Dan Elphick <delphick@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57657}
Bug: v8:7294, v8:7295, v8:8238
Change-Id: I52ec021bc92600f67cf27791d5b2df2a4342a4d5
Reviewed-on: https://chromium-review.googlesource.com/c/1348079
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57760}
Add a path into embedder tracing on allocation. This is safe as as Blink
is not allowed to call into V8 during object construction.
Bug: chromium:843903
Change-Id: I5af053c3169f5a33778ebce5d7c5c43e4efb1aa4
Reviewed-on: https://chromium-review.googlesource.com/c/1348749
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57757}
Use the list of keywords to tighten the CannotBeKeyword scan flag to
also exclude lower case letters which are not present in any of the
keywords.
Change-Id: I6a00b5f5ee8f47088539806f15890a7489441fea
Reviewed-on: https://chromium-review.googlesource.com/c/1347475
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57754}
This simplifies the ExpressionClassifier a bit again, making it a little more
understandable.
Change-Id: I57bdd871b10409ea04b33748609160f2b40a498a
Reviewed-on: https://chromium-review.googlesource.com/c/1348431
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57753}
If we're verifying/accumulating/throwing all possible classifier errors anyway,
we don't need our own classifier.
Change-Id: Ibfbdc4e5151190385598fc50bda9f9921b6aedce
Reviewed-on: https://chromium-review.googlesource.com/c/1348080
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57751}
This CL also makes existence of the optional padding field in JSArrayBuffer
explicit and ensures that the field stays cleared after initialization.
Bug: v8:8477, v8:8238
Change-Id: Ic4c5f6b0066903651f15bea91fbfe32ba62fa0e6
Reviewed-on: https://chromium-review.googlesource.com/c/1347469
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57750}
This API allows the embedder to provide a stack and PC, FP and
SP registers. V8 will then attempt to unwind the stack to the C++ frame
that called into JS. This API is signal-safe, meaning it does not call
any signal-unsafe OS functions or read/write any V8 state.
Bug: v8:8116
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I7e3e73753b711737020b6a5f11946096658afa6f
Reviewed-on: https://chromium-review.googlesource.com/c/1186724
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57749}
Now the accessors do not use the LoadWeakFixedArrayElement function.
Bug: v8:8486
Change-Id: Icccf294c25bbedb118cb2dd7a422dc71d70c727b
Reviewed-on: https://chromium-review.googlesource.com/c/1348071
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57748}
Add a profiler for functions imported to WASM instances. This profiler
is implemented entirely in JavaScript and monkey-patches
WebAssembly.instantiate() and new WebAssembly.Instance() to instrument
the imported functions to each instance in order to count their
invocations and cumulative time.
R=mstarzinger@chromium.org
Bug: v8:8423
Change-Id: If456355aba07dc69c5500bafbe35fc56b31486af
Reviewed-on: https://chromium-review.googlesource.com/c/1347488
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57746}
Port fed7bb501e
Original Commit Message:
This test cases ensures that it is possible to maintain a coherent
instruction cache by using {Assembler::FlushICache} in any order with
respect to changing page permissions via {SetPermissions}.
R=mstarzinger@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:6792
LOG=N
Change-Id: I23d5d0828dcbdd527aaa8708fa726a7cb5cbedfe
Reviewed-on: https://chromium-review.googlesource.com/c/1347511
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#57745}
this will allow to add raw fields to the native context in a pointer compression
friendly way.
This CL also adds a microtask_queue field to native context which will be used
in a follow-up CL.
Bug: v8:8238, v8:7703
Change-Id: I5ecf72dbc52e8261b694551cbc8476f967967723
Reviewed-on: https://chromium-review.googlesource.com/c/1348073
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57744}