|
Lines 221-226
public:
Source/JavaScriptCore/dfg/DFGPutStackSinkingPhase.cpp_sec1
|
| 221 |
continue; |
221 |
continue; |
| 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 |
auto escapeHandler = [&] (VirtualRegister operand) { |
230 |
auto escapeHandler = [&] (VirtualRegister operand) { |
| 225 |
if (operand.isHeader()) |
231 |
if (operand.isHeader()) |
| 226 |
return; |
232 |
return; |
|
Lines 390-395
public:
Source/JavaScriptCore/dfg/DFGPutStackSinkingPhase.cpp_sec2
|
| 390 |
deferred.operand(node->unlinkedLocal()) = ConflictingFlush; |
396 |
deferred.operand(node->unlinkedLocal()) = ConflictingFlush; |
| 391 |
break; |
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 |
default: { |
422 |
default: { |
| 395 |
auto escapeHandler = [&] (VirtualRegister operand) { |
423 |
auto escapeHandler = [&] (VirtualRegister operand) { |
|
Lines 418-433
public:
Source/JavaScriptCore/dfg/DFGPutStackSinkingPhase.cpp_sec3
|
| 418 |
preciseLocalClobberize( |
446 |
preciseLocalClobberize( |
| 419 |
m_graph, node, escapeHandler, escapeHandler, |
447 |
m_graph, node, escapeHandler, escapeHandler, |
| 420 |
[&] (VirtualRegister, Node*) { }); |
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 know |
| 424 |
// what their incoming value will be. |
| 425 |
// https://bugs.webkit.org/show_bug.cgi?id=141624 |
| 426 |
if (node->op() == GetStack) { |
| 427 |
StackAccessData* data = node->stackAccessData(); |
| 428 |
VirtualRegister operand = data->local; |
| 429 |
mapping.operand(operand) = node; |
| 430 |
} |
| 431 |
break; |
449 |
break; |
| 432 |
} } |
450 |
} } |
| 433 |
} |
451 |
} |