Index: src/builtins/builtins-sharedarraybuffer.cc |
diff --git a/src/builtins/builtins-sharedarraybuffer.cc b/src/builtins/builtins-sharedarraybuffer.cc |
index b651dbd30244a4fec43cfc93624b48b0ea684cc1..0915a68ec107095d7409bf10ada208732bb8a67c 100644 |
--- a/src/builtins/builtins-sharedarraybuffer.cc |
+++ b/src/builtins/builtins-sharedarraybuffer.cc |
@@ -10,6 +10,24 @@ |
namespace v8 { |
namespace internal { |
+using compiler::Node; |
+ |
+class SharedArrayBufferBuiltinsAssembler : public CodeStubAssembler { |
+ public: |
+ explicit SharedArrayBufferBuiltinsAssembler( |
+ compiler::CodeAssemblerState* state) |
+ : CodeStubAssembler(state) {} |
+ |
+ protected: |
+ void ValidateSharedTypedArray(Node* tagged, Node* context, |
+ Node** out_instance_type, |
+ Node** out_backing_store); |
+ Node* ConvertTaggedAtomicIndexToWord32(Node* tagged, Node* context, |
+ Node** number_index); |
+ void ValidateAtomicIndex(Node* index_word, Node* array_length_word, |
+ Node* context); |
+}; |
+ |
// ES7 sharedmem 6.3.4.1 get SharedArrayBuffer.prototype.byteLength |
BUILTIN(SharedArrayBufferPrototypeGetByteLength) { |
HandleScope scope(isolate); |
@@ -25,325 +43,296 @@ BUILTIN(SharedArrayBufferPrototypeGetByteLength) { |
return array_buffer->byte_length(); |
} |
-namespace { |
- |
-void ValidateSharedTypedArray(CodeStubAssembler* a, compiler::Node* tagged, |
- compiler::Node* context, |
- compiler::Node** out_instance_type, |
- compiler::Node** out_backing_store) { |
- using compiler::Node; |
- CodeStubAssembler::Label is_smi(a), not_smi(a), is_typed_array(a), |
- not_typed_array(a), is_shared(a), not_shared(a), is_float_or_clamped(a), |
- not_float_or_clamped(a), invalid(a); |
+void SharedArrayBufferBuiltinsAssembler::ValidateSharedTypedArray( |
+ Node* tagged, Node* context, Node** out_instance_type, |
+ Node** out_backing_store) { |
+ Label not_float_or_clamped(this), invalid(this); |
// Fail if it is not a heap object. |
- a->Branch(a->TaggedIsSmi(tagged), &is_smi, ¬_smi); |
- a->Bind(&is_smi); |
- a->Goto(&invalid); |
+ GotoIf(TaggedIsSmi(tagged), &invalid); |
// Fail if the array's instance type is not JSTypedArray. |
- a->Bind(¬_smi); |
- a->Branch(a->Word32Equal(a->LoadInstanceType(tagged), |
- a->Int32Constant(JS_TYPED_ARRAY_TYPE)), |
- &is_typed_array, ¬_typed_array); |
- a->Bind(¬_typed_array); |
- a->Goto(&invalid); |
+ GotoIf(Word32NotEqual(LoadInstanceType(tagged), |
+ Int32Constant(JS_TYPED_ARRAY_TYPE)), |
+ &invalid); |
// Fail if the array's JSArrayBuffer is not shared. |
- a->Bind(&is_typed_array); |
- Node* array_buffer = a->LoadObjectField(tagged, JSTypedArray::kBufferOffset); |
- Node* is_buffer_shared = |
- a->IsSetWord32<JSArrayBuffer::IsShared>(a->LoadObjectField( |
- array_buffer, JSArrayBuffer::kBitFieldOffset, MachineType::Uint32())); |
- a->Branch(is_buffer_shared, &is_shared, ¬_shared); |
- a->Bind(¬_shared); |
- a->Goto(&invalid); |
+ Node* array_buffer = LoadObjectField(tagged, JSTypedArray::kBufferOffset); |
+ Node* bitfield = LoadObjectField(array_buffer, JSArrayBuffer::kBitFieldOffset, |
+ MachineType::Uint32()); |
+ GotoIfNot(IsSetWord32<JSArrayBuffer::IsShared>(bitfield), &invalid); |
// Fail if the array's element type is float32, float64 or clamped. |
- a->Bind(&is_shared); |
- Node* elements_instance_type = a->LoadInstanceType( |
- a->LoadObjectField(tagged, JSObject::kElementsOffset)); |
+ Node* elements_instance_type = |
+ LoadInstanceType(LoadObjectField(tagged, JSObject::kElementsOffset)); |
STATIC_ASSERT(FIXED_INT8_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); |
STATIC_ASSERT(FIXED_INT16_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); |
STATIC_ASSERT(FIXED_INT32_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); |
STATIC_ASSERT(FIXED_UINT8_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); |
STATIC_ASSERT(FIXED_UINT16_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); |
STATIC_ASSERT(FIXED_UINT32_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); |
- a->Branch(a->Int32LessThan(elements_instance_type, |
- a->Int32Constant(FIXED_FLOAT32_ARRAY_TYPE)), |
- ¬_float_or_clamped, &is_float_or_clamped); |
- a->Bind(&is_float_or_clamped); |
- a->Goto(&invalid); |
- |
- a->Bind(&invalid); |
- a->CallRuntime(Runtime::kThrowNotIntegerSharedTypedArrayError, context, |
- tagged); |
- a->Unreachable(); |
- |
- a->Bind(¬_float_or_clamped); |
+ Branch(Int32LessThan(elements_instance_type, |
+ Int32Constant(FIXED_FLOAT32_ARRAY_TYPE)), |
+ ¬_float_or_clamped, &invalid); |
+ |
+ Bind(&invalid); |
+ { |
+ CallRuntime(Runtime::kThrowNotIntegerSharedTypedArrayError, context, |
+ tagged); |
+ Unreachable(); |
+ } |
+ |
+ Bind(¬_float_or_clamped); |
*out_instance_type = elements_instance_type; |
Node* backing_store = |
- a->LoadObjectField(array_buffer, JSArrayBuffer::kBackingStoreOffset); |
- Node* byte_offset = a->ChangeUint32ToWord(a->TruncateTaggedToWord32( |
- context, |
- a->LoadObjectField(tagged, JSArrayBufferView::kByteOffsetOffset))); |
+ LoadObjectField(array_buffer, JSArrayBuffer::kBackingStoreOffset); |
+ Node* byte_offset = ChangeUint32ToWord(TruncateTaggedToWord32( |
+ context, LoadObjectField(tagged, JSArrayBufferView::kByteOffsetOffset))); |
*out_backing_store = |
- a->IntPtrAdd(a->BitcastTaggedToWord(backing_store), byte_offset); |
+ IntPtrAdd(BitcastTaggedToWord(backing_store), byte_offset); |
} |
// https://tc39.github.io/ecmascript_sharedmem/shmem.html#Atomics.ValidateAtomicAccess |
-compiler::Node* ConvertTaggedAtomicIndexToWord32( |
- CodeStubAssembler* a, compiler::Node* tagged, compiler::Node* context, |
- compiler::Node** number_index) { |
- using compiler::Node; |
- CodeStubAssembler::Variable var_result(a, MachineRepresentation::kWord32); |
- |
- Callable to_number = CodeFactory::ToNumber(a->isolate()); |
- *number_index = a->CallStub(to_number, context, tagged); |
- CodeStubAssembler::Label done(a, &var_result); |
- |
- CodeStubAssembler::Label if_numberissmi(a), if_numberisnotsmi(a); |
- a->Branch(a->TaggedIsSmi(*number_index), &if_numberissmi, &if_numberisnotsmi); |
- |
- a->Bind(&if_numberissmi); |
+Node* SharedArrayBufferBuiltinsAssembler::ConvertTaggedAtomicIndexToWord32( |
+ Node* tagged, Node* context, Node** number_index) { |
+ Variable var_result(this, MachineRepresentation::kWord32); |
+ |
+ // TODO(jkummerow): Skip ToNumber call when |tagged| is a number already. |
+ // Maybe this can be unified with other tagged-to-index conversions? |
+ // Why does this return an int32, and not an intptr? |
+ // Why is there the additional |number_index| output parameter? |
+ Callable to_number = CodeFactory::ToNumber(isolate()); |
+ *number_index = CallStub(to_number, context, tagged); |
+ Label done(this, &var_result); |
+ |
+ Label if_numberissmi(this), if_numberisnotsmi(this); |
+ Branch(TaggedIsSmi(*number_index), &if_numberissmi, &if_numberisnotsmi); |
+ |
+ Bind(&if_numberissmi); |
{ |
- var_result.Bind(a->SmiToWord32(*number_index)); |
- a->Goto(&done); |
+ var_result.Bind(SmiToWord32(*number_index)); |
+ Goto(&done); |
} |
- a->Bind(&if_numberisnotsmi); |
+ Bind(&if_numberisnotsmi); |
{ |
- Node* number_index_value = a->LoadHeapNumberValue(*number_index); |
- Node* access_index = a->TruncateFloat64ToWord32(number_index_value); |
- Node* test_index = a->ChangeInt32ToFloat64(access_index); |
+ Node* number_index_value = LoadHeapNumberValue(*number_index); |
+ Node* access_index = TruncateFloat64ToWord32(number_index_value); |
+ Node* test_index = ChangeInt32ToFloat64(access_index); |
- CodeStubAssembler::Label if_indexesareequal(a), if_indexesarenotequal(a); |
- a->Branch(a->Float64Equal(number_index_value, test_index), |
- &if_indexesareequal, &if_indexesarenotequal); |
+ Label if_indexesareequal(this), if_indexesarenotequal(this); |
+ Branch(Float64Equal(number_index_value, test_index), &if_indexesareequal, |
+ &if_indexesarenotequal); |
- a->Bind(&if_indexesareequal); |
+ Bind(&if_indexesareequal); |
{ |
var_result.Bind(access_index); |
- a->Goto(&done); |
+ Goto(&done); |
} |
- a->Bind(&if_indexesarenotequal); |
- a->CallRuntime(Runtime::kThrowInvalidAtomicAccessIndexError, context); |
- a->Unreachable(); |
+ Bind(&if_indexesarenotequal); |
+ { |
+ CallRuntime(Runtime::kThrowInvalidAtomicAccessIndexError, context); |
+ Unreachable(); |
+ } |
} |
- a->Bind(&done); |
+ Bind(&done); |
return var_result.value(); |
} |
-void ValidateAtomicIndex(CodeStubAssembler* a, compiler::Node* index_word, |
- compiler::Node* array_length_word, |
- compiler::Node* context) { |
- using compiler::Node; |
+void SharedArrayBufferBuiltinsAssembler::ValidateAtomicIndex( |
+ Node* index_word, Node* array_length_word, Node* context) { |
// Check if the index is in bounds. If not, throw RangeError. |
- CodeStubAssembler::Label if_inbounds(a), if_notinbounds(a); |
- // TODO(jkummerow): Use unsigned comparison instead of "i<0 || i>length". |
- a->Branch( |
- a->Word32Or(a->Int32LessThan(index_word, a->Int32Constant(0)), |
- a->Int32GreaterThanOrEqual(index_word, array_length_word)), |
- &if_notinbounds, &if_inbounds); |
- a->Bind(&if_notinbounds); |
- a->CallRuntime(Runtime::kThrowInvalidAtomicAccessIndexError, context); |
- a->Unreachable(); |
- a->Bind(&if_inbounds); |
-} |
+ Label check_passed(this); |
+ GotoIf(Uint32LessThan(index_word, array_length_word), &check_passed); |
-} // anonymous namespace |
+ CallRuntime(Runtime::kThrowInvalidAtomicAccessIndexError, context); |
+ Unreachable(); |
-void Builtins::Generate_AtomicsLoad(compiler::CodeAssemblerState* state) { |
- using compiler::Node; |
- CodeStubAssembler a(state); |
- Node* array = a.Parameter(1); |
- Node* index = a.Parameter(2); |
- Node* context = a.Parameter(3 + 2); |
+ Bind(&check_passed); |
+} |
+ |
+TF_BUILTIN(AtomicsLoad, SharedArrayBufferBuiltinsAssembler) { |
+ Node* array = Parameter(1); |
+ Node* index = Parameter(2); |
+ Node* context = Parameter(3 + 2); |
Node* instance_type; |
Node* backing_store; |
- ValidateSharedTypedArray(&a, array, context, &instance_type, &backing_store); |
+ ValidateSharedTypedArray(array, context, &instance_type, &backing_store); |
Node* index_integer; |
Node* index_word32 = |
- ConvertTaggedAtomicIndexToWord32(&a, index, context, &index_integer); |
- Node* array_length_word32 = a.TruncateTaggedToWord32( |
- context, a.LoadObjectField(array, JSTypedArray::kLengthOffset)); |
- ValidateAtomicIndex(&a, index_word32, array_length_word32, context); |
- Node* index_word = a.ChangeUint32ToWord(index_word32); |
- |
- CodeStubAssembler::Label i8(&a), u8(&a), i16(&a), u16(&a), i32(&a), u32(&a), |
- other(&a); |
+ ConvertTaggedAtomicIndexToWord32(index, context, &index_integer); |
+ Node* array_length_word32 = TruncateTaggedToWord32( |
+ context, LoadObjectField(array, JSTypedArray::kLengthOffset)); |
+ ValidateAtomicIndex(index_word32, array_length_word32, context); |
+ Node* index_word = ChangeUint32ToWord(index_word32); |
+ |
+ Label i8(this), u8(this), i16(this), u16(this), i32(this), u32(this), |
+ other(this); |
int32_t case_values[] = { |
FIXED_INT8_ARRAY_TYPE, FIXED_UINT8_ARRAY_TYPE, FIXED_INT16_ARRAY_TYPE, |
FIXED_UINT16_ARRAY_TYPE, FIXED_INT32_ARRAY_TYPE, FIXED_UINT32_ARRAY_TYPE, |
}; |
- CodeStubAssembler::Label* case_labels[] = { |
+ Label* case_labels[] = { |
&i8, &u8, &i16, &u16, &i32, &u32, |
}; |
- a.Switch(instance_type, &other, case_values, case_labels, |
- arraysize(case_labels)); |
+ Switch(instance_type, &other, case_values, case_labels, |
+ arraysize(case_labels)); |
- a.Bind(&i8); |
- a.Return(a.SmiFromWord32( |
- a.AtomicLoad(MachineType::Int8(), backing_store, index_word))); |
+ Bind(&i8); |
+ Return(SmiFromWord32( |
+ AtomicLoad(MachineType::Int8(), backing_store, index_word))); |
- a.Bind(&u8); |
- a.Return(a.SmiFromWord32( |
- a.AtomicLoad(MachineType::Uint8(), backing_store, index_word))); |
+ Bind(&u8); |
+ Return(SmiFromWord32( |
+ AtomicLoad(MachineType::Uint8(), backing_store, index_word))); |
- a.Bind(&i16); |
- a.Return(a.SmiFromWord32(a.AtomicLoad(MachineType::Int16(), backing_store, |
- a.WordShl(index_word, 1)))); |
+ Bind(&i16); |
+ Return(SmiFromWord32( |
+ AtomicLoad(MachineType::Int16(), backing_store, WordShl(index_word, 1)))); |
- a.Bind(&u16); |
- a.Return(a.SmiFromWord32(a.AtomicLoad(MachineType::Uint16(), backing_store, |
- a.WordShl(index_word, 1)))); |
+ Bind(&u16); |
+ Return(SmiFromWord32(AtomicLoad(MachineType::Uint16(), backing_store, |
+ WordShl(index_word, 1)))); |
- a.Bind(&i32); |
- a.Return(a.ChangeInt32ToTagged(a.AtomicLoad( |
- MachineType::Int32(), backing_store, a.WordShl(index_word, 2)))); |
+ Bind(&i32); |
+ Return(ChangeInt32ToTagged( |
+ AtomicLoad(MachineType::Int32(), backing_store, WordShl(index_word, 2)))); |
- a.Bind(&u32); |
- a.Return(a.ChangeUint32ToTagged(a.AtomicLoad( |
- MachineType::Uint32(), backing_store, a.WordShl(index_word, 2)))); |
+ Bind(&u32); |
+ Return(ChangeUint32ToTagged(AtomicLoad(MachineType::Uint32(), backing_store, |
+ WordShl(index_word, 2)))); |
// This shouldn't happen, we've already validated the type. |
- a.Bind(&other); |
- a.Return(a.SmiConstant(0)); |
+ Bind(&other); |
+ Unreachable(); |
} |
-void Builtins::Generate_AtomicsStore(compiler::CodeAssemblerState* state) { |
- using compiler::Node; |
- CodeStubAssembler a(state); |
- Node* array = a.Parameter(1); |
- Node* index = a.Parameter(2); |
- Node* value = a.Parameter(3); |
- Node* context = a.Parameter(4 + 2); |
+TF_BUILTIN(AtomicsStore, SharedArrayBufferBuiltinsAssembler) { |
+ Node* array = Parameter(1); |
+ Node* index = Parameter(2); |
+ Node* value = Parameter(3); |
+ Node* context = Parameter(4 + 2); |
Node* instance_type; |
Node* backing_store; |
- ValidateSharedTypedArray(&a, array, context, &instance_type, &backing_store); |
+ ValidateSharedTypedArray(array, context, &instance_type, &backing_store); |
Node* index_integer; |
Node* index_word32 = |
- ConvertTaggedAtomicIndexToWord32(&a, index, context, &index_integer); |
- Node* array_length_word32 = a.TruncateTaggedToWord32( |
- context, a.LoadObjectField(array, JSTypedArray::kLengthOffset)); |
- ValidateAtomicIndex(&a, index_word32, array_length_word32, context); |
- Node* index_word = a.ChangeUint32ToWord(index_word32); |
+ ConvertTaggedAtomicIndexToWord32(index, context, &index_integer); |
+ Node* array_length_word32 = TruncateTaggedToWord32( |
+ context, LoadObjectField(array, JSTypedArray::kLengthOffset)); |
+ ValidateAtomicIndex(index_word32, array_length_word32, context); |
+ Node* index_word = ChangeUint32ToWord(index_word32); |
- Node* value_integer = a.ToInteger(context, value); |
- Node* value_word32 = a.TruncateTaggedToWord32(context, value_integer); |
+ Node* value_integer = ToInteger(context, value); |
+ Node* value_word32 = TruncateTaggedToWord32(context, value_integer); |
- CodeStubAssembler::Label u8(&a), u16(&a), u32(&a), other(&a); |
+ Label u8(this), u16(this), u32(this), other(this); |
int32_t case_values[] = { |
FIXED_INT8_ARRAY_TYPE, FIXED_UINT8_ARRAY_TYPE, FIXED_INT16_ARRAY_TYPE, |
FIXED_UINT16_ARRAY_TYPE, FIXED_INT32_ARRAY_TYPE, FIXED_UINT32_ARRAY_TYPE, |
}; |
- CodeStubAssembler::Label* case_labels[] = { |
+ Label* case_labels[] = { |
&u8, &u8, &u16, &u16, &u32, &u32, |
}; |
- a.Switch(instance_type, &other, case_values, case_labels, |
- arraysize(case_labels)); |
+ Switch(instance_type, &other, case_values, case_labels, |
+ arraysize(case_labels)); |
- a.Bind(&u8); |
- a.AtomicStore(MachineRepresentation::kWord8, backing_store, index_word, |
- value_word32); |
- a.Return(value_integer); |
+ Bind(&u8); |
+ AtomicStore(MachineRepresentation::kWord8, backing_store, index_word, |
+ value_word32); |
+ Return(value_integer); |
- a.Bind(&u16); |
- a.AtomicStore(MachineRepresentation::kWord16, backing_store, |
- a.WordShl(index_word, 1), value_word32); |
- a.Return(value_integer); |
+ Bind(&u16); |
+ AtomicStore(MachineRepresentation::kWord16, backing_store, |
+ WordShl(index_word, 1), value_word32); |
+ Return(value_integer); |
- a.Bind(&u32); |
- a.AtomicStore(MachineRepresentation::kWord32, backing_store, |
- a.WordShl(index_word, 2), value_word32); |
- a.Return(value_integer); |
+ Bind(&u32); |
+ AtomicStore(MachineRepresentation::kWord32, backing_store, |
+ WordShl(index_word, 2), value_word32); |
+ Return(value_integer); |
// This shouldn't happen, we've already validated the type. |
- a.Bind(&other); |
- a.Return(a.SmiConstant(0)); |
+ Bind(&other); |
+ Unreachable(); |
} |
-void Builtins::Generate_AtomicsExchange(compiler::CodeAssemblerState* state) { |
- using compiler::Node; |
- CodeStubAssembler a(state); |
- Node* array = a.Parameter(1); |
- Node* index = a.Parameter(2); |
- Node* value = a.Parameter(3); |
- Node* context = a.Parameter(4 + 2); |
+TF_BUILTIN(AtomicsExchange, SharedArrayBufferBuiltinsAssembler) { |
+ Node* array = Parameter(1); |
+ Node* index = Parameter(2); |
+ Node* value = Parameter(3); |
+ Node* context = Parameter(4 + 2); |
Node* instance_type; |
Node* backing_store; |
- ValidateSharedTypedArray(&a, array, context, &instance_type, &backing_store); |
+ ValidateSharedTypedArray(array, context, &instance_type, &backing_store); |
Node* index_integer; |
Node* index_word32 = |
- ConvertTaggedAtomicIndexToWord32(&a, index, context, &index_integer); |
- Node* array_length_word32 = a.TruncateTaggedToWord32( |
- context, a.LoadObjectField(array, JSTypedArray::kLengthOffset)); |
- ValidateAtomicIndex(&a, index_word32, array_length_word32, context); |
+ ConvertTaggedAtomicIndexToWord32(index, context, &index_integer); |
+ Node* array_length_word32 = TruncateTaggedToWord32( |
+ context, LoadObjectField(array, JSTypedArray::kLengthOffset)); |
+ ValidateAtomicIndex(index_word32, array_length_word32, context); |
- Node* value_integer = a.ToInteger(context, value); |
+ Node* value_integer = ToInteger(context, value); |
#if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 || \ |
V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X |
- // Node* index_integer = a.ToInteger(context, index); |
- a.Return(a.CallRuntime(Runtime::kAtomicsExchange, context, array, |
- index_integer, value_integer)); |
+ Return(CallRuntime(Runtime::kAtomicsExchange, context, array, index_integer, |
+ value_integer)); |
#else |
- Node* index_word = a.ChangeUint32ToWord(index_word32); |
+ Node* index_word = ChangeUint32ToWord(index_word32); |
- Node* value_word32 = a.TruncateTaggedToWord32(context, value_integer); |
+ Node* value_word32 = TruncateTaggedToWord32(context, value_integer); |
- CodeStubAssembler::Label i8(&a), u8(&a), i16(&a), u16(&a), i32(&a), u32(&a), |
- other(&a); |
+ Label i8(this), u8(this), i16(this), u16(this), i32(this), u32(this), |
+ other(this); |
int32_t case_values[] = { |
FIXED_INT8_ARRAY_TYPE, FIXED_UINT8_ARRAY_TYPE, FIXED_INT16_ARRAY_TYPE, |
FIXED_UINT16_ARRAY_TYPE, FIXED_INT32_ARRAY_TYPE, FIXED_UINT32_ARRAY_TYPE, |
}; |
- CodeStubAssembler::Label* case_labels[] = { |
+ Label* case_labels[] = { |
&i8, &u8, &i16, &u16, &i32, &u32, |
}; |
- a.Switch(instance_type, &other, case_values, case_labels, |
- arraysize(case_labels)); |
+ Switch(instance_type, &other, case_values, case_labels, |
+ arraysize(case_labels)); |
- a.Bind(&i8); |
- a.Return(a.SmiFromWord32(a.AtomicExchange(MachineType::Int8(), backing_store, |
- index_word, value_word32))); |
+ Bind(&i8); |
+ Return(SmiFromWord32(AtomicExchange(MachineType::Int8(), backing_store, |
+ index_word, value_word32))); |
- a.Bind(&u8); |
- a.Return(a.SmiFromWord32(a.AtomicExchange(MachineType::Uint8(), backing_store, |
- index_word, value_word32))); |
+ Bind(&u8); |
+ Return(SmiFromWord32(AtomicExchange(MachineType::Uint8(), backing_store, |
+ index_word, value_word32))); |
- a.Bind(&i16); |
- a.Return(a.SmiFromWord32(a.AtomicExchange(MachineType::Int16(), backing_store, |
- a.WordShl(index_word, 1), |
- value_word32))); |
+ Bind(&i16); |
+ Return(SmiFromWord32(AtomicExchange(MachineType::Int16(), backing_store, |
+ WordShl(index_word, 1), value_word32))); |
- a.Bind(&u16); |
- a.Return(a.SmiFromWord32( |
- a.AtomicExchange(MachineType::Uint16(), backing_store, |
- a.WordShl(index_word, 1), value_word32))); |
+ Bind(&u16); |
+ Return(SmiFromWord32(AtomicExchange(MachineType::Uint16(), backing_store, |
+ WordShl(index_word, 1), value_word32))); |
- a.Bind(&i32); |
- a.Return(a.ChangeInt32ToTagged( |
- a.AtomicExchange(MachineType::Int32(), backing_store, |
- a.WordShl(index_word, 2), value_word32))); |
+ Bind(&i32); |
+ Return(ChangeInt32ToTagged(AtomicExchange(MachineType::Int32(), backing_store, |
+ WordShl(index_word, 2), |
+ value_word32))); |
- a.Bind(&u32); |
- a.Return(a.ChangeUint32ToTagged( |
- a.AtomicExchange(MachineType::Uint32(), backing_store, |
- a.WordShl(index_word, 2), value_word32))); |
+ Bind(&u32); |
+ Return(ChangeUint32ToTagged( |
+ AtomicExchange(MachineType::Uint32(), backing_store, |
+ WordShl(index_word, 2), value_word32))); |
// This shouldn't happen, we've already validated the type. |
- a.Bind(&other); |
- a.Return(a.SmiConstant(0)); |
+ Bind(&other); |
+ Unreachable(); |
#endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 |
// || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X |
} |