@@ -30,7 +30,8 @@ transitioning builtin
3030PromiseResolve(implicit context: Context)(
3131 constructor: JSReceiver, value: JSAny): JSAny {
3232 const nativeContext = LoadNativeContext(context);
33- const promiseFun = *NativeContextSlot(ContextSlot::PROMISE_FUNCTION_INDEX);
33+ const promiseFun = *NativeContextSlot(
34+ nativeContext, ContextSlot::PROMISE_FUNCTION_INDEX);
3435 try {
3536 // Check if {value} is a JSPromise.
3637 const value = Cast<JSPromise>(value) otherwise NeedToAllocate;
@@ -40,7 +41,8 @@ PromiseResolve(implicit context: Context)(
4041 // intact, as that guards the lookup path for "constructor" on
4142 // JSPromise instances which have the (initial) Promise.prototype.
4243 const promisePrototype =
43- *NativeContextSlot(ContextSlot::PROMISE_PROTOTYPE_INDEX);
44+ *NativeContextSlot(
45+ nativeContext, ContextSlot::PROMISE_PROTOTYPE_INDEX);
4446 // Check that Torque load elimination works.
4547 static_assert(nativeContext == LoadNativeContext(context));
4648 if (value.map.prototype != promisePrototype) {
@@ -139,18 +141,20 @@ ResolvePromise(implicit context: Context)(
139141 assert(IsJSReceiverMap(resolutionMap));
140142 assert(!IsPromiseThenProtectorCellInvalid());
141143 if (resolutionMap ==
142- *NativeContextSlot(ContextSlot::ITERATOR_RESULT_MAP_INDEX)) {
144+ *NativeContextSlot(
145+ nativeContext, ContextSlot::ITERATOR_RESULT_MAP_INDEX)) {
143146 return FulfillPromise(promise, resolution);
144147 } else {
145148 goto Slow;
146149 }
147150 }
148151
149152 const promisePrototype =
150- *NativeContextSlot(ContextSlot::PROMISE_PROTOTYPE_INDEX);
153+ *NativeContextSlot(
154+ nativeContext, ContextSlot::PROMISE_PROTOTYPE_INDEX);
151155 if (resolutionMap.prototype == promisePrototype) {
152156 // The {resolution} is a native Promise in this case.
153- then = *NativeContextSlot(ContextSlot::PROMISE_THEN_INDEX);
157+ then = *NativeContextSlot(nativeContext, ContextSlot::PROMISE_THEN_INDEX);
154158 // Check that Torque load elimination works.
155159 static_assert(nativeContext == LoadNativeContext(context));
156160 goto Enqueue;
0 commit comments