Changeset 165522 in webkit for trunk/Source/JavaScriptCore/dfg/DFGDCEPhase.cpp
- Timestamp:
- Mar 12, 2014, 6:50:41 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGDCEPhase.cpp
r164229 r165522 1 1 /* 2 * Copyright (C) 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 260 260 if (node->op() == GetLocal) { 261 261 node = node->child1().node(); 262 ASSERT(node->op() == Phi || node->op() == SetArgument); 262 263 // FIXME: In the case that the variable is captured, we really want to be able 264 // to replace the variable-at-tail with the last use of the variable in the same 265 // way that CPS rethreading would do. The child of the GetLocal isn't necessarily 266 // the same as what CPS rethreading would do. For example, we may have: 267 // 268 // a: SetLocal(...) // live 269 // b: GetLocal(@a) // live 270 // c: GetLocal(@a) // dead 271 // 272 // When killing @c, the code below will set the variable-at-tail to @a, while CPS 273 // rethreading would have set @b. This is a benign bug, since all clients of CPS 274 // only use the variable-at-tail of captured variables to get the 275 // VariableAccessData and observe that it is in fact captured. But, this feels 276 // like it could cause bugs in the future. 277 // 278 // It's tempting to just dethread and then invoke CPS rethreading, but CPS 279 // rethreading fails to preserve exact ref-counts. So we would need a fixpoint. 280 // It's probably the case that this fixpoint will be guaranteed to converge after 281 // the second iteration (i.e. the second run of DCE will not kill anything and so 282 // will not need to dethread), but for now the safest approach is probably just to 283 // allow for this tiny bit of sloppiness. 284 // 285 // Another possible solution would be to simply say that DCE dethreads but then 286 // we never rethread before going to the backend. That feels intuitively right 287 // because it's unlikely that any of the phases after DCE in the backend rely on 288 // ThreadedCPS. 289 // 290 // https://bugs.webkit.org/show_bug.cgi?id=130115 291 ASSERT( 292 node->op() == Phi || node->op() == SetArgument 293 || node->variableAccessData()->isCaptured()); 294 263 295 if (node->shouldGenerate()) { 264 296 variables[i] = node;
Note:
See TracChangeset
for help on using the changeset viewer.