| 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 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 7 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
| 8 final Set<HInstruction> boundsChecked; | 8 final Set<HInstruction> boundsChecked; |
| 9 | 9 |
| 10 JavaScriptItemCompilationContext() | 10 JavaScriptItemCompilationContext() |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 | 410 |
| 411 // Checked mode helpers indexed by name. | 411 // Checked mode helpers indexed by name. |
| 412 Map<String, CheckedModeHelper> checkedModeHelperByName = | 412 Map<String, CheckedModeHelper> checkedModeHelperByName = |
| 413 new Map<String, CheckedModeHelper>.fromIterable( | 413 new Map<String, CheckedModeHelper>.fromIterable( |
| 414 checkedModeHelpers, | 414 checkedModeHelpers, |
| 415 key: (helper) => helper.name.slowToString()); | 415 key: (helper) => helper.name.slowToString()); |
| 416 | 416 |
| 417 /// Number of methods compiled before considering reflection. | 417 /// Number of methods compiled before considering reflection. |
| 418 int preMirrorsMethodCount = 0; | 418 int preMirrorsMethodCount = 0; |
| 419 | 419 |
| 420 JavaScriptBackend(Compiler compiler, bool generateSourceMap, bool disableEval) | 420 JavaScriptBackend(Compiler compiler, bool generateSourceMap) |
| 421 : namer = determineNamer(compiler), | 421 : namer = determineNamer(compiler), |
| 422 oneShotInterceptors = new Map<String, Selector>(), | 422 oneShotInterceptors = new Map<String, Selector>(), |
| 423 interceptedElements = new Map<SourceString, Set<Element>>(), | 423 interceptedElements = new Map<SourceString, Set<Element>>(), |
| 424 rti = new RuntimeTypes(compiler), | 424 rti = new RuntimeTypes(compiler), |
| 425 specializedGetInterceptors = new Map<String, Set<ClassElement>>(), | 425 specializedGetInterceptors = new Map<String, Set<ClassElement>>(), |
| 426 super(compiler, JAVA_SCRIPT_CONSTANT_SYSTEM) { | 426 super(compiler, JAVA_SCRIPT_CONSTANT_SYSTEM) { |
| 427 emitter = disableEval | 427 emitter = new CodeEmitterTask(compiler, namer, generateSourceMap); |
| 428 ? new CodeEmitterNoEvalTask(compiler, namer, generateSourceMap) | |
| 429 : new CodeEmitterTask(compiler, namer, generateSourceMap); | |
| 430 builder = new SsaBuilderTask(this); | 428 builder = new SsaBuilderTask(this); |
| 431 optimizer = new SsaOptimizerTask(this); | 429 optimizer = new SsaOptimizerTask(this); |
| 432 generator = new SsaCodeGeneratorTask(this); | 430 generator = new SsaCodeGeneratorTask(this); |
| 433 } | 431 } |
| 434 | 432 |
| 435 static Namer determineNamer(Compiler compiler) { | 433 static Namer determineNamer(Compiler compiler) { |
| 436 return compiler.enableMinification ? | 434 return compiler.enableMinification ? |
| 437 new MinifyNamer(compiler) : | 435 new MinifyNamer(compiler) : |
| 438 new Namer(compiler); | 436 new Namer(compiler); |
| 439 } | 437 } |
| (...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1841 copy(constant.values); | 1839 copy(constant.values); |
| 1842 copy(constant.protoValue); | 1840 copy(constant.protoValue); |
| 1843 copy(constant); | 1841 copy(constant); |
| 1844 } | 1842 } |
| 1845 | 1843 |
| 1846 void visitConstructed(ConstructedConstant constant) { | 1844 void visitConstructed(ConstructedConstant constant) { |
| 1847 copy(constant.fields); | 1845 copy(constant.fields); |
| 1848 copy(constant); | 1846 copy(constant); |
| 1849 } | 1847 } |
| 1850 } | 1848 } |
| OLD | NEW |