Bug 1629791 part 19 - Auto-generate boilerplate for more ops. r=evilpie

Depends on D71519

Differential Revision: https://phabricator.services.mozilla.com/D71520
This commit is contained in:
Jan de Mooij 2020-04-21 06:20:45 +00:00
Родитель b64e041b06
Коммит 00c4a6085c
5 изменённых файлов: 15 добавлений и 20 удалений

Просмотреть файл

@ -354,9 +354,10 @@ bool BaselineCacheIRCompiler::emitGuardSpecificObject() {
return true;
}
bool BaselineCacheIRCompiler::emitGuardSpecificAtom() {
bool BaselineCacheIRCompiler::emitGuardSpecificAtom(StringOperandId strId,
uint32_t expectedOffset) {
JitSpew(JitSpew_Codegen, "%s", __FUNCTION__);
Register str = allocator.useRegister(masm, reader.stringOperandId());
Register str = allocator.useRegister(masm, strId);
AutoScratchRegister scratch(allocator, masm);
FailurePath* failure;
@ -364,7 +365,7 @@ bool BaselineCacheIRCompiler::emitGuardSpecificAtom() {
return false;
}
Address atomAddr(stubAddress(reader.stubOffset()));
Address atomAddr(stubAddress(expectedOffset));
Label done;
masm.branchPtr(Assembler::Equal, atomAddr, str, &done);

Просмотреть файл

@ -840,11 +840,6 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter {
return guardSpecificObject(obj, expected);
}
FieldOffset guardSpecificAtom(StringOperandId str, JSAtom* expected) {
writeOpWithOperandId(CacheOp::GuardSpecificAtom, str);
return addStubField(uintptr_t(expected), StubField::Type::String);
}
Int32OperandId guardAndGetIndexFromString(StringOperandId str) {
Int32OperandId res(nextOperandId_++);
writeOpWithOperandId(CacheOp::GuardAndGetIndexFromString, str);
@ -1123,14 +1118,6 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter {
addStubField(uintptr_t(templateObject), StubField::Type::JSObject);
}
void loadInt32TruthyResult(ValOperandId integer) {
writeOpWithOperandId(CacheOp::LoadInt32TruthyResult, integer);
}
void loadDoubleTruthyResult(ValOperandId dbl) {
writeOpWithOperandId(CacheOp::LoadDoubleTruthyResult, dbl);
}
CACHE_IR_WRITER_GENERATED
};

Просмотреть файл

@ -217,9 +217,10 @@
- name: GuardSpecificAtom
shared: false
gen_boilerplate: true
operands:
str: StrId
expected: StringField
expected: AtomField
- name: GuardSpecificSymbol
shared: false
@ -1260,11 +1261,13 @@
- name: LoadInt32TruthyResult
shared: true
gen_boilerplate: true
operands:
input: ValId
- name: LoadDoubleTruthyResult
shared: true
gen_boilerplate: true
operands:
input: ValId

Просмотреть файл

@ -72,6 +72,7 @@ operand_writer_info = {
'GroupField': ('ObjectGroup*', 'writeGroupField'),
'ObjectField': ('JSObject*', 'writeObjectField'),
'StringField': ('JSString*', 'writeStringField'),
'AtomField': ('JSAtom*', 'writeStringField'),
'PropertyNameField': ('PropertyName*', 'writeStringField'),
'SymbolField': ('JS::Symbol*', 'writeSymbolField'),
'RawWordField': ('uintptr_t', 'writeRawWordField'),
@ -141,6 +142,7 @@ operand_compiler_info = {
'GroupField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'ObjectField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'StringField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'AtomField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'PropertyNameField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'SymbolField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'RawWordField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
@ -240,6 +242,7 @@ def generate_cacheirops_header(c_out, yaml_path):
'GroupField': 'Field',
'ObjectField': 'Field',
'StringField': 'Field',
'AtomField': 'Field',
'PropertyNameField': 'Field',
'SymbolField': 'Field',
'RawWordField': 'Field',

Просмотреть файл

@ -729,12 +729,13 @@ bool IonCacheIRCompiler::emitGuardSpecificObject() {
return true;
}
bool IonCacheIRCompiler::emitGuardSpecificAtom() {
bool IonCacheIRCompiler::emitGuardSpecificAtom(StringOperandId strId,
uint32_t expectedOffset) {
JitSpew(JitSpew_Codegen, "%s", __FUNCTION__);
Register str = allocator.useRegister(masm, reader.stringOperandId());
Register str = allocator.useRegister(masm, strId);
AutoScratchRegister scratch(allocator, masm);
JSAtom* atom = &stringStubField(reader.stubOffset())->asAtom();
JSAtom* atom = &stringStubField(expectedOffset)->asAtom();
FailurePath* failure;
if (!addFailurePath(&failure)) {