Commit e3fe27a1 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[builtins] Use uintptr indices in SharedArrayBuffer builtins

The CL fixes the following builtins:
  Atomics.add
  Atomics.and
  Atomics.compareExchange
  Atomics.exchange
  Atomics.load
  Atomics.or
  Atomics.store
  Atomics.sub
  Atomics.xor

Bug: v8:4153
Change-Id: Id6170fd093f6e2f9690838b4b789719ed2fc343c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1876847
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64541}
parent 39aa9102
......@@ -7540,38 +7540,6 @@ TNode<JSReceiver> CodeStubAssembler::ToObject_Inline(TNode<Context> context,
return result.value();
}
TNode<Smi> CodeStubAssembler::ToSmiIndex(TNode<Context> context,
TNode<Object> input,
Label* range_error) {
TVARIABLE(Smi, result);
Label check_undefined(this), return_zero(this), defined(this),
negative_check(this), done(this);
GotoIfNot(TaggedIsSmi(input), &check_undefined);
result = CAST(input);
Goto(&negative_check);
BIND(&check_undefined);
Branch(IsUndefined(input), &return_zero, &defined);
BIND(&defined);
TNode<Number> integer_input =
CAST(CallBuiltin(Builtins::kToInteger_TruncateMinusZero, context, input));
GotoIfNot(TaggedIsSmi(integer_input), range_error);
result = CAST(integer_input);
Goto(&negative_check);
BIND(&negative_check);
Branch(SmiLessThan(result.value(), SmiConstant(0)), range_error, &done);
BIND(&return_zero);
result = SmiConstant(0);
Goto(&done);
BIND(&done);
return result.value();
}
TNode<Smi> CodeStubAssembler::ToSmiLength(TNode<Context> context,
TNode<Object> input,
Label* range_error) {
......
......@@ -2662,11 +2662,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
kTruncateMinusZero,
};
// ES6 7.1.17 ToIndex, but jumps to range_error if the result is not a Smi.
// TODO(v8:4153): Use ToIndex() instead.
TNode<Smi> ToSmiIndex(TNode<Context> context, TNode<Object> input,
Label* range_error);
// ES6 7.1.15 ToLength, but jumps to range_error if the result is not a Smi.
TNode<Smi> ToSmiLength(TNode<Context> context, TNode<Object> input,
Label* range_error);
......
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