Changeset 245973 in webkit
- Timestamp:
- May 31, 2019, 11:16:45 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/webgpu/whlsl-store-to-property-updates-properly-expected.html (added)
-
LayoutTests/webgpu/whlsl-store-to-property-updates-properly.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245964 r245973 1 2019-05-31 Saam Barati <sbarati@apple.com> 2 3 [WHLSL] Make sure we properly emit code for "&*x" 4 https://bugs.webkit.org/show_bug.cgi?id=198198 5 6 Reviewed by Myles C. Maxfield. 7 8 * webgpu/whlsl-store-to-property-updates-properly-expected.html: Added. 9 * webgpu/whlsl-store-to-property-updates-properly.html: Added. 10 1 11 2019-05-31 Ryan Haddad <ryanhaddad@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r245972 r245973 1 2019-05-31 Saam Barati <sbarati@apple.com> 2 3 [WHLSL] Make sure we properly emit code for "&*x" 4 https://bugs.webkit.org/show_bug.cgi?id=198198 5 6 Reviewed by Myles C. Maxfield. 7 8 I ran into this when trying to test zero-filling code, so let's just fix it. 9 The issue is that the property resolver ends up emitting code that looks like 10 "&*x". The semantics of this are such that it should result in just x. 11 However, we emitted Metal code in such a way where we'd end up with a pointer 12 to a temporary value. To fix this, DereferenceExpression will emit code that results 13 in a reference type. Then, MakePointerExpression will correctly return the 14 pointer backing that reference type. 15 16 Because of this, we also no longer need to pattern match the lhs of assignment 17 expressions since we will now be assigning to a reference type. 18 19 Test: webgpu/whlsl-store-to-property-updates-properly.html 20 21 * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: 22 (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit): 23 1 24 2019-05-31 Geoffrey Garen <ggaren@apple.com> 2 25 -
trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp
r245945 r245973 458 458 void FunctionDefinitionWriter::visit(AST::AssignmentExpression& assignmentExpression) 459 459 { 460 if (is<AST::DereferenceExpression>(assignmentExpression.left())) {461 checkErrorAndVisit(downcast<AST::DereferenceExpression>(assignmentExpression.left()).pointer());462 auto leftName = m_stack.takeLast();463 checkErrorAndVisit(assignmentExpression.right());464 auto rightName = m_stack.takeLast();465 m_stringBuilder.append(makeString('*', leftName, " = ", rightName, ";\n"));466 m_stack.append(rightName);467 return;468 }469 460 checkErrorAndVisit(assignmentExpression.left()); 470 461 auto leftName = m_stack.takeLast(); … … 511 502 auto right = m_stack.takeLast(); 512 503 auto variableName = generateNextVariableName(); 513 m_stringBuilder.append(makeString( m_typeNamer.mangledNameForType(dereferenceExpression.resolvedType()), ' ', variableName, " = *", right, ";\n"));504 m_stringBuilder.append(makeString(AST::toString(*dereferenceExpression.typeAnnotation().leftAddressSpace()), ' ', m_typeNamer.mangledNameForType(dereferenceExpression.resolvedType()), "& ", variableName, " = *", right, ";\n")); 514 505 m_stack.append(variableName); 515 506 }
Note:
See TracChangeset
for help on using the changeset viewer.