|
Lines 2412-2428
CodeGenerator::visitAtomicTypedArrayElem
|
Link Here
|
---|
|
2412 |
Register elements = ToRegister(lir->elements()); |
2412 |
Register elements = ToRegister(lir->elements()); |
2413 |
Register outTemp = ToTempRegisterOrInvalid(lir->temp2()); |
2413 |
Register outTemp = ToTempRegisterOrInvalid(lir->temp2()); |
2414 |
Register valueTemp = ToTempRegisterOrInvalid(lir->valueTemp()); |
2414 |
Register valueTemp = ToTempRegisterOrInvalid(lir->valueTemp()); |
2415 |
Register offsetTemp = ToTempRegisterOrInvalid(lir->offsetTemp()); |
2415 |
Register offsetTemp = ToTempRegisterOrInvalid(lir->offsetTemp()); |
2416 |
Register maskTemp = ToTempRegisterOrInvalid(lir->maskTemp()); |
2416 |
Register maskTemp = ToTempRegisterOrInvalid(lir->maskTemp()); |
2417 |
Register value = ToRegister(lir->value()); |
2417 |
Register value = ToRegister(lir->value()); |
2418 |
|
2418 |
|
2419 |
Scalar::Type arrayType = lir->mir()->arrayType(); |
2419 |
Scalar::Type arrayType = lir->mir()->arrayType(); |
2420 |
int width = Scalar::byteSize(arrayType); |
2420 |
size_t width = Scalar::byteSize(arrayType); |
2421 |
|
2421 |
|
2422 |
if (lir->index()->isConstant()) { |
2422 |
if (lir->index()->isConstant()) { |
2423 |
Address mem(elements, ToInt32(lir->index()) * width); |
2423 |
Address mem(elements, ToInt32(lir->index()) * width); |
2424 |
masm.atomicFetchOpJS(arrayType, Synchronization::Full(), lir->mir()->operation(), value, |
2424 |
masm.atomicFetchOpJS(arrayType, Synchronization::Full(), lir->mir()->operation(), value, |
2425 |
mem, valueTemp, offsetTemp, maskTemp, outTemp, output); |
2425 |
mem, valueTemp, offsetTemp, maskTemp, outTemp, output); |
2426 |
} else { |
2426 |
} else { |
2427 |
BaseIndex mem(elements, ToRegister(lir->index()), ScaleFromElemWidth(width)); |
2427 |
BaseIndex mem(elements, ToRegister(lir->index()), ScaleFromElemWidth(width)); |
2428 |
masm.atomicFetchOpJS(arrayType, Synchronization::Full(), lir->mir()->operation(), value, |
2428 |
masm.atomicFetchOpJS(arrayType, Synchronization::Full(), lir->mir()->operation(), value, |
Lines 2436-2452
CodeGenerator::visitAtomicTypedArrayElem
|
Link Here
|
---|
|
2436 |
MOZ_ASSERT(!lir->mir()->hasUses()); |
2436 |
MOZ_ASSERT(!lir->mir()->hasUses()); |
2437 |
|
2437 |
|
2438 |
Register elements = ToRegister(lir->elements()); |
2438 |
Register elements = ToRegister(lir->elements()); |
2439 |
Register valueTemp = ToTempRegisterOrInvalid(lir->valueTemp()); |
2439 |
Register valueTemp = ToTempRegisterOrInvalid(lir->valueTemp()); |
2440 |
Register offsetTemp = ToTempRegisterOrInvalid(lir->offsetTemp()); |
2440 |
Register offsetTemp = ToTempRegisterOrInvalid(lir->offsetTemp()); |
2441 |
Register maskTemp = ToTempRegisterOrInvalid(lir->maskTemp()); |
2441 |
Register maskTemp = ToTempRegisterOrInvalid(lir->maskTemp()); |
2442 |
Register value = ToRegister(lir->value()); |
2442 |
Register value = ToRegister(lir->value()); |
2443 |
Scalar::Type arrayType = lir->mir()->arrayType(); |
2443 |
Scalar::Type arrayType = lir->mir()->arrayType(); |
2444 |
int width = Scalar::byteSize(arrayType); |
2444 |
size_t width = Scalar::byteSize(arrayType); |
2445 |
|
2445 |
|
2446 |
if (lir->index()->isConstant()) { |
2446 |
if (lir->index()->isConstant()) { |
2447 |
Address mem(elements, ToInt32(lir->index()) * width); |
2447 |
Address mem(elements, ToInt32(lir->index()) * width); |
2448 |
masm.atomicEffectOpJS(arrayType, Synchronization::Full(), lir->mir()->operation(), value, |
2448 |
masm.atomicEffectOpJS(arrayType, Synchronization::Full(), lir->mir()->operation(), value, |
2449 |
mem, valueTemp, offsetTemp, maskTemp); |
2449 |
mem, valueTemp, offsetTemp, maskTemp); |
2450 |
} else { |
2450 |
} else { |
2451 |
BaseIndex mem(elements, ToRegister(lir->index()), ScaleFromElemWidth(width)); |
2451 |
BaseIndex mem(elements, ToRegister(lir->index()), ScaleFromElemWidth(width)); |
2452 |
masm.atomicEffectOpJS(arrayType, Synchronization::Full(), lir->mir()->operation(), value, |
2452 |
masm.atomicEffectOpJS(arrayType, Synchronization::Full(), lir->mir()->operation(), value, |
Lines 2463-2479
CodeGenerator::visitCompareExchangeTyped
|
Link Here
|
---|
|
2463 |
|
2463 |
|
2464 |
Register oldval = ToRegister(lir->oldval()); |
2464 |
Register oldval = ToRegister(lir->oldval()); |
2465 |
Register newval = ToRegister(lir->newval()); |
2465 |
Register newval = ToRegister(lir->newval()); |
2466 |
Register valueTemp = ToTempRegisterOrInvalid(lir->valueTemp()); |
2466 |
Register valueTemp = ToTempRegisterOrInvalid(lir->valueTemp()); |
2467 |
Register offsetTemp = ToTempRegisterOrInvalid(lir->offsetTemp()); |
2467 |
Register offsetTemp = ToTempRegisterOrInvalid(lir->offsetTemp()); |
2468 |
Register maskTemp = ToTempRegisterOrInvalid(lir->maskTemp()); |
2468 |
Register maskTemp = ToTempRegisterOrInvalid(lir->maskTemp()); |
2469 |
|
2469 |
|
2470 |
Scalar::Type arrayType = lir->mir()->arrayType(); |
2470 |
Scalar::Type arrayType = lir->mir()->arrayType(); |
2471 |
int width = Scalar::byteSize(arrayType); |
2471 |
size_t width = Scalar::byteSize(arrayType); |
2472 |
|
2472 |
|
2473 |
if (lir->index()->isConstant()) { |
2473 |
if (lir->index()->isConstant()) { |
2474 |
Address dest(elements, ToInt32(lir->index()) * width); |
2474 |
Address dest(elements, ToInt32(lir->index()) * width); |
2475 |
masm.compareExchangeJS(arrayType, Synchronization::Full(), dest, oldval, newval, |
2475 |
masm.compareExchangeJS(arrayType, Synchronization::Full(), dest, oldval, newval, |
2476 |
valueTemp, offsetTemp, maskTemp, outTemp, output); |
2476 |
valueTemp, offsetTemp, maskTemp, outTemp, output); |
2477 |
} else { |
2477 |
} else { |
2478 |
BaseIndex dest(elements, ToRegister(lir->index()), ScaleFromElemWidth(width)); |
2478 |
BaseIndex dest(elements, ToRegister(lir->index()), ScaleFromElemWidth(width)); |
2479 |
masm.compareExchangeJS(arrayType, Synchronization::Full(), dest, oldval, newval, |
2479 |
masm.compareExchangeJS(arrayType, Synchronization::Full(), dest, oldval, newval, |
Lines 2489-2505
CodeGenerator::visitAtomicExchangeTypedA
|
Link Here
|
---|
|
2489 |
Register outTemp = ToTempRegisterOrInvalid(lir->temp()); |
2489 |
Register outTemp = ToTempRegisterOrInvalid(lir->temp()); |
2490 |
|
2490 |
|
2491 |
Register value = ToRegister(lir->value()); |
2491 |
Register value = ToRegister(lir->value()); |
2492 |
Register valueTemp = ToTempRegisterOrInvalid(lir->valueTemp()); |
2492 |
Register valueTemp = ToTempRegisterOrInvalid(lir->valueTemp()); |
2493 |
Register offsetTemp = ToTempRegisterOrInvalid(lir->offsetTemp()); |
2493 |
Register offsetTemp = ToTempRegisterOrInvalid(lir->offsetTemp()); |
2494 |
Register maskTemp = ToTempRegisterOrInvalid(lir->maskTemp()); |
2494 |
Register maskTemp = ToTempRegisterOrInvalid(lir->maskTemp()); |
2495 |
|
2495 |
|
2496 |
Scalar::Type arrayType = lir->mir()->arrayType(); |
2496 |
Scalar::Type arrayType = lir->mir()->arrayType(); |
2497 |
int width = Scalar::byteSize(arrayType); |
2497 |
size_t width = Scalar::byteSize(arrayType); |
2498 |
|
2498 |
|
2499 |
if (lir->index()->isConstant()) { |
2499 |
if (lir->index()->isConstant()) { |
2500 |
Address dest(elements, ToInt32(lir->index()) * width); |
2500 |
Address dest(elements, ToInt32(lir->index()) * width); |
2501 |
masm.atomicExchangeJS(arrayType, Synchronization::Full(), dest, value, valueTemp, |
2501 |
masm.atomicExchangeJS(arrayType, Synchronization::Full(), dest, value, valueTemp, |
2502 |
offsetTemp, maskTemp, outTemp, output); |
2502 |
offsetTemp, maskTemp, outTemp, output); |
2503 |
} else { |
2503 |
} else { |
2504 |
BaseIndex dest(elements, ToRegister(lir->index()), ScaleFromElemWidth(width)); |
2504 |
BaseIndex dest(elements, ToRegister(lir->index()), ScaleFromElemWidth(width)); |
2505 |
masm.atomicExchangeJS(arrayType, Synchronization::Full(), dest, value, valueTemp, |
2505 |
masm.atomicExchangeJS(arrayType, Synchronization::Full(), dest, value, valueTemp, |