void RegisterFile::gatherConservativeRoots(ConservativeRoots& conservativeRoots)
{
    for (Register* it = start(); it != end(); ++it) {
        JSValue v = it->jsValue();
        if (!v.isCell())
            continue;
        conservativeRoots.add(v.asCell());
    }
}
Exemple #2
0
void Arguments::tearOffForInlineCallFrame(JSGlobalData& globalData, Register* registers, InlineCallFrame* inlineCallFrame)
{
    for (size_t i = 0; i < d->numArguments; ++i) {
        ValueRecovery& recovery = inlineCallFrame->arguments[i + 1];
        // In the future we'll support displaced recoveries (indicating that the
        // argument was flushed to a different location), but for now we don't do
        // that so this code will fail if that were to happen. On the other hand,
        // it's much less likely that we'll support in-register recoveries since
        // this code does not (easily) have access to registers.
        JSValue value;
        Register* location = &registers[CallFrame::argumentOffset(i)];
        switch (recovery.technique()) {
        case AlreadyInRegisterFile:
            value = location->jsValue();
            break;
        case AlreadyInRegisterFileAsUnboxedInt32:
            value = jsNumber(location->unboxedInt32());
            break;
        case AlreadyInRegisterFileAsUnboxedCell:
            value = location->unboxedCell();
            break;
        case AlreadyInRegisterFileAsUnboxedBoolean:
            value = jsBoolean(location->unboxedBoolean());
            break;
        case AlreadyInRegisterFileAsUnboxedDouble:
#if USE(JSVALUE64)
            value = jsNumber(*bitwise_cast<double*>(location));
#else
            value = location->jsValue();
#endif
            break;
        case Constant:
            value = recovery.constant();
            break;
        default:
            ASSERT_NOT_REACHED();
            break;
        }
        argument(i).set(globalData, this, value);
    }
}