+ ASSERT(bytecodeIndex != std::numeric_limits<unsigned>::max());
+ info.bytecodeIndex = bytecodeIndex;
+ info.callReturnLocation = linkBuffer.locationOf(callReturnLocation);
+ info.hotPathBegin = linkBuffer.locationOf(hotPathBegin);
+
+ switch (m_type) {
+ case GetById: {
+ CodeLocationLabel hotPathBeginLocation = linkBuffer.locationOf(hotPathBegin);
+ info.patch.baseline.u.get.structureToCompare = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getStructureToCompare));
+ info.patch.baseline.u.get.structureCheck = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getStructureCheck));
+ info.patch.baseline.u.get.propertyStorageLoad = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(propertyStorageLoad));
+#if USE(JSVALUE64)
+ info.patch.baseline.u.get.displacementLabel = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getDisplacementLabel));
+#else
+ info.patch.baseline.u.get.displacementLabel1 = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getDisplacementLabel1));
+ info.patch.baseline.u.get.displacementLabel2 = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getDisplacementLabel2));
+#endif
+ info.patch.baseline.u.get.putResult = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getPutResult));
+ info.patch.baseline.u.get.coldPathBegin = MacroAssembler::differenceBetweenCodePtr(linkBuffer.locationOf(getColdPathBegin), linkBuffer.locationOf(callReturnLocation));
+ break;
+ }
+ case PutById:
+ CodeLocationLabel hotPathBeginLocation = linkBuffer.locationOf(hotPathBegin);
+ info.patch.baseline.u.put.structureToCompare = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(putStructureToCompare));
+ info.patch.baseline.u.put.propertyStorageLoad = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(propertyStorageLoad));
+#if USE(JSVALUE64)
+ info.patch.baseline.u.put.displacementLabel = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(putDisplacementLabel));
+#else
+ info.patch.baseline.u.put.displacementLabel1 = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(putDisplacementLabel1));
+ info.patch.baseline.u.put.displacementLabel2 = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(putDisplacementLabel2));
+#endif
+ break;
+ }
+}
+
+JITCode JIT::privateCompile(CodePtr* functionEntryArityCheck, JITCompilationEffort effort)
+{
+#if ENABLE(JIT_VERBOSE_OSR)
+ printf("Compiling JIT code!\n");
+#endif
+
+#if ENABLE(VALUE_PROFILER)
+ DFG::CapabilityLevel level = m_codeBlock->canCompileWithDFG();
+ switch (level) {
+ case DFG::CannotCompile:
+ m_canBeOptimized = false;
+ m_shouldEmitProfiling = false;
+ break;
+ case DFG::MayInline:
+ m_canBeOptimized = false;
+ m_canBeOptimizedOrInlined = true;
+ m_shouldEmitProfiling = true;
+ break;
+ case DFG::CanCompile:
+ m_canBeOptimized = true;
+ m_canBeOptimizedOrInlined = true;
+ m_shouldEmitProfiling = true;
+ break;
+ default:
+ RELEASE_ASSERT_NOT_REACHED();
+ break;
+ }
+#endif
+
+ if (Options::showDisassembly() || m_vm->m_perBytecodeProfiler)
+ m_disassembler = adoptPtr(new JITDisassembler(m_codeBlock));
+ if (m_vm->m_perBytecodeProfiler) {
+ m_compilation = m_vm->m_perBytecodeProfiler->newCompilation(m_codeBlock, Profiler::Baseline);
+ m_compilation->addProfiledBytecodes(*m_vm->m_perBytecodeProfiler, m_codeBlock);
+ }
+
+ if (m_disassembler)
+ m_disassembler->setStartOfCode(label());
+
+ // Just add a little bit of randomness to the codegen
+ if (m_randomGenerator.getUint32() & 1)
+ nop();
+
+ preserveReturnAddressAfterCall(regT2);
+ emitPutToCallFrameHeader(regT2, JSStack::ReturnPC);
+ emitPutImmediateToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);
+
+ Label beginLabel(this);
+