Skip to content

Commit 3695dcc

Browse files
sygV8 LUCI CQ
authored andcommitted
Revert "Add ContinuationPreservedEmbedderData builtins to extras binding"
This reverts commit 5c1dee6. Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20gc%20stress/50009/overview Original change's description: > Add ContinuationPreservedEmbedderData builtins to extras binding > > Node.js and Deno wish to use CPED for AsyncLocalStorage and APM, which > needs a high performance implementation. These builtins allow JavaScript > to handle CPED performantly. > > Change-Id: I7577be80818524baa52791dfce57d442d7c0c933 > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5638129 > Commit-Queue: snek <[email protected]> > Reviewed-by: Darius Mercadier <[email protected]> > Reviewed-by: Leszek Swirski <[email protected]> > Reviewed-by: Nico Hartmann <[email protected]> > Cr-Commit-Position: refs/heads/main@{#94607} Change-Id: Ief390f0b99891c8de83b4c794180440f91cbaf1f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5649024 Auto-Submit: Shu-yu Guo <[email protected]> Bot-Commit: Rubber Stamper <[email protected]> Commit-Queue: Rubber Stamper <[email protected]> Cr-Commit-Position: refs/heads/main@{#94608}
1 parent 5c1dee6 commit 3695dcc

27 files changed

Lines changed: 73 additions & 644 deletions

src/builtins/base.tq

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,7 @@ extern macro ChangeUint32ToWord(uint32): uintptr; // Doesn't sign-extend.
13171317
extern macro ChangeInt32ToInt64(int32): int64; // Sign-extends.
13181318
extern macro ChangeUint32ToUint64(uint32): uint64; // Doesn't sign-extend.
13191319
extern macro LoadNativeContext(Context): NativeContext;
1320+
extern macro GetContinuationPreservedEmbedderData(): Object;
13201321
extern macro TruncateFloat64ToFloat16(float64): float16;
13211322
extern macro TruncateFloat32ToFloat16(float32): float16;
13221323
extern macro TruncateFloat64ToFloat32(float64): float32;

src/builtins/promise-misc.tq

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ extern macro PromiseBuiltinsAssembler::IsIsolatePromiseHookEnabled(uint32):
3030

3131
extern macro PromiseBuiltinsAssembler::PromiseHookFlags(): uint32;
3232

33-
namespace macros {
34-
extern macro GetContinuationPreservedEmbedderData(): Object;
35-
extern macro SetContinuationPreservedEmbedderData(Object): void;
36-
}
37-
3833
namespace promise {
3934
extern macro IsFunctionWithPrototypeSlotMap(Map): bool;
4035

@@ -83,7 +78,7 @@ macro NewPromiseFulfillReactionJobTask(
8378
return new PromiseFulfillReactionJobTask{
8479
map: PromiseFulfillReactionJobTaskMapConstant(),
8580
continuation_preserved_embedder_data:
86-
macros::GetContinuationPreservedEmbedderData(),
81+
GetContinuationPreservedEmbedderData(),
8782
argument,
8883
context: handlerContext,
8984
handler,
@@ -111,7 +106,7 @@ macro NewPromiseRejectReactionJobTask(
111106
return new PromiseRejectReactionJobTask{
112107
map: PromiseRejectReactionJobTaskMapConstant(),
113108
continuation_preserved_embedder_data:
114-
macros::GetContinuationPreservedEmbedderData(),
109+
GetContinuationPreservedEmbedderData(),
115110
argument,
116111
context: handlerContext,
117112
handler,
@@ -306,7 +301,7 @@ macro NewPromiseReaction(
306301
return new PromiseReaction{
307302
map: PromiseReactionMapConstant(),
308303
continuation_preserved_embedder_data:
309-
macros::GetContinuationPreservedEmbedderData(),
304+
GetContinuationPreservedEmbedderData(),
310305
next: next,
311306
reject_handler: rejectHandler,
312307
fulfill_handler: fulfillHandler,
@@ -350,7 +345,7 @@ macro NewPromiseResolveThenableJobTask(
350345
return new PromiseResolveThenableJobTask{
351346
map: PromiseResolveThenableJobTaskMapConstant(),
352347
continuation_preserved_embedder_data:
353-
macros::GetContinuationPreservedEmbedderData(),
348+
GetContinuationPreservedEmbedderData(),
354349
context: nativeContext,
355350
promise_to_resolve: promiseToResolve,
356351
thenable,
@@ -455,18 +450,4 @@ transitioning macro BranchIfAccessCheckFailed(
455450
}
456451
} label HasAccess {}
457452
}
458-
459-
@if(V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA)
460-
transitioning javascript builtin GetContinuationPreservedEmbedderData(
461-
js-implicit context: Context, receiver: JSAny)(): JSAny {
462-
return UnsafeCast<JSAny>(macros::GetContinuationPreservedEmbedderData());
463-
}
464-
465-
@if(V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA)
466-
transitioning javascript builtin SetContinuationPreservedEmbedderData(
467-
js-implicit context: Context, receiver: JSAny)(data: Object): Undefined {
468-
macros::SetContinuationPreservedEmbedderData(data);
469-
return Undefined;
470-
}
471-
472453
}

src/compiler/js-call-reducer.cc

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5189,12 +5189,6 @@ Reduction JSCallReducer::ReduceJSCall(Node* node,
51895189
case Builtin::kBigIntAsIntN:
51905190
case Builtin::kBigIntAsUintN:
51915191
return ReduceBigIntAsN(node, builtin);
5192-
#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
5193-
case Builtin::kGetContinuationPreservedEmbedderData:
5194-
return ReduceGetContinuationPreservedEmbedderData(node);
5195-
case Builtin::kSetContinuationPreservedEmbedderData:
5196-
return ReduceSetContinuationPreservedEmbedderData(node);
5197-
#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
51985192
default:
51995193
break;
52005194
}
@@ -8858,39 +8852,6 @@ Reduction JSCallReducer::ReduceJSCallMathMinMaxWithArrayLike(Node* node,
88588852
return ReplaceWithSubgraph(&a, subgraph);
88598853
}
88608854

8861-
#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
8862-
Reduction JSCallReducer::ReduceGetContinuationPreservedEmbedderData(
8863-
Node* node) {
8864-
JSCallNode n(node);
8865-
Effect effect = n.effect();
8866-
Control control = n.control();
8867-
8868-
Node* value = effect = graph()->NewNode(
8869-
simplified()->GetContinuationPreservedEmbedderData(), effect);
8870-
8871-
ReplaceWithValue(node, value, effect, control);
8872-
return Replace(node);
8873-
}
8874-
8875-
Reduction JSCallReducer::ReduceSetContinuationPreservedEmbedderData(
8876-
Node* node) {
8877-
JSCallNode n(node);
8878-
Effect effect = n.effect();
8879-
Control control = n.control();
8880-
8881-
if (n.ArgumentCount() == 0) return NoChange();
8882-
8883-
effect =
8884-
graph()->NewNode(simplified()->SetContinuationPreservedEmbedderData(),
8885-
n.Argument(0), effect);
8886-
8887-
Node* value = jsgraph()->UndefinedConstant();
8888-
8889-
ReplaceWithValue(node, value, effect, control);
8890-
return Replace(node);
8891-
}
8892-
#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
8893-
88948855
CompilationDependencies* JSCallReducer::dependencies() const {
88958856
return broker()->dependencies();
88968857
}

src/compiler/js-call-reducer.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,6 @@ class V8_EXPORT_PRIVATE JSCallReducer final : public AdvancedReducer {
239239
base::Optional<Reduction> TryReduceJSCallMathMinMaxWithArrayLike(Node* node);
240240
Reduction ReduceJSCallMathMinMaxWithArrayLike(Node* node, Builtin builtin);
241241

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-
247242
// The pendant to ReplaceWithValue when using GraphAssembler-based reductions.
248243
Reduction ReplaceWithSubgraph(JSCallReducerAssembler* gasm, Node* subgraph);
249244
std::pair<Node*, Node*> ReleaseEffectAndControlFromAssembler(

src/compiler/opcodes.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -429,14 +429,6 @@
429429

430430
#define SIMPLIFIED_SPECULATIVE_NUMBER_UNOP_LIST(V) V(SpeculativeToNumber)
431431

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-
440432
#define SIMPLIFIED_OTHER_OP_LIST(V) \
441433
V(Allocate) \
442434
V(AllocateRaw) \
@@ -542,8 +534,7 @@
542534
V(TransitionElementsKind) \
543535
V(TypeOf) \
544536
V(Unsigned32Divide) \
545-
V(VerifyType) \
546-
SIMPLIFIED_CPED_OP_LIST(V)
537+
V(VerifyType)
547538

548539
#define SIMPLIFIED_SPECULATIVE_BIGINT_BINOP_LIST(V) \
549540
V(SpeculativeBigIntAdd) \

src/compiler/simplified-lowering.cc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4650,17 +4650,6 @@ class RepresentationSelector {
46504650
SetOutput<T>(node, LoadRepresentationOf(node->op()).representation());
46514651
return;
46524652

4653-
#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
4654-
case IrOpcode::kGetContinuationPreservedEmbedderData:
4655-
SetOutput<T>(node, MachineRepresentation::kTagged);
4656-
return;
4657-
4658-
case IrOpcode::kSetContinuationPreservedEmbedderData:
4659-
ProcessInput<T>(node, 0, UseInfo::AnyTagged());
4660-
SetOutput<T>(node, MachineRepresentation::kNone);
4661-
return;
4662-
#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
4663-
46644653
default:
46654654
FATAL(
46664655
"Representation inference: unsupported opcode %i (%s), node #%i\n.",

src/compiler/simplified-operator.cc

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,26 +1341,6 @@ struct SimplifiedOperatorGlobalCache final {
13411341
kSpeculativeToBigIntBigInt64Operator;
13421342
SpeculativeToBigIntOperator<BigIntOperationHint::kBigInt>
13431343
kSpeculativeToBigIntBigIntOperator;
1344-
1345-
#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
1346-
struct GetContinuationPreservedEmbedderDataOperator : public Operator {
1347-
GetContinuationPreservedEmbedderDataOperator()
1348-
: Operator(IrOpcode::kGetContinuationPreservedEmbedderData,
1349-
Operator::kNoThrow | Operator::kNoDeopt | Operator::kNoWrite,
1350-
"GetContinuationPreservedEmbedderData", 0, 1, 0, 1, 1, 0) {}
1351-
};
1352-
GetContinuationPreservedEmbedderDataOperator
1353-
kGetContinuationPreservedEmbedderData;
1354-
1355-
struct SetContinuationPreservedEmbedderDataOperator : public Operator {
1356-
SetContinuationPreservedEmbedderDataOperator()
1357-
: Operator(IrOpcode::kSetContinuationPreservedEmbedderData,
1358-
Operator::kNoThrow | Operator::kNoDeopt | Operator::kNoRead,
1359-
"SetContinuationPreservedEmbedderData", 1, 1, 0, 0, 1, 0) {}
1360-
};
1361-
SetContinuationPreservedEmbedderDataOperator
1362-
kSetContinuationPreservedEmbedderData;
1363-
#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
13641344
};
13651345

13661346
namespace {
@@ -2220,18 +2200,6 @@ const Operator* SimplifiedOperatorBuilder::StoreField(
22202200
2, 1, 1, 0, 1, 0, store_access);
22212201
}
22222202

2223-
#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
2224-
const Operator*
2225-
SimplifiedOperatorBuilder::GetContinuationPreservedEmbedderData() {
2226-
return &cache_.kGetContinuationPreservedEmbedderData;
2227-
}
2228-
2229-
const Operator*
2230-
SimplifiedOperatorBuilder::SetContinuationPreservedEmbedderData() {
2231-
return &cache_.kSetContinuationPreservedEmbedderData;
2232-
}
2233-
#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
2234-
22352203
const Operator* SimplifiedOperatorBuilder::LoadMessage() {
22362204
return zone()->New<Operator>(IrOpcode::kLoadMessage, Operator::kEliminatable,
22372205
"LoadMessage", 1, 1, 1, 1, 1, 0);

src/compiler/simplified-operator.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,11 +1218,6 @@ class V8_EXPORT_PRIVATE SimplifiedOperatorBuilder final
12181218
const FastApiCallFunctionVector& c_candidate_functions,
12191219
FeedbackSource const& feedback, CallDescriptor* descriptor);
12201220

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-
12261221
private:
12271222
Zone* zone() const { return zone_; }
12281223

src/compiler/turboshaft/assembler.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4375,16 +4375,6 @@ class TurboshaftAssemblerOpInterface
43754375
}
43764376
#endif // V8_ENABLE_WEBASSEMBLY
43774377

4378-
#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
4379-
V<Object> GetContinuationPreservedEmbedderData() {
4380-
return ReduceIfReachableGetContinuationPreservedEmbedderData();
4381-
}
4382-
4383-
void SetContinuationPreservedEmbedderData(V<Object> data) {
4384-
ReduceIfReachableSetContinuationPreservedEmbedderData(data);
4385-
}
4386-
#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
4387-
43884378
template <typename Rep>
43894379
V<Rep> resolve(const V<Rep>& v) {
43904380
return v;

src/compiler/turboshaft/graph-builder.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2398,14 +2398,6 @@ OpIndex GraphBuilder::Process(
23982398
kind);
23992399
}
24002400

2401-
#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
2402-
case IrOpcode::kGetContinuationPreservedEmbedderData:
2403-
return __ GetContinuationPreservedEmbedderData();
2404-
case IrOpcode::kSetContinuationPreservedEmbedderData:
2405-
__ SetContinuationPreservedEmbedderData(Map(node->InputAt(0)));
2406-
return OpIndex::Invalid();
2407-
#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
2408-
24092401
default:
24102402
std::cerr << "unsupported node type: " << *node->op() << "\n";
24112403
node->Print(std::cerr);

0 commit comments

Comments
 (0)