Chromium Code Reviews| 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 | 6 |
| 7 final JavaScriptBackend backend; | 7 final JavaScriptBackend backend; |
| 8 | 8 |
| 9 SsaCodeGeneratorTask(JavaScriptBackend backend) | 9 SsaCodeGeneratorTask(JavaScriptBackend backend) |
| 10 : this.backend = backend, | 10 : this.backend = backend, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 ClassElement enclosingClass = element.getEnclosingClass(); | 95 ClassElement enclosingClass = element.getEnclosingClass(); |
| 96 if (element.isInstanceMember() | 96 if (element.isInstanceMember() |
| 97 && enclosingClass.isNative() | 97 && enclosingClass.isNative() |
| 98 && native.isOverriddenMethod( | 98 && native.isOverriddenMethod( |
| 99 element, enclosingClass, nativeEmitter)) { | 99 element, enclosingClass, nativeEmitter)) { |
| 100 // Record that this method is overridden. In case of optional | 100 // Record that this method is overridden. In case of optional |
| 101 // arguments, the emitter will generate stubs to handle them, | 101 // arguments, the emitter will generate stubs to handle them, |
| 102 // and needs to know if the method is overridden. | 102 // and needs to know if the method is overridden. |
| 103 nativeEmitter.overriddenMethods.add(element); | 103 nativeEmitter.overriddenMethods.add(element); |
| 104 StringBuffer buffer = new StringBuffer(); | 104 StringBuffer buffer = new StringBuffer(); |
| 105 String codeString = prettyPrint(codegen.body).toString(); | 105 String codeString = "${prettyPrint(codegen.body).toString()}"; |
|
floitsch
2012/10/25 08:42:40
why was this necessary?
erikcorry
2012/10/25 09:09:28
Whatever the reason was, it went away again.
| |
| 106 native.generateMethodWithPrototypeCheckForElement( | 106 native.generateMethodWithPrototypeCheckForElement( |
| 107 compiler, buffer, element, codeString, parametersString); | 107 compiler, buffer, element, codeString, parametersString); |
| 108 js.Node nativeCode = new js.LiteralStatement(buffer.toString()); | 108 js.Node nativeCode = new js.LiteralStatement(buffer.toString()); |
| 109 body = new js.Block(<js.Statement>[nativeCode]); | 109 body = new js.Block(<js.Statement>[nativeCode]); |
| 110 } else { | 110 } else { |
| 111 body = codegen.body; | 111 body = codegen.body; |
| 112 } | 112 } |
| 113 js.Fun fun = buildJavaScriptFunction(element, parameters, body); | 113 js.Fun fun = buildJavaScriptFunction(element, parameters, body); |
| 114 return prettyPrint(fun); | 114 return prettyPrint(fun); |
| 115 }); | 115 }); |
| (...skipping 2874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2990 if (leftType.canBeNull() && rightType.canBeNull()) { | 2990 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 2991 if (left.isConstantNull() || right.isConstantNull() || | 2991 if (left.isConstantNull() || right.isConstantNull() || |
| 2992 (leftType.isPrimitive() && leftType == rightType)) { | 2992 (leftType.isPrimitive() && leftType == rightType)) { |
| 2993 return '=='; | 2993 return '=='; |
| 2994 } | 2994 } |
| 2995 return null; | 2995 return null; |
| 2996 } else { | 2996 } else { |
| 2997 return '==='; | 2997 return '==='; |
| 2998 } | 2998 } |
| 2999 } | 2999 } |
| OLD | NEW |