Bug 1667753 part 2 - Rename RawWord field type to RawInt32. r=anba

emitLoadStubField and emitLoadStubFieldConstant use move32/load32 for this type
so RawInt32 is more appropriate than RawWord.

Depends on D92601

Differential Revision: https://phabricator.services.mozilla.com/D92602
This commit is contained in:
Jan de Mooij 2020-10-06 13:00:22 +00:00
parent 1e3ea0c6ad
commit 1879259682
8 changed files with 49 additions and 49 deletions

View file

@ -189,8 +189,8 @@ JS::Symbol* CacheIRCloner::getSymbolField(uint32_t stubOffset) {
BaseScript* CacheIRCloner::getBaseScriptField(uint32_t stubOffset) {
return reinterpret_cast<BaseScript*>(readStubWord(stubOffset));
}
uintptr_t CacheIRCloner::getRawWordField(uint32_t stubOffset) {
return reinterpret_cast<uintptr_t>(readStubWord(stubOffset));
uint32_t CacheIRCloner::getRawInt32Field(uint32_t stubOffset) {
return uint32_t(reinterpret_cast<uintptr_t>(readStubWord(stubOffset)));
}
const void* CacheIRCloner::getRawPointerField(uint32_t stubOffset) {
return reinterpret_cast<const void*>(readStubWord(stubOffset));

View file

@ -228,7 +228,7 @@ class StubField {
public:
enum class Type : uint8_t {
// These fields take up a single word.
RawWord,
RawInt32,
RawPointer,
Shape,
ObjectGroup,
@ -622,8 +622,8 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter {
MOZ_ASSERT(script);
addStubField(uintptr_t(script), StubField::Type::BaseScript);
}
void writeRawWordField(uintptr_t word) {
addStubField(word, StubField::Type::RawWord);
void writeRawInt32Field(uint32_t val) {
addStubField(val, StubField::Type::RawInt32);
}
void writeRawPointerField(const void* ptr) {
addStubField(uintptr_t(ptr), StubField::Type::RawPointer);
@ -1208,7 +1208,7 @@ class MOZ_RAII CacheIRCloner {
PropertyName* getPropertyNameField(uint32_t stubOffset);
JS::Symbol* getSymbolField(uint32_t stubOffset);
BaseScript* getBaseScriptField(uint32_t stubOffset);
uintptr_t getRawWordField(uint32_t stubOffset);
uint32_t getRawInt32Field(uint32_t stubOffset);
const void* getRawPointerField(uint32_t stubOffset);
jsid getIdField(uint32_t stubOffset);
const Value getValueField(uint32_t stubOffset);

View file

@ -1107,7 +1107,7 @@ void CacheIRWriter::copyStubData(uint8_t* dest) const {
for (const StubField& field : stubFields_) {
switch (field.type()) {
case StubField::Type::RawWord:
case StubField::Type::RawInt32:
case StubField::Type::RawPointer:
*destWords = field.asWord();
break;
@ -1155,7 +1155,7 @@ void jit::TraceCacheIRStub(JSTracer* trc, T* stub,
while (true) {
StubField::Type fieldType = stubInfo->fieldType(field);
switch (fieldType) {
case StubField::Type::RawWord:
case StubField::Type::RawInt32:
case StubField::Type::RawPointer:
case StubField::Type::RawInt64:
case StubField::Type::DOMExpandoGeneration:
@ -2008,7 +2008,7 @@ bool CacheIRCompiler::emitGuardDynamicSlotIsSpecificObject(
}
// Guard on the expected object.
StubFieldOffset slot(slotOffset, StubField::Type::RawWord);
StubFieldOffset slot(slotOffset, StubField::Type::RawInt32);
masm.loadPtr(Address(obj, NativeObject::offsetOfSlots()), scratch1);
emitLoadStubField(slot, scratch2);
BaseObjectSlotIndex expectedSlot(scratch1, scratch2);
@ -5393,7 +5393,7 @@ bool CacheIRCompiler::emitStoreTypedObjectScalarProperty(
Scalar::Type type, uint32_t rhsId) {
JitSpew(JitSpew_Codegen, "%s", __FUNCTION__);
Register obj = allocator.useRegister(masm, objId);
StubFieldOffset offset(offsetOffset, StubField::Type::RawWord);
StubFieldOffset offset(offsetOffset, StubField::Type::RawInt32);
AutoAvailableFloatRegister floatScratch0(*this, FloatReg0);
@ -5475,7 +5475,7 @@ bool CacheIRCompiler::emitLoadTypedObjectResult(ObjOperandId objId,
AutoScratchRegister scratch1(allocator, masm);
AutoScratchRegister scratch2(allocator, masm);
StubFieldOffset offset(offsetOffset, StubField::Type::RawWord);
StubFieldOffset offset(offsetOffset, StubField::Type::RawInt32);
// Allocate BigInt if needed. The code after this should be infallible.
Maybe<Register> bigInt;
@ -5574,7 +5574,7 @@ bool CacheIRCompiler::emitStoreFixedSlotUndefinedResult(ObjOperandId objId,
Register obj = allocator.useRegister(masm, objId);
ValueOperand val = allocator.useValueRegister(masm, rhsId);
StubFieldOffset offset(offsetOffset, StubField::Type::RawWord);
StubFieldOffset offset(offsetOffset, StubField::Type::RawInt32);
emitLoadStubField(offset, scratch);
BaseIndex slot(obj, scratch, TimesOne);
@ -6968,7 +6968,7 @@ void CacheIRCompiler::emitLoadStubFieldConstant(StubFieldOffset val,
case StubField::Type::RawPointer:
masm.movePtr(ImmPtr(pointerStubField(val.getOffset())), dest);
break;
case StubField::Type::RawWord:
case StubField::Type::RawInt32:
masm.move32(Imm32(int32StubField(val.getOffset())), dest);
break;
default:
@ -7001,7 +7001,7 @@ void CacheIRCompiler::emitLoadStubField(StubFieldOffset val, Register dest) {
case StubField::Type::Id:
masm.loadPtr(load, dest);
break;
case StubField::Type::RawWord:
case StubField::Type::RawInt32:
masm.load32(load, dest);
break;
default:
@ -7013,7 +7013,7 @@ void CacheIRCompiler::emitLoadStubField(StubFieldOffset val, Register dest) {
Address CacheIRCompiler::emitAddressFromStubField(StubFieldOffset val,
Register base) {
JitSpew(JitSpew_Codegen, "%s", __FUNCTION__);
MOZ_ASSERT(val.getStubFieldType() == StubField::Type::RawWord);
MOZ_ASSERT(val.getStubFieldType() == StubField::Type::RawInt32);
if (stubFieldPolicy_ == StubFieldPolicy::Constant) {
int32_t offset = int32StubField(val.getOffset());
@ -7245,7 +7245,7 @@ bool CacheIRCompiler::emitLoadInt32Constant(uint32_t valOffset,
Int32OperandId resultId) {
JitSpew(JitSpew_Codegen, "%s", __FUNCTION__);
Register reg = allocator.defineRegister(masm, resultId);
StubFieldOffset val(valOffset, StubField::Type::RawWord);
StubFieldOffset val(valOffset, StubField::Type::RawInt32);
emitLoadStubField(val, reg);
return true;
}

View file

@ -852,11 +852,11 @@ class MOZ_RAII CacheIRCompiler {
}
int32_t int32StubField(uint32_t offset) {
MOZ_ASSERT(stubFieldPolicy_ == StubFieldPolicy::Constant);
return readStubWord(offset, StubField::Type::RawWord);
return readStubWord(offset, StubField::Type::RawInt32);
}
uint32_t uint32StubField(uint32_t offset) {
MOZ_ASSERT(stubFieldPolicy_ == StubFieldPolicy::Constant);
return readStubWord(offset, StubField::Type::RawWord);
return readStubWord(offset, StubField::Type::RawInt32);
}
Shape* shapeStubField(uint32_t offset) {
MOZ_ASSERT(stubFieldPolicy_ == StubFieldPolicy::Constant);

View file

@ -437,7 +437,7 @@
args:
fun: ObjId
expected: ObjectField
nargsAndFlags: RawWordField
nargsAndFlags: RawInt32Field
- name: GuardFunctionScript
shared: false
@ -447,7 +447,7 @@
args:
obj: ObjId
expected: BaseScriptField
nargsAndFlags: RawWordField
nargsAndFlags: RawInt32Field
- name: GuardSpecificAtom
shared: false
@ -605,7 +605,7 @@
args:
obj: ObjId
expected: ObjId
slot: RawWordField
slot: RawInt32Field
- name: GuardNoAllocationMetadataBuilder
shared: true
@ -825,7 +825,7 @@
cost_estimate: 6
args:
obj: ObjId
offset: RawWordField
offset: RawInt32Field
rhs: ValId
- name: StoreDynamicSlot
@ -834,7 +834,7 @@
cost_estimate: 6
args:
obj: ObjId
offset: RawWordField
offset: RawInt32Field
rhs: ValId
- name: AddAndStoreFixedSlot
@ -843,7 +843,7 @@
cost_estimate: 6
args:
obj: ObjId
offset: RawWordField
offset: RawInt32Field
rhs: ValId
changeGroup: BoolImm
newGroup: GroupField
@ -855,7 +855,7 @@
cost_estimate: 6
args:
obj: ObjId
offset: RawWordField
offset: RawInt32Field
rhs: ValId
changeGroup: BoolImm
newGroup: GroupField
@ -867,12 +867,12 @@
cost_estimate: 6
args:
obj: ObjId
offset: RawWordField
offset: RawInt32Field
rhs: ValId
changeGroup: BoolImm
newGroup: GroupField
newShape: ShapeField
numNewSlots: RawWordField
numNewSlots: RawInt32Field
- name: StoreTypedObjectReferenceProperty
shared: false
@ -880,7 +880,7 @@
cost_estimate: 6
args:
obj: ObjId
offset: RawWordField
offset: RawInt32Field
layout: TypedThingLayoutImm
type: ReferenceTypeImm
rhs: ValId
@ -891,7 +891,7 @@
cost_estimate: 2
args:
obj: ObjId
offset: RawWordField
offset: RawInt32Field
layout: TypedThingLayoutImm
type: ScalarTypeImm
rhs: RawId
@ -967,7 +967,7 @@
transpile: true
args:
obj: ObjId
offset: RawWordField
offset: RawInt32Field
rhs: ValId
- name: IsObjectResult
@ -1461,7 +1461,7 @@
setter: ObjectField
rhs: ValId
sameRealm: BoolImm
nargsAndFlags: RawWordField
nargsAndFlags: RawInt32Field
- name: CallScriptedSetter
shared: false
@ -1473,7 +1473,7 @@
setter: ObjectField
rhs: ValId
sameRealm: BoolImm
nargsAndFlags: RawWordField
nargsAndFlags: RawInt32Field
- name: CallInlinedSetter
shared: false
@ -1486,7 +1486,7 @@
rhs: ValId
icScript: RawPointerField
sameRealm: BoolImm
nargsAndFlags: RawWordField
nargsAndFlags: RawInt32Field
- name: CallDOMSetter
shared: false
@ -1625,7 +1625,7 @@
cost_estimate: 1
args:
obj: ObjId
offset: RawWordField
offset: RawInt32Field
- name: LoadFixedSlotTypedResult
shared: false
@ -1633,7 +1633,7 @@
cost_estimate: 1
args:
obj: ObjId
offset: RawWordField
offset: RawInt32Field
type: ValueTypeImm
- name: LoadDynamicSlotResult
@ -1642,7 +1642,7 @@
cost_estimate: 1
args:
obj: ObjId
offset: RawWordField
offset: RawInt32Field
- name: LoadTypedObjectResult
shared: true
@ -1652,7 +1652,7 @@
obj: ObjId
layout: TypedThingLayoutImm
typeDescr: ByteImm
offset: RawWordField
offset: RawInt32Field
- name: LoadDenseElementResult
shared: true
@ -1860,7 +1860,7 @@
cost_estimate: 1
args:
obj: ObjId
offset: RawWordField
offset: RawInt32Field
- name: LoadEnvironmentDynamicSlotResult
shared: false
@ -1868,7 +1868,7 @@
cost_estimate: 1
args:
obj: ObjId
offset: RawWordField
offset: RawInt32Field
- name: LoadObjectResult
shared: true
@ -1921,7 +1921,7 @@
receiver: ValId
getter: ObjectField
sameRealm: BoolImm
nargsAndFlags: RawWordField
nargsAndFlags: RawInt32Field
- name: CallInlinedGetterResult
shared: false
@ -1933,7 +1933,7 @@
getter: ObjectField
icScript: RawPointerField
sameRealm: BoolImm
nargsAndFlags: RawWordField
nargsAndFlags: RawInt32Field
- name: CallNativeGetterResult
shared: false
@ -1944,7 +1944,7 @@
receiver: ValId
getter: ObjectField
sameRealm: BoolImm
nargsAndFlags: RawWordField
nargsAndFlags: RawInt32Field
- name: CallDOMGetterResult
shared: false
@ -2022,7 +2022,7 @@
transpile: true
cost_estimate: 1
args:
val: RawWordField
val: RawInt32Field
result: Int32Id
- name: LoadBooleanConstant

View file

@ -79,7 +79,7 @@ arg_writer_info = {
'PropertyNameField': ('PropertyName*', 'writeStringField'),
'SymbolField': ('JS::Symbol*', 'writeSymbolField'),
'BaseScriptField': ('BaseScript*', 'writeBaseScriptField'),
'RawWordField': ('uintptr_t', 'writeRawWordField'),
'RawInt32Field': ('uint32_t', 'writeRawInt32Field'),
'RawPointerField': ('const void*', 'writeRawPointerField'),
'IdField': ('jsid', 'writeIdField'),
'ValueField': ('const Value&', 'writeValueField'),
@ -177,7 +177,7 @@ arg_reader_info = {
'PropertyNameField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'SymbolField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'BaseScriptField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'RawWordField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'RawInt32Field': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'RawPointerField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'IdField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'ValueField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
@ -261,7 +261,7 @@ arg_spewer_method = {
'PropertyNameField': 'spewField',
'SymbolField': 'spewField',
'BaseScriptField': 'spewField',
'RawWordField': 'spewField',
'RawInt32Field': 'spewField',
'RawPointerField': 'spewField',
'IdField': 'spewField',
'ValueField': 'spewField',
@ -395,7 +395,7 @@ arg_length = {
'PropertyNameField': 1,
'SymbolField': 1,
'BaseScriptField': 1,
'RawWordField': 1,
'RawInt32Field': 1,
'RawPointerField': 1,
'DOMExpandoGenerationField': 1,
'IdField': 1,

View file

@ -1043,7 +1043,7 @@ bool WarpScriptOracle::replaceNurseryPointers(ICStub* stub,
while (true) {
StubField::Type fieldType = stubInfo->fieldType(field);
switch (fieldType) {
case StubField::Type::RawWord:
case StubField::Type::RawInt32:
case StubField::Type::RawPointer:
case StubField::Type::RawInt64:
case StubField::Type::DOMExpandoGeneration:

View file

@ -323,7 +323,7 @@ void WarpCacheIR::traceData(JSTracer* trc) {
while (true) {
StubField::Type fieldType = stubInfo_->fieldType(field);
switch (fieldType) {
case StubField::Type::RawWord:
case StubField::Type::RawInt32:
case StubField::Type::RawPointer:
case StubField::Type::RawInt64:
case StubField::Type::DOMExpandoGeneration: