Changeset 207500 in webkit
- Timestamp:
- Oct 18, 2016 4:40:10 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r207475 r207500 1 2016-10-18 Keith Miller <keith_miller@apple.com> 2 3 GetByVal to GetById conversion in the DFG is incorrect for getters with control flow 4 https://bugs.webkit.org/show_bug.cgi?id=163629 5 6 Reviewed by Yusuke Suzuki. 7 8 * stress/get-by-val-to-id-with-getter.js: Added. 9 (foo): 10 (o.get hello): 11 1 12 2016-10-15 Filip Pizlo <fpizlo@apple.com> 2 13 -
trunk/Source/JavaScriptCore/ChangeLog
r207499 r207500 1 2016-10-18 Keith Miller <keith_miller@apple.com> 2 3 GetByVal to GetById conversion in the DFG is incorrect for getters with control flow 4 https://bugs.webkit.org/show_bug.cgi?id=163629 5 6 Reviewed by Yusuke Suzuki. 7 8 This patch fixes a bug in the DFG when attempt to convert a 9 GetByVal into a GetById. While converting the GetByVal, during 10 handleGetById in the Bytecode parser, we would mistakenly use the 11 opcode length of op_get_by_id rather than op_get_by_val. This causes 12 the new basic block we create to point to the wrong offset. In the 13 added test this will cause us to infinite loop. 14 15 * dfg/DFGByteCodeParser.cpp: 16 (JSC::DFG::ByteCodeParser::handleGetById): 17 (JSC::DFG::ByteCodeParser::parseBlock): 18 1 19 2016-10-18 Dean Jackson <dino@apple.com> 2 20 -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r207475 r207500 240 240 241 241 void handleGetById( 242 int destinationOperand, SpeculatedType, Node* base, unsigned identifierNumber, GetByIdStatus, AccessType );242 int destinationOperand, SpeculatedType, Node* base, unsigned identifierNumber, GetByIdStatus, AccessType, unsigned instructionSize); 243 243 void emitPutById( 244 244 Node* base, unsigned identifierNumber, Node* value, const PutByIdStatus&, bool isDirect); … … 3273 3273 void ByteCodeParser::handleGetById( 3274 3274 int destinationOperand, SpeculatedType prediction, Node* base, unsigned identifierNumber, 3275 GetByIdStatus getByIdStatus, AccessType type )3275 GetByIdStatus getByIdStatus, AccessType type, unsigned instructionSize) 3276 3276 { 3277 3277 // Attempt to reduce the set of things in the GetByIdStatus. … … 3435 3435 3436 3436 handleCall( 3437 destinationOperand, Call, InlineCallFrame::GetterCall, OPCODE_LENGTH(op_get_by_id),3437 destinationOperand, Call, InlineCallFrame::GetterCall, instructionSize, 3438 3438 getter, numberOfParameters - 1, registerOffset, *variant.callLinkStatus(), prediction); 3439 3439 } … … 4211 4211 4212 4212 if (compiledAsGetById) 4213 handleGetById(currentInstruction[1].u.operand, prediction, base, identifierNumber, getByIdStatus, AccessType::Get );4213 handleGetById(currentInstruction[1].u.operand, prediction, base, identifierNumber, getByIdStatus, AccessType::Get, OPCODE_LENGTH(op_get_by_val)); 4214 4214 else { 4215 4215 ArrayMode arrayMode = getArrayMode(currentInstruction[4].u.arrayProfile, Array::Read); … … 4349 4349 currentCodeOrigin(), uid); 4350 4350 AccessType type = op_try_get_by_id == opcodeID ? AccessType::GetPure : AccessType::Get; 4351 4351 4352 unsigned opcodeLength = opcodeID == op_try_get_by_id ? OPCODE_LENGTH(op_try_get_by_id) : OPCODE_LENGTH(op_get_by_id); 4353 4352 4354 handleGetById( 4353 currentInstruction[1].u.operand, prediction, base, identifierNumber, getByIdStatus, type );4355 currentInstruction[1].u.operand, prediction, base, identifierNumber, getByIdStatus, type, opcodeLength); 4354 4356 4355 4357 if (op_try_get_by_id == opcodeID)
Note: See TracChangeset
for help on using the changeset viewer.