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 part of ssa; | 5 part of ssa; |
6 | 6 |
7 class SsaCodeGeneratorTask extends CompilerTask { | 7 class SsaCodeGeneratorTask extends CompilerTask { |
8 | 8 |
9 final JavaScriptBackend backend; | 9 final JavaScriptBackend backend; |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 Token endToken; | 24 Token endToken; |
25 if (expression == null) { | 25 if (expression == null) { |
26 // Synthesized node. Use the enclosing element for the location. | 26 // Synthesized node. Use the enclosing element for the location. |
27 beginToken = endToken = element.position(); | 27 beginToken = endToken = element.position(); |
28 } else { | 28 } else { |
29 beginToken = expression.getBeginToken(); | 29 beginToken = expression.getBeginToken(); |
30 endToken = expression.getEndToken(); | 30 endToken = expression.getEndToken(); |
31 } | 31 } |
32 // TODO(podivilov): find the right sourceFile here and remove offset checks | 32 // TODO(podivilov): find the right sourceFile here and remove offset checks |
33 // below. | 33 // below. |
34 if (beginToken.charOffset < sourceFile.text.length) { | 34 if (beginToken.charOffset < sourceFile.length) { |
35 node.sourcePosition = new SourceFileLocation(sourceFile, beginToken); | 35 node.sourcePosition = new SourceFileLocation(sourceFile, beginToken); |
36 } | 36 } |
37 if (endToken.charOffset < sourceFile.text.length) { | 37 if (endToken.charOffset < sourceFile.length) { |
38 node.endSourcePosition = new SourceFileLocation(sourceFile, endToken); | 38 node.endSourcePosition = new SourceFileLocation(sourceFile, endToken); |
39 } | 39 } |
40 return node; | 40 return node; |
41 } | 41 } |
42 | 42 |
43 SourceFile sourceFileOfElement(Element element) { | 43 SourceFile sourceFileOfElement(Element element) { |
44 // TODO(johnniwinther): remove the 'element.patch' hack. | 44 // TODO(johnniwinther): remove the 'element.patch' hack. |
45 FunctionElement functionElement = element.asFunctionElement(); | 45 FunctionElement functionElement = element.asFunctionElement(); |
46 if (functionElement != null && functionElement.patch != null) { | 46 if (functionElement != null && functionElement.patch != null) { |
47 element = functionElement.patch; | 47 element = functionElement.patch; |
(...skipping 3005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3053 if (leftType.canBeNull() && rightType.canBeNull()) { | 3053 if (leftType.canBeNull() && rightType.canBeNull()) { |
3054 if (left.isConstantNull() || right.isConstantNull() || | 3054 if (left.isConstantNull() || right.isConstantNull() || |
3055 (leftType.isPrimitive(compiler) && leftType == rightType)) { | 3055 (leftType.isPrimitive(compiler) && leftType == rightType)) { |
3056 return '=='; | 3056 return '=='; |
3057 } | 3057 } |
3058 return null; | 3058 return null; |
3059 } else { | 3059 } else { |
3060 return '==='; | 3060 return '==='; |
3061 } | 3061 } |
3062 } | 3062 } |
OLD | NEW |