GeezerVison is showing github.com — deps: V8: backport 7857eb34db42 · nodejs/node@2d982d3
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/builtins/base.tq -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -1313,7 +1313,6 @@ extern macro ChangeUint32ToWord(uint32): uintptr; // Doesn't sign-extend. | 1313 | 1313 | extern macro ChangeInt32ToInt64(int32): int64; // Sign-extends. | 1314 | 1314 | extern macro ChangeUint32ToUint64(uint32): uint64; // Doesn't sign-extend. | 1315 | 1315 | extern macro LoadNativeContext(Context): NativeContext; | 1316 | | -extern macro GetContinuationPreservedEmbedderData(): Object; | 1317 | 1316 | extern macro TruncateFloat64ToFloat16(float64): float16; | 1318 | 1317 | extern macro TruncateFloat32ToFloat16(float32): float16; | 1319 | 1318 | extern macro TruncateFloat64ToFloat32(float64): float32; | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/builtins/promise-misc.tq +23-4Lines changed: 23 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -30,6 +30,11 @@ extern macro PromiseBuiltinsAssembler::IsIsolatePromiseHookEnabled(uint32): | 30 | 30 |
| 31 | 31 | extern macro PromiseBuiltinsAssembler::PromiseHookFlags(): uint32; | 32 | 32 |
| | 33 | +namespace macros { | | 34 | +extern macro GetContinuationPreservedEmbedderData(): Object; | | 35 | +extern macro SetContinuationPreservedEmbedderData(Object): void; | | 36 | +} | | 37 | + | 33 | 38 | namespace promise { | 34 | 39 | extern macro IsFunctionWithPrototypeSlotMap(Map): bool; | 35 | 40 |
| @@ -80,7 +85,7 @@ macro NewPromiseFulfillReactionJobTask( | 80 | 85 | return new PromiseFulfillReactionJobTask{ | 81 | 86 | map: PromiseFulfillReactionJobTaskMapConstant(), | 82 | 87 | continuation_preserved_embedder_data: | 83 | | - GetContinuationPreservedEmbedderData(), | | 88 | + macros::GetContinuationPreservedEmbedderData(), | 84 | 89 | argument, | 85 | 90 | context: handlerContext, | 86 | 91 | handler, | @@ -108,7 +113,7 @@ macro NewPromiseRejectReactionJobTask( | 108 | 113 | return new PromiseRejectReactionJobTask{ | 109 | 114 | map: PromiseRejectReactionJobTaskMapConstant(), | 110 | 115 | continuation_preserved_embedder_data: | 111 | | - GetContinuationPreservedEmbedderData(), | | 116 | + macros::GetContinuationPreservedEmbedderData(), | 112 | 117 | argument, | 113 | 118 | context: handlerContext, | 114 | 119 | handler, | @@ -303,7 +308,7 @@ macro NewPromiseReaction( | 303 | 308 | return new PromiseReaction{ | 304 | 309 | map: PromiseReactionMapConstant(), | 305 | 310 | continuation_preserved_embedder_data: | 306 | | - GetContinuationPreservedEmbedderData(), | | 311 | + macros::GetContinuationPreservedEmbedderData(), | 307 | 312 | next: next, | 308 | 313 | reject_handler: rejectHandler, | 309 | 314 | fulfill_handler: fulfillHandler, | @@ -347,7 +352,7 @@ macro NewPromiseResolveThenableJobTask( | 347 | 352 | return new PromiseResolveThenableJobTask{ | 348 | 353 | map: PromiseResolveThenableJobTaskMapConstant(), | 349 | 354 | continuation_preserved_embedder_data: | 350 | | - GetContinuationPreservedEmbedderData(), | | 355 | + macros::GetContinuationPreservedEmbedderData(), | 351 | 356 | context: nativeContext, | 352 | 357 | promise_to_resolve: promiseToResolve, | 353 | 358 | thenable, | @@ -452,4 +457,18 @@ transitioning macro BranchIfAccessCheckFailed( | 452 | 457 | } | 453 | 458 | } label HasAccess {} | 454 | 459 | } | | 460 | + | | 461 | +@if(V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA) | | 462 | +transitioning javascript builtin GetContinuationPreservedEmbedderData( | | 463 | + js-implicit context: Context, receiver: JSAny)(): JSAny { | | 464 | + return UnsafeCast<JSAny>(macros::GetContinuationPreservedEmbedderData()); | | 465 | +} | | 466 | + | | 467 | +@if(V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA) | | 468 | +transitioning javascript builtin SetContinuationPreservedEmbedderData( | | 469 | + js-implicit context: Context, receiver: JSAny)(data: Object): Undefined { | | 470 | + macros::SetContinuationPreservedEmbedderData(data); | | 471 | + return Undefined; | | 472 | +} | | 473 | + | 455 | 474 | } |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/compiler/js-call-reducer.cc +39Lines changed: 39 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -5108,6 +5108,12 @@ Reduction JSCallReducer::ReduceJSCall(Node* node, | 5108 | 5108 | case Builtin::kBigIntAsIntN: | 5109 | 5109 | case Builtin::kBigIntAsUintN: | 5110 | 5110 | return ReduceBigIntAsN(node, builtin); | | 5111 | +#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 5112 | + case Builtin::kGetContinuationPreservedEmbedderData: | | 5113 | + return ReduceGetContinuationPreservedEmbedderData(node); | | 5114 | + case Builtin::kSetContinuationPreservedEmbedderData: | | 5115 | + return ReduceSetContinuationPreservedEmbedderData(node); | | 5116 | +#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | 5111 | 5117 | default: | 5112 | 5118 | break; | 5113 | 5119 | } | @@ -8780,6 +8786,39 @@ Reduction JSCallReducer::ReduceJSCallMathMinMaxWithArrayLike(Node* node, | 8780 | 8786 | return ReplaceWithSubgraph(&a, subgraph); | 8781 | 8787 | } | 8782 | 8788 |
| | 8789 | +#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 8790 | +Reduction JSCallReducer::ReduceGetContinuationPreservedEmbedderData( | | 8791 | + Node* node) { | | 8792 | + JSCallNode n(node); | | 8793 | + Effect effect = n.effect(); | | 8794 | + Control control = n.control(); | | 8795 | + | | 8796 | + Node* value = effect = graph()->NewNode( | | 8797 | + simplified()->GetContinuationPreservedEmbedderData(), effect); | | 8798 | + | | 8799 | + ReplaceWithValue(node, value, effect, control); | | 8800 | + return Replace(node); | | 8801 | +} | | 8802 | + | | 8803 | +Reduction JSCallReducer::ReduceSetContinuationPreservedEmbedderData( | | 8804 | + Node* node) { | | 8805 | + JSCallNode n(node); | | 8806 | + Effect effect = n.effect(); | | 8807 | + Control control = n.control(); | | 8808 | + | | 8809 | + if (n.ArgumentCount() == 0) return NoChange(); | | 8810 | + | | 8811 | + effect = | | 8812 | + graph()->NewNode(simplified()->SetContinuationPreservedEmbedderData(), | | 8813 | + n.Argument(0), effect); | | 8814 | + | | 8815 | + Node* value = jsgraph()->UndefinedConstant(); | | 8816 | + | | 8817 | + ReplaceWithValue(node, value, effect, control); | | 8818 | + return Replace(node); | | 8819 | +} | | 8820 | +#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 8821 | + | 8783 | 8822 | CompilationDependencies* JSCallReducer::dependencies() const { | 8784 | 8823 | return broker()->dependencies(); | 8785 | 8824 | } | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/compiler/js-call-reducer.h +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -239,6 +239,11 @@ class V8_EXPORT_PRIVATE JSCallReducer final : public AdvancedReducer { | 239 | 239 | base::Optional<Reduction> TryReduceJSCallMathMinMaxWithArrayLike(Node* node); | 240 | 240 | Reduction ReduceJSCallMathMinMaxWithArrayLike(Node* node, Builtin builtin); | 241 | 241 |
| | 242 | +#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 243 | + Reduction ReduceGetContinuationPreservedEmbedderData(Node* node); | | 244 | + Reduction ReduceSetContinuationPreservedEmbedderData(Node* node); | | 245 | +#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 246 | + | 242 | 247 | // The pendant to ReplaceWithValue when using GraphAssembler-based reductions. | 243 | 248 | Reduction ReplaceWithSubgraph(JSCallReducerAssembler* gasm, Node* subgraph); | 244 | 249 | std::pair<Node*, Node*> ReleaseEffectAndControlFromAssembler( | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/compiler/opcodes.h +10-1Lines changed: 10 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 429 | 429 |
| 430 | 430 | #define SIMPLIFIED_SPECULATIVE_NUMBER_UNOP_LIST(V) V(SpeculativeToNumber) | 431 | 431 |
| | 432 | +#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 433 | +#define SIMPLIFIED_CPED_OP_LIST(V) \ | | 434 | + V(GetContinuationPreservedEmbedderData) \ | | 435 | + V(SetContinuationPreservedEmbedderData) | | 436 | +#else | | 437 | +#define SIMPLIFIED_CPED_OP_LIST(V) | | 438 | +#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 439 | + | 432 | 440 | #define SIMPLIFIED_OTHER_OP_LIST(V) \ | 433 | 441 | V(Allocate) \ | 434 | 442 | V(AllocateRaw) \ | | 534 | 542 | V(TransitionElementsKind) \ | 535 | 543 | V(TypeOf) \ | 536 | 544 | V(Unsigned32Divide) \ | 537 | | - V(VerifyType) | | 545 | + V(VerifyType) \ | | 546 | + SIMPLIFIED_CPED_OP_LIST(V) | 538 | 547 |
| 539 | 548 | #define SIMPLIFIED_SPECULATIVE_BIGINT_BINOP_LIST(V) \ | 540 | 549 | V(SpeculativeBigIntAdd) \ | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/compiler/simplified-lowering.cc +11Lines changed: 11 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -4635,6 +4635,17 @@ class RepresentationSelector { | 4635 | 4635 | SetOutput<T>(node, LoadRepresentationOf(node->op()).representation()); | 4636 | 4636 | return; | 4637 | 4637 |
| | 4638 | +#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 4639 | + case IrOpcode::kGetContinuationPreservedEmbedderData: | | 4640 | + SetOutput<T>(node, MachineRepresentation::kTagged); | | 4641 | + return; | | 4642 | + | | 4643 | + case IrOpcode::kSetContinuationPreservedEmbedderData: | | 4644 | + ProcessInput<T>(node, 0, UseInfo::AnyTagged()); | | 4645 | + SetOutput<T>(node, MachineRepresentation::kNone); | | 4646 | + return; | | 4647 | +#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 4648 | + | 4638 | 4649 | default: | 4639 | 4650 | FATAL( | 4640 | 4651 | "Representation inference: unsupported opcode %i (%s), node #%i\n.", | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/compiler/simplified-operator.cc +32Lines changed: 32 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1339,6 +1339,26 @@ struct SimplifiedOperatorGlobalCache final { | 1339 | 1339 | kSpeculativeToBigIntBigInt64Operator; | 1340 | 1340 | SpeculativeToBigIntOperator<BigIntOperationHint::kBigInt> | 1341 | 1341 | kSpeculativeToBigIntBigIntOperator; | | 1342 | + | | 1343 | +#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 1344 | + struct GetContinuationPreservedEmbedderDataOperator : public Operator { | | 1345 | + GetContinuationPreservedEmbedderDataOperator() | | 1346 | + : Operator(IrOpcode::kGetContinuationPreservedEmbedderData, | | 1347 | + Operator::kNoThrow | Operator::kNoDeopt | Operator::kNoWrite, | | 1348 | + "GetContinuationPreservedEmbedderData", 0, 1, 0, 1, 1, 0) {} | | 1349 | + }; | | 1350 | + GetContinuationPreservedEmbedderDataOperator | | 1351 | + kGetContinuationPreservedEmbedderData; | | 1352 | + | | 1353 | + struct SetContinuationPreservedEmbedderDataOperator : public Operator { | | 1354 | + SetContinuationPreservedEmbedderDataOperator() | | 1355 | + : Operator(IrOpcode::kSetContinuationPreservedEmbedderData, | | 1356 | + Operator::kNoThrow | Operator::kNoDeopt | Operator::kNoRead, | | 1357 | + "SetContinuationPreservedEmbedderData", 1, 1, 0, 0, 1, 0) {} | | 1358 | + }; | | 1359 | + SetContinuationPreservedEmbedderDataOperator | | 1360 | + kSetContinuationPreservedEmbedderData; | | 1361 | +#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | 1342 | 1362 | }; | 1343 | 1363 |
| 1344 | 1364 | namespace { | @@ -2198,6 +2218,18 @@ const Operator* SimplifiedOperatorBuilder::StoreField( | 2198 | 2218 | 2, 1, 1, 0, 1, 0, store_access); | 2199 | 2219 | } | 2200 | 2220 |
| | 2221 | +#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 2222 | +const Operator* | | 2223 | +SimplifiedOperatorBuilder::GetContinuationPreservedEmbedderData() { | | 2224 | + return &cache_.kGetContinuationPreservedEmbedderData; | | 2225 | +} | | 2226 | + | | 2227 | +const Operator* | | 2228 | +SimplifiedOperatorBuilder::SetContinuationPreservedEmbedderData() { | | 2229 | + return &cache_.kSetContinuationPreservedEmbedderData; | | 2230 | +} | | 2231 | +#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 2232 | + | 2201 | 2233 | const Operator* SimplifiedOperatorBuilder::LoadMessage() { | 2202 | 2234 | return zone()->New<Operator>(IrOpcode::kLoadMessage, Operator::kEliminatable, | 2203 | 2235 | "LoadMessage", 1, 1, 1, 1, 1, 0); | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/compiler/simplified-operator.h +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1218,6 +1218,11 @@ class V8_EXPORT_PRIVATE SimplifiedOperatorBuilder final | 1218 | 1218 | const FastApiCallFunctionVector& c_candidate_functions, | 1219 | 1219 | FeedbackSource const& feedback, CallDescriptor* descriptor); | 1220 | 1220 |
| | 1221 | +#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 1222 | + const Operator* GetContinuationPreservedEmbedderData(); | | 1223 | + const Operator* SetContinuationPreservedEmbedderData(); | | 1224 | +#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 1225 | + | 1221 | 1226 | private: | 1222 | 1227 | Zone* zone() const { return zone_; } | 1223 | 1228 |
| |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/compiler/turboshaft/assembler.h +10Lines changed: 10 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -3855,6 +3855,16 @@ class TurboshaftAssemblerOpInterface | 3855 | 3855 | } | 3856 | 3856 | #endif // V8_ENABLE_WEBASSEMBLY | 3857 | 3857 |
| | 3858 | +#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 3859 | + V<Object> GetContinuationPreservedEmbedderData() { | | 3860 | + return ReduceIfReachableGetContinuationPreservedEmbedderData(); | | 3861 | + } | | 3862 | + | | 3863 | + void SetContinuationPreservedEmbedderData(V<Object> data) { | | 3864 | + ReduceIfReachableSetContinuationPreservedEmbedderData(data); | | 3865 | + } | | 3866 | +#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 3867 | + | 3858 | 3868 | template <typename Rep> | 3859 | 3869 | V<Rep> resolve(const V<Rep>& v) { | 3860 | 3870 | return v; | |
Collapse file Copy file name to clipboardExpand all lines: deps/v8/src/compiler/turboshaft/graph-builder.cc +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2263,6 +2263,14 @@ OpIndex GraphBuilder::Process( | 2263 | 2263 | return OpIndex::Invalid(); | 2264 | 2264 | } | 2265 | 2265 |
| | 2266 | +#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 2267 | + case IrOpcode::kGetContinuationPreservedEmbedderData: | | 2268 | + return __ GetContinuationPreservedEmbedderData(); | | 2269 | + case IrOpcode::kSetContinuationPreservedEmbedderData: | | 2270 | + __ SetContinuationPreservedEmbedderData(Map(node->InputAt(0))); | | 2271 | + return OpIndex::Invalid(); | | 2272 | +#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA | | 2273 | + | 2266 | 2274 | default: | 2267 | 2275 | std::cerr << "unsupported node type: " << *node->op() << "\n"; | 2268 | 2276 | node->Print(std::cerr); | |
|