Bug 1833484 - Remove now superflous optimization from baseline and Warp r=jandem

Differential Revision: https://phabricator.services.mozilla.com/D178245
This commit is contained in:
Matthew Gaudet 2023-05-17 14:59:51 +00:00
Родитель f0828bc714
Коммит fba4072b2b
3 изменённых файлов: 1 добавлений и 50 удалений

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

@ -3226,39 +3226,8 @@ bool BaselineCodeGen<Handler>::emit_NewPrivateName() {
return true;
}
template <>
bool BaselineCompilerCodeGen::tryOptimizeGetGlobalName() {
PropertyName* name = handler.script()->getName(handler.pc());
// These names are non-configurable on the global and cannot be shadowed.
if (name == cx->names().undefined) {
frame.push(UndefinedValue());
return true;
}
if (name == cx->names().NaN) {
frame.push(JS::NaNValue());
return true;
}
if (name == cx->names().Infinity) {
frame.push(JS::InfinityValue());
return true;
}
return false;
}
template <>
bool BaselineInterpreterCodeGen::tryOptimizeGetGlobalName() {
// Interpreter doesn't optimize simple GETGNAMEs.
return false;
}
template <typename Handler>
bool BaselineCodeGen<Handler>::emit_GetGName() {
if (tryOptimizeGetGlobalName()) {
return true;
}
frame.syncStack(0);
loadGlobalLexicalEnvironment(R0.scratchReg());

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

@ -231,9 +231,8 @@ class BaselineCodeGen {
[[nodiscard]] bool emitSetElemSuper(bool strict);
[[nodiscard]] bool emitSetPropSuper(bool strict);
// Try to bake in the result of GetGName/BindGName instead of using an IC.
// Try to bake in the result of BindGName instead of using an IC.
// Return true if we managed to optimize the op.
bool tryOptimizeGetGlobalName();
bool tryOptimizeBindGlobalName();
[[nodiscard]] bool emitInitPropGetterSetter();

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

@ -1846,23 +1846,6 @@ bool WarpBuilder::build_GetName(BytecodeLocation loc) {
bool WarpBuilder::build_GetGName(BytecodeLocation loc) {
MOZ_ASSERT(!script_->hasNonSyntacticScope());
// Try to optimize undefined/NaN/Infinity.
PropertyName* name = loc.getPropertyName(script_);
const JSAtomState& names = mirGen().runtime->names();
if (name == names.undefined) {
pushConstant(UndefinedValue());
return true;
}
if (name == names.NaN) {
pushConstant(JS::NaNValue());
return true;
}
if (name == names.Infinity) {
pushConstant(JS::InfinityValue());
return true;
}
MDefinition* env = globalLexicalEnvConstant();
return buildIC(loc, CacheKind::GetName, {env});
}