v8/test/cctest/interpreter/bytecode_expectations
Benedikt Meurer c041296189 [builtins] Refactor the promise resolution and rejection logic.
This introduces dedicated builtins

  - FulfillPromise,
  - RejectPromise, and
  - ResolvePromise,

which perform the corresponding operations from the language
specification, and removes the redundant entry points and the
excessive inlining of these operations into other builtins. We
also add the same logic on the C++ side, so that we don't need
to go into JavaScript land when resolving/rejecting from the
API.

The C++ side has a complete implementation, including full support
for the debugger and the current PromiseHook machinery. This is to
avoid constantly crossing the boundary for those cases, and to also
simplify the CSA side (and soon the TurboFan side), where we only
do the fast-path and bail out to the runtime for the general handling.

On top of this we introduce %_RejectPromise and %_ResolvePromise,
which are entry points used by the bytecode and parser desugarings
for async functions, and also used by the V8 Extras API. Thanks to
this we can uniformly optimize these in TurboFan, where we have
corresponding operators JSRejectPromise and JSResolvePromise, which
currently just call into the builtins, but middle-term can be further
optimized, i.e. to skip the "then" lookup for JSResolvePromise when
we know something about the resolution.

In TurboFan we can also already inline the default PromiseCapability
[[Reject]] and [[Resolve]] functions, although this is not as effective
as it can be right now, until we have inlining support for the Promise
constructor (being worked on by petermarshall@ right now) and/or SFI
based CALL_IC feedback.

Overall this change is meant as a refactoring without significant
performance impact anywhere; it seems to improve performance of
simple async functions a bit, but otherwise is neutral.

Bug: v8:7253
Change-Id: Id0b979f9b2843560e38cd8df4b02627dad4b6d8c
Reviewed-on: https://chromium-review.googlesource.com/911632
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51260}
2018-02-13 04:18:12 +00:00
..
ArrayLiterals.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
AssignmentsInBinaryExpression.golden [parser] Add an n-ary node for large binop chains 2017-10-25 11:28:55 +00:00
AsyncGenerators.golden [typedarray] Port ConstructByIterable by CSA. 2018-02-06 17:06:43 +00:00
BasicBlockToBoolean.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
BasicLoops.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
BreakableBlocks.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
CallAndSpread.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
CallGlobal.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
CallLookupSlot.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
CallNew.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
CallRuntime.golden [Interpreter] Make CallJSRuntime implicitly use undefined reciever. 2017-09-07 12:14:24 +00:00
ClassAndSuperClass.golden [class] Store class fields initializer on the constructor 2017-11-27 10:35:11 +00:00
ClassDeclarations.golden [class] Implement super property access in instance fields 2017-11-28 10:14:19 +00:00
ClassFields.golden [class] Split out static fields into a separate flag 2017-12-22 13:04:51 +00:00
CompareNil.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
CompareTypeOf.golden [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
CompoundExpressions.golden [storeic] Drop duplicate stubs for each LanguageMode 2017-09-05 18:00:39 +00:00
Conditional.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
ConstVariable.golden [ignition] removed nop bytecode 2017-07-18 16:14:29 +00:00
ConstVariableContextSlot.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
ContextParameters.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
ContextVariables.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
CountOperators.golden Drop custom accessor deoptimization support 2017-11-06 20:20:58 +00:00
CreateArguments.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
CreateRestParameter.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
DeadCodeRemoval.golden [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
DeclareGlobals.golden [interpreter] Merge StaGlobal[Sloppy/Strict] into one bytecode. 2017-12-14 10:03:00 +00:00
Delete.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
DeleteLookupSlotInEval.golden [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
DoDebugger.golden
DoExpression.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
Eval.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
ForAwaitOf.golden [builtins] Refactor the promise resolution and rejection logic. 2018-02-13 04:18:12 +00:00
ForIn.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
ForOf.golden [typedarray] Port ConstructByIterable by CSA. 2018-02-06 17:06:43 +00:00
ForOfLoop.golden [builtins] Refactor the promise resolution and rejection logic. 2018-02-13 04:18:12 +00:00
FunctionLiterals.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
GenerateTestUndetectable.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
Generators.golden [typedarray] Port ConstructByIterable by CSA. 2018-02-06 17:06:43 +00:00
GlobalCompoundExpressions.golden [interpreter] Merge StaGlobal[Sloppy/Strict] into one bytecode. 2017-12-14 10:03:00 +00:00
GlobalCountOperators.golden [interpreter] Merge StaGlobal[Sloppy/Strict] into one bytecode. 2017-12-14 10:03:00 +00:00
GlobalDelete.golden [ignition] Fix return value of delete on global lexical variables 2017-08-23 16:17:48 +00:00
HeapNumberConstants.golden [ast] Move AstValue implementation into Literal 2017-10-27 20:21:29 +00:00
IfConditions.golden [turbofan] Introduce InstanceOfIC to collect rhs feedback. 2017-10-23 10:15:36 +00:00
IntegerConstants.golden [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
LetVariable.golden [ignition] removed nop bytecode 2017-07-18 16:14:29 +00:00
LetVariableContextSlot.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
LoadGlobal.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
LogicalExpressions.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
LookupSlot.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
LookupSlotInEval.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
Modules.golden [ignition] Reduce generator switch boilerplate 2018-01-24 17:09:54 +00:00
NewAndSpread.golden [class] Implement super property access in instance fields 2017-11-28 10:14:19 +00:00
NewTarget.golden [Interpreter] Remove new.target from fixed frame slot. 2017-08-11 17:04:08 +00:00
ObjectLiterals.golden Drop custom accessor deoptimization support 2017-11-06 20:20:58 +00:00
OuterContextVariables.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
Parameters.golden [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
PrimitiveExpressions.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
PrimitiveReturnStatements.golden [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
PropertyCall.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
PropertyLoads.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
PropertyStores.golden [storeic] Drop duplicate stubs for each LanguageMode 2017-09-05 18:00:39 +00:00
RegExpLiterals.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
RemoveRedundantLdar.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
StandardForLoop.golden [builtins] Refactor the promise resolution and rejection logic. 2018-02-13 04:18:12 +00:00
StaticClassFields.golden [class] Split out static fields into a separate flag 2017-12-22 13:04:51 +00:00
StoreGlobal.golden [interpreter] Merge StaGlobal[Sloppy/Strict] into one bytecode. 2017-12-14 10:03:00 +00:00
StringConcat.golden [parser] Add an n-ary node for large binop chains 2017-10-25 11:28:55 +00:00
StringConstants.golden [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
SuperCallAndSpread.golden [class] Store class fields initializer on the constructor 2017-11-27 10:35:11 +00:00
Switch.golden [FeedbackVector] Case statements can share a single vector slot 2017-11-07 11:16:47 +00:00
ThisFunction.golden Move function name var initialization to BytecodeGenerator 2017-11-27 18:37:47 +00:00
Throw.golden [ignition] Expect 'I' for signed bytecode operands 2017-01-25 17:39:24 +00:00
TopLevelObjectLiterals.golden [interpreter] Merge StaGlobal[Sloppy/Strict] into one bytecode. 2017-12-14 10:03:00 +00:00
TryCatch.golden [inspector] improve return position of explicit return in non-async function 2017-07-14 19:10:13 +00:00
TryFinally.golden [ignition] Always write the deferred command result register 2017-08-25 16:31:24 +00:00
Typeof.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00
UnaryOperators.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
WideRegisters.golden [Cleanup][Interpreter] Move feedback slot allocation to bytecode generator 2017-10-19 16:17:14 +00:00
WithStatement.golden [objects] Make feedback vector a first-class object 2017-07-27 13:31:55 +00:00