| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 5 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
| 6 import '../compiler.dart' show Compiler; | 6 import '../compiler.dart' show Compiler; |
| 7 import '../constants/constant_system.dart'; | 7 import '../constants/constant_system.dart'; |
| 8 import '../constants/values.dart'; | 8 import '../constants/values.dart'; |
| 9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
| 10 import '../js_backend/backend_helpers.dart' show BackendHelpers; | 10 import '../js_backend/backend_helpers.dart' show BackendHelpers; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 compiler); | 317 compiler); |
| 318 node.conditionalConstantInterceptor = constantInstruction; | 318 node.conditionalConstantInterceptor = constantInstruction; |
| 319 constantInstruction.usedBy.add(node); | 319 constantInstruction.usedBy.add(node); |
| 320 return false; | 320 return false; |
| 321 } | 321 } |
| 322 } | 322 } |
| 323 } | 323 } |
| 324 } | 324 } |
| 325 | 325 |
| 326 // Try creating a one-shot interceptor or optimized is-check | 326 // Try creating a one-shot interceptor or optimized is-check |
| 327 if (compiler.hasIncrementalSupport) return false; | 327 if (compiler.options.hasIncrementalSupport) return false; |
| 328 if (node.usedBy.length != 1) return false; | 328 if (node.usedBy.length != 1) return false; |
| 329 HInstruction user = node.usedBy.single; | 329 HInstruction user = node.usedBy.single; |
| 330 | 330 |
| 331 // If the interceptor [node] was loop hoisted, we keep the interceptor. | 331 // If the interceptor [node] was loop hoisted, we keep the interceptor. |
| 332 if (!user.hasSameLoopHeaderAs(node)) return false; | 332 if (!user.hasSameLoopHeaderAs(node)) return false; |
| 333 | 333 |
| 334 bool replaceUserWith(HInstruction replacement) { | 334 bool replaceUserWith(HInstruction replacement) { |
| 335 HBasicBlock block = user.block; | 335 HBasicBlock block = user.block; |
| 336 block.addAfter(user, replacement); | 336 block.addAfter(user, replacement); |
| 337 block.rewrite(user, replacement); | 337 block.rewrite(user, replacement); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 instruction = new HInvokeDynamicMethod( | 414 instruction = new HInvokeDynamicMethod( |
| 415 selector, mask, inputs, node.instructionType, true); | 415 selector, mask, inputs, node.instructionType, true); |
| 416 } | 416 } |
| 417 | 417 |
| 418 HBasicBlock block = node.block; | 418 HBasicBlock block = node.block; |
| 419 block.addAfter(node, instruction); | 419 block.addAfter(node, instruction); |
| 420 block.rewrite(node, instruction); | 420 block.rewrite(node, instruction); |
| 421 return true; | 421 return true; |
| 422 } | 422 } |
| 423 } | 423 } |
| OLD | NEW |