currentInstruction += OPCODE_LENGTH(op_method_check);
// Do the method check - check the object & its prototype's structure inline (this is the common case).
- m_methodCallCompilationInfo.append(MethodCallCompilationInfo(m_propertyAccessCompilationInfo.size()));
+ m_methodCallCompilationInfo.append(MethodCallCompilationInfo(m_bytecodeOffset, m_propertyAccessCompilationInfo.size()));
MethodCallCompilationInfo& info = m_methodCallCompilationInfo.last();
int dst = currentInstruction[1].u.operand;
Label hotPathBegin(this);
m_propertyAccessCompilationInfo.append(PropertyStubCompilationInfo());
+ m_propertyAccessCompilationInfo.last().bytecodeIndex = m_bytecodeOffset;
m_propertyAccessCompilationInfo.last().hotPathBegin = hotPathBegin;
DataLabelPtr structureToCompare;
Label hotPathBegin(this);
m_propertyAccessCompilationInfo.append(PropertyStubCompilationInfo());
+ m_propertyAccessCompilationInfo.last().bytecodeIndex = m_bytecodeOffset;
m_propertyAccessCompilationInfo.last().hotPathBegin = hotPathBegin;
// It is important that the following instruction plants a 32bit immediate, in order that it can be patched over.
}
// Compile a store into an object's property storage. May overwrite base.
-void JIT::compilePutDirectOffset(RegisterID base, RegisterID valueTag, RegisterID valuePayload, Structure* structure, size_t cachedOffset)
+void JIT::compilePutDirectOffset(RegisterID base, RegisterID valueTag, RegisterID valuePayload, size_t cachedOffset)
{
int offset = cachedOffset;
- if (structure->isUsingInlineStorage())
- offset += JSObject::offsetOfInlineStorage() / sizeof(Register);
- else
- loadPtr(Address(base, JSObject::offsetOfPropertyStorage()), base);
+ loadPtr(Address(base, JSObject::offsetOfPropertyStorage()), base);
emitStore(offset, valueTag, valuePayload, base);
}
// Compile a load from an object's property storage. May overwrite base.
-void JIT::compileGetDirectOffset(RegisterID base, RegisterID resultTag, RegisterID resultPayload, Structure* structure, size_t cachedOffset)
+void JIT::compileGetDirectOffset(RegisterID base, RegisterID resultTag, RegisterID resultPayload, size_t cachedOffset)
{
int offset = cachedOffset;
- if (structure->isUsingInlineStorage()) {
- offset += JSObject::offsetOfInlineStorage() / sizeof(Register);
- emitLoad(offset, resultTag, resultPayload, base);
- } else {
- RegisterID temp = resultPayload;
- loadPtr(Address(base, JSObject::offsetOfPropertyStorage()), temp);
- emitLoad(offset, resultTag, resultPayload, temp);
- }
+ RegisterID temp = resultPayload;
+ loadPtr(Address(base, JSObject::offsetOfPropertyStorage()), temp);
+ emitLoad(offset, resultTag, resultPayload, temp);
}
void JIT::compileGetDirectOffset(JSObject* base, RegisterID resultTag, RegisterID resultPayload, size_t cachedOffset)
{
- load32(reinterpret_cast<char*>(&base->m_propertyStorage[cachedOffset]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload), resultPayload);
- load32(reinterpret_cast<char*>(&base->m_propertyStorage[cachedOffset]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag), resultTag);
+ loadPtr(base->addressOfPropertyStorage(), resultTag);
+ load32(Address(resultTag, cachedOffset * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), resultPayload);
+ load32(Address(resultTag, cachedOffset * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), resultTag);
}
void JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, size_t cachedOffset, StructureChain* chain, ReturnAddressPtr returnAddress, bool direct)
load32(Address(stackPointerRegister, OBJECT_OFFSETOF(JITStackFrame, args[2]) + sizeof(void*) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT3);
load32(Address(stackPointerRegister, OBJECT_OFFSETOF(JITStackFrame, args[2]) + sizeof(void*) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT2);
#endif
- compilePutDirectOffset(regT0, regT2, regT3, newStructure, cachedOffset);
+ compilePutDirectOffset(regT0, regT2, regT3, cachedOffset);
ret();
bool needsStubLink = false;
if (slot.cachedPropertyType() == PropertySlot::Getter) {
needsStubLink = true;
- compileGetDirectOffset(regT0, regT2, regT1, structure, cachedOffset);
+ compileGetDirectOffset(regT0, regT2, regT1, cachedOffset);
JITStubCall stubCall(this, cti_op_get_by_id_getter_stub);
stubCall.addArgument(regT1);
stubCall.addArgument(regT0);
stubCall.addArgument(TrustedImmPtr(stubInfo->callReturnLocation.executableAddress()));
stubCall.call();
} else
- compileGetDirectOffset(regT0, regT1, regT0, structure, cachedOffset);
+ compileGetDirectOffset(regT0, regT1, regT0, cachedOffset);
Jump success = jump();