X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/f9bf01c6616d5ddcf65b13b33cedf9e387ff7a63..a253471d7f8e4d91bf6ebabab00155c3b387d3d0:/jit/JITStubCall.h?ds=sidebyside diff --git a/jit/JITStubCall.h b/jit/JITStubCall.h index cfbd7dc..a525ff2 100644 --- a/jit/JITStubCall.h +++ b/jit/JITStubCall.h @@ -99,12 +99,24 @@ namespace JSC { m_stackIndex += stackIndexStep; } + void addArgument(JIT::TrustedImm32 argument) + { + m_jit->poke(argument, m_stackIndex); + m_stackIndex += stackIndexStep; + } + void addArgument(JIT::Imm32 argument) { m_jit->poke(argument, m_stackIndex); m_stackIndex += stackIndexStep; } + void addArgument(JIT::TrustedImmPtr argument) + { + m_jit->poke(argument, m_stackIndex); + m_stackIndex += stackIndexStep; + } + void addArgument(JIT::ImmPtr argument) { m_jit->poke(argument, m_stackIndex); @@ -116,13 +128,15 @@ namespace JSC { m_jit->poke(argument, m_stackIndex); m_stackIndex += stackIndexStep; } - + +#if USE(JSVALUE32_64) void addArgument(const JSValue& value) { m_jit->poke(JIT::Imm32(value.payload()), m_stackIndex); m_jit->poke(JIT::Imm32(value.tag()), m_stackIndex + 1); m_stackIndex += stackIndexStep; } +#endif void addArgument(JIT::RegisterID tag, JIT::RegisterID payload) { @@ -165,17 +179,18 @@ namespace JSC { JIT::Call call() { #if ENABLE(OPCODE_SAMPLING) - if (m_jit->m_bytecodeIndex != (unsigned)-1) - m_jit->sampleInstruction(m_jit->m_codeBlock->instructions().begin() + m_jit->m_bytecodeIndex, true); + if (m_jit->m_bytecodeOffset != (unsigned)-1) + m_jit->sampleInstruction(m_jit->m_codeBlock->instructions().begin() + m_jit->m_bytecodeOffset, true); #endif m_jit->restoreArgumentReference(); + m_jit->updateTopCallFrame(); JIT::Call call = m_jit->call(); - m_jit->m_calls.append(CallRecord(call, m_jit->m_bytecodeIndex, m_stub.value())); + m_jit->m_calls.append(CallRecord(call, m_jit->m_bytecodeOffset, m_stub.value())); #if ENABLE(OPCODE_SAMPLING) - if (m_jit->m_bytecodeIndex != (unsigned)-1) - m_jit->sampleInstruction(m_jit->m_codeBlock->instructions().begin() + m_jit->m_bytecodeIndex, false); + if (m_jit->m_bytecodeOffset != (unsigned)-1) + m_jit->sampleInstruction(m_jit->m_codeBlock->instructions().begin() + m_jit->m_bytecodeOffset, false); #endif #if USE(JSVALUE32_64) @@ -197,6 +212,21 @@ namespace JSC { m_jit->emitStoreCell(dst, JIT::returnValueRegister); return call; } + + JIT::Call callWithValueProfiling(unsigned dst) + { + ASSERT(m_returnType == Value || m_returnType == Cell); + JIT::Call call = this->call(); + ASSERT(JIT::returnValueRegister == JIT::regT0); + if (m_returnType == Cell) + m_jit->move(JIT::TrustedImm32(JSValue::CellTag), JIT::regT1); + m_jit->emitValueProfilingSite(); + if (m_returnType == Value) + m_jit->emitStore(dst, JIT::regT1, JIT::regT0); + else + m_jit->emitStoreCell(dst, JIT::returnValueRegister); + return call; + } #else JIT::Call call(unsigned dst) // dst is a virtual register. { @@ -205,6 +235,16 @@ namespace JSC { m_jit->emitPutVirtualRegister(dst); return call; } + + JIT::Call callWithValueProfiling(unsigned dst) + { + ASSERT(m_returnType == VoidPtr || m_returnType == Cell); + JIT::Call call = this->call(); + ASSERT(JIT::returnValueRegister == JIT::regT0); + m_jit->emitValueProfilingSite(); + m_jit->emitPutVirtualRegister(dst); + return call; + } #endif JIT::Call call(JIT::RegisterID dst) // dst is a machine register.