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

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

@ -840,11 +840,6 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter {
return guardSpecificObject(obj, expected); 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 guardAndGetIndexFromString(StringOperandId str) {
Int32OperandId res(nextOperandId_++); Int32OperandId res(nextOperandId_++);
writeOpWithOperandId(CacheOp::GuardAndGetIndexFromString, str); writeOpWithOperandId(CacheOp::GuardAndGetIndexFromString, str);
@ -1123,14 +1118,6 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter {
addStubField(uintptr_t(templateObject), StubField::Type::JSObject); 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 CACHE_IR_WRITER_GENERATED
}; };

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

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

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

@ -72,6 +72,7 @@ operand_writer_info = {
'GroupField': ('ObjectGroup*', 'writeGroupField'), 'GroupField': ('ObjectGroup*', 'writeGroupField'),
'ObjectField': ('JSObject*', 'writeObjectField'), 'ObjectField': ('JSObject*', 'writeObjectField'),
'StringField': ('JSString*', 'writeStringField'), 'StringField': ('JSString*', 'writeStringField'),
'AtomField': ('JSAtom*', 'writeStringField'),
'PropertyNameField': ('PropertyName*', 'writeStringField'), 'PropertyNameField': ('PropertyName*', 'writeStringField'),
'SymbolField': ('JS::Symbol*', 'writeSymbolField'), 'SymbolField': ('JS::Symbol*', 'writeSymbolField'),
'RawWordField': ('uintptr_t', 'writeRawWordField'), 'RawWordField': ('uintptr_t', 'writeRawWordField'),
@ -141,6 +142,7 @@ operand_compiler_info = {
'GroupField': ('uint32_t', 'Offset', 'reader.stubOffset()'), 'GroupField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'ObjectField': ('uint32_t', 'Offset', 'reader.stubOffset()'), 'ObjectField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'StringField': ('uint32_t', 'Offset', 'reader.stubOffset()'), 'StringField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'AtomField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'PropertyNameField': ('uint32_t', 'Offset', 'reader.stubOffset()'), 'PropertyNameField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'SymbolField': ('uint32_t', 'Offset', 'reader.stubOffset()'), 'SymbolField': ('uint32_t', 'Offset', 'reader.stubOffset()'),
'RawWordField': ('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', 'GroupField': 'Field',
'ObjectField': 'Field', 'ObjectField': 'Field',
'StringField': 'Field', 'StringField': 'Field',
'AtomField': 'Field',
'PropertyNameField': 'Field', 'PropertyNameField': 'Field',
'SymbolField': 'Field', 'SymbolField': 'Field',
'RawWordField': 'Field', 'RawWordField': 'Field',

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

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