Changeset 181487 in webkit
- Timestamp:
- Mar 13, 2015, 1:18:08 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
dfg/DFGPutStackSinkingPhase.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r181486 r181487 1 2015-03-13 Filip Pizlo <fpizlo@apple.com> 2 3 DFG::PutStackSinkingPhase should eliminate GetStacks that have an obviously known source 4 https://bugs.webkit.org/show_bug.cgi?id=141624 5 6 Reviewed by Oliver Hunt. 7 8 This was an obvious omission from the original PutStackSinkingPhase. Previously, we would treat 9 GetStacks conservatively and assume that the stack slot escaped. That's pretty dumb, since a 10 GetStack is a local load of the stack. This change makes GetStack a no-op from the standpoint of 11 this phase's deferral analysis. At the end we either keep the GetStack (if there was no concrete 12 deferral) or we replace it with an identity over the value that would have been stored by the 13 deferred PutStack. Note that this might be a Phi that the phase creates, so this is strictly 14 stronger than what GCSE could do. 15 16 This is probably not a speed-up now, but it will be very useful for the varargs simplification 17 done in bug 141174. 18 19 * dfg/DFGPutStackSinkingPhase.cpp: 20 1 21 2015-03-12 Geoffrey Garen <ggaren@apple.com> 2 22 -
trunk/Source/JavaScriptCore/dfg/DFGPutStackSinkingPhase.cpp
r180691 r181487 222 222 } 223 223 224 if (node->op() == GetStack) { 225 // A GetStack doesn't affect anything, since we know which local we are reading 226 // from. 227 continue; 228 } 229 224 230 auto escapeHandler = [&] (VirtualRegister operand) { 225 231 if (operand.isHeader()) … … 391 397 break; 392 398 } 399 400 case GetStack: { 401 StackAccessData* data = node->stackAccessData(); 402 FlushFormat format = deferred.operand(data->local); 403 if (!isConcrete(format)) { 404 // This means there is no deferral. No deferral means that the most 405 // authoritative value for this stack slot is what is stored in the stack. So, 406 // keep the GetStack. 407 break; 408 } 409 410 // We have a concrete deferral, which means a PutStack that hasn't executed yet. It 411 // would have stored a value with a certain format. That format must match our 412 // format. But more importantly, we can simply use the value that the PutStack would 413 // have stored and get rid of the GetStack. 414 DFG_ASSERT(m_graph, node, format == data->format); 415 416 Node* incoming = mapping.operand(data->local); 417 node->convertToIdentity(); 418 node->child1() = incoming->defaultEdge(); 419 break; 420 } 393 421 394 422 default: { … … 419 447 m_graph, node, escapeHandler, escapeHandler, 420 448 [&] (VirtualRegister, Node*) { }); 421 422 // If we're a GetStack, then we also create a mapping.423 // FIXME: We should be able to just eliminate such GetLocals, when we know424 // what their incoming value will be.425 // https://bugs.webkit.org/show_bug.cgi?id=141624426 if (node->op() == GetStack) {427 StackAccessData* data = node->stackAccessData();428 VirtualRegister operand = data->local;429 mapping.operand(operand) = node;430 }431 449 break; 432 450 } }
Note:
See TracChangeset
for help on using the changeset viewer.