From d6a599dbc9d824a462b2b206316e102bf8136446 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 11 Jul 2012 13:45:28 +0200 Subject: Imported WebKit commit 8ff1f22783a32de82fee915abd55bd1b298f2644 (http://svn.webkit.org/repository/webkit/trunk@122325) New snapshot that should work with the latest Qt build system changes --- Source/JavaScriptCore/bytecode/PutByIdStatus.cpp | 41 +++++++++++++----------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'Source/JavaScriptCore/bytecode/PutByIdStatus.cpp') diff --git a/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp b/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp index 3715606fe..e9456313a 100644 --- a/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp +++ b/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp @@ -43,12 +43,13 @@ PutByIdStatus PutByIdStatus::computeFromLLInt(CodeBlock* profiledBlock, unsigned Structure* structure = instruction[4].u.structure.get(); if (!structure) - return PutByIdStatus(NoInformation, 0, 0, 0, notFound); + return PutByIdStatus(NoInformation, 0, 0, 0, invalidOffset); - if (instruction[0].u.opcode == llint_op_put_by_id) { - size_t offset = structure->get(*profiledBlock->globalData(), ident); - if (offset == notFound) - return PutByIdStatus(NoInformation, 0, 0, 0, notFound); + if (instruction[0].u.opcode == llint_op_put_by_id + || instruction[0].u.opcode == llint_op_put_by_id_out_of_line) { + PropertyOffset offset = structure->get(*profiledBlock->globalData(), ident); + if (!isValidOffset(offset)) + return PutByIdStatus(NoInformation, 0, 0, 0, invalidOffset); return PutByIdStatus(SimpleReplace, structure, 0, 0, offset); } @@ -56,20 +57,22 @@ PutByIdStatus PutByIdStatus::computeFromLLInt(CodeBlock* profiledBlock, unsigned ASSERT(structure->transitionWatchpointSetHasBeenInvalidated()); ASSERT(instruction[0].u.opcode == llint_op_put_by_id_transition_direct - || instruction[0].u.opcode == llint_op_put_by_id_transition_normal); + || instruction[0].u.opcode == llint_op_put_by_id_transition_normal + || instruction[0].u.opcode == llint_op_put_by_id_transition_direct_out_of_line + || instruction[0].u.opcode == llint_op_put_by_id_transition_normal_out_of_line); Structure* newStructure = instruction[6].u.structure.get(); StructureChain* chain = instruction[7].u.structureChain.get(); ASSERT(newStructure); ASSERT(chain); - size_t offset = newStructure->get(*profiledBlock->globalData(), ident); - if (offset == notFound) - return PutByIdStatus(NoInformation, 0, 0, 0, notFound); + PropertyOffset offset = newStructure->get(*profiledBlock->globalData(), ident); + if (!isValidOffset(offset)) + return PutByIdStatus(NoInformation, 0, 0, 0, invalidOffset); return PutByIdStatus(SimpleTransition, structure, newStructure, chain, offset); #else - return PutByIdStatus(NoInformation, 0, 0, 0, notFound); + return PutByIdStatus(NoInformation, 0, 0, 0, invalidOffset); #endif } @@ -83,7 +86,7 @@ PutByIdStatus PutByIdStatus::computeFor(CodeBlock* profiledBlock, unsigned bytec return computeFromLLInt(profiledBlock, bytecodeIndex, ident); if (profiledBlock->likelyToTakeSlowCase(bytecodeIndex)) - return PutByIdStatus(TakesSlowPath, 0, 0, 0, notFound); + return PutByIdStatus(TakesSlowPath, 0, 0, 0, invalidOffset); StructureStubInfo& stubInfo = profiledBlock->getStubInfo(bytecodeIndex); if (!stubInfo.seen) @@ -94,24 +97,24 @@ PutByIdStatus PutByIdStatus::computeFor(CodeBlock* profiledBlock, unsigned bytec return computeFromLLInt(profiledBlock, bytecodeIndex, ident); case access_put_by_id_replace: { - size_t offset = stubInfo.u.putByIdReplace.baseObjectStructure->get( + PropertyOffset offset = stubInfo.u.putByIdReplace.baseObjectStructure->get( *profiledBlock->globalData(), ident); - if (offset != notFound) { + if (isValidOffset(offset)) { return PutByIdStatus( SimpleReplace, stubInfo.u.putByIdReplace.baseObjectStructure.get(), 0, 0, offset); } - return PutByIdStatus(TakesSlowPath, 0, 0, 0, notFound); + return PutByIdStatus(TakesSlowPath, 0, 0, 0, invalidOffset); } case access_put_by_id_transition_normal: case access_put_by_id_transition_direct: { ASSERT(stubInfo.u.putByIdTransition.previousStructure->transitionWatchpointSetHasBeenInvalidated()); - size_t offset = stubInfo.u.putByIdTransition.structure->get( + PropertyOffset offset = stubInfo.u.putByIdTransition.structure->get( *profiledBlock->globalData(), ident); - if (offset != notFound) { + if (isValidOffset(offset)) { return PutByIdStatus( SimpleTransition, stubInfo.u.putByIdTransition.previousStructure.get(), @@ -119,14 +122,14 @@ PutByIdStatus PutByIdStatus::computeFor(CodeBlock* profiledBlock, unsigned bytec stubInfo.u.putByIdTransition.chain.get(), offset); } - return PutByIdStatus(TakesSlowPath, 0, 0, 0, notFound); + return PutByIdStatus(TakesSlowPath, 0, 0, 0, invalidOffset); } default: - return PutByIdStatus(TakesSlowPath, 0, 0, 0, notFound); + return PutByIdStatus(TakesSlowPath, 0, 0, 0, invalidOffset); } #else // ENABLE(JIT) - return PutByIdStatus(NoInformation, 0, 0, 0, notFound); + return PutByIdStatus(NoInformation, 0, 0, 0, invalidOffset); #endif // ENABLE(JIT) } -- cgit v1.2.1