summaryrefslogtreecommitdiffstats
path: root/js/src/jit/BaselineCacheIRCompiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit/BaselineCacheIRCompiler.cpp')
-rw-r--r--js/src/jit/BaselineCacheIRCompiler.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/js/src/jit/BaselineCacheIRCompiler.cpp b/js/src/jit/BaselineCacheIRCompiler.cpp
index 92490ef8b8..29cada7037 100644
--- a/js/src/jit/BaselineCacheIRCompiler.cpp
+++ b/js/src/jit/BaselineCacheIRCompiler.cpp
@@ -427,7 +427,7 @@ bool BaselineCacheIRCompiler::emitGuardSpecificAtom(StringOperandId strId,
Address atomAddr(stubAddress(expectedOffset));
- Label done;
+ Label done, notCachedAtom;
masm.branchPtr(Assembler::Equal, atomAddr, str, &done);
// The pointers are not equal, so if the input string is also an atom it
@@ -435,6 +435,11 @@ bool BaselineCacheIRCompiler::emitGuardSpecificAtom(StringOperandId strId,
masm.branchTest32(Assembler::NonZero, Address(str, JSString::offsetOfFlags()),
Imm32(JSString::ATOM_BIT), failure->label());
+ masm.tryFastAtomize(str, scratch, scratch, &notCachedAtom);
+ masm.branchPtr(Assembler::Equal, atomAddr, scratch, &done);
+ masm.jump(failure->label());
+ masm.bind(&notCachedAtom);
+
// Check the length.
masm.loadPtr(atomAddr, scratch);
masm.loadStringLength(scratch, scratch);
@@ -1464,9 +1469,13 @@ bool BaselineCacheIRCompiler::emitHasClassResult(ObjOperandId objId,
void BaselineCacheIRCompiler::emitAtomizeString(Register str, Register temp,
Label* failure) {
- Label isAtom;
+ Label isAtom, notCachedAtom;
masm.branchTest32(Assembler::NonZero, Address(str, JSString::offsetOfFlags()),
Imm32(JSString::ATOM_BIT), &isAtom);
+ masm.tryFastAtomize(str, temp, str, &notCachedAtom);
+ masm.jump(&isAtom);
+ masm.bind(&notCachedAtom);
+
{
LiveRegisterSet save(GeneralRegisterSet::Volatile(),
liveVolatileFloatRegs());
@@ -2032,6 +2041,7 @@ bool BaselineCacheIRCompiler::init(CacheKind kind) {
break;
case CacheKind::GetProp:
case CacheKind::TypeOf:
+ case CacheKind::TypeOfEq:
case CacheKind::ToPropertyKey:
case CacheKind::GetIterator:
case CacheKind::OptimizeSpreadCall: