return call;
}
-ALWAYS_INLINE void CTI::emitJumpSlowCaseIfIsJSCell(X86Assembler::RegisterID reg, unsigned opcodeIndex)
-{
- m_jit.testl_i32r(JSImmediate::TagMask, reg);
- m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJe(), opcodeIndex));
-}
-
ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotJSCell(X86Assembler::RegisterID reg, unsigned opcodeIndex)
{
m_jit.testl_i32r(JSImmediate::TagMask, reg);
break;
}
case op_eq_null: {
- emitGetArg(instruction[i + 2].u.operand, X86::edx);
-
- // go to a slow case either if this is not an immediate, or if the immediate is not undefined/null.
- emitJumpSlowCaseIfIsJSCell(X86::edx, i);
- m_jit.andl_i32r(~JSImmediate::ExtendedTagBitUndefined, X86::edx);
- m_jit.cmpl_i32r(JSImmediate::FullTagTypeNull, X86::edx);
- m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i));
-
- m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax);
+ emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
+ emitCall(i, Machine::cti_op_eq_null);
emitPutResult(instruction[i + 1].u.operand);
-
i += 3;
break;
}
case op_neq_null: {
- emitGetArg(instruction[i + 2].u.operand, X86::edx);
-
- // go to a slow case either if this is not an immediate, or if the immediate is not undefined/null.
- emitJumpSlowCaseIfIsJSCell(X86::edx, i);
- m_jit.andl_i32r(~JSImmediate::ExtendedTagBitUndefined, X86::edx);
- m_jit.cmpl_i32r(JSImmediate::FullTagTypeNull, X86::edx);
- m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i));
-
- m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax);
+ emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
+ emitCall(i, Machine::cti_op_neq_null);
emitPutResult(instruction[i + 1].u.operand);
-
i += 3;
break;
}
break;
}
CTI_COMPILE_BINARY_OP_SLOW_CASE(op_mul);
- case op_eq_null: {
- m_jit.link(iter->from, m_jit.label());
-
- // Value is a JSCell - speculate false, check for StringObjectThatMasqueradesAsUndefined.
- m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax);
- emitPutResult(instruction[i + 1].u.operand);
- m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsStringObjectThatMasqueradesAsUndefinedVptr), X86::edx);
- m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3]);
-
- // Value is a StringObjectThatMasqueradesAsUndefined
- m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax);
- emitPutResult(instruction[i + 1].u.operand);
- m_jit.link(m_jit.emitUnlinkedJmp(), m_labels[i + 3]);
-
- // Value is an immediate other than undefined/null
- m_jit.link((++iter)->from, m_jit.label());
- m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax);
- emitPutResult(instruction[i + 1].u.operand);
-
- i += 3;
- break;
- }
- case op_neq_null: {
- m_jit.link(iter->from, m_jit.label());
-
- // Value is a JSCell - speculate false, check for StringObjectThatMasqueradesAsUndefined.
- m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax);
- emitPutResult(instruction[i + 1].u.operand);
- m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsStringObjectThatMasqueradesAsUndefinedVptr), X86::edx);
- m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3]);
-
- // Value is a StringObjectThatMasqueradesAsUndefined
- m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax);
- emitPutResult(instruction[i + 1].u.operand);
- m_jit.link(m_jit.emitUnlinkedJmp(), m_labels[i + 3]);
-
- // Value is an immediate other than undefined/null
- m_jit.link((++iter)->from, m_jit.label());
- m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax);
- emitPutResult(instruction[i + 1].u.operand);
-
- i += 3;
- break;
- }
default:
ASSERT_NOT_REACHED();
break;
static const int repatchOffsetGetByIdStructureID = 19;
static const int repatchOffsetGetByIdBranchToSlowCase = 25;
static const int repatchOffsetGetByIdPropertyMapOffset = 34;
-#if ENABLE(SAMPLING_TOOL)
- static const int repatchOffsetGetByIdSlowCaseCall = 27;
-#else
static const int repatchOffsetGetByIdSlowCaseCall = 17;
-#endif
public:
static void compile(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
void emitJumpSlowCaseIfIsJSCell(X86Assembler::RegisterID reg, unsigned opcodeIndex);
void emitJumpSlowCaseIfNotJSCell(X86Assembler::RegisterID reg, unsigned opcodeIndex);
+
void emitJumpSlowCaseIfNotImm(X86Assembler::RegisterID, unsigned opcodeIndex);
void emitJumpSlowCaseIfNotImms(X86Assembler::RegisterID, X86Assembler::RegisterID, unsigned opcodeIndex);
#include "debugger.h"
#include "operations.h"
#include "SamplingTool.h"
-#include "StringObjectThatMasqueradesAsUndefined.h"
#include <stdio.h>
#if PLATFORM(DARWIN)
m_jsArrayVptr = jsArray->vptr();
static_cast<JSCell*>(jsArray)->~JSCell();
- StringObjectThatMasqueradesAsUndefined* jsStringObjectThatMasqueradesAsUndefined = new (storage) StringObjectThatMasqueradesAsUndefined(StringObjectThatMasqueradesAsUndefined::VPtrStealingHack);
- m_jsStringObjectThatMasqueradesAsUndefinedVptr = jsStringObjectThatMasqueradesAsUndefined->vptr();
- static_cast<JSCell*>(jsStringObjectThatMasqueradesAsUndefined)->~JSCell();
-
JSString* jsString = new (storage) JSString(JSString::VPtrStealingHack);
m_jsStringVptr = jsString->vptr();
static_cast<JSCell*>(jsString)->~JSCell();
JSValue* Machine::cti_op_eq_null(CTI_ARGS)
{
JSValue* src = ARG_src1;
-
if (src->isUndefinedOrNull())
return jsBoolean(true);
- return jsBoolean(ARG_exec->machine()->doesMasqueradesAsUndefined(src));
+ return jsBoolean(!JSImmediate::isImmediate(src) && static_cast<JSCell*>(src)->masqueradeAsUndefined());
}
JSValue* Machine::cti_op_neq_null(CTI_ARGS)
if (src->isUndefinedOrNull())
return jsBoolean(false);
- return jsBoolean(!ARG_exec->machine()->doesMasqueradesAsUndefined(src));
+ return jsBoolean(JSImmediate::isImmediate(src) || !static_cast<JSCell*>(src)->masqueradeAsUndefined());
}
void* Machine::cti_vm_throw(CTI_ARGS)