| 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 js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 const VERBOSE_OPTIMIZER_HINTS = false; | 7 const VERBOSE_OPTIMIZER_HINTS = false; |
| 8 | 8 |
| 9 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 9 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
| 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); | 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); |
| (...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1910 } | 1910 } |
| 1911 if (hasNoThrows && !hasNoInline) { | 1911 if (hasNoThrows && !hasNoInline) { |
| 1912 compiler.internalErrorOnElement( | 1912 compiler.internalErrorOnElement( |
| 1913 element, "@NoThrows() should always be combined with @NoInline"); | 1913 element, "@NoThrows() should always be combined with @NoInline"); |
| 1914 } | 1914 } |
| 1915 if (hasNoSideEffects && !hasNoInline) { | 1915 if (hasNoSideEffects && !hasNoInline) { |
| 1916 compiler.internalErrorOnElement( | 1916 compiler.internalErrorOnElement( |
| 1917 element, "@NoSideEffects() should always be combined with @NoInline"); | 1917 element, "@NoSideEffects() should always be combined with @NoInline"); |
| 1918 } | 1918 } |
| 1919 } | 1919 } |
| 1920 |
| 1921 CodeBuffer codeOf(Element element) { |
| 1922 return generatedCode.containsKey(element) |
| 1923 ? jsAst.prettyPrint(generatedCode[element], compiler) |
| 1924 : null; |
| 1925 } |
| 1920 } | 1926 } |
| 1921 | 1927 |
| 1922 /// Records that [constant] is used by [user.element]. | 1928 /// Records that [constant] is used by [user.element]. |
| 1923 class Dependency { | 1929 class Dependency { |
| 1924 final Constant constant; | 1930 final Constant constant; |
| 1925 final TreeElements user; | 1931 final TreeElements user; |
| 1926 | 1932 |
| 1927 const Dependency(this.constant, this.user); | 1933 const Dependency(this.constant, this.user); |
| 1928 } | 1934 } |
| 1929 | 1935 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1968 copy(constant.values); | 1974 copy(constant.values); |
| 1969 copy(constant.protoValue); | 1975 copy(constant.protoValue); |
| 1970 copy(constant); | 1976 copy(constant); |
| 1971 } | 1977 } |
| 1972 | 1978 |
| 1973 void visitConstructed(ConstructedConstant constant) { | 1979 void visitConstructed(ConstructedConstant constant) { |
| 1974 copy(constant.fields); | 1980 copy(constant.fields); |
| 1975 copy(constant); | 1981 copy(constant); |
| 1976 } | 1982 } |
| 1977 } | 1983 } |
| OLD | NEW |