summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/jit
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-27 21:51:42 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-27 21:51:42 +0200
commitbe01689f43cf6882cf670d33df49ead1f570c53a (patch)
tree4bb2161d8983b38e3e7ed37b4a50303bfd5e2e85 /Source/JavaScriptCore/jit
parenta89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (diff)
downloadqtwebkit-be01689f43cf6882cf670d33df49ead1f570c53a.tar.gz
Imported WebKit commit 8d6c5efc74f0222dfc7bcce8d845d4a2707ed9e6 (http://svn.webkit.org/repository/webkit/trunk@118629)
Diffstat (limited to 'Source/JavaScriptCore/jit')
-rw-r--r--Source/JavaScriptCore/jit/JITOpcodes.cpp22
-rw-r--r--Source/JavaScriptCore/jit/JITOpcodes32_64.cpp29
2 files changed, 37 insertions, 14 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);
}
diff --git a/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp b/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
index 5643fe9f3..12e47b2ee 100644
--- a/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
+++ b/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
@@ -1548,12 +1548,15 @@ void JIT::emit_op_convert_this(Instruction* currentInstruction)
{
unsigned thisRegister = currentInstruction[1].u.operand;
- emitLoad(thisRegister, regT1, regT0);
+ emitLoad(thisRegister, regT3, regT2);
- addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::CellTag)));
- addSlowCase(branchPtr(Equal, Address(regT0, JSCell::classInfoOffset()), TrustedImmPtr(&JSString::s_info)));
-
- map(m_bytecodeOffset + OPCODE_LENGTH(op_convert_this), thisRegister, regT1, regT0);
+ addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::CellTag)));
+ if (shouldEmitProfiling()) {
+ loadPtr(Address(regT2, JSCell::structureOffset()), regT0);
+ move(regT3, regT1);
+ emitValueProfilingSite();
+ }
+ addSlowCase(branchPtr(Equal, Address(regT2, JSCell::classInfoOffset()), TrustedImmPtr(&JSString::s_info)));
}
void JIT::emitSlow_op_convert_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
@@ -1562,16 +1565,26 @@ void JIT::emitSlow_op_convert_this(Instruction* currentInstruction, Vector<SlowC
unsigned thisRegister = currentInstruction[1].u.operand;
linkSlowCase(iter);
- Jump isNotUndefined = branch32(NotEqual, regT1, TrustedImm32(JSValue::UndefinedTag));
+ if (shouldEmitProfiling()) {
+ move(TrustedImm32(JSValue::UndefinedTag), regT1);
+ move(TrustedImm32(0), regT0);
+ }
+ Jump isNotUndefined = branch32(NotEqual, regT3, TrustedImm32(JSValue::UndefinedTag));
+ emitValueProfilingSite();
move(TrustedImmPtr(globalThis), regT0);
move(TrustedImm32(JSValue::CellTag), regT1);
emitStore(thisRegister, regT1, regT0);
emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_convert_this));
- isNotUndefined.link(this);
linkSlowCase(iter);
+ if (shouldEmitProfiling()) {
+ move(TrustedImm32(JSValue::CellTag), regT1);
+ move(TrustedImmPtr(m_globalData->stringStructure.get()), regT0);
+ }
+ isNotUndefined.link(this);
+ emitValueProfilingSite();
JITStubCall stubCall(this, cti_op_convert_this);
- stubCall.addArgument(regT1, regT0);
+ stubCall.addArgument(regT3, regT2);
stubCall.call(thisRegister);
}