From be01689f43cf6882cf670d33df49ead1f570c53a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sun, 27 May 2012 21:51:42 +0200 Subject: Imported WebKit commit 8d6c5efc74f0222dfc7bcce8d845d4a2707ed9e6 (http://svn.webkit.org/repository/webkit/trunk@118629) --- Source/JavaScriptCore/jit/JITOpcodes.cpp | 22 ++++++++++++++------ Source/JavaScriptCore/jit/JITOpcodes32_64.cpp | 29 +++++++++++++++++++-------- 2 files changed, 37 insertions(+), 14 deletions(-) (limited to 'Source/JavaScriptCore/jit') 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, VectorglobalObject()->globalScopeChain()->globalThis.get(); linkSlowCase(iter); - Jump isNotUndefined = branchPtr(NotEqual, regT0, TrustedImmPtr(JSValue::encode(jsUndefined()))); + if (shouldEmitProfiling()) + move(TrustedImmPtr(bitwise_cast(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(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::iterator& iter) @@ -1562,16 +1565,26 @@ void JIT::emitSlow_op_convert_this(Instruction* currentInstruction, VectorstringStructure.get()), regT0); + } + isNotUndefined.link(this); + emitValueProfilingSite(); JITStubCall stubCall(this, cti_op_convert_this); - stubCall.addArgument(regT1, regT0); + stubCall.addArgument(regT3, regT2); stubCall.call(thisRegister); } -- cgit v1.2.1