Commit bc981e61 authored by jgruber's avatar jgruber Committed by Commit bot

[promises] Simplify PromiseSetHasHandler

No need to untag/tag flags, and we can also omit the write barrier.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2591193002
Cr-Commit-Position: refs/heads/master@{#41890}
parent ceb29f7c
......@@ -94,11 +94,10 @@ Node* PromiseBuiltinsAssembler::PromiseHasHandler(Node* promise) {
}
void PromiseBuiltinsAssembler::PromiseSetHasHandler(Node* promise) {
Node* const flags =
SmiUntag(LoadObjectField(promise, JSPromise::kFlagsOffset));
Node* const flags = LoadObjectField(promise, JSPromise::kFlagsOffset);
Node* const new_flags =
WordOr(flags, IntPtrConstant(1 << JSPromise::kHasHandlerBit));
StoreObjectField(promise, JSPromise::kFlagsOffset, SmiTag(new_flags));
SmiOr(flags, SmiConstant(1 << JSPromise::kHasHandlerBit));
StoreObjectFieldNoWriteBarrier(promise, JSPromise::kFlagsOffset, new_flags);
}
Node* PromiseBuiltinsAssembler::SpeciesConstructor(Node* context, Node* object,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment