| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 class SsaCodeGeneratorTask extends CompilerTask { | 5 class SsaCodeGeneratorTask extends CompilerTask { |
| 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); | 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); |
| 7 String get name() => 'SSA code generator'; | 7 String get name() => 'SSA code generator'; |
| 8 | 8 |
| 9 String generate(WorkItem work, HGraph graph) { | 9 String generate(WorkItem work, HGraph graph) { |
| 10 return measure(() { | 10 return measure(() { |
| (...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 || isSupertypeOfNativeClass(element))) { | 980 || isSupertypeOfNativeClass(element))) { |
| 981 buffer.add("("); | 981 buffer.add("("); |
| 982 endParen = true; | 982 endParen = true; |
| 983 } else { | 983 } else { |
| 984 beginExpression(precedence); | 984 beginExpression(precedence); |
| 985 } | 985 } |
| 986 buffer.add('!!'); | 986 buffer.add('!!'); |
| 987 use(input, JSPrecedence.MEMBER_PRECEDENCE); | 987 use(input, JSPrecedence.MEMBER_PRECEDENCE); |
| 988 buffer.add('.'); | 988 buffer.add('.'); |
| 989 buffer.add(compiler.namer.operatorIs(node.typeExpression)); | 989 buffer.add(compiler.namer.operatorIs(node.typeExpression)); |
| 990 if (element.isNative() || isSupertypeOfNativeClass(element)) { | 990 if (element.isClass() && (element.dynamic.isNative() |
| 991 || isSupertypeOfNativeClass(element))) { |
| 991 buffer.add(' || '); | 992 buffer.add(' || '); |
| 992 beginExpression(JSPrecedence.LOGICAL_AND_PRECEDENCE); | 993 beginExpression(JSPrecedence.LOGICAL_AND_PRECEDENCE); |
| 993 // First check if the object is not a Dart object. If the | 994 // First check if the object is not a Dart object. If the |
| 994 // object is a Dart object, we know the property check was | 995 // object is a Dart object, we know the property check was |
| 995 // sufficient. | 996 // sufficient. |
| 996 buffer.add('!'); | 997 buffer.add('!'); |
| 997 use(input, JSPrecedence.MEMBER_PRECEDENCE); | 998 use(input, JSPrecedence.MEMBER_PRECEDENCE); |
| 998 buffer.add('.'); | 999 buffer.add('.'); |
| 999 buffer.add(compiler.namer.operatorIs(objectClass)); | 1000 buffer.add(compiler.namer.operatorIs(objectClass)); |
| 1000 buffer.add(' && '); | 1001 buffer.add(' && '); |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 startBailoutSwitch(); | 1393 startBailoutSwitch(); |
| 1393 } | 1394 } |
| 1394 } | 1395 } |
| 1395 | 1396 |
| 1396 void endElse(HIf node) { | 1397 void endElse(HIf node) { |
| 1397 if (node.elseBlock.hasBailouts()) { | 1398 if (node.elseBlock.hasBailouts()) { |
| 1398 endBailoutSwitch(); | 1399 endBailoutSwitch(); |
| 1399 } | 1400 } |
| 1400 } | 1401 } |
| 1401 } | 1402 } |
| OLD | NEW |