diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/JavaScriptCore/bytecode/PutByIdStatus.cpp | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/bytecode/PutByIdStatus.cpp')
-rw-r--r-- | Source/JavaScriptCore/bytecode/PutByIdStatus.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp b/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp index 7d6ba0987..24a57eb50 100644 --- a/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp +++ b/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp @@ -49,7 +49,7 @@ PutByIdStatus PutByIdStatus::computeFromLLInt(CodeBlock* profiledBlock, unsigned if (instruction[0].u.opcode == LLInt::getOpcode(llint_op_put_by_id) || instruction[0].u.opcode == LLInt::getOpcode(llint_op_put_by_id_out_of_line)) { - PropertyOffset offset = structure->get(*profiledBlock->globalData(), ident); + PropertyOffset offset = structure->get(*profiledBlock->vm(), ident); if (!isValidOffset(offset)) return PutByIdStatus(NoInformation, 0, 0, 0, invalidOffset); @@ -68,7 +68,7 @@ PutByIdStatus PutByIdStatus::computeFromLLInt(CodeBlock* profiledBlock, unsigned ASSERT(newStructure); ASSERT(chain); - PropertyOffset offset = newStructure->get(*profiledBlock->globalData(), ident); + PropertyOffset offset = newStructure->get(*profiledBlock->vm(), ident); if (!isValidOffset(offset)) return PutByIdStatus(NoInformation, 0, 0, 0, invalidOffset); @@ -94,13 +94,17 @@ PutByIdStatus PutByIdStatus::computeFor(CodeBlock* profiledBlock, unsigned bytec if (!stubInfo.seen) return computeFromLLInt(profiledBlock, bytecodeIndex, ident); + if (stubInfo.resetByGC) + return PutByIdStatus(TakesSlowPath, 0, 0, 0, invalidOffset); + switch (stubInfo.accessType) { case access_unset: - return computeFromLLInt(profiledBlock, bytecodeIndex, ident); + // If the JIT saw it but didn't optimize it, then assume that this takes slow path. + return PutByIdStatus(TakesSlowPath, 0, 0, 0, invalidOffset); case access_put_by_id_replace: { PropertyOffset offset = stubInfo.u.putByIdReplace.baseObjectStructure->get( - *profiledBlock->globalData(), ident); + *profiledBlock->vm(), ident); if (isValidOffset(offset)) { return PutByIdStatus( SimpleReplace, @@ -115,7 +119,7 @@ PutByIdStatus PutByIdStatus::computeFor(CodeBlock* profiledBlock, unsigned bytec case access_put_by_id_transition_direct: { ASSERT(stubInfo.u.putByIdTransition.previousStructure->transitionWatchpointSetHasBeenInvalidated()); PropertyOffset offset = stubInfo.u.putByIdTransition.structure->get( - *profiledBlock->globalData(), ident); + *profiledBlock->vm(), ident); if (isValidOffset(offset)) { return PutByIdStatus( SimpleTransition, @@ -135,7 +139,7 @@ PutByIdStatus PutByIdStatus::computeFor(CodeBlock* profiledBlock, unsigned bytec #endif // ENABLE(JIT) } -PutByIdStatus PutByIdStatus::computeFor(JSGlobalData& globalData, JSGlobalObject* globalObject, Structure* structure, Identifier& ident, bool isDirect) +PutByIdStatus PutByIdStatus::computeFor(VM& vm, JSGlobalObject* globalObject, Structure* structure, Identifier& ident, bool isDirect) { if (PropertyName(ident).asIndex() != PropertyName::NotAnIndex) return PutByIdStatus(TakesSlowPath); @@ -147,11 +151,16 @@ PutByIdStatus PutByIdStatus::computeFor(JSGlobalData& globalData, JSGlobalObject return PutByIdStatus(TakesSlowPath); unsigned attributes; - JSCell* specificValueIgnored; - PropertyOffset offset = structure->get(globalData, ident, attributes, specificValueIgnored); + JSCell* specificValue; + PropertyOffset offset = structure->get(vm, ident, attributes, specificValue); if (isValidOffset(offset)) { if (attributes & (Accessor | ReadOnly)) return PutByIdStatus(TakesSlowPath); + if (specificValue) { + // We need the PutById slow path to verify that we're storing the right value into + // the specialized slot. + return PutByIdStatus(TakesSlowPath); + } return PutByIdStatus(SimpleReplace, structure, 0, 0, offset); } @@ -169,7 +178,7 @@ PutByIdStatus PutByIdStatus::computeFor(JSGlobalData& globalData, JSGlobalObject if (!isDirect) { // If the prototype chain has setters or read-only properties, then give up. - if (structure->prototypeChainMayInterceptStoreTo(globalData, ident)) + if (structure->prototypeChainMayInterceptStoreTo(vm, ident)) return PutByIdStatus(TakesSlowPath); // If the prototype chain hasn't been normalized (i.e. there are proxies or dictionaries) @@ -204,7 +213,7 @@ PutByIdStatus PutByIdStatus::computeFor(JSGlobalData& globalData, JSGlobalObject return PutByIdStatus( SimpleTransition, structure, transition, - structure->prototypeChain(globalData, globalObject), offset); + structure->prototypeChain(vm, globalObject), offset); } } // namespace JSC |