Esempio n. 1
0
void Cache::write(long int address) {

    long int index = 0, localTag = 0;
    int slot = 0;
    STATUS status = FAIL;
    totalWrite++;

    calculateTagFromAddress(address, localTag, index);
    status = searchForTagInASet(localTag, index, slot);
    if (SUCCESS == status) {
//write hit
        writeHit++;
        if (FIFO != lruPolicy) {
            updateLru(index, slot);
        }
        updateValidity(index, slot, DIRTY);
    } else {
//write miss
        writeMiss++;
        if ((NULL == next) && (EXCLUSION != incPolicy)) {
            memTraffic++;
        }
        status = checkSpaceInASet(index, slot);
        if (SUCCESS == status) {
            //there is space in cache, no need to evict
            if (NULL != next) {
                next->read(address);
            }

            tag[index][slot] = localTag;
            updateLru(index, slot);
            updateValidity(index, slot, DIRTY);
        } else {
            //no space in cache, need to evict LRU
            evictBlockFromASet(index);
            status = checkSpaceInASet(index, slot);
            if (NULL != next) {
                next->read(address);
            }
            if (SUCCESS == status) {
                tag[index][slot] = localTag;
                updateLru(index, slot);
                updateValidity(index, slot, DIRTY);
            } else {
                ERROR_LOG;
                cout << "ER : This can't be happening" << endl;
            }
        }
    }
}
void HTMLTextAreaElement::setValue(const String& value)
{
    // Code elsewhere normalizes line endings added by the user via the keyboard or pasting.
    // We normalize line endings coming from JavaScript here.
    String normalizedValue = value.isNull() ? "" : value;
    normalizedValue.replace("\r\n", "\n");
    normalizedValue.replace('\r', '\n');

    // Return early because we don't want to move the caret or trigger other side effects
    // when the value isn't changing. This matches Firefox behavior, at least.
    if (normalizedValue == this->value())
        return;

    m_value = normalizedValue;
    setFormControlValueMatchesRenderer(true);
    updatePlaceholderVisibility(false);
    if (inDocument())
        document()->updateStyleIfNeeded();
    if (renderer())
        renderer()->updateFromElement();

    // Set the caret to the end of the text value.
    if (document()->focusedNode() == this) {
        unsigned endOfString = m_value.length();
        setSelectionRange(endOfString, endOfString);
    }

    setNeedsStyleRecalc();
    notifyFormStateChanged(this);
    updateValidity();
}
Esempio n. 3
0
STATUS Cache::evictBlockWithAddress(long int address) {
    long int index = 0, localTag = 0;
    int slot = 0;
    STATUS status = FAIL;
    STATUS writeToMemDuringBackInvalidation = FAIL;

    calculateTagFromAddress(address, localTag, index);
    status = searchForTagInASet(localTag, index, slot);
    if (SUCCESS == status) {
        if (INCLUSION == incPolicy) {
            if (NULL != previous) {
                writeToMemDuringBackInvalidation = previous->evictBlockWithAddress(address);
            }
        }
        if (FAIL == writeToMemDuringBackInvalidation) {
            if ((DIRTY == validity[index][slot]) && (INCLUSION == incPolicy)) {
                writeToMemDuringBackInvalidation = SUCCESS;
                memTraffic++;
            } else {
                writeToMemDuringBackInvalidation = FAIL;
            }
        }

        tag[index][slot] = 0x7FFFFFFFFFFFFFFF;
        updateValidity(index, slot, INVALID);
//updateLru(index, slot);
        return writeToMemDuringBackInvalidation;

    } else {
        writeToMemDuringBackInvalidation = FAIL;
    }
    return writeToMemDuringBackInvalidation;
}
void QGeoTiledMapPixmapObjectInfo::pixmapChanged(const QPixmap &pixmap)
{
    updateValidity();
    if (!this->pixmap->pixmap().isNull()) {
        pixmapItem1->setPixmap(this->pixmap->pixmap());
        if (pixmapItem2)
            pixmapItem2->setPixmap(this->pixmap->pixmap());
    }
    if (valid())
        updateItem();
}
void HTMLTextAreaElement::subtreeHasChanged()
{
    setChangedSinceLastFormControlChangeEvent(true);
    setFormControlValueMatchesRenderer(false);
    updateValidity();

    if (!focused())
        return;

    if (Frame* frame = document().frame())
        frame->editor().textDidChangeInTextArea(this);
    // When typing in a textarea, childrenChanged is not called, so we need to force the directionality check.
    calculateAndAdjustDirectionality();
}
void HTMLTextAreaElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
    if (name == rowsAttr) {
        int rows = value.toInt();
        if (rows <= 0)
            rows = defaultRows;
        if (m_rows != rows) {
            m_rows = rows;
            if (renderer())
                renderer()->setNeedsLayoutAndPrefWidthsRecalc();
        }
    } else if (name == colsAttr) {
        int cols = value.toInt();
        if (cols <= 0)
            cols = defaultCols;
        if (m_cols != cols) {
            m_cols = cols;
            if (renderer())
                renderer()->setNeedsLayoutAndPrefWidthsRecalc();
        }
    } else if (name == wrapAttr) {
        // The virtual/physical values were a Netscape extension of HTML 3.0, now deprecated.
        // The soft/hard /off values are a recommendation for HTML 4 extension by IE and NS 4.
        WrapMethod wrap;
        if (equalIgnoringCase(value, "physical") || equalIgnoringCase(value, "hard") || equalIgnoringCase(value, "on"))
            wrap = HardWrap;
        else if (equalIgnoringCase(value, "off"))
            wrap = NoWrap;
        else
            wrap = SoftWrap;
        if (wrap != m_wrap) {
            m_wrap = wrap;
            if (renderer())
                renderer()->setNeedsLayoutAndPrefWidthsRecalc();
        }
    } else if (name == accesskeyAttr) {
        // ignore for the moment
    } else if (name == maxlengthAttr)
        updateValidity();
    else
        HTMLTextFormControlElement::parseAttribute(name, value);
}
Esempio n. 7
0
void Cache::evictBlockFromASet(long int index) {
    long int localTag = 0;
    long int tempAdd = 0;
    int slot;
    STATUS status = FAIL;
    getLru(index, localTag, slot);
    tempAdd = tag[index][slot];
    tempAdd = tempAdd << bitsForIndex;
    tempAdd = tempAdd | index;
    tempAdd = tempAdd << bitsForBlockOffset;

    if (INCLUSION == incPolicy) {
        if (NULL != previous) {
            status = previous->evictBlockWithAddress(tempAdd);
            if (SUCCESS == status) {
                validity[index][slot] = VALID;
            }
        }
    }

    if (DIRTY == validity[index][slot]) {
        writeBack++;
        if (NULL == next) {
            memTraffic++;
        }
        if (NULL != next) {
            next->write(tempAdd);
        }
    } else {
        if ((EXCLUSION == incPolicy) && (NULL != next)) {
            next->write(tempAdd);
            next->updateValidity(tempAdd, VALID);
        }
    }

    tag[index][slot] = 0x7FFFFFFFFFFFFFFF;
    updateValidity(index, slot, INVALID);
    //updateLru(index, slot);
}
void HTMLTextAreaElement::setNonDirtyValue(const String& value)
{
    setValueCommon(value);
    m_isDirty = false;
    updateValidity();
}
void OfonoModemInterface::interfacesChanged(const QStringList& /*interfaces*/)
{
    updateValidity();
}
Esempio n. 10
0
void OfonoModemInterface::modemValidityChanged(bool /*validity*/)
{
    updateValidity();
}
void QGeoTiledMapPixmapObjectInfo::coordinateChanged(const QGeoCoordinate &coordinate)
{
    updateValidity();
    if (valid())
        update();
}
Esempio n. 12
0
SWING Cache::read(long int address) {
    SWING swing = MISS;
    long int index = 0, localTag = 0;
    int slot = 0;
    STATUS status = FAIL;
    VALIDITY validi = VALID;

    totalRead++;
    calculateTagFromAddress(address, localTag, index);
    status = searchForTagInASet(localTag, index, slot);
    if (SUCCESS == status) {
//read hit
        swing = HIT;
        readHit++;
        if (FIFO != lruPolicy) {
            updateLru(index, slot);
        }
        if (EXCLUSION == incPolicy) {
            if (NULL != previous) {
                evictBlockWithAddress(address);
            }
        }
    } else {
//read miss
        swing = MISS;
        readMiss++;
        if (NULL == next) {
            memTraffic++;
        }
        status = checkSpaceInASet(index, slot);
        if (SUCCESS == status) {
            // there is space in cache, no need to evict
            if (NULL != next) {
                checkValidity(address, validi);
                if (DIRTY != validi) {
                    validi = VALID;
                }
                next->read(address);
            }
            if (EXCLUSION != incPolicy) {
                tag[index][slot] = localTag;
                updateLru(index, slot);
                updateValidity(index, slot, VALID);
            } else {
                if (NULL == previous) {
                    tag[index][slot] = localTag;
                    updateLru(index, slot);
                    updateValidity(index, slot, validi);
                }
            }
        } else {
            //no space in cache, need to evict LRU
            if (EXCLUSION != incPolicy) {
                evictBlockFromASet(index);
                if (NULL != next) {
                    next->read(address);
                }
                status = checkSpaceInASet(index, slot);
                if (SUCCESS == status) {
                    tag[index][slot] = localTag;
                    updateLru(index, slot);
                    updateValidity(index, slot, VALID);
                } else {
                    ERROR_LOG;
                    cout << "ER : This can't be happening" << endl;
                }
            } else {
                if (NULL == previous) {
                    evictBlockFromASet(index);
                    if (NULL != next) {
                        checkValidity(address, validi);
                        if (DIRTY != validi) {
                            validi = VALID;
                        }
                        next->read(address);
                    }
                    status = checkSpaceInASet(index, slot);
                    if (SUCCESS == status) {
                        tag[index][slot] = localTag;
                        updateLru(index, slot);
                        updateValidity(index, slot, validi);
                    } else {
                        ERROR_LOG;
                        cout << "ER : This can't be happening" << endl;
                    }
                }
            }
        }
    }
    return swing;
}