summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/jit/JITOpcodes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/jit/JITOpcodes.cpp')
-rw-r--r--Source/JavaScriptCore/jit/JITOpcodes.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/Source/JavaScriptCore/jit/JITOpcodes.cpp b/Source/JavaScriptCore/jit/JITOpcodes.cpp
index d458f7fb5..aa2938cc2 100644
--- a/Source/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/Source/JavaScriptCore/jit/JITOpcodes.cpp
@@ -1257,10 +1257,14 @@ void JIT::emit_op_init_lazy_reg(Instruction* currentInstruction)
void JIT::emit_op_convert_this(Instruction* currentInstruction)
{
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
+ emitGetVirtualRegister(currentInstruction[1].u.operand, regT1);
- emitJumpSlowCaseIfNotJSCell(regT0);
- addSlowCase(branchPtr(Equal, Address(regT0, JSCell::classInfoOffset()), TrustedImmPtr(&JSString::s_info)));
+ emitJumpSlowCaseIfNotJSCell(regT1);
+ if (shouldEmitProfiling()) {
+ loadPtr(Address(regT1, JSCell::structureOffset()), regT0);
+ emitValueProfilingSite();
+ }
+ addSlowCase(branchPtr(Equal, Address(regT1, JSCell::classInfoOffset()), TrustedImmPtr(&JSString::s_info)));
}
void JIT::emit_op_create_this(Instruction* currentInstruction)
@@ -1315,15 +1319,21 @@ void JIT::emitSlow_op_convert_this(Instruction* currentInstruction, Vector<SlowC
void* globalThis = m_codeBlock->globalObject()->globalScopeChain()->globalThis.get();
linkSlowCase(iter);
- Jump isNotUndefined = branchPtr(NotEqual, regT0, TrustedImmPtr(JSValue::encode(jsUndefined())));
+ if (shouldEmitProfiling())
+ move(TrustedImmPtr(bitwise_cast<void*>(JSValue::encode(jsUndefined()))), regT0);
+ Jump isNotUndefined = branchPtr(NotEqual, regT1, TrustedImmPtr(JSValue::encode(jsUndefined())));
+ emitValueProfilingSite();
move(TrustedImmPtr(globalThis), regT0);
emitPutVirtualRegister(currentInstruction[1].u.operand, regT0);
emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_convert_this));
- isNotUndefined.link(this);
linkSlowCase(iter);
+ if (shouldEmitProfiling())
+ move(TrustedImmPtr(bitwise_cast<void*>(JSValue::encode(m_globalData->stringStructure.get()))), regT0);
+ isNotUndefined.link(this);
+ emitValueProfilingSite();
JITStubCall stubCall(this, cti_op_convert_this);
- stubCall.addArgument(regT0);
+ stubCall.addArgument(regT1);
stubCall.call(currentInstruction[1].u.operand);
}