| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart2js.js_emitter.startup_emitter.model_emitter; | 5 part of dart2js.js_emitter.startup_emitter.model_emitter; |
| 6 | 6 |
| 7 /// The fast startup emitter's goal is to minimize the amount of work that the | 7 /// The fast startup emitter's goal is to minimize the amount of work that the |
| 8 /// JavaScript engine has to do before it can start running user code. | 8 /// JavaScript engine has to do before it can start running user code. |
| 9 /// | 9 /// |
| 10 /// Whenever possible, the emitter uses object literals instead of updating | 10 /// Whenever possible, the emitter uses object literals instead of updating |
| (...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 // same JavaScript context (except for testing) this shouldn't have any | 1013 // same JavaScript context (except for testing) this shouldn't have any |
| 1014 // impact on real-world programs, though. | 1014 // impact on real-world programs, though. |
| 1015 globals.add( | 1015 globals.add( |
| 1016 new js.Property(js.string(CREATE_NEW_ISOLATE), | 1016 new js.Property(js.string(CREATE_NEW_ISOLATE), |
| 1017 js.js('function () { return $staticStateName; }'))); | 1017 js.js('function () { return $staticStateName; }'))); |
| 1018 // TODO(floitsch): add remaining isolate functions. | 1018 // TODO(floitsch): add remaining isolate functions. |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 globals.add(emitMangledGlobalNames()); | 1021 globals.add(emitMangledGlobalNames()); |
| 1022 | 1022 |
| 1023 // The [MANGLED_NAMES] table is only relevant for reflection. |
| 1024 // TODO(floitsch): verify that this is correct. |
| 1025 globals.add(new js.Property(js.string(MANGLED_NAMES), |
| 1026 new js.ObjectInitializer([]))); |
| 1027 |
| 1023 globals.add(emitGetTypeFromName()); | 1028 globals.add(emitGetTypeFromName()); |
| 1024 | 1029 |
| 1025 globals.addAll(emitMetadata(program)); | 1030 globals.addAll(emitMetadata(program)); |
| 1026 | 1031 |
| 1027 if (program.needsNativeSupport) { | 1032 if (program.needsNativeSupport) { |
| 1028 globals.add(new js.Property(js.string(INTERCEPTORS_BY_TAG), | 1033 globals.add(new js.Property(js.string(INTERCEPTORS_BY_TAG), |
| 1029 new js.LiteralNull())); | 1034 new js.LiteralNull())); |
| 1030 globals.add(new js.Property(js.string(LEAF_TAGS), | 1035 globals.add(new js.Property(js.string(LEAF_TAGS), |
| 1031 new js.LiteralNull())); | 1036 new js.LiteralNull())); |
| 1032 } | 1037 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 } | 1100 } |
| 1096 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", | 1101 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", |
| 1097 js.objectLiteral(interceptorsByTag))); | 1102 js.objectLiteral(interceptorsByTag))); |
| 1098 statements.add(js.js.statement("setOrUpdateLeafTags(#);", | 1103 statements.add(js.js.statement("setOrUpdateLeafTags(#);", |
| 1099 js.objectLiteral(leafTags))); | 1104 js.objectLiteral(leafTags))); |
| 1100 statements.add(subclassAssignment); | 1105 statements.add(subclassAssignment); |
| 1101 | 1106 |
| 1102 return new js.Block(statements); | 1107 return new js.Block(statements); |
| 1103 } | 1108 } |
| 1104 } | 1109 } |
| OLD | NEW |