Changeset 262995 in webkit for trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
- Timestamp:
- Jun 12, 2020, 8:09:21 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r262613 r262995 56 56 Return value: The register holding the production's value. 57 57 dst: An optional parameter specifying the most efficient destination at 58 which to store the production's value. The callee must honor dst. 58 which to store the production's value. 59 If dst is null, you may return whatever VirtualRegister you want. Otherwise you have to return dst. 59 60 60 61 The dst argument provides for a crude form of copy propagation. For example, … … 63 64 64 65 becomes 65 66 66 67 load r[x], 1 67 68 68 69 instead of 69 70 70 71 load r0, 1 71 72 mov r[x], r0 72 73 73 74 because the assignment node, "x =", passes r[x] as dst to the number node, "1". 74 75 */ … … 85 86 // ------------------------------ ThrowableExpressionData -------------------------------- 86 87 87 RegisterID* ThrowableExpressionData::emitThrowReferenceError(BytecodeGenerator& generator, const String& message )88 RegisterID* ThrowableExpressionData::emitThrowReferenceError(BytecodeGenerator& generator, const String& message, RegisterID* dst) 88 89 { 89 90 generator.emitExpressionInfo(divot(), divotStart(), divotEnd()); 90 91 generator.emitThrowReferenceError(message); 92 if (dst) 93 return dst; 91 94 return generator.newTemporary(); 92 95 } … … 2248 2251 return emitThrowReferenceError(generator, m_operator == Operator::PlusPlus 2249 2252 ? "Postfix ++ operator applied to value that is not a reference."_s 2250 : "Postfix -- operator applied to value that is not a reference."_s); 2253 : "Postfix -- operator applied to value that is not a reference."_s, 2254 dst); 2251 2255 } 2252 2256 … … 2280 2284 generator.emitExpressionInfo(divot(), divotStart(), divotEnd()); 2281 2285 if (m_base->isSuperNode()) 2282 return emitThrowReferenceError(generator, "Cannot delete a super property" );2286 return emitThrowReferenceError(generator, "Cannot delete a super property", dst); 2283 2287 return generator.emitDeleteByVal(finalDest.get(), r0.get(), r1.get()); 2284 2288 } … … 2296 2300 generator.emitExpressionInfo(divot(), divotStart(), divotEnd()); 2297 2301 if (m_base->isSuperNode()) 2298 return emitThrowReferenceError(generator, "Cannot delete a super property" );2302 return emitThrowReferenceError(generator, "Cannot delete a super property", dst); 2299 2303 return generator.emitDeleteById(finalDest.get(), r0.get(), m_ident); 2300 2304 } … … 2485 2489 return emitThrowReferenceError(generator, m_operator == Operator::PlusPlus 2486 2490 ? "Prefix ++ operator applied to value that is not a reference."_s 2487 : "Prefix -- operator applied to value that is not a reference."_s); 2491 : "Prefix -- operator applied to value that is not a reference."_s, 2492 dst); 2488 2493 } 2489 2494 … … 3200 3205 emitShortCircuitAssignment(generator, result.get(), m_operator, afterAssignment.get()); 3201 3206 3202 result =generator.emitNode(result.get(), m_right); // Execute side effects first.3207 generator.emitNode(result.get(), m_right); // Execute side effects first. 3203 3208 3204 3209 bool threwException = isReadOnly ? generator.emitReadOnlyExceptionIfNeeded(var) : false; … … 3353 3358 // ------------------------------ AssignErrorNode ----------------------------------- 3354 3359 3355 RegisterID* AssignErrorNode::emitBytecode(BytecodeGenerator& generator, RegisterID* )3356 { 3357 return emitThrowReferenceError(generator, "Left side of assignment is not a reference."_s );3360 RegisterID* AssignErrorNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst) 3361 { 3362 return emitThrowReferenceError(generator, "Left side of assignment is not a reference."_s, dst); 3358 3363 } 3359 3364
Note:
See TracChangeset
for help on using the changeset viewer.